public void execute(XmlSchemaType stype, CorbaTypeImpl ctype) { if (member != null) { member.setIdltype(ctype.getQName()); } if (element != null) { element.setSchemaType(stype); element.setSchemaTypeName(stype.getQName()); if (stype.getQName().equals(ReferenceConstants.WSADDRESSING_TYPE)) { element.setNillable(true); } } }
private XmlSchemaElement generateWrapper(QName el, XmlSchemaSequence wrappingSequence) { XmlSchemaComplexType schemaComplexType = new XmlSchemaComplexType(schema, false); schemaComplexType.setParticle(wrappingSequence); XmlSchemaElement wrappingSchemaElement = new XmlSchemaElement(schema, true); wrappingSchemaElement.setName(el.getLocalPart()); wrappingSchemaElement.setSchemaType(schemaComplexType); return wrappingSchemaElement; }
private XmlSchemaElement doTransform(String name, ResolvedType resolvedType) { final boolean empty = currentElement.isEmpty(); final XmlSchemaElement schemaElement = new XmlSchemaElement(schema, empty); schemaElement.setName(name); currentElement.push(schemaElement); final XmlSchemaType visit = resolvedType.visit(this); if (visit != null) { if (visit.getQName() != null) { schemaElement.setSchemaTypeName(visit.getQName()); } else { schemaElement.setSchemaType(visit); } } currentElement.pop(); return schemaElement; }
/** * Generate schema construct for given type * * @param localPartName */ private XmlSchemaComplexType createSchemaTypeForMethodPart(String localPartName) { XmlSchema xmlSchema = getXmlSchema(schemaTargetNameSpace); QName elementName = new QName(this.schemaTargetNameSpace, localPartName, this.schema_namespace_prefix); XmlSchemaComplexType complexType = getComplexTypeForElement(xmlSchema, elementName); if (complexType == null) { complexType = new XmlSchemaComplexType(xmlSchema, false); XmlSchemaElement globalElement = new XmlSchemaElement(xmlSchema, false); globalElement.setSchemaType(complexType); globalElement.setName(localPartName); xmlSchema.getItems().add(globalElement); xmlSchema.getElements().put(elementName, globalElement); } typeTable.addComplexSchema(localPartName, elementName); return complexType; }
private XmlSchemaElement doTransform(String name, ResolvedType resolvedType) { final boolean empty = currentElement.isEmpty(); final XmlSchemaElement schemaElement = new XmlSchemaElement(schema, empty); schemaElement.setName(name); currentElement.push(schemaElement); final XmlSchemaType visit = resolvedType.visit(this); if (visit != null) { if (visit.getQName() != null) { schemaElement.setSchemaTypeName(visit.getQName()); } else { schemaElement.setSchemaType(visit); } } currentElement.pop(); return schemaElement; }
/** * Generate schema construct for given type * * @param localPartName */ private XmlSchemaComplexType createSchemaTypeForMethodPart(String localPartName) { XmlSchema xmlSchema = getXmlSchema(schemaTargetNameSpace); QName elementName = new QName(this.schemaTargetNameSpace, localPartName, this.schema_namespace_prefix); XmlSchemaComplexType complexType = getComplexTypeForElement(xmlSchema, elementName); if (complexType == null) { complexType = new XmlSchemaComplexType(xmlSchema, false); XmlSchemaElement globalElement = new XmlSchemaElement(xmlSchema, false); globalElement.setSchemaType(complexType); globalElement.setName(localPartName); xmlSchema.getItems().add(globalElement); xmlSchema.getElements().put(elementName, globalElement); } typeTable.addComplexSchema(localPartName, elementName); return complexType; }
private XmlSchemaElement createElementType(AST memberNode, XmlSchemaType stype, Scope fqName) { // xmlschema:member XmlSchemaElement member = new XmlSchemaElement(schema, false); String memberName = memberNode.toString(); member.setName(memberName); if (stype != null) { member.setSchemaType(stype); member.setSchemaTypeName(stype.getQName()); if (stype.getQName().equals(ReferenceConstants.WSADDRESSING_TYPE)) { member.setNillable(true); } } else { wsdlVisitor.getDeferredActions(). add(fqName, new ExceptionDeferredAction(member)); } return member; }
LOG.severe(message.toString()); } else { element.setSchemaType(type);
private XmlSchemaComplexType createSchemaTypeForMethodPart(String localPartName) { XmlSchema xmlSchema = getXmlSchema(schemaTargetNameSpace); QName elementName = new QName(this.schemaTargetNameSpace, localPartName, this.schema_namespace_prefix); XmlSchemaComplexType complexType = getComplexTypeForElement(xmlSchema, elementName); if (complexType == null) { complexType = new XmlSchemaComplexType(xmlSchema, false); XmlSchemaElement globalElement = new XmlSchemaElement(xmlSchema, false); globalElement.setName(localPartName); boolean disallowAnonTypes = isAnonymousTypesDisallowed(); if (disallowAnonTypes) { String complexTypeName = localPartName.substring(0, 1).toUpperCase() + localPartName.substring(1); complexType.setName(complexTypeName); globalElement.setSchemaTypeName(complexType.getQName()); xmlSchema.getItems().add(complexType); xmlSchema.getSchemaTypes().put(complexType.getQName(), complexType); } else { globalElement.setSchemaType(complexType); } xmlSchema.getItems().add(globalElement); xmlSchema.getElements().put(elementName, globalElement); } typeTable.addComplexSchema(localPartName, elementName); return complexType; }
LOG.severe(message.toString()); } else { element.setSchemaType(type);
/** * Create a nex XML schema element. * <p/> * We use the source URI to mark these injected elements. * * @param typeQName the element type * @param elementQName the element name * @param schema the XML schema */ public static void addXmlSchemaElement(final QName typeQName, final QName elementQName, final XmlSchema schema) { XmlSchemaElement el = new XmlSchemaElement(); el.setQName(elementQName); el.setName(elementQName.getLocalPart()); el.setSchemaTypeName(typeQName); el.setSchemaType(schema.getTypeByName(typeQName)); el.setSourceURI(XsdConstants.INJECTED_ELEMENT); schema.getElements().add(elementQName, el); schema.getItems().add(el); }
LOG.severe(message.toString()); } else { element.setSchemaType(type);
private XmlSchemaElement createXmlSchemaElement(AST memberNode, XmlSchemaType schemaType, Scope fqName) { // xmlschema:member XmlSchemaElement member = new XmlSchemaElement(schema, false); String memberName = memberNode.toString(); member.setName(memberName); member.setSchemaType(schemaType); if (schemaType != null) { member.setSchemaTypeName(schemaType.getQName()); if (schemaType.getQName().equals(ReferenceConstants.WSADDRESSING_TYPE)) { member.setNillable(true); } } else { wsdlVisitor.getDeferredActions(). add(fqName, new StructDeferredAction(member)); } return member; }
private XmlSchemaComplexType createSchemaTypeForMethodPart(String localPartName) { XmlSchema xmlSchema = getXmlSchema(schemaTargetNameSpace); QName elementName = new QName(this.schemaTargetNameSpace, localPartName, this.schema_namespace_prefix); XmlSchemaComplexType complexType = getComplexTypeForElement(xmlSchema, elementName); if (complexType == null) { complexType = new XmlSchemaComplexType(xmlSchema, false); XmlSchemaElement globalElement = new XmlSchemaElement(xmlSchema, false); globalElement.setName(localPartName); boolean disallowAnonTypes = isAnonymousTypesDisallowed(); if (disallowAnonTypes) { String complexTypeName = localPartName.substring(0, 1).toUpperCase() + localPartName.substring(1); complexType.setName(complexTypeName); globalElement.setSchemaTypeName(complexType.getQName()); xmlSchema.getItems().add(complexType); xmlSchema.getSchemaTypes().put(complexType.getQName(), complexType); } else { globalElement.setSchemaType(complexType); } xmlSchema.getItems().add(globalElement); xmlSchema.getElements().put(elementName, globalElement); } typeTable.addComplexSchema(localPartName, elementName); return complexType; }
private XmlSchemaComplexType createSchemaTypeForFault(String localPartName) { XmlSchema xmlSchema = getXmlSchema(schemaTargetNameSpace); QName elementName = new QName(this.schemaTargetNameSpace, localPartName, this.schema_namespace_prefix); XmlSchemaComplexType complexType = getComplexTypeForElement(xmlSchema, elementName); if (complexType == null) { complexType = new XmlSchemaComplexType(xmlSchema, false); XmlSchemaElement globalElement = new XmlSchemaElement(xmlSchema, false); globalElement.setName(localPartName); boolean disallowAnonTypes = isAnonymousTypesDisallowed(); if (disallowAnonTypes) { complexType.setName(localPartName); globalElement.setSchemaTypeName(complexType.getQName()); xmlSchema.getItems().add(complexType); xmlSchema.getSchemaTypes().put(complexType.getQName(), complexType); } else { globalElement.setSchemaType(complexType); } xmlSchema.getItems().add(globalElement); xmlSchema.getElements().put(elementName, globalElement); } return complexType; }
private XmlSchemaComplexType createSchemaTypeForFault(String localPartName) { XmlSchema xmlSchema = getXmlSchema(schemaTargetNameSpace); QName elementName = new QName(this.schemaTargetNameSpace, localPartName, this.schema_namespace_prefix); XmlSchemaComplexType complexType = getComplexTypeForElement(xmlSchema, elementName); if (complexType == null) { complexType = new XmlSchemaComplexType(xmlSchema, false); XmlSchemaElement globalElement = new XmlSchemaElement(xmlSchema, false); globalElement.setName(localPartName); boolean disallowAnonTypes = isAnonymousTypesDisallowed(); if (disallowAnonTypes) { complexType.setName(localPartName); globalElement.setSchemaTypeName(complexType.getQName()); xmlSchema.getItems().add(complexType); xmlSchema.getSchemaTypes().put(complexType.getQName(), complexType); } else { globalElement.setSchemaType(complexType); } xmlSchema.getItems().add(globalElement); xmlSchema.getElements().put(elementName, globalElement); } return complexType; }
xmlSchemaElement.setSchemaType(xmlSchemaComplexType); xmlSchemaElement.setSchemaTypeName(new QName(schemaTargetNameSpace, xmlSchemaComplexType.getName()));
true); xmlSchemaElement.setSchemaType(xmlSchemaComplexType); xmlSchemaElement.setSchemaTypeName(new QName(schemaTargetNameSpace, xmlSchemaComplexType.getName())); return new QName(xmlSchema.getTargetNamespace(), complexTypeName);
public WSDLPart(Part part, Class javaType) throws InvalidWSDLException { this.part = part; QName elementName = part.getElementName(); if (elementName != null) { element = WSDLOperationIntrospectorImpl.this.getElement(elementName); if (element == null) { throw new InvalidWSDLException("Element cannot be resolved: " + elementName.toString()); } } else { // Create an faked XSD element to host the metadata element = new XmlSchemaElement(); element.setName(part.getName()); element.setQName(new QName(null, part.getName())); QName typeName = part.getTypeName(); if (typeName != null) { XmlSchemaType type = WSDLOperationIntrospectorImpl.this.getType(typeName); if (type == null) { throw new InvalidWSDLException("Type cannot be resolved: " + typeName.toString()); } element.setSchemaType(type); element.setSchemaTypeName(type.getQName()); } } XMLType xmlType = new XMLType(getElementInfo(element)); xmlType.setNillable(element.isNillable()); xmlType.setMany(element.getMaxOccurs() > 1); dataType = new DataTypeImpl<XMLType>(dataBinding, javaType, xmlType); }
public WSDLPart(Part part, Class javaType) throws InvalidWSDLException { this.part = part; QName elementName = part.getElementName(); if (elementName != null) { element = WSDLOperationIntrospectorImpl.this.getElement(elementName); if (element == null) { throw new InvalidWSDLException("Element cannot be resolved: " + elementName.toString()); } } else { // Create an faked XSD element to host the metadata element = new XmlSchemaElement(); element.setName(part.getName()); element.setQName(new QName(null, part.getName())); QName typeName = part.getTypeName(); if (typeName != null) { XmlSchemaType type = WSDLOperationIntrospectorImpl.this.getType(typeName); if (type == null) { throw new InvalidWSDLException("Type cannot be resolved: " + typeName.toString()); } element.setSchemaType(type); element.setSchemaTypeName(type.getQName()); } } XMLType xmlType = new XMLType(getElementInfo(element)); xmlType.setNillable(element.isNillable()); xmlType.setMany(element.getMaxOccurs() > 1); dataType = new DataTypeImpl<XMLType>(dataBinding, javaType, xmlType); }