Package javolution.text

Examples of javolution.text.CharArray


     * @param namespaceURI the URI reference or <code>null</code> if none.
     * @param localName the local name.
     * @param toString the string representation.
     */
    private QName(String namespaceURI, String localName, String toString) {
        _namespaceURI = (namespaceURI == null) ? null : new CharArray(namespaceURI);
        _localName = new CharArray(localName);
        _toString = toString;
    }
View Full Code Here


     * @return the referenced object or <code>null</code> if the specified
     *         XML input does not have a reference attribute.
     */
    public Object readReference(XMLFormat.InputElement xml)
            throws XMLStreamException {
        CharArray value = xml._reader.getAttributeValue(
                toCsq(_refURI), toCsq(_refName));
        if (value == null)
            return null;
        int ref = value.toInt();
        if (ref >= _idToObject.size())
            throw new XMLStreamException("Reference: " + value + " not found");
        return _idToObject.get(ref);
    }
View Full Code Here

     * @param  obj the object being referenced.
     * @param  xml the input XML element holding the reference identifier.
     */
    public void createReference(Object obj, XMLFormat.InputElement xml)
            throws XMLStreamException {
        CharArray value = xml._reader.getAttributeValue(
                toCsq(_idURI), toCsq(_idName));
        if (value == null)
            return;
        int i = value.toInt();
        if (_idToObject.size() != i)
            throw new XMLStreamException("Identifier discontinuity detected "
                    + "(expected " + _idToObject.size() + " found " + i + ")");
        _idToObject.add(obj);
    }
View Full Code Here

         * getStreamReader().getElementText()}).
         *
         * @return the element text content or an empty sequence if none.
         */
        public CharArray getText() throws XMLStreamException {
            CharArray txt = _reader.getElementText();
            _isReaderAtNext = true; // End element is next.
            return txt;
        }
View Full Code Here

         * @return the value for the specified attribute or
         *         the <code>defaultValue</code> if the attribute is not found.
         */
        public String getAttribute(String name, String defaultValue)
                throws XMLStreamException {
            CharArray value = getAttribute(name);
            return (value != null) ? value.toString() : defaultValue;
        }
View Full Code Here

         * @return the <code>boolean</code> value for the specified attribute or
         *         the default value if the attribute is not found.
         */
        public boolean getAttribute(String name, boolean defaultValue)
                throws XMLStreamException {
            CharArray value = getAttribute(name);
            return (value != null) ? value.toBoolean() : defaultValue;
        }
View Full Code Here

         * @return the <code>char</code> value for the specified attribute or
         *         the default value if the attribute is not found.
         */
        public char getAttribute(String name, char defaultValue)
                throws XMLStreamException {
            CharArray value = getAttribute(name);
            if (value == null)
                return defaultValue;
            if (value.length() != 1)
                throw new XMLStreamException(
                        "Single character expected (read '" + value + "')");
            return value.charAt(0);
        }
View Full Code Here

         * @return the <code>byte</code> value for the specified attribute or
         *         the default value if the attribute is not found.
         */
        public byte getAttribute(String name, byte defaultValue)
                throws XMLStreamException {
            CharArray value = getAttribute(name);
            return (value != null) ? (byte) value.toInt() : defaultValue;
        }
View Full Code Here

         * @return the <code>short</code> value for the specified attribute or
         *         the default value if the attribute is not found.
         */
        public short getAttribute(String name, short defaultValue)
                throws XMLStreamException {
            CharArray value = getAttribute(name);
            return (value != null) ? (short) value.toInt() : defaultValue;
        }
View Full Code Here

         * @return the <code>int</code> value for the specified attribute or
         *         the default value if the attribute is not found.
         */
        public int getAttribute(String name, int defaultValue)
                throws XMLStreamException {
            CharArray value = getAttribute(name);
            return (value != null) ? value.toInt() : defaultValue;
        }
View Full Code Here

TOP

Related Classes of javolution.text.CharArray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.