/** * @return the namespace URI of this name query. */ private String getNamespaceURI() { return lowerName != null ? lowerName.getNamespaceURI() : upperName.getNamespaceURI(); }
/** * {@inheritDoc} */ public boolean definesResidual() { return Name.NS_DEFAULT_URI.equals(name.getNamespaceURI()) && "*".equals(name.getLocalName()); }
/** * 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()); }
/** * 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()); }
/** * @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); }
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 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(); } }
/** * @param name a Name. * @return <code>true</code> if <code>name</code> is the rep:excerpt * function, <code>false</code> otherwise. */ private boolean isExcerptFunction(Name name) { return name.getNamespaceURI().equals(Name.NS_REP_URI) && name.getLocalName().startsWith(EXCERPT_FUNC_LPAR); }
/** * @param name a Name. * @return <code>true</code> if <code>name</code> is the rep:excerpt * function, <code>false</code> otherwise. */ private boolean isExcerptFunction(Name name) { return name.getNamespaceURI().equals(Name.NS_REP_URI) && name.getLocalName().startsWith(EXCERPT_FUNC_LPAR); }
private String getJCRName(Name name) { StringBuilder str = new StringBuilder("{"); str.append(name.getNamespaceURI()); str.append("}"); str.append(name.getLocalName()); return str.toString(); } }
/** * @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 boolean matches(Element element) { Name name = element.getName(); boolean nsMatches = namespaceUri.matcher(name.getNamespaceURI()).matches(); boolean localMatches = localName.matcher(name.getLocalName()).matches(); return nsMatches && localMatches; }
private void indexNodeTypeNameFacet(Document doc, String fieldName, Name internalValue) { try { String value = mappings.getPrefix(internalValue.getNamespaceURI()) + ":" + internalValue.getLocalName(); doc.add(new Field(fieldName, value, Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO)); } catch (NamespaceException ignore) {} }
public void unregisterNodeTypes(Name[] nodeTypeNames) throws NoSuchNodeTypeException, RepositoryException { for (Name name : nodeTypeNames) { if (!definitions.containsKey(name)) { throw new NoSuchNodeTypeException("{" + name.getNamespaceURI() + "}" + name.getLocalName()); } } for (Name name : nodeTypeNames) { definitions.remove(name); } }
public void unregisterNodeTypes(Name[] nodeTypeNames) throws NoSuchNodeTypeException, RepositoryException { for (Name name : nodeTypeNames) { if (!definitions.containsKey(name)) { throw new NoSuchNodeTypeException("{" + name.getNamespaceURI() + "}" + name.getLocalName()); } } for (Name name : nodeTypeNames) { definitions.remove(name); } }
private static Name decode(Name name) { String decodedLN = ISO9075.decode(name.getLocalName()); if (decodedLN.equals(name.getLocalName())) { return name; } else { return NAME_FACTORY.create(name.getNamespaceURI(), decodedLN); } } }
private static Name encode(Name name) { String encoded = ISO9075.encode(name.getLocalName()); if (encoded.equals(name.getLocalName())) { return name; } else { return NameFactoryImpl.getInstance().create(name.getNamespaceURI(), encoded); } } }
private static Name encode(Name name) { String encoded = ISO9075.encode(name.getLocalName()); if (encoded.equals(name.getLocalName())) { return name; } else { return NameFactoryImpl.getInstance().create(name.getNamespaceURI(), encoded); } } }
private Name toName(String name) throws IllegalNameException, NamespaceException { Name n = resolver.getQName(name); String decodedLocalName = ISO9075.decode(n.getLocalName()); return NAME_FACTORY.create(n.getNamespaceURI(), decodedLocalName); }
private Name toName(String name) throws IllegalNameException, NamespaceException { Name n = resolver.getQName(name); String decodedLocalName = ISO9075.decode(n.getLocalName()); return NAME_FACTORY.create(n.getNamespaceURI(), decodedLocalName); }