本文整理汇总了Java中com.sun.xml.internal.fastinfoset.EncodingConstants.TERMINATOR属性的典型用法代码示例。如果您正苦于以下问题:Java EncodingConstants.TERMINATOR属性的具体用法?Java EncodingConstants.TERMINATOR怎么用?Java EncodingConstants.TERMINATOR使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.sun.xml.internal.fastinfoset.EncodingConstants
的用法示例。
在下文中一共展示了EncodingConstants.TERMINATOR属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeLowLevelEndStartElement
public final void writeLowLevelEndStartElement() throws IOException {
if (hasMark()) {
resetMark();
} else {
// Terminate the attributes
_b = EncodingConstants.TERMINATOR;
_terminate = true;
}
}
示例2: encodeTerminationAndCurrentElement
protected void encodeTerminationAndCurrentElement(boolean terminateAfter) throws XMLStreamException {
try {
encodeTermination();
if (_inStartElement) {
_b = EncodingConstants.ELEMENT;
if (_attributesArrayIndex > 0) {
_b |= EncodingConstants.ELEMENT_ATTRIBUTE_FLAG;
}
// Encode namespace decls associated with this element
if (_namespacesArrayIndex > 0) {
write(_b | EncodingConstants.ELEMENT_NAMESPACES_FLAG);
for (int i = 0; i < _namespacesArrayIndex;) {
encodeNamespaceAttribute(_namespacesArray[i++], _namespacesArray[i++]);
}
_namespacesArrayIndex = 0;
write(EncodingConstants.TERMINATOR);
_b = 0;
}
// If element's prefix is empty - apply default scope namespace
if (_currentPrefix.length() == 0) {
if (_currentUri.length() == 0) {
_currentUri = _nsContext.getNamespaceURI("");
} else {
String tmpPrefix = getPrefix(_currentUri);
if (tmpPrefix != null) {
_currentPrefix = tmpPrefix;
}
}
}
encodeElementQualifiedNameOnThirdBit(_currentUri, _currentPrefix, _currentLocalName);
for (int i = 0; i < _attributesArrayIndex;) {
encodeAttributeQualifiedNameOnSecondBit(
_attributesArray[i++], _attributesArray[i++], _attributesArray[i++]);
final String value = _attributesArray[i];
_attributesArray[i++] = null;
final boolean addToTable = isAttributeValueLengthMatchesLimit(value.length());
encodeNonIdentifyingStringOnFirstBit(value, _v.attributeValue, addToTable, false);
_b = EncodingConstants.TERMINATOR;
_terminate = true;
}
_attributesArrayIndex = 0;
_inStartElement = false;
if (_isEmptyElement) {
encodeElementTermination();
if (_nsSupportContextStack[_stackCount--] == true) {
_nsContext.popContext();
}
_isEmptyElement = false;
}
if (terminateAfter) {
encodeTermination();
}
}
} catch (IOException e) {
throw new XMLStreamException(e);
}
}
示例3: encodeAttributes
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;
}