private void fillChildren( Class c, Pattern p, Collection col ) { if(p.getClass()==c) { BinaryPattern bp = (BinaryPattern)p; bp.fillChildren(c,bp.p1,col); bp.fillChildren(c,bp.p2,col); } else { col.add(p); } } }
void checkRestrictions(int context, DuplicateAttributeDetector dad, Alphabet alpha) throws RestrictionViolationException { switch (context) { case START_CONTEXT: throw new RestrictionViolationException("start_contains_group"); case DATA_EXCEPT_CONTEXT: throw new RestrictionViolationException("data_except_contains_group"); } super.checkRestrictions(context == ELEMENT_REPEAT_CONTEXT ? ELEMENT_REPEAT_GROUP_CONTEXT : context, dad, alpha); if (context != LIST_CONTEXT && !contentTypeGroupable(p1.getContentType(), p2.getContentType())) throw new RestrictionViolationException("group_string"); }
@Override void checkRestrictions(int context, DuplicateAttributeDetector dad, Alphabet alpha) throws RestrictionViolationException { switch (context) { case START_CONTEXT: throw new RestrictionViolationException("start_contains_group"); case DATA_EXCEPT_CONTEXT: throw new RestrictionViolationException("data_except_contains_group"); } super.checkRestrictions(context == ELEMENT_REPEAT_CONTEXT ? ELEMENT_REPEAT_GROUP_CONTEXT : context, dad, alpha); if (context != LIST_CONTEXT && !contentTypeGroupable(p1.getContentType(), p2.getContentType())) throw new RestrictionViolationException("group_string"); }
/** * Adds all the children of this pattern to the given collection. * * <p> * For example, if this pattern is (A|B|C), it adds A, B, and C * to the collection, even though internally it's represented * as (A|(B|C)). */ public final void fillChildren( Collection col ) { fillChildren(getClass(),p1,col); fillChildren(getClass(),p2,col); }
/** * Adds all the children of this pattern to the given collection. * * <p> * For example, if this pattern is (A|B|C), it adds A, B, and C * to the collection, even though internally it's represented * as (A|(B|C)). */ public final void fillChildren( Collection col ) { fillChildren(getClass(),p1,col); fillChildren(getClass(),p2,col); }
private void fillChildren( Class c, Pattern p, Collection col ) { if(p.getClass()==c) { BinaryPattern bp = (BinaryPattern)p; bp.fillChildren(c,bp.p1,col); bp.fillChildren(c,bp.p2,col); } else { col.add(p); } } }
/** * Same as {@link #fillChildren(Collection)} but returns an array. */ public final Pattern[] getChildren() { List lst = new ArrayList(); fillChildren(lst); return (Pattern[]) lst.toArray(new Pattern[lst.size()]); }
/** * Same as {@link #fillChildren(Collection)} but returns an array. */ public final Pattern[] getChildren() { List lst = new ArrayList(); fillChildren(lst); return (Pattern[]) lst.toArray(new Pattern[lst.size()]); }