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); }
/** * 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(); }
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; }
String local = name.getLocalPart(); local = local.substring(0, local.length() - "Function".length()); name = new NameImpl(name.getNamespaceURI(), name.getSeparator(), local); f = findFunctionInternal(name, parameters, fallback);
/** Initializes builder state from another attribute type. */ public AttributeTypeBuilder init(AttributeType type) { name = type.getName().getLocalPart(); separator = type.getName().getSeparator(); namespaceURI = type.getName().getNamespaceURI(); isAbstract = type.isAbstract(); if (type.getRestrictions() != null) { restrictions().addAll(type.getRestrictions()); } description = type.getDescription() != null ? type.getDescription().toString() : null; isIdentifiable = type.isIdentified(); binding = type.getBinding(); superType = type.getSuper(); if (type instanceof GeometryType) { crs = ((GeometryType) type).getCoordinateReferenceSystem(); } return this; }
mapping.namespaces.getPrefix( mapping.getTargetFeature().getName().getNamespaceURI()); String separator = mapping.getTargetFeature().getName().getSeparator(); String typeName = mapping.getTargetFeature().getLocalName(); throw new UnsupportedOperationException(
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); }
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; }
String local = name.getLocalPart(); local = local.substring(0, local.length()-"Function".length()); name = new NameImpl(name.getNamespaceURI(), name.getSeparator(), local); f = findFunctionInternal(name, parameters, fallback);
/** * Initializes builder state from another attribute type. */ public AttributeTypeBuilder init( AttributeType type ) { name = type.getName().getLocalPart(); separator = type.getName().getSeparator(); namespaceURI = type.getName().getNamespaceURI(); isAbstract = type.isAbstract(); if ( type.getRestrictions() != null ) { restrictions().addAll( type.getRestrictions() ); } description = type.getDescription() != null ? type.getDescription().toString() : null; isIdentifiable = type.isIdentified(); binding = type.getBinding(); superType = type.getSuper(); if ( type instanceof GeometryType ) { crs = ((GeometryType)type).getCoordinateReferenceSystem(); } return this; }