*/
package org.opendaylight.yangtools.yang.parser.stmt.reactor;
+import java.util.LinkedList;
+
+import java.util.List;
import com.google.common.base.Preconditions;
import com.google.common.base.Throwables;
import com.google.common.collect.HashMultimap;
private final StatementDefinitionContext<A, D, E> definition;
private final StatementIdentifier identifier;
private final StatementSourceReference statementDeclSource;
+ private int order = 0;
private Map<StatementIdentifier, StatementContextBase<?, ?, ?>> substatements = new LinkedHashMap<>();
private E effectiveInstance;
private StatementContextBase<?, ?, ?> originalCtx;
- private TypeOfCopy typeOfCopy = TypeOfCopy.ORIGINAL;
+ private List<TypeOfCopy> copyHistory;
private boolean isSupportedToBuildEffective = true;
}
@Override
- public TypeOfCopy getTypeOfCopy() {
- return typeOfCopy;
+ public List<TypeOfCopy> getCopyHistory() {
+ return copyHistory;
+ }
+
+ @Override
+ public void addToCopyHistory(TypeOfCopy typeOfCopy) {
+ this.copyHistory.add(typeOfCopy);
}
@Override
- public void setTypeOfCopy(TypeOfCopy typeOfCopy) {
- this.typeOfCopy = typeOfCopy;
+ public void addAllToCopyHistory(List<TypeOfCopy> typeOfCopyList) {
+ this.copyHistory.addAll(typeOfCopyList);
}
@Override
this.originalCtx = originalCtx;
}
+ @Override
+ public void setOrder(int order) {
+ this.order = order;
+ }
+
+ @Override
+ public int getOrder() {
+ return order;
+ }
+
@Override
public ModelProcessingPhase getCompletedPhase() {
return completedPhase;
this.identifier = builder.createIdentifier();
this.statementDeclSource = builder.getStamementSource();
this.completedPhase = null;
+ initCopyHistory();
}
StatementContextBase(StatementContextBase<A, D, E> original) {
this.statementDeclSource = Preconditions.checkNotNull(original.statementDeclSource,
"Statement context statementDeclSource cannot be null");
this.completedPhase = null;
+ initCopyHistory();
+ }
+
+ private void initCopyHistory() {
+ this.copyHistory = new LinkedList<>();
+ this.copyHistory.add(TypeOfCopy.ORIGINAL);
}
/**