com.sun.xml.internal.org.jvnet.fastinfoset.sax.EncodingAlgorithmAttributes Java Examples

The following examples show how to use com.sun.xml.internal.org.jvnet.fastinfoset.sax.EncodingAlgorithmAttributes. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EncodingAlgorithmAttributesImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Use registered encoding algorithms and copy an existing Attributes object.
 *
 * <p>This constructor is especially useful inside a
 * {@link org.xml.sax.ContentHandler#startElement startElement} event.</p>
 *
 * @param registeredEncodingAlgorithms
 *      The registeredEncodingAlgorithms encoding algorithms.
 * @param attributes The existing Attributes object.
 */
public EncodingAlgorithmAttributesImpl(Map registeredEncodingAlgorithms,
        Attributes attributes) {
    _data = new String[DEFAULT_CAPACITY * SIZE];
    _algorithmIds = new int[DEFAULT_CAPACITY];
    _algorithmData = new Object[DEFAULT_CAPACITY];
    _alphabets = new String[DEFAULT_CAPACITY];
    _toIndex = new boolean[DEFAULT_CAPACITY];

    _registeredEncodingAlgorithms = registeredEncodingAlgorithms;

    if (attributes != null) {
        if (attributes instanceof EncodingAlgorithmAttributes) {
            setAttributes((EncodingAlgorithmAttributes)attributes);
        } else {
            setAttributes(attributes);
        }
    }
}
 
Example #2
Source File: EncodingAlgorithmAttributesImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy an entire EncodingAlgorithmAttributes object.
 *
 * @param atts The attributes to copy.
 */
public void setAttributes(EncodingAlgorithmAttributes atts) {
    _length = atts.getLength();
    if (_length > 0) {

        if (_length >= _algorithmData.length) {
            resizeNoCopy();
        }

        int index = 0;
        for (int i = 0; i < _length; i++) {
            _data[index++] = atts.getURI(i);
            _data[index++] = atts.getLocalName(i);
            _data[index++] = atts.getQName(i);
            _data[index++] = atts.getType(i);
            _data[index++] = atts.getValue(i);
            _data[index++] = atts.getAlgorithmURI(i);
            _algorithmIds[i] = atts.getAlgorithmIndex(i);
            _algorithmData[i] = atts.getAlgorithmData(i);
            _toIndex[i] = false;
            _alphabets[i] = null;
        }
    }
}
 
Example #3
Source File: EncodingAlgorithmAttributesImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Use registered encoding algorithms and copy an existing Attributes object.
 *
 * <p>This constructor is especially useful inside a
 * {@link org.xml.sax.ContentHandler#startElement startElement} event.</p>
 *
 * @param registeredEncodingAlgorithms
 *      The registeredEncodingAlgorithms encoding algorithms.
 * @param attributes The existing Attributes object.
 */
public EncodingAlgorithmAttributesImpl(Map registeredEncodingAlgorithms,
        Attributes attributes) {
    _data = new String[DEFAULT_CAPACITY * SIZE];
    _algorithmIds = new int[DEFAULT_CAPACITY];
    _algorithmData = new Object[DEFAULT_CAPACITY];
    _alphabets = new String[DEFAULT_CAPACITY];
    _toIndex = new boolean[DEFAULT_CAPACITY];

    _registeredEncodingAlgorithms = registeredEncodingAlgorithms;

    if (attributes != null) {
        if (attributes instanceof EncodingAlgorithmAttributes) {
            setAttributes((EncodingAlgorithmAttributes)attributes);
        } else {
            setAttributes(attributes);
        }
    }
}
 
Example #4
Source File: EncodingAlgorithmAttributesImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy an entire EncodingAlgorithmAttributes object.
 *
 * @param atts The attributes to copy.
 */
public void setAttributes(EncodingAlgorithmAttributes atts) {
    _length = atts.getLength();
    if (_length > 0) {

        if (_length >= _algorithmData.length) {
            resizeNoCopy();
        }

        int index = 0;
        for (int i = 0; i < _length; i++) {
            _data[index++] = atts.getURI(i);
            _data[index++] = atts.getLocalName(i);
            _data[index++] = atts.getQName(i);
            _data[index++] = atts.getType(i);
            _data[index++] = atts.getValue(i);
            _data[index++] = atts.getAlgorithmURI(i);
            _algorithmIds[i] = atts.getAlgorithmIndex(i);
            _algorithmData[i] = atts.getAlgorithmData(i);
            _toIndex[i] = false;
            _alphabets[i] = null;
        }
    }
}
 
Example #5
Source File: EncodingAlgorithmAttributesImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Use registered encoding algorithms and copy an existing Attributes object.
 *
 * <p>This constructor is especially useful inside a
 * {@link org.xml.sax.ContentHandler#startElement startElement} event.</p>
 *
 * @param registeredEncodingAlgorithms
 *      The registeredEncodingAlgorithms encoding algorithms.
 * @param attributes The existing Attributes object.
 */
public EncodingAlgorithmAttributesImpl(Map registeredEncodingAlgorithms,
        Attributes attributes) {
    _data = new String[DEFAULT_CAPACITY * SIZE];
    _algorithmIds = new int[DEFAULT_CAPACITY];
    _algorithmData = new Object[DEFAULT_CAPACITY];
    _alphabets = new String[DEFAULT_CAPACITY];
    _toIndex = new boolean[DEFAULT_CAPACITY];

    _registeredEncodingAlgorithms = registeredEncodingAlgorithms;

    if (attributes != null) {
        if (attributes instanceof EncodingAlgorithmAttributes) {
            setAttributes((EncodingAlgorithmAttributes)attributes);
        } else {
            setAttributes(attributes);
        }
    }
}
 
Example #6
Source File: EncodingAlgorithmAttributesImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy an entire EncodingAlgorithmAttributes object.
 *
 * @param atts The attributes to copy.
 */
public void setAttributes(EncodingAlgorithmAttributes atts) {
    _length = atts.getLength();
    if (_length > 0) {

        if (_length >= _algorithmData.length) {
            resizeNoCopy();
        }

        int index = 0;
        for (int i = 0; i < _length; i++) {
            _data[index++] = atts.getURI(i);
            _data[index++] = atts.getLocalName(i);
            _data[index++] = atts.getQName(i);
            _data[index++] = atts.getType(i);
            _data[index++] = atts.getValue(i);
            _data[index++] = atts.getAlgorithmURI(i);
            _algorithmIds[i] = atts.getAlgorithmIndex(i);
            _algorithmData[i] = atts.getAlgorithmData(i);
            _toIndex[i] = false;
            _alphabets[i] = null;
        }
    }
}
 
Example #7
Source File: EncodingAlgorithmAttributesImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Use registered encoding algorithms and copy an existing Attributes object.
 *
 * <p>This constructor is especially useful inside a
 * {@link org.xml.sax.ContentHandler#startElement startElement} event.</p>
 *
 * @param registeredEncodingAlgorithms
 *      The registeredEncodingAlgorithms encoding algorithms.
 * @param attributes The existing Attributes object.
 */
public EncodingAlgorithmAttributesImpl(Map registeredEncodingAlgorithms,
        Attributes attributes) {
    _data = new String[DEFAULT_CAPACITY * SIZE];
    _algorithmIds = new int[DEFAULT_CAPACITY];
    _algorithmData = new Object[DEFAULT_CAPACITY];
    _alphabets = new String[DEFAULT_CAPACITY];
    _toIndex = new boolean[DEFAULT_CAPACITY];

    _registeredEncodingAlgorithms = registeredEncodingAlgorithms;

    if (attributes != null) {
        if (attributes instanceof EncodingAlgorithmAttributes) {
            setAttributes((EncodingAlgorithmAttributes)attributes);
        } else {
            setAttributes(attributes);
        }
    }
}
 
Example #8
Source File: EncodingAlgorithmAttributesImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy an entire EncodingAlgorithmAttributes object.
 *
 * @param atts The attributes to copy.
 */
public void setAttributes(EncodingAlgorithmAttributes atts) {
    _length = atts.getLength();
    if (_length > 0) {

        if (_length >= _algorithmData.length) {
            resizeNoCopy();
        }

        int index = 0;
        for (int i = 0; i < _length; i++) {
            _data[index++] = atts.getURI(i);
            _data[index++] = atts.getLocalName(i);
            _data[index++] = atts.getQName(i);
            _data[index++] = atts.getType(i);
            _data[index++] = atts.getValue(i);
            _data[index++] = atts.getAlgorithmURI(i);
            _algorithmIds[i] = atts.getAlgorithmIndex(i);
            _algorithmData[i] = atts.getAlgorithmData(i);
            _toIndex[i] = false;
            _alphabets[i] = null;
        }
    }
}
 
Example #9
Source File: EncodingAlgorithmAttributesImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Use registered encoding algorithms and copy an existing Attributes object.
 *
 * <p>This constructor is especially useful inside a
 * {@link org.xml.sax.ContentHandler#startElement startElement} event.</p>
 *
 * @param registeredEncodingAlgorithms
 *      The registeredEncodingAlgorithms encoding algorithms.
 * @param attributes The existing Attributes object.
 */
public EncodingAlgorithmAttributesImpl(Map registeredEncodingAlgorithms,
        Attributes attributes) {
    _data = new String[DEFAULT_CAPACITY * SIZE];
    _algorithmIds = new int[DEFAULT_CAPACITY];
    _algorithmData = new Object[DEFAULT_CAPACITY];
    _alphabets = new String[DEFAULT_CAPACITY];
    _toIndex = new boolean[DEFAULT_CAPACITY];

    _registeredEncodingAlgorithms = registeredEncodingAlgorithms;

    if (attributes != null) {
        if (attributes instanceof EncodingAlgorithmAttributes) {
            setAttributes((EncodingAlgorithmAttributes)attributes);
        } else {
            setAttributes(attributes);
        }
    }
}
 
Example #10
Source File: EncodingAlgorithmAttributesImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy an entire EncodingAlgorithmAttributes object.
 *
 * @param atts The attributes to copy.
 */
public void setAttributes(EncodingAlgorithmAttributes atts) {
    _length = atts.getLength();
    if (_length > 0) {

        if (_length >= _algorithmData.length) {
            resizeNoCopy();
        }

        int index = 0;
        for (int i = 0; i < _length; i++) {
            _data[index++] = atts.getURI(i);
            _data[index++] = atts.getLocalName(i);
            _data[index++] = atts.getQName(i);
            _data[index++] = atts.getType(i);
            _data[index++] = atts.getValue(i);
            _data[index++] = atts.getAlgorithmURI(i);
            _algorithmIds[i] = atts.getAlgorithmIndex(i);
            _algorithmData[i] = atts.getAlgorithmData(i);
            _toIndex[i] = false;
            _alphabets[i] = null;
        }
    }
}
 
Example #11
Source File: EncodingAlgorithmAttributesImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Use registered encoding algorithms and copy an existing Attributes object.
 *
 * <p>This constructor is especially useful inside a
 * {@link org.xml.sax.ContentHandler#startElement startElement} event.</p>
 *
 * @param registeredEncodingAlgorithms
 *      The registeredEncodingAlgorithms encoding algorithms.
 * @param attributes The existing Attributes object.
 */
public EncodingAlgorithmAttributesImpl(Map registeredEncodingAlgorithms,
        Attributes attributes) {
    _data = new String[DEFAULT_CAPACITY * SIZE];
    _algorithmIds = new int[DEFAULT_CAPACITY];
    _algorithmData = new Object[DEFAULT_CAPACITY];
    _alphabets = new String[DEFAULT_CAPACITY];
    _toIndex = new boolean[DEFAULT_CAPACITY];

    _registeredEncodingAlgorithms = registeredEncodingAlgorithms;

    if (attributes != null) {
        if (attributes instanceof EncodingAlgorithmAttributes) {
            setAttributes((EncodingAlgorithmAttributes)attributes);
        } else {
            setAttributes(attributes);
        }
    }
}
 
Example #12
Source File: EncodingAlgorithmAttributesImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy an entire EncodingAlgorithmAttributes object.
 *
 * @param atts The attributes to copy.
 */
public void setAttributes(EncodingAlgorithmAttributes atts) {
    _length = atts.getLength();
    if (_length > 0) {

        if (_length >= _algorithmData.length) {
            resizeNoCopy();
        }

        int index = 0;
        for (int i = 0; i < _length; i++) {
            _data[index++] = atts.getURI(i);
            _data[index++] = atts.getLocalName(i);
            _data[index++] = atts.getQName(i);
            _data[index++] = atts.getType(i);
            _data[index++] = atts.getValue(i);
            _data[index++] = atts.getAlgorithmURI(i);
            _algorithmIds[i] = atts.getAlgorithmIndex(i);
            _algorithmData[i] = atts.getAlgorithmData(i);
            _toIndex[i] = false;
            _alphabets[i] = null;
        }
    }
}
 
Example #13
Source File: EncodingAlgorithmAttributesImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Use registered encoding algorithms and copy an existing Attributes object.
 *
 * <p>This constructor is especially useful inside a
 * {@link org.xml.sax.ContentHandler#startElement startElement} event.</p>
 *
 * @param registeredEncodingAlgorithms
 *      The registeredEncodingAlgorithms encoding algorithms.
 * @param attributes The existing Attributes object.
 */
public EncodingAlgorithmAttributesImpl(Map registeredEncodingAlgorithms,
        Attributes attributes) {
    _data = new String[DEFAULT_CAPACITY * SIZE];
    _algorithmIds = new int[DEFAULT_CAPACITY];
    _algorithmData = new Object[DEFAULT_CAPACITY];
    _alphabets = new String[DEFAULT_CAPACITY];
    _toIndex = new boolean[DEFAULT_CAPACITY];

    _registeredEncodingAlgorithms = registeredEncodingAlgorithms;

    if (attributes != null) {
        if (attributes instanceof EncodingAlgorithmAttributes) {
            setAttributes((EncodingAlgorithmAttributes)attributes);
        } else {
            setAttributes(attributes);
        }
    }
}
 
Example #14
Source File: EncodingAlgorithmAttributesImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy an entire EncodingAlgorithmAttributes object.
 *
 * @param atts The attributes to copy.
 */
public void setAttributes(EncodingAlgorithmAttributes atts) {
    _length = atts.getLength();
    if (_length > 0) {

        if (_length >= _algorithmData.length) {
            resizeNoCopy();
        }

        int index = 0;
        for (int i = 0; i < _length; i++) {
            _data[index++] = atts.getURI(i);
            _data[index++] = atts.getLocalName(i);
            _data[index++] = atts.getQName(i);
            _data[index++] = atts.getType(i);
            _data[index++] = atts.getValue(i);
            _data[index++] = atts.getAlgorithmURI(i);
            _algorithmIds[i] = atts.getAlgorithmIndex(i);
            _algorithmData[i] = atts.getAlgorithmData(i);
            _toIndex[i] = false;
            _alphabets[i] = null;
        }
    }
}
 
Example #15
Source File: EncodingAlgorithmAttributesImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Use registered encoding algorithms and copy an existing Attributes object.
 *
 * <p>This constructor is especially useful inside a
 * {@link org.xml.sax.ContentHandler#startElement startElement} event.</p>
 *
 * @param registeredEncodingAlgorithms
 *      The registeredEncodingAlgorithms encoding algorithms.
 * @param attributes The existing Attributes object.
 */
public EncodingAlgorithmAttributesImpl(Map registeredEncodingAlgorithms,
        Attributes attributes) {
    _data = new String[DEFAULT_CAPACITY * SIZE];
    _algorithmIds = new int[DEFAULT_CAPACITY];
    _algorithmData = new Object[DEFAULT_CAPACITY];
    _alphabets = new String[DEFAULT_CAPACITY];
    _toIndex = new boolean[DEFAULT_CAPACITY];

    _registeredEncodingAlgorithms = registeredEncodingAlgorithms;

    if (attributes != null) {
        if (attributes instanceof EncodingAlgorithmAttributes) {
            setAttributes((EncodingAlgorithmAttributes)attributes);
        } else {
            setAttributes(attributes);
        }
    }
}
 
Example #16
Source File: EncodingAlgorithmAttributesImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Copy an entire EncodingAlgorithmAttributes object.
 *
 * @param atts The attributes to copy.
 */
public void setAttributes(EncodingAlgorithmAttributes atts) {
    _length = atts.getLength();
    if (_length > 0) {

        if (_length >= _algorithmData.length) {
            resizeNoCopy();
        }

        int index = 0;
        for (int i = 0; i < _length; i++) {
            _data[index++] = atts.getURI(i);
            _data[index++] = atts.getLocalName(i);
            _data[index++] = atts.getQName(i);
            _data[index++] = atts.getType(i);
            _data[index++] = atts.getValue(i);
            _data[index++] = atts.getAlgorithmURI(i);
            _algorithmIds[i] = atts.getAlgorithmIndex(i);
            _algorithmData[i] = atts.getAlgorithmData(i);
            _toIndex[i] = false;
            _alphabets[i] = null;
        }
    }
}
 
Example #17
Source File: SAXDocumentSerializer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
protected void encodeAttributes(Attributes atts) throws IOException, FastInfosetException {
    boolean addToTable;
    boolean mustBeAddedToTable;
    String value;
    if (atts instanceof EncodingAlgorithmAttributes) {
        final EncodingAlgorithmAttributes eAtts = (EncodingAlgorithmAttributes)atts;
        Object data;
        String alphabet;
        for (int i = 0; i < eAtts.getLength(); i++) {
            if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
                data = eAtts.getAlgorithmData(i);
                // If data is null then there is no algorithm data
                if (data == null) {
                    value = eAtts.getValue(i);
                    addToTable = isAttributeValueLengthMatchesLimit(value.length());
                    mustBeAddedToTable = eAtts.getToIndex(i);

                    alphabet = eAtts.getAlpababet(i);
                    if (alphabet == null) {
                        encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, mustBeAddedToTable);
                    } else if (alphabet == RestrictedAlphabet.DATE_TIME_CHARACTERS) {
                        encodeDateTimeNonIdentifyingStringOnFirstBit(
                                value, addToTable, mustBeAddedToTable);
                    } else if (alphabet == RestrictedAlphabet.NUMERIC_CHARACTERS) {
                        encodeNumericNonIdentifyingStringOnFirstBit(
                                value, addToTable, mustBeAddedToTable);
                    } else {
                        encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, mustBeAddedToTable);
                    }
                } else {
                    encodeNonIdentifyingStringOnFirstBit(eAtts.getAlgorithmURI(i),
                            eAtts.getAlgorithmIndex(i), data);
                }
            }
        }
    } else {
        for (int i = 0; i < atts.getLength(); i++) {
            if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
                value = atts.getValue(i);
                addToTable = isAttributeValueLengthMatchesLimit(value.length());
                encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, false);
            }
        }
    }
    _b = EncodingConstants.TERMINATOR;
    _terminate = true;
}
 
Example #18
Source File: SAXDocumentSerializer.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
protected void encodeAttributes(Attributes atts) throws IOException, FastInfosetException {
    boolean addToTable;
    boolean mustBeAddedToTable;
    String value;
    if (atts instanceof EncodingAlgorithmAttributes) {
        final EncodingAlgorithmAttributes eAtts = (EncodingAlgorithmAttributes)atts;
        Object data;
        String alphabet;
        for (int i = 0; i < eAtts.getLength(); i++) {
            if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
                data = eAtts.getAlgorithmData(i);
                // If data is null then there is no algorithm data
                if (data == null) {
                    value = eAtts.getValue(i);
                    addToTable = isAttributeValueLengthMatchesLimit(value.length());
                    mustBeAddedToTable = eAtts.getToIndex(i);

                    alphabet = eAtts.getAlpababet(i);
                    if (alphabet == null) {
                        encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, mustBeAddedToTable);
                    } else if (alphabet == RestrictedAlphabet.DATE_TIME_CHARACTERS) {
                        encodeDateTimeNonIdentifyingStringOnFirstBit(
                                value, addToTable, mustBeAddedToTable);
                    } else if (alphabet == RestrictedAlphabet.NUMERIC_CHARACTERS) {
                        encodeNumericNonIdentifyingStringOnFirstBit(
                                value, addToTable, mustBeAddedToTable);
                    } else {
                        encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, mustBeAddedToTable);
                    }
                } else {
                    encodeNonIdentifyingStringOnFirstBit(eAtts.getAlgorithmURI(i),
                            eAtts.getAlgorithmIndex(i), data);
                }
            }
        }
    } else {
        for (int i = 0; i < atts.getLength(); i++) {
            if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
                value = atts.getValue(i);
                addToTable = isAttributeValueLengthMatchesLimit(value.length());
                encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, false);
            }
        }
    }
    _b = EncodingConstants.TERMINATOR;
    _terminate = true;
}
 
Example #19
Source File: SAXDocumentSerializer.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
protected void encodeAttributes(Attributes atts) throws IOException, FastInfosetException {
    boolean addToTable;
    boolean mustBeAddedToTable;
    String value;
    if (atts instanceof EncodingAlgorithmAttributes) {
        final EncodingAlgorithmAttributes eAtts = (EncodingAlgorithmAttributes)atts;
        Object data;
        String alphabet;
        for (int i = 0; i < eAtts.getLength(); i++) {
            if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
                data = eAtts.getAlgorithmData(i);
                // If data is null then there is no algorithm data
                if (data == null) {
                    value = eAtts.getValue(i);
                    addToTable = isAttributeValueLengthMatchesLimit(value.length());
                    mustBeAddedToTable = eAtts.getToIndex(i);

                    alphabet = eAtts.getAlpababet(i);
                    if (alphabet == null) {
                        encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, mustBeAddedToTable);
                    } else if (alphabet == RestrictedAlphabet.DATE_TIME_CHARACTERS) {
                        encodeDateTimeNonIdentifyingStringOnFirstBit(
                                value, addToTable, mustBeAddedToTable);
                    } else if (alphabet == RestrictedAlphabet.NUMERIC_CHARACTERS) {
                        encodeNumericNonIdentifyingStringOnFirstBit(
                                value, addToTable, mustBeAddedToTable);
                    } else {
                        encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, mustBeAddedToTable);
                    }
                } else {
                    encodeNonIdentifyingStringOnFirstBit(eAtts.getAlgorithmURI(i),
                            eAtts.getAlgorithmIndex(i), data);
                }
            }
        }
    } else {
        for (int i = 0; i < atts.getLength(); i++) {
            if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
                value = atts.getValue(i);
                addToTable = isAttributeValueLengthMatchesLimit(value.length());
                encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, false);
            }
        }
    }
    _b = EncodingConstants.TERMINATOR;
    _terminate = true;
}
 
Example #20
Source File: SAXDocumentSerializer.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
protected void encodeAttributes(Attributes atts) throws IOException, FastInfosetException {
    boolean addToTable;
    boolean mustBeAddedToTable;
    String value;
    if (atts instanceof EncodingAlgorithmAttributes) {
        final EncodingAlgorithmAttributes eAtts = (EncodingAlgorithmAttributes)atts;
        Object data;
        String alphabet;
        for (int i = 0; i < eAtts.getLength(); i++) {
            if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
                data = eAtts.getAlgorithmData(i);
                // If data is null then there is no algorithm data
                if (data == null) {
                    value = eAtts.getValue(i);
                    addToTable = isAttributeValueLengthMatchesLimit(value.length());
                    mustBeAddedToTable = eAtts.getToIndex(i);

                    alphabet = eAtts.getAlpababet(i);
                    if (alphabet == null) {
                        encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, mustBeAddedToTable);
                    } else if (alphabet == RestrictedAlphabet.DATE_TIME_CHARACTERS) {
                        encodeDateTimeNonIdentifyingStringOnFirstBit(
                                value, addToTable, mustBeAddedToTable);
                    } else if (alphabet == RestrictedAlphabet.NUMERIC_CHARACTERS) {
                        encodeNumericNonIdentifyingStringOnFirstBit(
                                value, addToTable, mustBeAddedToTable);
                    } else {
                        encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, mustBeAddedToTable);
                    }
                } else {
                    encodeNonIdentifyingStringOnFirstBit(eAtts.getAlgorithmURI(i),
                            eAtts.getAlgorithmIndex(i), data);
                }
            }
        }
    } else {
        for (int i = 0; i < atts.getLength(); i++) {
            if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
                value = atts.getValue(i);
                addToTable = isAttributeValueLengthMatchesLimit(value.length());
                encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, false);
            }
        }
    }
    _b = EncodingConstants.TERMINATOR;
    _terminate = true;
}
 
Example #21
Source File: SAXDocumentSerializer.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
protected void encodeAttributes(Attributes atts) throws IOException, FastInfosetException {
    boolean addToTable;
    boolean mustBeAddedToTable;
    String value;
    if (atts instanceof EncodingAlgorithmAttributes) {
        final EncodingAlgorithmAttributes eAtts = (EncodingAlgorithmAttributes)atts;
        Object data;
        String alphabet;
        for (int i = 0; i < eAtts.getLength(); i++) {
            if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
                data = eAtts.getAlgorithmData(i);
                // If data is null then there is no algorithm data
                if (data == null) {
                    value = eAtts.getValue(i);
                    addToTable = isAttributeValueLengthMatchesLimit(value.length());
                    mustBeAddedToTable = eAtts.getToIndex(i);

                    alphabet = eAtts.getAlpababet(i);
                    if (alphabet == null) {
                        encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, mustBeAddedToTable);
                    } else if (alphabet == RestrictedAlphabet.DATE_TIME_CHARACTERS) {
                        encodeDateTimeNonIdentifyingStringOnFirstBit(
                                value, addToTable, mustBeAddedToTable);
                    } else if (alphabet == RestrictedAlphabet.NUMERIC_CHARACTERS) {
                        encodeNumericNonIdentifyingStringOnFirstBit(
                                value, addToTable, mustBeAddedToTable);
                    } else {
                        encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, mustBeAddedToTable);
                    }
                } else {
                    encodeNonIdentifyingStringOnFirstBit(eAtts.getAlgorithmURI(i),
                            eAtts.getAlgorithmIndex(i), data);
                }
            }
        }
    } else {
        for (int i = 0; i < atts.getLength(); i++) {
            if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
                value = atts.getValue(i);
                addToTable = isAttributeValueLengthMatchesLimit(value.length());
                encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, false);
            }
        }
    }
    _b = EncodingConstants.TERMINATOR;
    _terminate = true;
}
 
Example #22
Source File: SAXDocumentSerializer.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
protected void encodeAttributes(Attributes atts) throws IOException, FastInfosetException {
    boolean addToTable;
    boolean mustBeAddedToTable;
    String value;
    if (atts instanceof EncodingAlgorithmAttributes) {
        final EncodingAlgorithmAttributes eAtts = (EncodingAlgorithmAttributes)atts;
        Object data;
        String alphabet;
        for (int i = 0; i < eAtts.getLength(); i++) {
            if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
                data = eAtts.getAlgorithmData(i);
                // If data is null then there is no algorithm data
                if (data == null) {
                    value = eAtts.getValue(i);
                    addToTable = isAttributeValueLengthMatchesLimit(value.length());
                    mustBeAddedToTable = eAtts.getToIndex(i);

                    alphabet = eAtts.getAlpababet(i);
                    if (alphabet == null) {
                        encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, mustBeAddedToTable);
                    } else if (alphabet == RestrictedAlphabet.DATE_TIME_CHARACTERS) {
                        encodeDateTimeNonIdentifyingStringOnFirstBit(
                                value, addToTable, mustBeAddedToTable);
                    } else if (alphabet == RestrictedAlphabet.NUMERIC_CHARACTERS) {
                        encodeNumericNonIdentifyingStringOnFirstBit(
                                value, addToTable, mustBeAddedToTable);
                    } else {
                        encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, mustBeAddedToTable);
                    }
                } else {
                    encodeNonIdentifyingStringOnFirstBit(eAtts.getAlgorithmURI(i),
                            eAtts.getAlgorithmIndex(i), data);
                }
            }
        }
    } else {
        for (int i = 0; i < atts.getLength(); i++) {
            if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
                value = atts.getValue(i);
                addToTable = isAttributeValueLengthMatchesLimit(value.length());
                encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, false);
            }
        }
    }
    _b = EncodingConstants.TERMINATOR;
    _terminate = true;
}
 
Example #23
Source File: SAXDocumentSerializer.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
protected void encodeAttributes(Attributes atts) throws IOException, FastInfosetException {
    boolean addToTable;
    boolean mustBeAddedToTable;
    String value;
    if (atts instanceof EncodingAlgorithmAttributes) {
        final EncodingAlgorithmAttributes eAtts = (EncodingAlgorithmAttributes)atts;
        Object data;
        String alphabet;
        for (int i = 0; i < eAtts.getLength(); i++) {
            if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
                data = eAtts.getAlgorithmData(i);
                // If data is null then there is no algorithm data
                if (data == null) {
                    value = eAtts.getValue(i);
                    addToTable = isAttributeValueLengthMatchesLimit(value.length());
                    mustBeAddedToTable = eAtts.getToIndex(i);

                    alphabet = eAtts.getAlpababet(i);
                    if (alphabet == null) {
                        encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, mustBeAddedToTable);
                    } else if (alphabet == RestrictedAlphabet.DATE_TIME_CHARACTERS) {
                        encodeDateTimeNonIdentifyingStringOnFirstBit(
                                value, addToTable, mustBeAddedToTable);
                    } else if (alphabet == RestrictedAlphabet.NUMERIC_CHARACTERS) {
                        encodeNumericNonIdentifyingStringOnFirstBit(
                                value, addToTable, mustBeAddedToTable);
                    } else {
                        encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, mustBeAddedToTable);
                    }
                } else {
                    encodeNonIdentifyingStringOnFirstBit(eAtts.getAlgorithmURI(i),
                            eAtts.getAlgorithmIndex(i), data);
                }
            }
        }
    } else {
        for (int i = 0; i < atts.getLength(); i++) {
            if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
                value = atts.getValue(i);
                addToTable = isAttributeValueLengthMatchesLimit(value.length());
                encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, false);
            }
        }
    }
    _b = EncodingConstants.TERMINATOR;
    _terminate = true;
}
 
Example #24
Source File: SAXDocumentSerializer.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
protected void encodeAttributes(Attributes atts) throws IOException, FastInfosetException {
    boolean addToTable;
    boolean mustBeAddedToTable;
    String value;
    if (atts instanceof EncodingAlgorithmAttributes) {
        final EncodingAlgorithmAttributes eAtts = (EncodingAlgorithmAttributes)atts;
        Object data;
        String alphabet;
        for (int i = 0; i < eAtts.getLength(); i++) {
            if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
                data = eAtts.getAlgorithmData(i);
                // If data is null then there is no algorithm data
                if (data == null) {
                    value = eAtts.getValue(i);
                    addToTable = isAttributeValueLengthMatchesLimit(value.length());
                    mustBeAddedToTable = eAtts.getToIndex(i);

                    alphabet = eAtts.getAlpababet(i);
                    if (alphabet == null) {
                        encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, mustBeAddedToTable);
                    } else if (alphabet == RestrictedAlphabet.DATE_TIME_CHARACTERS) {
                        encodeDateTimeNonIdentifyingStringOnFirstBit(
                                value, addToTable, mustBeAddedToTable);
                    } else if (alphabet == RestrictedAlphabet.NUMERIC_CHARACTERS) {
                        encodeNumericNonIdentifyingStringOnFirstBit(
                                value, addToTable, mustBeAddedToTable);
                    } else {
                        encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, mustBeAddedToTable);
                    }
                } else {
                    encodeNonIdentifyingStringOnFirstBit(eAtts.getAlgorithmURI(i),
                            eAtts.getAlgorithmIndex(i), data);
                }
            }
        }
    } else {
        for (int i = 0; i < atts.getLength(); i++) {
            if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
                value = atts.getValue(i);
                addToTable = isAttributeValueLengthMatchesLimit(value.length());
                encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, false);
            }
        }
    }
    _b = EncodingConstants.TERMINATOR;
    _terminate = true;
}