| Method from com.sun.xml.internal.fastinfoset.sax.SAXDocumentSerializer Detail: |
public void alphabetCharacters(String alphabet,
char[] ch,
int start,
int length) throws SAXException {
if (length < = 0) {
return;
}
try {
encodeTermination();
encodeAlphabetCharacters(alphabet, ch, start, length);
} catch (IOException e) {
throw new SAXException(e);
} catch (FastInfosetException e) {
throw new SAXException(e);
}
}
|
public final void booleans(boolean[] b,
int start,
int length) throws SAXException {
if (length < = 0) {
return;
}
try {
encodeTermination();
encodeCIIBuiltInAlgorithmData(EncodingAlgorithmIndexes.BOOLEAN, b, start, length);
} catch (IOException e) {
throw new SAXException(e);
} catch (FastInfosetException e) {
throw new SAXException(e);
}
}
|
public final void bytes(byte[] b,
int start,
int length) throws SAXException {
if (length < = 0) {
return;
}
try {
encodeTermination();
encodeCIIOctetAlgorithmData(EncodingAlgorithmIndexes.BASE64, b, start, length);
} catch (IOException e) {
throw new SAXException(e);
}
}
|
public final void characters(char[] ch,
int start,
int length) throws SAXException {
if (length < = 0) {
return;
}
if (getIgnoreWhiteSpaceTextContent() &&
isWhiteSpace(ch, start, length)) return;
try {
encodeTermination();
if (!_charactersAsCDATA) {
encodeCharacters(ch, start, length);
} else {
encodeCIIBuiltInAlgorithmDataAsCDATA(ch, start, length);
}
} catch (IOException e) {
throw new SAXException(e);
} catch (FastInfosetException e) {
throw new SAXException(e);
}
}
|
public final void comment(char[] ch,
int start,
int length) throws SAXException {
try {
if (getIgnoreComments()) return;
encodeTermination();
encodeComment(ch, start, length);
} catch (IOException e) {
throw new SAXException("startElement", e);
}
}
|
public final int countAttributes(Attributes atts) {
// Count attributes ignoring any in the XMLNS namespace
// Note, such attributes may be produced when transforming from a DOM node
int count = 0;
for (int i = 0; i < atts.getLength(); i++) {
final String uri = atts.getURI(i);
if (uri == "http://www.w3.org/2000/xmlns/" || uri.equals("http://www.w3.org/2000/xmlns/")) {
continue;
}
count++;
}
return count;
}
|
public void dateTimeCharacters(char[] ch,
int start,
int length) throws SAXException {
if (length < = 0) {
return;
}
try {
encodeTermination();
encodeFourBitCharacters(RestrictedAlphabet.DATE_TIME_CHARACTERS_INDEX, EncodingConstants.DATE_TIME_CHARACTERS_TABLE, ch, start, length);
} catch (IOException e) {
throw new SAXException(e);
} catch (FastInfosetException e) {
throw new SAXException(e);
}
}
|
public final void doubles(double[] d,
int start,
int length) throws SAXException {
if (length < = 0) {
return;
}
try {
encodeTermination();
encodeCIIBuiltInAlgorithmData(EncodingAlgorithmIndexes.DOUBLE, d, start, length);
} catch (IOException e) {
throw new SAXException(e);
} catch (FastInfosetException e) {
throw new SAXException(e);
}
}
|
protected final boolean encodeAttribute(String namespaceURI,
String qName,
String localName) throws IOException {
LocalNameQualifiedNamesMap.Entry entry = _v.attributeName.obtainEntry(qName);
if (entry._valueIndex > 0) {
QualifiedName[] names = entry._value;
for (int i = 0; i < entry._valueIndex; i++) {
if ((namespaceURI == names[i].namespaceName || namespaceURI.equals(names[i].namespaceName))) {
encodeNonZeroIntegerOnSecondBitFirstBitZero(names[i].index);
return true;
}
}
}
return encodeLiteralAttributeQualifiedNameOnSecondBit(namespaceURI, getPrefixFromQualifiedName(qName),
localName, entry);
}
|
protected final void encodeElement(String namespaceURI,
String qName,
String localName) throws IOException {
LocalNameQualifiedNamesMap.Entry entry = _v.elementName.obtainEntry(qName);
if (entry._valueIndex > 0) {
QualifiedName[] names = entry._value;
for (int i = 0; i < entry._valueIndex; i++) {
if ((namespaceURI == names[i].namespaceName || namespaceURI.equals(names[i].namespaceName))) {
encodeNonZeroIntegerOnThirdBit(names[i].index);
return;
}
}
}
encodeLiteralElementQualifiedNameOnThirdBit(namespaceURI, getPrefixFromQualifiedName(qName),
localName, entry);
}
|
public final void endCDATA() throws SAXException {
_charactersAsCDATA = false;
}
|
public final void endDTD() throws SAXException {
}
|
public final void endDocument() throws SAXException {
try {
encodeDocumentTermination();
} catch (IOException e) {
throw new SAXException("endDocument", e);
}
}
|
public final void endElement(String namespaceURI,
String localName,
String qName) throws SAXException {
try {
encodeElementTermination();
} catch (IOException e) {
throw new SAXException("startElement", e);
}
}
|
public final void endEntity(String name) throws SAXException {
}
|
public final void floats(float[] f,
int start,
int length) throws SAXException {
if (length < = 0) {
return;
}
try {
encodeTermination();
encodeCIIBuiltInAlgorithmData(EncodingAlgorithmIndexes.FLOAT, f, start, length);
} catch (IOException e) {
throw new SAXException(e);
} catch (FastInfosetException e) {
throw new SAXException(e);
}
}
|
public final void ignorableWhitespace(char[] ch,
int start,
int length) throws SAXException {
if (getIgnoreWhiteSpaceTextContent()) return;
characters(ch, start, length);
}
|
public final void ints(int[] i,
int start,
int length) throws SAXException {
if (length < = 0) {
return;
}
try {
encodeTermination();
encodeCIIBuiltInAlgorithmData(EncodingAlgorithmIndexes.INT, i, start, length);
} catch (IOException e) {
throw new SAXException(e);
} catch (FastInfosetException e) {
throw new SAXException(e);
}
}
|
public final void longs(long[] l,
int start,
int length) throws SAXException {
if (length < = 0) {
return;
}
try {
encodeTermination();
encodeCIIBuiltInAlgorithmData(EncodingAlgorithmIndexes.LONG, l, start, length);
} catch (IOException e) {
throw new SAXException(e);
} catch (FastInfosetException e) {
throw new SAXException(e);
}
}
|
public void numericCharacters(char[] ch,
int start,
int length) throws SAXException {
if (length < = 0) {
return;
}
try {
encodeTermination();
encodeFourBitCharacters(RestrictedAlphabet.NUMERIC_CHARACTERS_INDEX, EncodingConstants.NUMERIC_CHARACTERS_TABLE, ch, start, length);
} catch (IOException e) {
throw new SAXException(e);
} catch (FastInfosetException e) {
throw new SAXException(e);
}
}
|
public final void object(String URI,
int id,
Object data) throws SAXException {
try {
encodeTermination();
encodeNonIdentifyingStringOnThirdBit(URI, id, data);
} catch (IOException e) {
throw new SAXException(e);
} catch (FastInfosetException e) {
throw new SAXException(e);
}
}
|
public final void octets(String URI,
int id,
byte[] b,
int start,
int length) throws SAXException {
if (length < = 0) {
return;
}
try {
encodeTermination();
encodeNonIdentifyingStringOnThirdBit(URI, id, b, start, length);
} catch (IOException e) {
throw new SAXException(e);
} catch (FastInfosetException e) {
throw new SAXException(e);
}
}
|
public final void processingInstruction(String target,
String data) throws SAXException {
try {
if (getIgnoreProcesingInstructions()) return;
if (target == "") {
throw new SAXException(CommonResourceBundle.getInstance().
getString("message.processingInstructionTargetIsEmpty"));
}
encodeTermination();
encodeProcessingInstruction(target, data);
} catch (IOException e) {
throw new SAXException("processingInstruction", e);
}
}
|
public void reset() {
super.reset();
_elementHasNamespaces = false;
_charactersAsCDATA = false;
}
|
public final void setDocumentLocator(Locator locator) {
}
|
public final void shorts(short[] s,
int start,
int length) throws SAXException {
if (length < = 0) {
return;
}
try {
encodeTermination();
encodeCIIBuiltInAlgorithmData(EncodingAlgorithmIndexes.SHORT, s, start, length);
} catch (IOException e) {
throw new SAXException(e);
} catch (FastInfosetException e) {
throw new SAXException(e);
}
}
|
public final void skippedEntity(String name) throws SAXException {
}
|
public final void startCDATA() throws SAXException {
_charactersAsCDATA = true;
}
|
public final void startDTD(String name,
String publicId,
String systemId) throws SAXException {
}
|
public final void startDocument() throws SAXException {
try {
reset();
encodeHeader(false);
encodeInitialVocabulary();
} catch (IOException e) {
throw new SAXException("startDocument", e);
}
}
|
public final void startElement(String namespaceURI,
String localName,
String qName,
Attributes atts) throws SAXException {
// TODO consider using buffer for encoding of attributes, then pre-counting is not necessary
final int attributeCount = (atts != null && atts.getLength() > 0)
? countAttributes(atts) : 0;
try {
if (_elementHasNamespaces) {
_elementHasNamespaces = false;
if (attributeCount > 0) {
// Flag the marked byte with attributes
_octetBuffer[_markIndex] |= EncodingConstants.ELEMENT_ATTRIBUTE_FLAG;
}
resetMark();
write(EncodingConstants.TERMINATOR);
_b = 0;
} else {
encodeTermination();
_b = EncodingConstants.ELEMENT;
if (attributeCount > 0) {
_b |= EncodingConstants.ELEMENT_ATTRIBUTE_FLAG;
}
}
encodeElement(namespaceURI, qName, localName);
if (attributeCount > 0) {
boolean addToTable;
String value;
if (atts instanceof EncodingAlgorithmAttributes) {
final EncodingAlgorithmAttributes eAtts = (EncodingAlgorithmAttributes)atts;
for (int i = 0; i < eAtts.getLength(); i++) {
if (encodeAttribute(atts.getURI(i), atts.getQName(i), atts.getLocalName(i))) {
final Object data = eAtts.getAlgorithmData(i);
// If data is null then there is no algorithm data
if (data == null) {
value = eAtts.getValue(i);
addToTable = (value.length() < attributeValueSizeConstraint) ? true : false;
encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable);
} 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 = (value.length() < attributeValueSizeConstraint) ? true : false;
encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable);
}
}
}
_b = EncodingConstants.TERMINATOR;
_terminate = true;
}
} catch (IOException e) {
throw new SAXException("startElement", e);
} catch (FastInfosetException e) {
throw new SAXException("startElement", e);
}
}
|
public final void startEntity(String name) throws SAXException {
}
|
public final void startPrefixMapping(String prefix,
String uri) throws SAXException {
try {
if (_elementHasNamespaces == false) {
encodeTermination();
// Mark the current buffer position to flag attributes if necessary
mark();
_elementHasNamespaces = true;
// Write out Element byte with namespaces
write(EncodingConstants.ELEMENT | EncodingConstants.ELEMENT_NAMESPACES_FLAG);
}
encodeNamespaceAttribute(prefix, uri);
} catch (IOException e) {
throw new SAXException("startElement", e);
}
}
|
public void uuids(long[] msblsb,
int start,
int length) throws SAXException {
if (length < = 0) {
return;
}
try {
encodeTermination();
encodeCIIBuiltInAlgorithmData(EncodingAlgorithmIndexes.UUID, msblsb, start, length);
} catch (IOException e) {
throw new SAXException(e);
} catch (FastInfosetException e) {
throw new SAXException(e);
}
}
|