public String getJCRName(Name name) throws NamespaceException { return name.getLocalName(); } });
/** * @return the local name term of the upper name or <code>null</code> if no * upper name is set. */ private Term getUpperLocalNameTerm() { if (upperName == null) { return null; } else { return new Term(FieldNames.LOCAL_NAME, upperName.getLocalName()); } }
/** * {@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()); }
/** * @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); }
/** * 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()); }
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(); } }
private String getJCRName(Name name) { StringBuilder str = new StringBuilder("{"); str.append(name.getNamespaceURI()); str.append("}"); str.append(name.getLocalName()); return str.toString(); } }
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: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); }
public static void check(Name name) { if (log.isDebugEnabled()) { String lname = name.getLocalName(); String normalized = Normalizer.normalize(lname, Form.NFC); if (!lname.equals(normalized)) { String message = "The new node name '" + dump(lname) + "' is not in Unicode NFC form ('" + dump(normalized) + "')."; log.debug(message, new Exception("Call chain")); } } }
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 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 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 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); }
public void testMatchCondition() throws Exception{ IndexingConfiguration config = createConfig("config6"); Node n = testRootNode.addNode(nodeName1, ntUnstructured); n.addMixin(mixReferenceable); n.setProperty(FOO.getLocalName(), "high"); session.save(); nState = (NodeState) getSearchIndex().getContext().getItemStateManager().getItemState( new NodeId(n.getIdentifier())); assertFalse(config.isIndexed(nState, FOO)); }