DelegatingHandler(ParserDelegate delegate, QName elementName, Handler parent) { this.delegate = delegate; this.parent = parent; this.elementName = elementName; // create a parse tree XSDElementDeclaration e = XSDFactory.eINSTANCE.createXSDElementDeclaration(); e.setTargetNamespace(elementName.getNamespaceURI()); e.setName(elementName.getLocalPart()); ElementImpl instance = new ElementImpl(e); instance.setName(elementName.getLocalPart()); instance.setNamespace(elementName.getNamespaceURI()); parseTree = new NodeImpl(instance); }
public ElementInstance element(String text, QName qname) { // create a fake element declaration and element instance XSDElementDeclaration declaration = XSDFactory.eINSTANCE.createXSDElementDeclaration(); declaration.setTypeDefinition(xsdSimple(qname.getLocalPart())); ElementInstance element = new ElementImpl(declaration); element.setText(text); return element; }
XSDFactory.eINSTANCE.createXSDElementDeclaration(); elementDecl.setTargetNamespace(Encoder.COMMENT.getNamespaceURI()); elementDecl.setName(Encoder.COMMENT.getLocalPart()); XSDElementDeclaration wrapper = XSDFactory.eINSTANCE.createXSDElementDeclaration(); wrapper.setResolvedElementDeclaration(elementDecl); particle.setContent(wrapper);
root = XSDFactory.eINSTANCE.createXSDElementDeclaration(); root.setName(name.getLocalPart()); root.setTargetNamespace(name.getNamespaceURI());
xsd.getQNamePrefixToNamespaceMap().put("gml", "http://www.opengis.net/gml"); XSDElementDeclaration element = factory.createXSDElementDeclaration(); element.setName(simpleFeatureType.getTypeName());
XSDElementDeclaration decl = XSDFactory.eINSTANCE.createXSDElementDeclaration(); decl.setName(qualifiedName.getLocalPart()); decl.setTargetNamespace(qualifiedName.getNamespaceURI());
XSDParticle particle(Attribute att) { XSDFactory factory = XSDFactory.eINSTANCE; AttributeType attType = att.getType(); XSDTypeDefinition xsdType = schemaIndex.getTypeDefinition( new QName( attType.getName().getNamespaceURI(), attType.getName().getLocalPart())); XSDElementDeclaration element = factory.createXSDElementDeclaration(); element.setName(att.getName().getLocalPart()); element.setTargetNamespace(att.getName().getNamespaceURI()); element.setTypeDefinition(xsdType); XSDParticle particle = factory.createXSDParticle(); particle.setContent(element); return particle; } }
XSDElementDeclaration element = f.createXSDElementDeclaration(); element.setName(attribute.getLocalName()); element.setNillable(attribute.isNillable());
substitutedChildParticle.setMinOccurs(descriptor.getMinOccurs()); XSDElementDeclaration wrapper = XSDFactory.eINSTANCE.createXSDElementDeclaration(); wrapper.setResolvedElementDeclaration( (XSDElementDeclaration) propertyElement); substitutedChildParticle.setMinOccurs(childParticle.getMinOccurs()); XSDElementDeclaration wrapper = XSDFactory.eINSTANCE.createXSDElementDeclaration(); wrapper.setResolvedElementDeclaration(e); substitutedChildParticle.setContent(wrapper); substitutedChildParticle.setMinOccurs(descriptor.getMinOccurs()); XSDElementDeclaration wrapper = XSDFactory.eINSTANCE.createXSDElementDeclaration(); wrapper.setResolvedElementDeclaration( (XSDElementDeclaration) propertyElement); substitutedChildParticle.setMinOccurs(descriptor.getMinOccurs()); XSDElementDeclaration wrapper = XSDFactory.eINSTANCE.createXSDElementDeclaration(); wrapper.setResolvedElementDeclaration( (XSDElementDeclaration) propertyElement);
XSDElementDeclaration attribute = factory.createXSDElementDeclaration(); attribute.setName(attributeDescriptor.getLocalName()); attribute.setNillable(attributeDescriptor.isNillable());
public FeatureTypeContext(SimpleFeature f, GMLDelegate gml) { this.featureType = f.getFeatureType(); QName featureName = new QName( featureType.getName().getNamespaceURI(), featureType.getName().getLocalPart()); // look up the element in the schema XSDElementDeclaration element = encoder.getSchemaIndex().getElementDeclaration(featureName); if (element == null) { // create one element = XSDFactory.eINSTANCE.createXSDElementDeclaration(); element.setName(featureType.getName().getLocalPart()); element.setTargetNamespace(featureType.getName().getNamespaceURI()); element.setTypeDefinition( encoder.getSchemaIndex().getTypeDefinition(GML.AbstractFeatureType)); } // look up all the bindings for each property BindingLoader bindingLoader = encoder.getBindingLoader(); // get all the properties List properties = gml.getFeatureProperties(f, element, encoder); attributes = setupAttributeContexts(properties, featureType, bindingLoader); featureQualifiedName = getFeatureQualifiedName(featureName); }
XSDFactory.eINSTANCE.createXSDElementDeclaration(); element.setTypeDefinition(itemType);
public static XSDElementDeclaration createElementDeclaration(Node node) { if (XSDConstants.nodeType(node) == XSDConstants.ELEMENT_ELEMENT) { XSDElementDeclaration xsdElementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration(); xsdElementDeclaration.setElement((Element)node); return xsdElementDeclaration; } return null; }
public static XSDElementDeclaration createElementDeclaration(Node node) { if (XSDConstants.nodeType(node) == XSDConstants.ELEMENT_ELEMENT) { XSDElementDeclaration xsdElementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration(); xsdElementDeclaration.setElement((Element)node); return xsdElementDeclaration; } return null; }
protected void addElementDeclarationReference(XSDSchema schema, XSDModelGroup modelGroup, String reference) { XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle(); XSDElementDeclaration elementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration(); elementDeclaration.setResolvedElementDeclaration(schema.resolveElementDeclaration(reference)); particle.setContent(elementDeclaration); modelGroup.getContents().add(particle); }
protected void addXMIExtension(XSDModelGroup modelGroup) { if (!minimizedXMI) { importXMI(); XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle(); XSDElementDeclaration xsdElementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration(); xsdElementDeclaration.setResolvedElementDeclaration(xsdElementDeclaration.resolveElementDeclaration(XMI_URI, "Extension")); particle.setContent(xsdElementDeclaration); modelGroup.getContents().add(particle); } }
protected XSDElementDeclaration buildGlobalElement(XSDSchema xsdSchema, EClass eClass) { XSDElementDeclaration xsdElementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration(); xsdElementDeclaration.setName(extendedMetaData.getName(eClass)); XSDTypeDefinition xsdTypeDefinition = xsdSchema.resolveTypeDefinitionURI(getURI(eClass)); handleImport(xsdSchema, xsdTypeDefinition); xsdElementDeclaration.setTypeDefinition(xsdTypeDefinition); xsdSchema.getContents().add(xsdElementDeclaration); map(xsdElementDeclaration, eClass); createEcoreAnnotation(xsdElementDeclaration, "ignore", "true"); return xsdElementDeclaration; }
protected XSDElementDeclaration buildGlobalElement(XSDSchema xsdSchema, EClass eClass) { XSDElementDeclaration xsdElementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration(); xsdElementDeclaration.setName(extendedMetaData.getName(eClass)); XSDTypeDefinition xsdTypeDefinition = xsdSchema.resolveTypeDefinitionURI(getURI(eClass)); handleImport(xsdSchema, xsdTypeDefinition); xsdElementDeclaration.setTypeDefinition(xsdTypeDefinition); xsdSchema.getContents().add(xsdElementDeclaration); map(xsdElementDeclaration, eClass); createEcoreAnnotation(xsdElementDeclaration, "ignore", "true"); return xsdElementDeclaration; }
protected XSDElementDeclaration createGlobalXSDElementDeclaration() { ensureSchemaElement(xsdSchema); XSDSimpleTypeDefinition type = xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("string"); //$NON-NLS-1$ XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory(); XSDElementDeclaration element = factory.createXSDElementDeclaration(); element.setName(XSDCommonUIUtils.createUniqueElementName( nameToAdd == null ? "NewElement" : nameToAdd , xsdSchema.getElementDeclarations())); //$NON-NLS-1$ element.setTypeDefinition(type); return element; }
XSDParticle particle(Attribute att) { XSDFactory factory = XSDFactory.eINSTANCE; AttributeType attType = att.getType(); XSDTypeDefinition xsdType = schemaIndex.getTypeDefinition( new QName(attType.getName().getNamespaceURI(), attType.getName().getLocalPart())); XSDElementDeclaration element = factory.createXSDElementDeclaration(); element.setName(att.getName().getLocalPart()); element.setTargetNamespace(att.getName().getNamespaceURI()); element.setTypeDefinition(xsdType); XSDParticle particle = factory.createXSDParticle(); particle.setContent(element); return particle; }