/** Creates a new instance of ParserVocabulary */ public ParserVocabulary() { namespaceName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false); prefix = new PrefixArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS); localName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false); otherNCName = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, false); otherURI = new StringArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, true); attributeValue = new StringArray(ValueArray.DEFAULT_CAPACITY, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, true); otherString = new CharArrayArray(ValueArray.DEFAULT_CAPACITY, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS); characterContentChunk = new ContiguousCharArrayArray(ValueArray.DEFAULT_CAPACITY, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS, ContiguousCharArrayArray.INITIAL_CHARACTER_SIZE, NON_IDENTIFYING_STRING_TABLE_MAXIMUM_CHARACTERS); elementName = new QualifiedNameArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS); attributeName = new QualifiedNameArray(ValueArray.DEFAULT_CAPACITY, IDENTIFYING_STRING_TABLE_MAXIMUM_ITEMS); tables[RESTRICTED_ALPHABET] = restrictedAlphabet; tables[ENCODING_ALGORITHM] = encodingAlgorithm; tables[PREFIX] = prefix; tables[NAMESPACE_NAME] = namespaceName; tables[LOCAL_NAME] = localName; tables[OTHER_NCNAME] = otherNCName; tables[OTHER_URI] = otherURI; tables[ATTRIBUTE_VALUE] = attributeValue; tables[OTHER_STRING] = otherString; tables[CHARACTER_CONTENT_CHUNK] = characterContentChunk; tables[ELEMENT_NAME] = elementName; tables[ATTRIBUTE_NAME] = attributeName; }
private void addToTable(String s, StringArray a, StringIntMap m) { if (s.length() == 0) { return; } if (m != null) m.obtainIndex(s); a.add(s); }
public final void setReadOnlyArray(StringArray readOnlyArray, boolean clear) { if (readOnlyArray != null) { _readOnlyArray = readOnlyArray; _readOnlyArraySize = readOnlyArray.getSize(); if (clear) { clear(); } _array = getCompleteArray(); _size = _readOnlyArraySize; } }
public final String[] getCompleteArray() { if (_readOnlyArray == null) { // Return cloned version of internal _array return getArray(); // return _array; } else { final String[] ra = _readOnlyArray.getCompleteArray(); final String[] a = new String[_readOnlyArraySize + _array.length]; System.arraycopy(ra, 0, a, 0, _readOnlyArraySize); return a; } }
protected final void processAIIEncodingAlgorithm(QualifiedName name, boolean addToTable) throws FastInfosetException, IOException { String URI = null; if (_identifier >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START) { URI = _v.encodingAlgorithm.get(_identifier - EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START); if (URI == null) { throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.URINotPresent", new Object[]{Integer.valueOf(_identifier)})); } } else if (_identifier >= EncodingConstants.ENCODING_ALGORITHM_BUILTIN_END) { if (_identifier == EncodingAlgorithmIndexes.CDATA) { throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.CDATAAlgorithmNotSupported")); } // Reserved built-in algorithms for future use // TODO should use sax property to decide if event will be // reported, allows for support through handler if required. throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.identifiers10to31Reserved")); } final byte[] data = new byte[_octetBufferLength]; System.arraycopy(_octetBuffer, _octetBufferStart, data, 0, _octetBufferLength); _attributes.addAttributeWithAlgorithmData(name, URI, _identifier, data); if (addToTable) { _attributeValueTable.add(_attributes.getValue(_attributes.getIndex(name.qName))); } }
protected final void processCIIEncodingAlgorithm(boolean addToTable) throws FastInfosetException, IOException { _algorithmData = _octetBuffer; _algorithmDataOffset = _octetBufferStart; _algorithmDataLength = _octetBufferLength; _isAlgorithmDataCloned = false; if (_algorithmId >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START) { _algorithmURI = _v.encodingAlgorithm.get(_algorithmId - EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START); if (_algorithmURI == null) { throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.URINotPresent", new Object[]{Integer.valueOf(_identifier)})); } } else if (_algorithmId > EncodingConstants.ENCODING_ALGORITHM_BUILTIN_END) { // Reserved built-in algorithms for future use // TODO should use sax property to decide if event will be // reported, allows for support through handler if required. throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.identifiers10to31Reserved")); } if (addToTable) { convertEncodingAlgorithmDataToCharacters(); _characterContentChunkTable.add(_characters, _characters.length); } }
public final int add(String s) { if (_size == _array.length) { resize(); } _array[_size++] = s; return _size; }
public final void setReadOnlyArray(ValueArray readOnlyArray, boolean clear) { if (!(readOnlyArray instanceof StringArray)) { throw new IllegalArgumentException(CommonResourceBundle.getInstance(). getString("message.illegalClass", new Object[]{readOnlyArray})); } setReadOnlyArray((StringArray)readOnlyArray, clear); }
public final String[] getCompleteArray() { if (_readOnlyArray == null) { return _array; } else { final String[] ra = _readOnlyArray.getCompleteArray(); final String[] a = new String[_readOnlyArraySize + _array.length]; System.arraycopy(ra, 0, a, 0, _readOnlyArraySize); return a; } }
String URI = null; if (_identifier >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START) { URI = _v.encodingAlgorithm.get(_identifier - EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START); if (URI == null) { throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.URINotPresent", new Object[]{Integer.valueOf(_identifier)})); algorithmData); if (addToTable) { _attributeValueTable.add(_attributes.getValue(_attributes.getIndex(name.qName)));
protected final void processCIIEncodingAlgorithm(boolean addToTable) throws FastInfosetException, IOException { _algorithmData = _octetBuffer; _algorithmDataOffset = _octetBufferStart; _algorithmDataLength = _octetBufferLength; _isAlgorithmDataCloned = false; if (_algorithmId >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START) { _algorithmURI = _v.encodingAlgorithm.get(_algorithmId - EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START); if (_algorithmURI == null) { throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.URINotPresent", new Object[]{Integer.valueOf(_identifier)})); } } else if (_algorithmId > EncodingConstants.ENCODING_ALGORITHM_BUILTIN_END) { // Reserved built-in algorithms for future use // TODO should use sax property to decide if event will be // reported, allows for support through handler if required. throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.identifiers10to31Reserved")); } if (addToTable) { convertEncodingAlgorithmDataToCharacters(); _characterContentChunkTable.add(_characters, _characters.length); } }
public final String[] getCompleteArray() { if (_readOnlyArray == null) { // Return cloned version of internal _array return getArray(); // return _array; } else { final String[] ra = _readOnlyArray.getCompleteArray(); final String[] a = new String[_readOnlyArraySize + _array.length]; System.arraycopy(ra, 0, a, 0, _readOnlyArraySize); return a; } }
public final int add(String s) { if (_size == _array.length) { resize(); } _array[_size++] = s; return _size; }
public final void setReadOnlyArray(ValueArray readOnlyArray, boolean clear) { if (!(readOnlyArray instanceof StringArray)) { throw new IllegalArgumentException(CommonResourceBundle.getInstance(). getString("message.illegalClass", new Object[]{readOnlyArray})); } setReadOnlyArray((StringArray)readOnlyArray, clear); }
public final void setReadOnlyArray(StringArray readOnlyArray, boolean clear) { if (readOnlyArray != null) { _readOnlyArray = readOnlyArray; _readOnlyArraySize = readOnlyArray.getSize(); if (clear) { clear(); } _array = getCompleteArray(); _size = _readOnlyArraySize; } }
private void addToTable(String s, StringArray a, StringIntMap m) { if (s.length() == 0) { return; } if (m != null) m.obtainIndex(s); a.add(s); }