public void setNestedParticles(java.util.List nestedParticles) { for (int i = 0; i < nestedParticles.size(); i++) { NestedParticle next = (NestedParticle)nestedParticles.get(i); if (next instanceof Choice) { addChoice((Choice)next); } else if (next instanceof Sequence) { addSequence((Sequence)next); } } }
public void addElement(Element elem) { orderedElements.add(elem); getElements().add(elem); }
public void setChoice(Choice choice) { this.choice = choice; if (choice != null) { choice.setOwner(this); this.typeDefParticle = choice; } }
} else { Choice choice = new Choice(); if (property.getGenericType() != null) { choice.setMaxOccurs(Occurs.UNBOUNDED); choice.setMinOccurs(Occurs.ZERO); element.setName(localName); choice.addElement(element); ((Sequence) compositor).addChoice(choice); } else if (compositor instanceof Choice) { ((Choice) compositor).addChoice(choice);
Choice theChoice = new Choice(); if (isCollection) { theChoice.setMaxOccurs(Occurs.UNBOUNDED); element = processReferenceDescriptor(element, getDescriptorByClass(fieldToClassMap.get(field), descriptors), schemaForNamespace, workingSchema, properties, descriptors, field, false); theChoice.addElement(element);
/** * Convenience method for processing a choice property. Required * schema components will be generated and set accordingly. * * @param property the choice property to be processed * @param typeInfo the TypeInfo that the given property belongs to * @param type the ComplexType which compositor(s) should be added to * @param compositor the sequence/choice/all to modify * @param schema the schema being built */ private void addChoiceToSchema(Property property, TypeInfo typeInfo, ComplexType type, TypeDefParticle compositor, Schema schema) { Choice choice = new Choice(); if (property.getGenericType() != null) { choice.setMaxOccurs(Occurs.UNBOUNDED); } ArrayList<Property> choiceProperties = (ArrayList<Property>) property.getChoiceProperties(); addToSchemaType(typeInfo, choiceProperties, choice, type, schema); if (compositor instanceof Sequence) { ((Sequence) compositor).addChoice(choice); } else if (compositor instanceof Choice) { ((Choice) compositor).addChoice(choice); } }
nestedParticle = new Choice(); nestedParticle.setMaxOccurs(Occurs.UNBOUNDED); } else {
if (globalGroup != null) { if (globalGroup.getChoice() != null) { globalGroup.getChoice().setMaxOccurs(group.getMaxOccurs()); processChoice(targetNamespace, defaultNamespace, owningType, globalGroup.getChoice(), isMany); } else if (globalGroup.getSequence() != null) {
private void processChoice(String targetNamespace, String defaultNamespace, SDOType owningType, Choice choice, boolean isMany) { if (choice != null) { processTypeDef(targetNamespace, defaultNamespace, owningType, choice); java.util.List orderedItems = choice.getOrderedElements(); for (int i = 0; i < orderedItems.size(); i++) { Object next = orderedItems.get(i); if (!isMany && maxOccursGreaterThanOne(choice.getMaxOccurs())) { isMany = true; } if (next instanceof Choice) { processChoice(targetNamespace, defaultNamespace, owningType, (Choice) next, isMany); } else if (next instanceof Sequence) { processSequence(targetNamespace, defaultNamespace, owningType, (Sequence) next, isMany); } else if (next instanceof Any) { processAny(targetNamespace, defaultNamespace, (Any) next, owningType, choice);//isMany?? } else if (next instanceof Element) { processElement(targetNamespace, defaultNamespace, owningType, choice, (Element) next, false, isMany); } else if (next instanceof Group) { processGroup(targetNamespace, defaultNamespace, owningType, choice, (Group) next, isMany); } } } }
/** * Convenience method for processing an any property. Required * schema components will be generated and set accordingly. * * @param property the choice property to be processed * @param compositor the sequence/choice/all to modify * @param isCollection if true will be unbounded * @param anyNamespace value for the Any's namespace attribute */ private void addAnyToSchema(Property property, TypeDefParticle compositor, boolean isCollection, String anyNamespace) { Any any = new Any(); any.setNamespace(anyNamespace); if (property.isLax()) { any.setProcessContents(Any.LAX); } else { any.setProcessContents(SKIP); } if (isCollection) { any.setMinOccurs(Occurs.ZERO); any.setMaxOccurs(Occurs.UNBOUNDED); } if (compositor instanceof Sequence) { ((Sequence) compositor).addAny(any); } else if (compositor instanceof Choice) { ((Choice) compositor).addAny(any); } }
private boolean shouldBeSequenced(TypeDefParticle typeDefParticle) { java.util.List elements = typeDefParticle.getElements(); if ((elements != null) && (elements.size() > 1)) { return true; } if (typeDefParticle instanceof Sequence) { java.util.List allItems = ((Sequence) typeDefParticle).getOrderedElements(); for (int i = 0; i < allItems.size(); i++) { Object nextItem = allItems.get(i); if (nextItem instanceof TypeDefParticle) { boolean sequenced = shouldBeSequenced((TypeDefParticle) nextItem); if (sequenced) { return true; } } } } else if (typeDefParticle instanceof Choice) { java.util.List allItems = ((Choice) typeDefParticle).getOrderedElements(); for (int i = 0; i < allItems.size(); i++) { Object nextItem = allItems.get(i); if (nextItem instanceof TypeDefParticle) { boolean sequenced = shouldBeSequenced((TypeDefParticle) nextItem); if (sequenced) { return true; } } } } return false; }
} else { Choice choice = new Choice(); if (property.getGenericType() != null) { choice.setMaxOccurs(Occurs.UNBOUNDED); choice.setMinOccurs(Occurs.ZERO); element.setName(localName); choice.addElement(element); ((Sequence) compositor).addChoice(choice); } else if (compositor instanceof Choice) { ((Choice) compositor).addChoice(choice);
Choice theChoice = new Choice(); if (isCollection) { theChoice.setMaxOccurs(Occurs.UNBOUNDED); element = processReferenceDescriptor(element, getDescriptorByClass(fieldToClassMap.get(field), descriptors), schemaForNamespace, workingSchema, properties, descriptors, field, false); theChoice.addElement(element);
/** * Convenience method for processing a choice property. Required * schema components will be generated and set accordingly. * * @param property the choice property to be processed * @param typeInfo the TypeInfo that the given property belongs to * @param type the ComplexType which compositor(s) should be added to * @param compositor the sequence/choice/all to modify * @param schema the schema being built */ private void addChoiceToSchema(Property property, TypeInfo typeInfo, ComplexType type, TypeDefParticle compositor, Schema schema) { Choice choice = new Choice(); if (property.getGenericType() != null) { choice.setMaxOccurs(Occurs.UNBOUNDED); } ArrayList<Property> choiceProperties = (ArrayList<Property>) property.getChoiceProperties(); addToSchemaType(typeInfo, choiceProperties, choice, type, schema); if (compositor instanceof Sequence) { ((Sequence) compositor).addChoice(choice); } else if (compositor instanceof Choice) { ((Choice) compositor).addChoice(choice); } }
nestedParticle = new Choice(); nestedParticle.setMaxOccurs(Occurs.UNBOUNDED); } else {
if (globalGroup != null) { if (globalGroup.getChoice() != null) { globalGroup.getChoice().setMaxOccurs(group.getMaxOccurs()); processChoice(targetNamespace, defaultNamespace, owningType, globalGroup.getChoice(), isMany); } else if (globalGroup.getSequence() != null) {
private void processChoice(String targetNamespace, String defaultNamespace, SDOType owningType, Choice choice, boolean isMany) { if (choice != null) { processTypeDef(targetNamespace, defaultNamespace, owningType, choice); java.util.List orderedItems = choice.getOrderedElements(); for (int i = 0; i < orderedItems.size(); i++) { Object next = orderedItems.get(i); if (!isMany && maxOccursGreaterThanOne(choice.getMaxOccurs())) { isMany = true; } if (next instanceof Choice) { processChoice(targetNamespace, defaultNamespace, owningType, (Choice) next, isMany); } else if (next instanceof Sequence) { processSequence(targetNamespace, defaultNamespace, owningType, (Sequence) next, isMany); } else if (next instanceof Any) { processAny(targetNamespace, defaultNamespace, (Any) next, owningType, choice);//isMany?? } else if (next instanceof Element) { processElement(targetNamespace, defaultNamespace, owningType, choice, (Element) next, false, isMany); } else if (next instanceof Group) { processGroup(targetNamespace, defaultNamespace, owningType, choice, (Group) next, isMany); } } } }
/** * Convenience method for processing an any property. Required * schema components will be generated and set accordingly. * * @param property the choice property to be processed * @param compositor the sequence/choice/all to modify * @param isCollection if true will be unbounded * @param anyNamespace value for the Any's namespace attribute */ private void addAnyToSchema(Property property, TypeDefParticle compositor, boolean isCollection, String anyNamespace) { Any any = new Any(); any.setNamespace(anyNamespace); if (property.isLax()) { any.setProcessContents(Any.LAX); } else { any.setProcessContents(SKIP); } if (isCollection) { any.setMinOccurs(Occurs.ZERO); any.setMaxOccurs(Occurs.UNBOUNDED); } if (compositor instanceof Sequence) { ((Sequence) compositor).addAny(any); } else if (compositor instanceof Choice) { ((Choice) compositor).addAny(any); } }
private boolean shouldBeSequenced(TypeDefParticle typeDefParticle) { java.util.List elements = typeDefParticle.getElements(); if ((elements != null) && (elements.size() > 1)) { return true; } if (typeDefParticle instanceof Sequence) { java.util.List allItems = ((Sequence) typeDefParticle).getOrderedElements(); for (int i = 0; i < allItems.size(); i++) { Object nextItem = allItems.get(i); if (nextItem instanceof TypeDefParticle) { boolean sequenced = shouldBeSequenced((TypeDefParticle) nextItem); if (sequenced) { return true; } } } } else if (typeDefParticle instanceof Choice) { java.util.List allItems = ((Choice) typeDefParticle).getOrderedElements(); for (int i = 0; i < allItems.size(); i++) { Object nextItem = allItems.get(i); if (nextItem instanceof TypeDefParticle) { boolean sequenced = shouldBeSequenced((TypeDefParticle) nextItem); if (sequenced) { return true; } } } } return false; }
Choice theChoice = new Choice(); if (isCollection) { theChoice.setMaxOccurs(Occurs.UNBOUNDED); element = processReferenceDescriptor(element, getDescriptorByClass(fieldToClassMap.get(field), descriptors), schemaForNamespace, workingSchema, properties, descriptors, field, false); theChoice.addElement(element);