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); }
XSDElementDeclaration clone = (XSDElementDeclaration) e.cloneConcreteComponent(false, false); clone.setTargetNamespace(GML.NAMESPACE);
root.setTargetNamespace(name.getNamespaceURI()); root.setTypeDefinition(type);
elementDecl.setTargetNamespace(Encoder.COMMENT.getNamespaceURI()); elementDecl.setName(Encoder.COMMENT.getLocalPart()); elementDecl.setElement(comment);
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.setTargetNamespace(attributeNs); } else { element.setTargetNamespace(featureType.getName().getNamespaceURI());
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.setTargetNamespace(instance.getNamespace());
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; }
public void visitElementDeclaration(XSDElementDeclaration element) { super.visitElementDeclaration(element); if (element.isElementDeclarationReference()) { if (element.getResolvedElementDeclaration().getTargetNamespace() != null) { if (element.getResolvedElementDeclaration().getTargetNamespace().equals(oldNS)) { // set the resolved element's declaration to new ns // this is defect 237518 - target namespace rename creates a new namespace element.getResolvedElementDeclaration().setTargetNamespace(newNS); } } else { if (oldNS == null || (oldNS != null && oldNS.equals(""))) { element.getResolvedElementDeclaration().setTargetNamespace(newNS); } } } } }
elementDecl.setTargetNamespace(Encoder.COMMENT.getNamespaceURI()); elementDecl.setName(Encoder.COMMENT.getLocalPart()); elementDecl.setElement(comment);
private void buildSchemaContent( FeatureTypeInfo featureTypeMeta, XSDSchema schema, XSDFactory factory, String baseUrl) throws IOException { if (!findTypeInSchema(featureTypeMeta, schema, factory)) { // build the type manually FeatureType featureType = featureTypeMeta.getFeatureType(); if (featureTypeMeta.isCircularArcPresent() && this.getClass().equals(GML3.class)) { featureType = new CurveTypeWrapper(featureType); } XSDComplexTypeDefinition xsdComplexType = buildComplexSchemaContent(featureType, schema, factory); XSDElementDeclaration element = factory.createXSDElementDeclaration(); element.setName(featureTypeMeta.getName()); element.setTargetNamespace(featureTypeMeta.getNamespace().getURI()); synchronized (Schemas.class) { // this call changes the global schemas too, need to be synchronized element.setSubstitutionGroupAffiliation(getFeatureElement()); } element.setTypeDefinition(xsdComplexType); schema.getContents().add(element); schema.updateElement(); } }
element.setTargetNamespace(featureTypeMeta.getNamespace().getURI()); synchronized (Schemas.class) { element.setSubstitutionGroupAffiliation(getFeatureElement());
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.setTargetNamespace(instance.getNamespace());
if (namespace != null) child.setTargetNamespace(namespace);
element.setTargetNamespace(instance.getNamespace());
element.setTargetNamespace( instance.getNamespace() );