- for (final EffectiveStatement<?, ?> effectiveStatement : effectiveSubstatements()) {
- if (effectiveStatement instanceof RevisionEffectiveStatementImpl) {
- revision = ((RevisionEffectiveStatementImpl) effectiveStatement).argument();
- }
- if (effectiveStatement instanceof PrefixEffectiveStatementImpl) {
- prefix = ((PrefixEffectiveStatementImpl) effectiveStatement).argument();
- }
+ RevisionDateEffectiveStatementImpl revisionDateStmt = firstEffective(RevisionDateEffectiveStatementImpl.class);
+ this.revision = (revisionDateStmt == null) ? SimpleDateFormatUtil.DEFAULT_DATE_IMP : revisionDateStmt.argument();
+
+ PrefixEffectiveStatementImpl prefixStmt = firstEffective(PrefixEffectiveStatementImpl.class);
+ if (prefixStmt != null) {
+ this.prefix = prefixStmt.argument();
+ } else {
+ throw new MissingSubstatementException("Prefix is mandatory substatement of import statement",
+ ctx.getStatementSourceReference());