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); }
root.setName(name.getLocalPart()); root.setTargetNamespace(name.getNamespaceURI()); root.setTypeDefinition(type);
XSDFactory.eINSTANCE.createXSDElementDeclaration(); elementDecl.setTargetNamespace(Encoder.COMMENT.getNamespaceURI()); elementDecl.setName(Encoder.COMMENT.getLocalPart()); elementDecl.setElement(comment);
element.setName(simpleFeatureType.getTypeName());
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; } }
element.setName(attribute.getLocalName()); element.setNillable(attribute.isNillable());
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); }
element.setName(instance.getName());
protected XSDElementDeclaration createUnresolvedElementDeclaration(String namespace, String localName) { XSDElementDeclaration xsdElementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration(); if (localName != null) { xsdElementDeclaration.setName(localName); } if (namespace != null) { xsdElementDeclaration.setTargetNamespace(namespace); } xsdElementDeclaration.setResolvedElementDeclaration(xsdElementDeclaration); return xsdElementDeclaration; }
protected XSDElementDeclaration createUnresolvedElementDeclaration(String namespace, String localName) { XSDElementDeclaration xsdElementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration(); if (localName != null) { xsdElementDeclaration.setName(localName); } if (namespace != null) { xsdElementDeclaration.setTargetNamespace(namespace); } xsdElementDeclaration.setResolvedElementDeclaration(xsdElementDeclaration); return xsdElementDeclaration; }
protected XSDParticle createXSDElementDeclarationForComplexType() { XSDSimpleTypeDefinition type = xsdModelGroup.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition("string"); //$NON-NLS-1$ XSDElementDeclaration element = XSDFactory.eINSTANCE.createXSDElementDeclaration(); ArrayList usedAttributeNames = new ArrayList(); usedAttributeNames.addAll(XSDCommonUIUtils.getAllAttributes(xsdComplexTypeDefinition)); usedAttributeNames.addAll(XSDCommonUIUtils.getInheritedAttributes(xsdComplexTypeDefinition)); element.setName(XSDCommonUIUtils.createUniqueElementName( nameToAdd == null ? "NewElement" : nameToAdd , usedAttributeNames)); //$NON-NLS-1$ element.setTypeDefinition(type); XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle(); particle.setContent(element); addedXSDConcreteComponent = element; return particle; }
protected XSDParticle createXSDElementDeclarationForModelGroupDefinitions() { XSDSimpleTypeDefinition type = xsdModelGroup.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition("string"); //$NON-NLS-1$ XSDElementDeclaration element = XSDFactory.eINSTANCE.createXSDElementDeclaration(); ArrayList usedAttributeNames = new ArrayList(); usedAttributeNames.addAll(XSDCommonUIUtils.getAllAttributes(xsdModelGroupDefinition)); element.setName(XSDCommonUIUtils.createUniqueElementName( nameToAdd == null ? "NewElement" : nameToAdd , usedAttributeNames)); //$NON-NLS-1$ element.setTypeDefinition(type); XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle(); particle.setContent(element); addedXSDConcreteComponent = element; return 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 createElementDeclaration(XSDSchema schema, String name, String type, boolean schemaType) { XSDElementDeclaration elementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration(); elementDeclaration.setName(name); if (schemaType) { elementDeclaration.setTypeDefinition(schema.getSchemaForSchema().resolveSimpleTypeDefinition(type)); } else { elementDeclaration.setTypeDefinition(schema.resolveSimpleTypeDefinition(type)); } return elementDeclaration; }
protected XSDElementDeclaration createElementDeclaration(XSDSchema schema, String name, String type, boolean schemaType) { XSDElementDeclaration elementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration(); elementDeclaration.setName(name); if (schemaType) { elementDeclaration.setTypeDefinition(schema.getSchemaForSchema().resolveSimpleTypeDefinition(type)); } else { elementDeclaration.setTypeDefinition(schema.resolveSimpleTypeDefinition(type)); } return elementDeclaration; }
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; }