/** * Template method for creating an attribute name. * * @return {@link org.geotools.feature.Types#typeName(String, String)} */ protected Name createName(String ns, String local) { return Types.typeName(ns, local); }
/** * Template method for creating a type name. * * @return {@link org.geotools.feature.iso.Types#typeName(String, String)} */ protected Name createTypeName(String ns, String local) { return Types.typeName(ns, local); }
/** * Creates a set of type names from a set of strings. * * <p>This method returns null if names == null. * * <p>The ith name has getLocalPart() == names[i] and getNamespaceURI() == null */ public static Name[] toTypeNames(String[] names) { if (names == null) { return null; } Name[] typeNames = new Name[names.length]; for (int i = 0; i < names.length; i++) { typeNames[i] = typeName(names[i]); } return typeNames; }
/** * Creates a set of attribute names from a set of strings. * * <p>This method returns null if names == null. * * <p>The ith name has getLocalPart() == names[i] and getNamespaceURI() == null */ public static Name[] toNames(String[] names) { if (names == null) { return null; } Name[] attributeNames = new Name[names.length]; for (int i = 0; i < names.length; i++) { attributeNames[i] = typeName(names[i]); } return attributeNames; }
/** * Adds an association to the complex attribute being built. <br> * * <p>This method uses the type supplied in {@link #setType(AttributeType)} in order to * determine the association type. * * @param value The value of the association, an attribute. * @param name The name of the association. * @param namespaceURI The namespace of the association */ public void associate(Attribute attribute, String name, String namespaceURI) { associate(attribute, Types.typeName(namespaceURI, name)); }
/** * Adds an attribute to the complex attribute being built. <br> * * <p>This method uses the type supplied in {@link #setType(AttributeType)} in order to * determine the attribute type. * * @param id The id of the attribute. * @param value The value of the attribute. * @param name The name of the attribute. * @param namespaceURI The namespace of the attribute. */ public Attribute add(String id, Object value, String name, String namespaceURI) { return add(id, value, Types.typeName(namespaceURI, name)); }
public NodeIterator attributeIterator(QName qname) { return new XmlAttributeNodeIterator( this, Types.typeName( getNamespaceResolver().getNamespaceURI(qname.getPrefix()), qname.getName())); } }
public NodeIterator attributeIterator(QName qname) { return new DescriptorXmlAttributeNodeIterator( this, Types.typeName( getNamespaceResolver().getNamespaceURI(qname.getPrefix()), qname.getName())); } }
private AttributeDescriptor createAttributeDescriptor( final XSDElementDeclaration elemDecl, int minOccurs, int maxOccurs, CoordinateReferenceSystem crs) { String targetNamespace = elemDecl.getTargetNamespace(); String name = elemDecl.getName(); Name elemName = Types.typeName(targetNamespace, name); AttributeType type = getTypeOf(elemDecl, crs); boolean nillable = elemDecl.isNillable(); Object defaultValue = null; AttributeDescriptor descriptor = createAttributeDescriptor( type, crs, elemName, minOccurs, maxOccurs, nillable, defaultValue); descriptor.getUserData().put(XSDElementDeclaration.class, elemDecl); return descriptor; }
if (!(sub.getName().equals(elemDecl.getName())) || !(sub.getTargetNamespace().equals(elemDecl.getTargetNamespace()))) { Name elemName = Types.typeName(sub.getTargetNamespace(), sub.getName()); AttributeType type = getTypeOf(sub, crs); if (type != null) { Name typeName = Types.typeName(typeDef.getTargetNamespace(), typeDef.getName()); AttributeType attType = typeRegistry.get(typeName);
Types.typeName(elemDecl.getTargetNamespace(), elemDecl.getName())); for (SchemaIndex schemaIndex : schemas) { elemDecl = schemaIndex.getElementDeclaration(qname); String targetNamespace = typeDefinition.getTargetNamespace(); String name = typeDefinition.getName(); Name typeName = Types.typeName(targetNamespace, name); type = getAttributeType(typeName, typeDefinition, crs); if (type == null) { String name = elemDecl.getName(); String targetNamespace = elemDecl.getTargetNamespace(); Name overrideName = Types.typeName(targetNamespace, name); type = createType(overrideName, typeDefinition, crs, true);
public NodeIterator childIterator(NodeTest test, boolean reverse, NodePointer startWith) { if (test instanceof NodeNameTest) { NodeNameTest nodeNameTest = (NodeNameTest) test; if (!nodeNameTest.isWildcard()) { String localName = nodeNameTest.getNodeName().getName(); String nameSpace = nodeNameTest.getNamespaceURI(); if (nameSpace == null) nameSpace = getNamespaceResolver().getNamespaceURI(""); return new SingleFeatureTypeAttributeIterator( this, ((ComplexType) attType), Types.typeName(nameSpace, localName)); } else { return new FeatureTypeAttributeIterator(this, ((ComplexType) attType)); } } if (test instanceof NodeTypeTest) { NodeTypeTest nodeTypeTest = (NodeTypeTest) test; if (nodeTypeTest.getNodeType() == Compiler.NODE_TYPE_NODE) { return new FeatureTypeAttributeIterator(this, ((ComplexType) attType)); } } return super.childIterator(test, reverse, startWith); }
public NodeIterator childIterator(NodeTest test, boolean reverse, NodePointer startWith) { if (test instanceof NodeNameTest) { NodeNameTest nodeNameTest = (NodeNameTest) test; if (!nodeNameTest.isWildcard()) { String localName = nodeNameTest.getNodeName().getName(); String nameSpace = nodeNameTest.getNamespaceURI(); if (nameSpace == null) nameSpace = getNamespaceResolver().getNamespaceURI(""); return new SingleFeatureTypeAttributeIterator( this, featureType, Types.typeName(nameSpace, localName)); } else { return new FeatureTypeAttributeIterator(this, featureType); } } if (test instanceof NodeTypeTest) { NodeTypeTest nodeTypeTest = (NodeTypeTest) test; if (nodeTypeTest.getNodeType() == Compiler.NODE_TYPE_NODE) { return new FeatureTypeAttributeIterator(this, featureType); } } return super.childIterator(test, reverse, startWith); } }
public NodeIterator childIterator(NodeTest test, boolean reverse, NodePointer startWith) { if (test instanceof NodeNameTest) { NodeNameTest nodeNameTest = (NodeNameTest) test; if (!nodeNameTest.isWildcard()) { String localName = nodeNameTest.getNodeName().getName(); String nameSpace = nodeNameTest.getNamespaceURI(); if (nameSpace == null) nameSpace = getNamespaceResolver().getNamespaceURI(""); return new AttributeNodeIterator(this, Types.typeName(nameSpace, localName)); } else { return new AttributeNodeIterator(this); } } if (test instanceof NodeTypeTest) { NodeTypeTest nodeTypeTest = (NodeTypeTest) test; if (nodeTypeTest.getNodeType() == Compiler.NODE_TYPE_NODE) { return new AttributeNodeIterator(this); } } return super.childIterator(test, reverse, startWith); }
userData.put(Types.typeName(EG, "att"), "test attribute");
public NodeIterator attributeIterator(QName qname) { return new DescriptorXmlAttributeNodeIterator( this, Types.typeName( getNamespaceResolver().getNamespaceURI(qname.getPrefix()), qname.getName())); } }
public NodeIterator attributeIterator(QName qname) { return new XmlAttributeNodeIterator( this, Types.typeName( getNamespaceResolver().getNamespaceURI(qname.getPrefix()), qname.getName())); } }
private AttributeDescriptor createAttributeDescriptor( final XSDElementDeclaration elemDecl, int minOccurs, int maxOccurs, CoordinateReferenceSystem crs) { String targetNamespace = elemDecl.getTargetNamespace(); String name = elemDecl.getName(); Name elemName = Types.typeName(targetNamespace, name); AttributeType type = getTypeOf(elemDecl, crs); boolean nillable = elemDecl.isNillable(); Object defaultValue = null; AttributeDescriptor descriptor = createAttributeDescriptor( type, crs, elemName, minOccurs, maxOccurs, nillable, defaultValue); descriptor.getUserData().put(XSDElementDeclaration.class, elemDecl); return descriptor; }