void checkRestrictions(int context, DuplicateAttributeDetector dad, Alphabet alpha) throws RestrictionViolationException { if (dad != null) dad.startChoice(); p1.checkRestrictions(context, dad, alpha); if (dad != null) dad.alternative(); p2.checkRestrictions(context, dad, alpha); if (dad != null) dad.endChoice(); }
void checkRestrictions(int context, DuplicateAttributeDetector dad, Alphabet alpha) throws RestrictionViolationException { if (alpha != null) alpha.addElement(origNameClass); if (checkedRestrictions) return; switch (context) { case DATA_EXCEPT_CONTEXT: throw new RestrictionViolationException("data_except_contains_element"); case LIST_CONTEXT: throw new RestrictionViolationException("list_contains_element"); case ATTRIBUTE_CONTEXT: throw new RestrictionViolationException("attribute_contains_element"); } checkedRestrictions = true; try { p.checkRestrictions(ELEMENT_CONTEXT, new DuplicateAttributeDetector(), null); } catch (RestrictionViolationException e) { checkedRestrictions = false; e.maybeSetLocator(loc); throw e; } }
throw new RestrictionViolationException("data_except_contains_attribute"); if (!dad.addAttribute(nameClass)) { if (nameClass instanceof SimpleNameClass) throw new RestrictionViolationException("duplicate_attribute_detail", ((SimpleNameClass)nameClass).name);
@Override void checkRestrictions(int context, DuplicateAttributeDetector dad, Alphabet alpha) throws RestrictionViolationException { if (alpha != null) alpha.addElement(origNameClass); if (checkedRestrictions) return; switch (context) { case DATA_EXCEPT_CONTEXT: throw new RestrictionViolationException("data_except_contains_element"); case LIST_CONTEXT: throw new RestrictionViolationException("list_contains_element"); case ATTRIBUTE_CONTEXT: throw new RestrictionViolationException("attribute_contains_element"); } checkedRestrictions = true; try { p.checkRestrictions(ELEMENT_CONTEXT, new DuplicateAttributeDetector(), null); } catch (RestrictionViolationException e) { checkedRestrictions = false; e.maybeSetLocator(loc); throw e; } }
throw new RestrictionViolationException("data_except_contains_attribute"); if (!dad.addAttribute(nameClass)) { if (nameClass instanceof SimpleNameClass) throw new RestrictionViolationException("duplicate_attribute_detail", ((SimpleNameClass)nameClass).name);
void checkRestrictions(int context, DuplicateAttributeDetector dad, Alphabet alpha) throws RestrictionViolationException { if (dad != null) dad.startChoice(); p1.checkRestrictions(context, dad, alpha); if (dad != null) dad.alternative(); p2.checkRestrictions(context, dad, alpha); if (dad != null) dad.endChoice(); }