/** * Returns the value of the named XML attribute. * * @param attributes set of XML attributes * @param name attribute name * @return attribute value, * or <code>null</code> if the named attribute is not found */ private static String getAttribute(Attributes attributes, Name name) { return attributes.getValue(name.getNamespaceURI(), name.getLocalName()); }
/** * The resulting sort-order is: 1. descending weight, 2. ascending key * (i.e. string representation of this sorted set). * * @param o the other key to compare * @return the result of the comparison */ public int compareTo(Key o) { WeightedKey other = (WeightedKey) o; // compare weights if (weight > other.weight) { return -1; } else if (weight < other.weight) { return 1; } // compare arrays of names int len1 = names.length; int len2 = other.names.length; int len = Math.min(len1, len2); for (int i = 0; i < len; i++) { Name name1 = names[i]; Name name2 = other.names[i]; int result = name1.compareTo(name2); if (result != 0) { return result; } } return len1 - len2; }
public String getJCRName(Name name) throws NamespaceException { return name.getLocalName(); } });
/** * @return the namespace URI of this name query. */ private String getNamespaceURI() { return lowerName != null ? lowerName.getNamespaceURI() : upperName.getNamespaceURI(); }
@Override public String getJCRName(Name name) throws NamespaceException { return name.getLocalName(); } }));
/** * @return the namespace URI of this name query. */ private String getNamespaceURI() { return lowerName != null ? lowerName.getNamespaceURI() : upperName.getNamespaceURI(); }
/** * Returns the value of the named XML attribute. * * @param attributes set of XML attributes * @param name attribute name * @return attribute value, * or <code>null</code> if the named attribute is not found */ private static String getAttribute(Attributes attributes, Name name) { return attributes.getValue(name.getNamespaceURI(), name.getLocalName()); }
public String getJCRName(Name name) throws NamespaceException { return name.getLocalName(); } });
private String getNamespacePrefix(final Name name) { try { final String namespacePrefix = monitorSession.getNamespacePrefix(name.getNamespaceURI()); if (!hippoNamespacePrefixed.contains(namespacePrefix)) { return namespacePrefix; } } catch (RepositoryException e) { // ignore } return null; }
private static String getAttribute(Attributes attributes, Name name) { return attributes.getValue(name.getNamespaceURI(), name.getLocalName()); }
protected String getElementString() { return NAME.getLocalName(); }
public String getHippoNamespaceURI() { // we know the hippo:handle is of namespace hippo, hence we can take the hippo namespace from here. return getHippoHandleName().getNamespaceURI(); }
/** * {@inheritDoc} */ public boolean definesResidual() { return Name.NS_DEFAULT_URI.equals(name.getNamespaceURI()) && "*".equals(name.getLocalName()); }
protected String getElementString() { return NAME.getLocalName(); }
/** * Utility method for verifying that the namespace of a <code>Name</code> * is registered; a <code>null</code> argument is silently ignored. * @param name name whose namespace is to be checked * @throws RepositoryException if the namespace of the given name is not * registered or if an unspecified error occurred */ private void checkNamespace(Name name) throws RepositoryException { if (name != null) { // make sure namespace uri denotes a registered namespace nsRegistry.getPrefix(name.getNamespaceURI()); } } }
/** * @param name a Name. * @return <code>true</code> if <code>name</code> is the rep:spellcheck * function, <code>false</code> otherwise. */ private boolean isSpellCheckFunction(Name name) { return name.getNamespaceURI().equals(Name.NS_REP_URI) && name.getLocalName().startsWith(SPELLCHECK_FUNC_LPAR); }
protected String getElementString() { return NAME.getLocalName(); }
/** * Utility method for verifying that the namespace of a <code>Name</code> * is registered; a <code>null</code> argument is silently ignored. * @param name name whose namespace is to be checked * @throws RepositoryException if the namespace of the given name is not * registered or if an unspecified error occurred */ private void checkNamespace(Name name) throws RepositoryException { if (name != null) { // make sure namespace uri denotes a registered namespace nsRegistry.getPrefix(name.getNamespaceURI()); } } }
private String getQualifiedName(Name name, Map<String,String> uriToPrefix) { String uri = name.getNamespaceURI(); String prefix = (Name.NS_DEFAULT_URI.equals(uri)) ? Name.NS_EMPTY_PREFIX : uriToPrefix.get(uri); return prefix + ":" + name.getLocalName(); } }
protected String getElementString() { return NAME.getLocalName(); }