Refine search
public <T extends ResourceInfo> T getResourceByName(Name name, Class<T> clazz) { return getResourceByName(name.getNamespaceURI(), name.getLocalPart(), clazz); }
public LayerInfo getLayerByName(Name name) { if (name.getNamespaceURI() != null) { NamespaceInfo ns = getNamespaceByURI(name.getNamespaceURI()); if (ns != null) { return getLayerByName(ns.getPrefix() + ":" + name.getLocalPart()); } } return getLayerByName(name.getLocalPart()); }
public DataAccess<?, ?> access(Name name) { String workspace = name.getNamespaceURI(); String localName = name.getLocalPart(); DataStoreInfo info = getCatalog().getDataStoreByName(workspace, localName); if (info == null) { info = getCatalog().getDataStoreByName(localName); if (info == null) { return null; } } try { return info.getDataStore(null); } catch (IOException ex) { throw new RuntimeException(ex); } }
/** Convert a Name to a type reference (namespace ":" name) */ protected String typeRef(Name name) { return name.getNamespaceURI() + ":" + name.getLocalPart(); }
/** Convert a Name to a type reference (namespace ":" name) */ protected String typeRef(Name name) { return name.getNamespaceURI() + ":" + name.getLocalPart(); }
/** Compares this operand with the specified value for equality. */ @Override public boolean equals(final Object other) { if (other != null && other instanceof Name) { final Name that = (Name) other; return namespaceURI.equals(that.getNamespaceURI()) && name.equals(that.getLocalPart()); } return false; }
info = cat.getResourceByName( att.getType().getName().getNamespaceURI(), att.getType().getName().getLocalPart(), FeatureTypeInfo.class); map.put("fid", ""); map.put("typeName", att.getType().getName().getLocalPart());
/** * Creates a type name from another name. * * @param name The other name. */ public static Name typeName(Name name) { return new NameImpl(name.getNamespaceURI(), name.getLocalPart()); }
public static boolean equals(Name name, QName qName) { if (name == null && qName != null) { return false; } if (qName == null && name != null) { return false; } if (XMLConstants.NULL_NS_URI.equals(qName.getNamespaceURI())) { if (null != name.getNamespaceURI()) { return false; } else { return name.getLocalPart().equals(qName.getLocalPart()); } } if (null == name.getNamespaceURI() && !XMLConstants.NULL_NS_URI.equals(qName.getNamespaceURI())) { return false; } return name.getNamespaceURI().equals(qName.getNamespaceURI()) && name.getLocalPart().equals(qName.getLocalPart()); }
/** Returns the qname */ public QName getName() { return new QName(name.getNamespaceURI(), name.getLocalPart()); }
/** * Constructor with full attribute name. * * @param name Attribute Name. */ public AttributeExpressionImpl(Name name) { attPath = name.getLocalPart(); schema = null; if (name.getNamespaceURI() != null) { namespaceSupport = new NamespaceSupport(); namespaceSupport.declarePrefix("", name.getNamespaceURI()); } else { namespaceSupport = null; } }
private String getPropertyNameXpath(Name propName) { String xpath; String namespaceUri = propName.getNamespaceURI(); if (namespaceUri != null) { String namespace = namespaces.getPrefix(namespaceUri); xpath = namespace + propName.getSeparator() + propName.getLocalPart(); } else { xpath = propName.getLocalPart(); } return xpath; }
public static QName toQName(Name featurePath, NamespaceSupport ns) { if (featurePath == null) { return null; } String namespace = featurePath.getNamespaceURI(); String localName = featurePath.getLocalPart(); QName qName; if (null == namespace) { qName = new QName(localName); } else { if (ns != null) { String prefix = ns.getPrefix(namespace); if (prefix != null) { qName = new QName(namespace, localName, prefix); return qName; } } qName = new QName(namespace, localName); } return qName; }
/** * Encode any client properties (XML attributes) found in the UserData map of a ComplexAttribute * as XML attributes of the element. * * @param complex the ComplexAttribute to search for client properties * @param element the element to which XML attributes should be added */ @SuppressWarnings("unchecked") public static void encodeClientProperties(Property complex, Element element) { Map<Name, Object> clientProperties = (Map<Name, Object>) complex.getUserData().get(Attributes.class); if (clientProperties != null) { for (Name name : clientProperties.keySet()) { if (clientProperties.get(name) != null) { element.setAttributeNS( name.getNamespaceURI(), name.getLocalPart(), clientProperties.get(name).toString()); } } } }
private Name functionName(Name functionName) { String name = functionName.getLocalPart(); // strip off "Function" prefix int index = -1; if ((index = name.indexOf("Function")) != -1) { name = name.substring(0, index); } // convert to lower case name = name.toLowerCase().trim(); // JD: not sure why the first character is converted back to upper case, disabling this and // just keeping everything lower case, as this is only used internally to store functions // it should affect any existing clients // char c = name.charAt(0); // name = name.replaceFirst("" + c, "" + Character.toUpperCase(c)); return new NameImpl(functionName.getNamespaceURI(), functionName.getSeparator(), name); }
public FieldType getFieldType(String name) { for (FieldType fieldType : fieldTypes) { final Name ftName = fieldType.getName(); String localPart = name; String nameSpace = ""; if (name.contains(":")) { final int indexOf = name.lastIndexOf(":"); localPart = name.substring(indexOf + 1, localPart.length()); nameSpace = name.substring(0, indexOf); } final String ftLocalPart = ftName.getLocalPart().toString(); final String ftNameSpace = ftName.getNamespaceURI(); if (ftLocalPart.equals(localPart)) { if (ftNameSpace != null) { if (ftNameSpace.equals(nameSpace)) return fieldType; } return fieldType; } } return null; }
/** Sets the local name and namespace uri of the built type. */ public void setName(Name name) { setName(name.getLocalPart()); setNamespaceURI(name.getNamespaceURI()); }
public static boolean isDecendedFrom(FeatureType featureType, FeatureType isParentType) { try { return isDecendedFrom( featureType, new URI(isParentType.getName().getNamespaceURI()), isParentType.getName().getLocalPart()); } catch (URISyntaxException e) { throw new RuntimeException(e); } }
private void setPathIndex(Attribute att, StepList sl) { Object index = att.getUserData().get(ComplexFeatureConstants.MAPPED_ATTRIBUTE_INDEX); if (index != null) { int mappedIndex = Integer.parseInt(String.valueOf(index)); // get prefixed attribute name Name attName = att.getName(); String nsPrefix = namespaces.getPrefix(attName.getNamespaceURI()); String xpath = nsPrefix + ":" + attName.getLocalPart(); // set the index of the attribute in the attribute mapping steps sl.setIndex(mappedIndex, xpath, XPATH_SEPARATOR); } }
/** * Converts a {@link Name} to a prefixed name (i.e. p:Foo), by looking up the right prefix in * the provided {@link NamespaceSupport}. If no prefix is found, the return value will be the * same as that of {@link Name#getLocalPart()}. * * @param name the name to translate in prefixed form * @param ns namespace context, relates namespaces to prefixes * @return */ public static String toPrefixedName(Name name, NamespaceSupport ns) { StringBuilder sb = new StringBuilder(); if (name == null) { return null; } String prefix = null; if (ns != null) { prefix = ns.getPrefix(name.getNamespaceURI()); } if (prefix != null && !prefix.isEmpty()) { sb.append(prefix); sb.append(name.getSeparator()); } sb.append(name.getLocalPart()); return sb.toString(); }