Java Code Examples for com.sun.xml.internal.fastinfoset.stax.StAXDocumentSerializer#setVocabulary()

The following examples show how to use com.sun.xml.internal.fastinfoset.stax.StAXDocumentSerializer#setVocabulary() . 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: FastInfosetCodec.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new (@link StAXDocumentSerializer} instance.
 *
 * @param in the OutputStream to serialize to.
 * @param retainState if true the serializer should retain the state of
 *        vocabulary tables for multiple serializations.
 * @return a new {@link StAXDocumentSerializer} instance.
 */
/* package */ static StAXDocumentSerializer createNewStreamWriter(OutputStream out,
        boolean retainState, int indexedStringSizeLimit, int stringsMemoryLimit) {
    StAXDocumentSerializer serializer = new StAXDocumentSerializer(out);
    if (retainState) {
        /**
         * Create a serializer vocabulary external to the serializer.
         * This will ensure that the vocabulary will never be cleared
         * for each serialization and will be retained (and will grow)
         * for each serialization
         */
        SerializerVocabulary vocabulary = new SerializerVocabulary();
        serializer.setVocabulary(vocabulary);
        serializer.setMinAttributeValueSize(0);
        serializer.setMaxAttributeValueSize(indexedStringSizeLimit);
        serializer.setMinCharacterContentChunkSize(0);
        serializer.setMaxCharacterContentChunkSize(indexedStringSizeLimit);
        serializer.setAttributeValueMapMemoryLimit(stringsMemoryLimit);
        serializer.setCharacterContentChunkMapMemoryLimit(stringsMemoryLimit);
    }
    return serializer;
}
 
Example 2
Source File: FastInfosetCodec.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new (@link StAXDocumentSerializer} instance.
 *
 * @param in the OutputStream to serialize to.
 * @param retainState if true the serializer should retain the state of
 *        vocabulary tables for multiple serializations.
 * @return a new {@link StAXDocumentSerializer} instance.
 */
/* package */ static StAXDocumentSerializer createNewStreamWriter(OutputStream out,
        boolean retainState, int indexedStringSizeLimit, int stringsMemoryLimit) {
    StAXDocumentSerializer serializer = new StAXDocumentSerializer(out);
    if (retainState) {
        /**
         * Create a serializer vocabulary external to the serializer.
         * This will ensure that the vocabulary will never be cleared
         * for each serialization and will be retained (and will grow)
         * for each serialization
         */
        SerializerVocabulary vocabulary = new SerializerVocabulary();
        serializer.setVocabulary(vocabulary);
        serializer.setMinAttributeValueSize(0);
        serializer.setMaxAttributeValueSize(indexedStringSizeLimit);
        serializer.setMinCharacterContentChunkSize(0);
        serializer.setMaxCharacterContentChunkSize(indexedStringSizeLimit);
        serializer.setAttributeValueMapMemoryLimit(stringsMemoryLimit);
        serializer.setCharacterContentChunkMapMemoryLimit(stringsMemoryLimit);
    }
    return serializer;
}
 
Example 3
Source File: FastInfosetCodec.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new (@link StAXDocumentSerializer} instance.
 *
 * @param in the OutputStream to serialize to.
 * @param retainState if true the serializer should retain the state of
 *        vocabulary tables for multiple serializations.
 * @return a new {@link StAXDocumentSerializer} instance.
 */
/* package */ static StAXDocumentSerializer createNewStreamWriter(OutputStream out,
        boolean retainState, int indexedStringSizeLimit, int stringsMemoryLimit) {
    StAXDocumentSerializer serializer = new StAXDocumentSerializer(out);
    if (retainState) {
        /**
         * Create a serializer vocabulary external to the serializer.
         * This will ensure that the vocabulary will never be cleared
         * for each serialization and will be retained (and will grow)
         * for each serialization
         */
        SerializerVocabulary vocabulary = new SerializerVocabulary();
        serializer.setVocabulary(vocabulary);
        serializer.setMinAttributeValueSize(0);
        serializer.setMaxAttributeValueSize(indexedStringSizeLimit);
        serializer.setMinCharacterContentChunkSize(0);
        serializer.setMaxCharacterContentChunkSize(indexedStringSizeLimit);
        serializer.setAttributeValueMapMemoryLimit(stringsMemoryLimit);
        serializer.setCharacterContentChunkMapMemoryLimit(stringsMemoryLimit);
    }
    return serializer;
}
 
Example 4
Source File: FastInfosetCodec.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new (@link StAXDocumentSerializer} instance.
 *
 * @param in the OutputStream to serialize to.
 * @param retainState if true the serializer should retain the state of
 *        vocabulary tables for multiple serializations.
 * @return a new {@link StAXDocumentSerializer} instance.
 */
/* package */ static StAXDocumentSerializer createNewStreamWriter(OutputStream out,
        boolean retainState, int indexedStringSizeLimit, int stringsMemoryLimit) {
    StAXDocumentSerializer serializer = new StAXDocumentSerializer(out);
    if (retainState) {
        /**
         * Create a serializer vocabulary external to the serializer.
         * This will ensure that the vocabulary will never be cleared
         * for each serialization and will be retained (and will grow)
         * for each serialization
         */
        SerializerVocabulary vocabulary = new SerializerVocabulary();
        serializer.setVocabulary(vocabulary);
        serializer.setMinAttributeValueSize(0);
        serializer.setMaxAttributeValueSize(indexedStringSizeLimit);
        serializer.setMinCharacterContentChunkSize(0);
        serializer.setMaxCharacterContentChunkSize(indexedStringSizeLimit);
        serializer.setAttributeValueMapMemoryLimit(stringsMemoryLimit);
        serializer.setCharacterContentChunkMapMemoryLimit(stringsMemoryLimit);
    }
    return serializer;
}
 
Example 5
Source File: FastInfosetCodec.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new (@link StAXDocumentSerializer} instance.
 *
 * @param in the OutputStream to serialize to.
 * @param retainState if true the serializer should retain the state of
 *        vocabulary tables for multiple serializations.
 * @return a new {@link StAXDocumentSerializer} instance.
 */
/* package */ static StAXDocumentSerializer createNewStreamWriter(OutputStream out,
        boolean retainState, int indexedStringSizeLimit, int stringsMemoryLimit) {
    StAXDocumentSerializer serializer = new StAXDocumentSerializer(out);
    if (retainState) {
        /**
         * Create a serializer vocabulary external to the serializer.
         * This will ensure that the vocabulary will never be cleared
         * for each serialization and will be retained (and will grow)
         * for each serialization
         */
        SerializerVocabulary vocabulary = new SerializerVocabulary();
        serializer.setVocabulary(vocabulary);
        serializer.setMinAttributeValueSize(0);
        serializer.setMaxAttributeValueSize(indexedStringSizeLimit);
        serializer.setMinCharacterContentChunkSize(0);
        serializer.setMaxCharacterContentChunkSize(indexedStringSizeLimit);
        serializer.setAttributeValueMapMemoryLimit(stringsMemoryLimit);
        serializer.setCharacterContentChunkMapMemoryLimit(stringsMemoryLimit);
    }
    return serializer;
}
 
Example 6
Source File: FastInfosetCodec.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new (@link StAXDocumentSerializer} instance.
 *
 * @param in the OutputStream to serialize to.
 * @param retainState if true the serializer should retain the state of
 *        vocabulary tables for multiple serializations.
 * @return a new {@link StAXDocumentSerializer} instance.
 */
/* package */ static StAXDocumentSerializer createNewStreamWriter(OutputStream out,
        boolean retainState, int indexedStringSizeLimit, int stringsMemoryLimit) {
    StAXDocumentSerializer serializer = new StAXDocumentSerializer(out);
    if (retainState) {
        /**
         * Create a serializer vocabulary external to the serializer.
         * This will ensure that the vocabulary will never be cleared
         * for each serialization and will be retained (and will grow)
         * for each serialization
         */
        SerializerVocabulary vocabulary = new SerializerVocabulary();
        serializer.setVocabulary(vocabulary);
        serializer.setMinAttributeValueSize(0);
        serializer.setMaxAttributeValueSize(indexedStringSizeLimit);
        serializer.setMinCharacterContentChunkSize(0);
        serializer.setMaxCharacterContentChunkSize(indexedStringSizeLimit);
        serializer.setAttributeValueMapMemoryLimit(stringsMemoryLimit);
        serializer.setCharacterContentChunkMapMemoryLimit(stringsMemoryLimit);
    }
    return serializer;
}
 
Example 7
Source File: FastInfosetCodec.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new (@link StAXDocumentSerializer} instance.
 *
 * @param in the OutputStream to serialize to.
 * @param retainState if true the serializer should retain the state of
 *        vocabulary tables for multiple serializations.
 * @return a new {@link StAXDocumentSerializer} instance.
 */
/* package */ static StAXDocumentSerializer createNewStreamWriter(OutputStream out,
        boolean retainState, int indexedStringSizeLimit, int stringsMemoryLimit) {
    StAXDocumentSerializer serializer = new StAXDocumentSerializer(out);
    if (retainState) {
        /**
         * Create a serializer vocabulary external to the serializer.
         * This will ensure that the vocabulary will never be cleared
         * for each serialization and will be retained (and will grow)
         * for each serialization
         */
        SerializerVocabulary vocabulary = new SerializerVocabulary();
        serializer.setVocabulary(vocabulary);
        serializer.setMinAttributeValueSize(0);
        serializer.setMaxAttributeValueSize(indexedStringSizeLimit);
        serializer.setMinCharacterContentChunkSize(0);
        serializer.setMaxCharacterContentChunkSize(indexedStringSizeLimit);
        serializer.setAttributeValueMapMemoryLimit(stringsMemoryLimit);
        serializer.setCharacterContentChunkMapMemoryLimit(stringsMemoryLimit);
    }
    return serializer;
}
 
Example 8
Source File: FastInfosetCodec.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create a new (@link StAXDocumentSerializer} instance.
 *
 * @param in the OutputStream to serialize to.
 * @param retainState if true the serializer should retain the state of
 *        vocabulary tables for multiple serializations.
 * @return a new {@link StAXDocumentSerializer} instance.
 */
/* package */ static StAXDocumentSerializer createNewStreamWriter(OutputStream out,
        boolean retainState, int indexedStringSizeLimit, int stringsMemoryLimit) {
    StAXDocumentSerializer serializer = new StAXDocumentSerializer(out);
    if (retainState) {
        /**
         * Create a serializer vocabulary external to the serializer.
         * This will ensure that the vocabulary will never be cleared
         * for each serialization and will be retained (and will grow)
         * for each serialization
         */
        SerializerVocabulary vocabulary = new SerializerVocabulary();
        serializer.setVocabulary(vocabulary);
        serializer.setMinAttributeValueSize(0);
        serializer.setMaxAttributeValueSize(indexedStringSizeLimit);
        serializer.setMinCharacterContentChunkSize(0);
        serializer.setMaxCharacterContentChunkSize(indexedStringSizeLimit);
        serializer.setAttributeValueMapMemoryLimit(stringsMemoryLimit);
        serializer.setCharacterContentChunkMapMemoryLimit(stringsMemoryLimit);
    }
    return serializer;
}