/** * Get the local part of the QName * * @return the local part of the QName */ public String getLocalPart() { return qName.getLocalPart(); }
/** * The local part of the QName * * @return the local part of the QName */ public String getLocalName() { return sqName.getLocalPart(); }
/** * Get the local part * * @return the local part of the name (the part after the colon) */ /*@NotNull*/ public final String getLocalName() { return qName.getLocalPart(); }
/** * Get the local part of the name of the error code * * @return the local part of the name of the error code */ /*@Nullable*/ public String getErrorCodeLocalPart() { return errorCode == null ? null : errorCode.getLocalPart(); }
/** * Test whether this QNameTest matches a given QName * * @param qname the QName to be matched * @return true if the name matches, false if not */ public boolean matches(StructuredQName qname) { return localName.equals(qname.getLocalPart()); }
/** * Get the local part of a name, given its name code or fingerprint * * @param nameCode the integer name code or fingerprint of the name * @return the local part of the name represented by this name code or fingerprint */ public String getLocalName(int nameCode) { return getUnprefixedQName(nameCode).getLocalPart(); }
/** * Get the local name of the type (a system-allocated name if anonymous). Needed to implement the * DOM level 3 TypeInfo interface. */ public String getTypeName() { return schemaType.getStructuredQName().getLocalPart(); }
/** * Test whether the NameTest matches a given QName * * @param qname the QName to be matched * @return true if the name matches */ public boolean matches(StructuredQName qname) { computeUriAndLocal(); return qname.getLocalPart().equals(localName) && qname.hasURI(uri); }
/** * Convert the StructuredQName to a javax.xml.namespace.QName * * @return an object of class javax.xml.namespace.QName representing this qualified name */ public QName toJaxpQName() { return new javax.xml.namespace.QName(getURI(), getLocalPart(), getPrefix()); }
private void computeUriAndLocal() { if (uri == null || localName == null) { StructuredQName name = namePool.getUnprefixedQName(fingerprint); uri = name.getURI(); localName = name.getLocalPart(); } }
public FingerprintedQName(StructuredQName qName, NamePool pool) { this.qName = qName; this.fingerprint = pool.allocateFingerprint(qName.getURI(), qName.getLocalPart()); }
private NamedTemplate findTemplate(StructuredQName templateName) throws XPathException { PrincipalStylesheetModule pack = getPrincipalStylesheetModule(); NamedTemplate template = pack.getNamedTemplate(templateName); if (template == null) { if (templateName.hasURI(NamespaceConstant.XSLT) && templateName.getLocalPart().equals("original")) { // Handle xsl:original return (NamedTemplate) getXslOriginal(StandardNames.XSL_TEMPLATE); } compileError("Cannot find a template named " + calledTemplateName, "XTSE0650"); } return template; }
/** * Make a static call on this function, with specified arguments. * @param arguments the supplied arguments to the function call. This will always * be an empty array, since this is a zero-arity function. * @return This implementation returns a call on the equivalent arity-1 version * of the function, supplying "." as an explicit argument. */ @Override public Expression makeFunctionCall(Expression[] arguments) { Expression arg = new ContextItemExpression(); return SystemFunction.makeCall(getFunctionName().getLocalPart(), getRetainedStaticContext(), arg); }
/** * Create a system function call on this function in which the context item * is supplied as an explicit argument * @return an equivalent function call in which the context item is supplied explicitly. */ public Expression makeContextItemExplicit() { Expression[] args = new Expression[]{new ContextItemExpression()}; return SystemFunction.makeCall(getFunctionName().getLocalPart(), getRetainedStaticContext(), args); }
@Override public SystemFunction copy() { FormatInteger fi2 = (FormatInteger) SystemFunction.makeFunction(getFunctionName().getLocalPart(), getRetainedStaticContext(), getArity()); fi2.formatter = formatter; return fi2; } }
/** * Evaluate the function. This is done by creating a function of the same name, with the context item * as an explicit argument, and evaluating that. * @param item the context item * @param context XPath dynamic context (not normally used) * @return the result of the function * @throws XPathException in the event of a dynamic error */ public GroundedValue evaluate(Item item, XPathContext context) throws XPathException { SystemFunction f = SystemFunction.makeFunction(getDetails().name.getLocalPart(), getRetainedStaticContext(), 1); return f.call(context, new Sequence[]{item}).materialize(); }
@Override public Expression makeFunctionCall(Expression[] arguments) { Expression ci = new ContextItemExpression(); Expression sv = SystemFunction.makeCall("string", getRetainedStaticContext(), ci); return SystemFunction.makeCall(getFunctionName().getLocalPart(), getRetainedStaticContext(), sv); }
@Override public Expression makeFunctionCall(Expression[] arguments) { Expression ci = new ContextItemExpression(); Expression sv = SystemFunction.makeCall("data", getRetainedStaticContext(), ci); return SystemFunction.makeCall(getFunctionName().getLocalPart(), getRetainedStaticContext(), sv); }
private SystemFunction addFlagsArgument() { Configuration config = getRetainedStaticContext().getConfiguration(); SystemFunction fixed = config.makeSystemFunction( getFunctionName().getLocalPart(), getArity() + 1); fixed.setRetainedStaticContext(getRetainedStaticContext()); return fixed; }
@Override public GroundedValue evaluate(Item item, XPathContext context) throws XPathException { SystemFunction f = SystemFunction.makeFunction(getDetails().name.getLocalPart(), getRetainedStaticContext(), 1); StringValue val = new StringValue(item.getStringValueCS()); return f.call(context, new Sequence[]{val}).materialize(); }