/** * Contribute array-related properties. * <p/> * If this is a array depending on, there must me a corresponding ODO Object * that we enrich with the array dimensions as the numeric range. * * @param xsdElement the xsd element marked as an array * @param cobolAnnotations the xsd element COBOL annotations * @param props the corresponding set of properties */ @SuppressWarnings("unchecked") private void addArrayProps(XmlSchemaElement xsdElement, CobolAnnotations cobolAnnotations, Map < String, Object > props) { props.put(MIN_OCCURS_PROP_NAME, xsdElement.getMinOccurs()); props.put(MAX_OCCURS_PROP_NAME, xsdElement.getMaxOccurs()); String dependingOn = cobolAnnotations.getDependingOn(); if (dependingOn != null) { Map < String, Object > depProps = (Map < String, Object >) odoObjects .get(dependingOn); depProps.put(MIN_INCLUSIVE_PROP_NAME, Long.toString(xsdElement.getMinOccurs())); depProps.put(MAX_INCLUSIVE_PROP_NAME, Long.toString(xsdElement.getMaxOccurs())); props.put(DEPENDING_ON_PROP_NAME, odoObjectNames.get(dependingOn)); } }
private boolean needToRender(MessagePartInfo part) { if (part != null && part.getXmlSchema() instanceof XmlSchemaElement) { XmlSchemaElement element = (XmlSchemaElement)part.getXmlSchema(); return element.isNillable() && element.getMinOccurs() > 0; } return false; }
private static XmlElementInfo createXmlElementInfo(final QName qname, final QName xmlType, final XmlSchemaElement element) { final XmlElementInfo elementInfo = new XmlElementInfo(); elementInfo.qname = qname; elementInfo.xmlType = xmlType; elementInfo.minOccurs = element.getMinOccurs(); elementInfo.maxOccurs = element.getMaxOccurs(); elementInfo.nillable = element.isNillable(); return elementInfo; }
private boolean needToRender(MessagePartInfo part) { if (part != null && part.getXmlSchema() instanceof XmlSchemaElement) { XmlSchemaElement element = (XmlSchemaElement)part.getXmlSchema(); return element.isNillable() && element.getMinOccurs() > 0; } return false; }
break; long minOccurs = innerElement.getMinOccurs(); boolean nillable = innerElement.isNillable(); String name =
OMElement bodyFirstChild) throws AxisFault { long minOccurs = innerElement.getMinOccurs(); boolean nillable = innerElement.isNillable(); String name =
OMElement bodyFirstChild) throws AxisFault { long minOccurs = innerElement.getMinOccurs(); boolean nillable = innerElement.isNillable(); String name =
/** * Create an elementInfo that stores information about a global, named, * element. * * @param element the element * @param currentSchema the schema it came from. * @param schemaCollection the collection of all schemas. * @param prefixAccumulator the accumulator that assigns prefixes. * @return */ public static ParticleInfo forGlobalElement(XmlSchemaElement element, XmlSchema currentSchema, SchemaCollection schemaCollection, NamespacePrefixAccumulator prefixAccumulator) { ParticleInfo elementInfo = new ParticleInfo(); elementInfo.particle = element; elementInfo.minOccurs = element.getMinOccurs(); elementInfo.maxOccurs = element.getMaxOccurs(); elementInfo.nillable = element.isNillable(); elementInfo.global = true; factoryCommon(element, currentSchema, schemaCollection, prefixAccumulator, elementInfo); return elementInfo; }
public boolean isLiteralArray(XmlSchemaComplexType type) { boolean array = false; if ((type.getAttributes().isEmpty()) && (type.getParticle() instanceof XmlSchemaSequence)) { XmlSchemaSequence stype = (XmlSchemaSequence)type.getParticle(); if ((stype.getItems().size() == 1) && (stype.getItems().get(0) instanceof XmlSchemaElement)) { XmlSchemaElement el = (XmlSchemaElement)stype.getItems().get(0); if (!(el.getMaxOccurs() == 1)) { // it's a literal array array = true; } if (el.getMaxOccurs() == 1 && el.getMinOccurs() == 1 && type.getName() != null && WSDLTypes.isAnonymous(type.getName())) { array = true; } } } return array; }
elementInfo.maxOccurs = 1; } else { elementInfo.minOccurs = element.getMinOccurs(); elementInfo.maxOccurs = element.getMaxOccurs(); elementInfo.nillable = element.isNillable();
minOccurs = arrayEl.getMinOccurs();
private static ElementInfo getElementInfo(XmlSchemaElement element) { if (element == null) { return null; } ElementInfo elementInfo = new ElementInfo(element.getQName(), getTypeInfo(element.getSchemaType())); elementInfo.setMany(element.getMaxOccurs() > 1); elementInfo.setNillable(element.isNillable()); elementInfo.setOmissible(element.getMinOccurs()==0); return elementInfo; }
private static ElementInfo getElementInfo(XmlSchemaElement element) { if (element == null) { return null; } ElementInfo elementInfo = new ElementInfo(element.getQName(), getTypeInfo(element.getSchemaType())); elementInfo.setMany(element.getMaxOccurs() > 1); elementInfo.setNillable(element.isNillable()); elementInfo.setOmissible(element.getMinOccurs()==0); return elementInfo; }
break; long minOccurs = innerElement.getMinOccurs(); boolean nillable = innerElement.isNillable(); String name =
private Map < String, Object > getProps(int fieldIndex, XmlSchemaElement xsdElement, RootCompositeType compositeTypes) { Map < String, Object > props; CobolAnnotations cobolAnnotations = new CobolAnnotations(xsdElement); if (xsdElement.getSchemaType() instanceof XmlSchemaComplexType) { props = getProps((XmlSchemaComplexType) xsdElement.getSchemaType(), compositeTypes); } else if (xsdElement.getSchemaType() instanceof XmlSchemaSimpleType) { props = getProps((XmlSchemaSimpleType) xsdElement.getSchemaType(), cobolAnnotations); if (props.get(ODO_OBJECT_PROP_NAME) != null) { odoObjectNames.put(cobolAnnotations.getCobolName(), getFieldName(xsdElement)); } } else { throw new Xsd2ConverterException("Unsupported xsd element of type " + xsdElement.getSchemaType().getQName() + " at line " + xsdElement.getLineNumber()); } if (xsdElement.getMaxOccurs() > 1) { addArrayProps(xsdElement, cobolAnnotations, props); } if (xsdElement.getMinOccurs() == 0 && xsdElement.getMaxOccurs() == 1) { addOptionalProps(xsdElement, cobolAnnotations, props); } props.put(COBOL_NAME_PROP_NAME, cobolAnnotations.getCobolName()); props.put(FIELD_INDEX_PROP_NAME, fieldIndex); return props; }
(innerElement.getMinOccurs() == 0)) { continue; (innerElement.getMinOccurs() == 0)) { continue;
if (!(element.getMaxOccurs() == 1) || !(element.getMinOccurs() == 1)) { QName name = createQNameCorbaNamespace(getModulePrefix(membertype) + elemName.getLocalPart() + "Array"); if (memName != null) { element.getMaxOccurs(), element.getMinOccurs(), false); } else { element.getMaxOccurs(), element.getMinOccurs(), false);
getAvroTypeName(xsdType), avroChildrenFields, xsdElement.getMaxOccurs() > 1, xsdElement.getMinOccurs() == 0 && xsdElement.getMaxOccurs() == 1); ObjectNode avroRecordElement = MAPPER.createObjectNode(); getAvroFieldName(xsdElement), xsdElement.getMinOccurs(), xsdElement.getMaxOccurs(), avroFields);
if (obj == null) { if (part.getXmlSchema() instanceof XmlSchemaElement && ((XmlSchemaElement)part.getXmlSchema()).getMinOccurs() == 0) {
if (obj == null) { if (part.getXmlSchema() instanceof XmlSchemaElement && ((XmlSchemaElement)part.getXmlSchema()).getMinOccurs() == 0) {