本文整理汇总了Java中com.sun.xml.internal.fastinfoset.EncodingConstants.ELEMENT_ATTRIBUTE_FLAG属性的典型用法代码示例。如果您正苦于以下问题:Java EncodingConstants.ELEMENT_ATTRIBUTE_FLAG属性的具体用法?Java EncodingConstants.ELEMENT_ATTRIBUTE_FLAG怎么用?Java EncodingConstants.ELEMENT_ATTRIBUTE_FLAG使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.sun.xml.internal.fastinfoset.EncodingConstants
的用法示例。
在下文中一共展示了EncodingConstants.ELEMENT_ATTRIBUTE_FLAG属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
示例2: writeLowLevelStartAttributes
public final void writeLowLevelStartAttributes() throws IOException {
if (hasMark()) {
_octetBuffer[_markIndex] |= EncodingConstants.ELEMENT_ATTRIBUTE_FLAG;
resetMark();
}
}