/** * Create a new XMLString from a Java string. * * * @param string Java String reference, which must be non-null. * * @return An XMLString object that wraps the String reference. */ public XMLString newstr(String string) { return new XString(string); }
/** * Create a new XMLString from a Java string. * * * @param string Java String reference, which must be non-null. * * @return An XMLString object that wraps the String reference. */ public XMLString newstr(String string) { return new XString(string); }
/** * Converts all of the characters in this <code>String</code> to upper * case using the rules of the given locale. * @param locale use the case transformation rules for this locale * @return the String, converted to uppercase. * @see java.lang.Character#toUpperCase(char) * @see java.lang.String#toLowerCase(Locale) */ public XMLString toUpperCase(Locale locale) { return new XString(str().toUpperCase(locale)); }
/** * Removes white space from both ends of this string. * * @return this string, with white space removed from the front and end. */ public XMLString trim() { return new XString(str().trim()); }
/** * Converts all of the characters in this <code>String</code> to lower * case using the rules of the given <code>Locale</code>. * * @param locale use the case transformation rules for this locale * @return the String, converted to lowercase. * @see java.lang.Character#toLowerCase(char) * @see java.lang.String#toUpperCase(Locale) */ public XMLString toLowerCase(Locale locale) { return new XString(str().toLowerCase(locale)); }
/** * Converts all of the characters in this <code>String</code> to upper * case using the rules of the given locale. * @param locale use the case transformation rules for this locale * @return the String, converted to uppercase. * @see java.lang.Character#toUpperCase(char) * @see java.lang.String#toLowerCase(Locale) */ public XMLString toUpperCase(Locale locale) { return new XString(str().toUpperCase(locale)); }
/** * Removes white space from both ends of this string. * * @return this string, with white space removed from the front and end. */ public XMLString trim() { return new XString(str().trim()); }
/** * Converts all of the characters in this <code>String</code> to lower * case using the rules of the given <code>Locale</code>. * * @param locale use the case transformation rules for this locale * @return the String, converted to lowercase. * @see java.lang.Character#toLowerCase(char) * @see java.lang.String#toUpperCase(Locale) */ public XMLString toLowerCase(Locale locale) { return new XString(str().toLowerCase(locale)); }
/** * Converts all of the characters in this <code>String</code> to lower * case using the rules of the default locale, which is returned * by <code>Locale.getDefault</code>. * <p> * * @return the string, converted to lowercase. * @see java.lang.Character#toLowerCase(char) * @see java.lang.String#toLowerCase(Locale) */ public XMLString toLowerCase() { return new XString(str().toLowerCase()); }
/** * Concatenates the specified string to the end of this string. * * @param str the <code>String</code> that is concatenated to the end * of this <code>String</code>. * @return a string that represents the concatenation of this object's * characters followed by the string argument's characters. * @exception java.lang.NullPointerException if <code>str</code> is * <code>null</code>. */ public XMLString concat(String str) { // %REVIEW% Make an FSB here? return new XString(str().concat(str)); }
/** * Concatenates the specified string to the end of this string. * * @param str the <code>String</code> that is concatenated to the end * of this <code>String</code>. * @return a string that represents the concatenation of this object's * characters followed by the string argument's characters. * @exception java.lang.NullPointerException if <code>str</code> is * <code>null</code>. */ public XMLString concat(String str) { // %OPT% Make an FSB here? return new XString(str().concat(str)); }
/** * Converts all of the characters in this <code>String</code> to lower * case using the rules of the default locale, which is returned * by <code>Locale.getDefault</code>. * <p> * * @return the string, converted to lowercase. * @see java.lang.Character#toLowerCase(char) * @see java.lang.String#toLowerCase(Locale) */ public XMLString toLowerCase() { return new XString(str().toLowerCase()); }
/** * Concatenates the specified string to the end of this string. * * @param str the <code>String</code> that is concatenated to the end * of this <code>String</code>. * @return a string that represents the concatenation of this object's * characters followed by the string argument's characters. * @exception java.lang.NullPointerException if <code>str</code> is * <code>null</code>. */ public XMLString concat(String str) { // %OPT% Make an FSB here? return new XString(str().concat(str)); }
/** * Concatenates the specified string to the end of this string. * * @param str the <code>String</code> that is concatenated to the end * of this <code>String</code>. * @return a string that represents the concatenation of this object's * characters followed by the string argument's characters. * @exception java.lang.NullPointerException if <code>str</code> is * <code>null</code>. */ public XMLString concat(String str) { // %REVIEW% Make an FSB here? return new XString(str().concat(str)); }
/** * Returns a new string that is a substring of this string. The * substring begins at the specified <code>beginIndex</code> and * extends to the character at index <code>endIndex - 1</code>. * Thus the length of the substring is <code>endIndex-beginIndex</code>. * * @param beginIndex the beginning index, inclusive. * @param endIndex the ending index, exclusive. * @return the specified substring. * @exception IndexOutOfBoundsException if the * <code>beginIndex</code> is negative, or * <code>endIndex</code> is larger than the length of * this <code>String</code> object, or * <code>beginIndex</code> is larger than * <code>endIndex</code>. */ public XMLString substring(int beginIndex, int endIndex) { return new XString(str().substring(beginIndex, endIndex)); }
/** * Returns a new string that is a substring of this string. The * substring begins with the character at the specified index and * extends to the end of this string. <p> * Examples: * <blockquote><pre> * "unhappy".substring(2) returns "happy" * "Harbison".substring(3) returns "bison" * "emptiness".substring(9) returns "" (an empty string) * </pre></blockquote> * * @param beginIndex the beginning index, inclusive. * @return the specified substring. * @exception IndexOutOfBoundsException if * <code>beginIndex</code> is negative or larger than the * length of this <code>String</code> object. */ public XMLString substring(int beginIndex) { return new XString(str().substring(beginIndex)); }
/** * Execute the function. The function must return * a valid object. * @param xctxt The current execution context. * @return A valid XObject. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { int context = getArg0AsNode(xctxt); if(DTM.NULL == context) return XString.EMPTYSTRING; DTM dtm = xctxt.getDTM(context); String s = (context != DTM.NULL) ? dtm.getLocalName(context) : ""; if(s.startsWith("#") || s.equals("xmlns")) return XString.EMPTYSTRING; return new XString(s); } }
/** * Execute the function. The function must return * a valid object. * @param xctxt The current execution context. * @return A valid XObject. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { String s1 = m_arg0.execute(xctxt).str(); String s2 = m_arg1.execute(xctxt).str(); int index = s1.indexOf(s2); return (-1 == index) ? XString.EMPTYSTRING : new XString(s1.substring(0, index)); } }
/** * Execute the function. The function must return * a valid object. * @param xctxt The current execution context. * @return A valid XObject. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { String s1 = m_arg0.execute(xctxt).str(); String s2 = m_arg1.execute(xctxt).str(); int index = s1.indexOf(s2); return (-1 == index) ? XString.EMPTYSTRING : new XString(s1.substring(0, index)); } }
/** * Execute the function. The function must return * a valid object. * @param xctxt The current execution context. * @return A valid XObject. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { String name = m_arg0.execute(xctxt).str(); int context = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(context); int doc = dtm.getDocument(); String uri = dtm.getUnparsedEntityURI(name); return new XString(uri); } }