/** * Create an attribute reference and add it to a given complex type. * This method will typically be called when processing an XPath * and a prefixed path element is encountered that requires an * attribute ref. * * @param attributeRefName * @param owningComplexType * @return */ public Attribute createRefAttribute(String attributeRefName, ComplexType owningComplexType) { Attribute refAttribute = new Attribute(); refAttribute.setRef(attributeRefName); if (owningComplexType.getSimpleContent() != null) { owningComplexType.getSimpleContent().getExtension().getOrderedAttributes().add(refAttribute); } else { owningComplexType.getOrderedAttributes().add(refAttribute); } return refAttribute; }
/** * Create an attribute reference and add it to a given complex type. * This method will typically be called when processing an XPath * and a prefixed path element is encountered that requires an * attribute ref. * * @param attributeRefName * @param owningComplexType * @return */ public Attribute createRefAttribute(String attributeRefName, ComplexType owningComplexType) { Attribute refAttribute = new Attribute(); refAttribute.setRef(attributeRefName); if (owningComplexType.getSimpleContent() != null) { owningComplexType.getSimpleContent().getExtension().getOrderedAttributes().add(refAttribute); } else { owningComplexType.getOrderedAttributes().add(refAttribute); } return refAttribute; }
reference.setRef(prefix + COLON + attribute.getName()); if (type.getSimpleContent() != null) { type.getSimpleContent().getExtension().getOrderedAttributes().add(reference); } else { type.getOrderedAttributes().add(reference); if (type.getSimpleContent() != null) { type.getSimpleContent().getExtension().getOrderedAttributes().add(attribute); } else if (type.getComplexContent() != null) { type.getComplexContent().getExtension().getOrderedAttributes().add(attribute);
reference.setRef(prefix + COLON + attribute.getName()); if (type.getSimpleContent() != null) { type.getSimpleContent().getExtension().getOrderedAttributes().add(reference); } else { type.getOrderedAttributes().add(reference); if (type.getSimpleContent() != null) { type.getSimpleContent().getExtension().getOrderedAttributes().add(attribute); } else if (type.getComplexContent() != null) { type.getComplexContent().getExtension().getOrderedAttributes().add(attribute);
/** * Convenience method for processing an any attribute property. Required * schema components will be generated and set accordingly. * * @param type the ComplexType which compositor(s) should be added to */ private void addAnyAttributeToSchema(ComplexType type) { AnyAttribute anyAttribute = new AnyAttribute(); anyAttribute.setProcessContents(SKIP); anyAttribute.setNamespace(Constants.ANY_NAMESPACE_OTHER); if (type.getSimpleContent() != null) { SimpleContent content = type.getSimpleContent(); if(content.getExtension() != null){ content.getExtension().setAnyAttribute(anyAttribute); }else if(content.getRestriction() != null){ content.getRestriction().setAnyAttribute(anyAttribute); } } else { type.setAnyAttribute(anyAttribute); } }
/** * Convenience method for processing an any attribute property. Required * schema components will be generated and set accordingly. * * @param type the ComplexType which compositor(s) should be added to */ private void addAnyAttributeToSchema(ComplexType type) { AnyAttribute anyAttribute = new AnyAttribute(); anyAttribute.setProcessContents(SKIP); anyAttribute.setNamespace(Constants.ANY_NAMESPACE_OTHER); if (type.getSimpleContent() != null) { SimpleContent content = type.getSimpleContent(); if(content.getExtension() != null){ content.getExtension().setAnyAttribute(anyAttribute); }else if(content.getRestriction() != null){ content.getRestriction().setAnyAttribute(anyAttribute); } } else { type.setAnyAttribute(anyAttribute); } }
processComplexContent(targetNamespace, defaultNamespace, complexType.getComplexContent(), newType); finishComplexType(newType); } else if (complexType.getSimpleContent() != null) { processSimpleContent(targetNamespace, defaultNamespace, complexType.getSimpleContent(), newType); finishComplexType(newType); } else {
private SDOType processComplexType(String targetNamespace, String defaultNamespace, String name, ComplexType complexType) { if (complexType == null) { return null; } boolean addedNR = addNextNamespaceResolver(complexType.getAttributesMap()); SDOType newType = startComplexType(targetNamespace, defaultNamespace, name, complexType); if (newType != null) { if (complexType.getComplexContent() != null) { processComplexContent(targetNamespace, defaultNamespace, complexType.getComplexContent(), newType); finishComplexType(newType); } else if (complexType.getSimpleContent() != null) { processSimpleContent(targetNamespace, defaultNamespace, complexType.getSimpleContent(), newType); finishComplexType(newType); } else { if (complexType.getChoice() != null) { processChoice(targetNamespace, defaultNamespace, newType, complexType.getChoice(), false); } else if (complexType.getSequence() != null) { processSequence(targetNamespace, defaultNamespace, newType, complexType.getSequence(), false); } else if (complexType.getAll() != null) { processAll(targetNamespace, defaultNamespace, newType, complexType.getAll(), false); } processOrderedAttributes(targetNamespace, defaultNamespace, newType, complexType.getOrderedAttributes()); finishComplexType(newType); } } if (addedNR) { namespaceResolvers.remove(namespaceResolvers.size() - 1); } return newType; }
Extension extension = new Extension(); extension.setBaseType(type.getRestriction().getBaseType()); cType.getSimpleContent().setExtension(extension); currentElement.setSimpleType(null); currentElement.setComplexType(cType); Extension extension = new Extension(); extension.setBaseType(type.getRestriction().getBaseType()); cType.getSimpleContent().setExtension(extension); currentElement.setSimpleType(null); currentElement.setComplexType(cType);
Extension extension = new Extension(); extension.setBaseType(type.getRestriction().getBaseType()); cType.getSimpleContent().setExtension(extension); currentElement.setSimpleType(null); currentElement.setComplexType(cType); Extension extension = new Extension(); extension.setBaseType(type.getRestriction().getBaseType()); cType.getSimpleContent().setExtension(extension); currentElement.setSimpleType(null); currentElement.setComplexType(cType);