/** * Returns the short buffer as a local name. The return value is released in * emitDoctypeToken(). * * @return the smaller buffer as local name */ private void strBufToDoctypeName() { doctypeName = Portability.newLocalNameFromBuffer(strBuf, 0, strBufLen, interner); }
/** * Returns the buffer as a local name. The return value is released in * emitDoctypeToken(). * * @return the buffer as local name */ private void strBufToDoctypeName() { doctypeName = Portability.newLocalNameFromBuffer(strBuf, strBufLen, interner); clearStrBufAfterUse(); }
/** * Returns the buffer as a local name. The return value is released in * emitDoctypeToken(). * * @return the buffer as local name */ private void strBufToDoctypeName() { doctypeName = Portability.newLocalNameFromBuffer(strBuf, strBufLen, interner); clearStrBufAfterUse(); }
static ElementName elementNameByBuffer(@NoLength char[] buf, int offset, int length, Interner interner) { int hash = ElementName.bufToHash(buf, length); int index = Arrays.binarySearch(ElementName.ELEMENT_HASHES, hash); if (index < 0) { return new ElementName(Portability.newLocalNameFromBuffer(buf, offset, length, interner)); } else { ElementName elementName = ElementName.ELEMENT_NAMES[index]; @Local String name = elementName.name; if (!Portability.localEqualsBuffer(name, buf, offset, length)) { return new ElementName(Portability.newLocalNameFromBuffer(buf, offset, length, interner)); } return elementName; } }
private void strBufToElementNameString() { if (containsHyphen) { // We've got a custom element or annotation-xml. @Local String annotationName = ElementName.ANNOTATION_XML.getName(); if (Portability.localEqualsBuffer(annotationName, strBuf, strBufLen)) { tagName = ElementName.ANNOTATION_XML; } else { nonInternedTagName.setNameForNonInterned(Portability.newLocalNameFromBuffer(strBuf, strBufLen, interner) // CPPONLY: , true ); tagName = nonInternedTagName; } } else { tagName = ElementName.elementNameByBuffer(strBuf, strBufLen, interner); if (tagName == null) { nonInternedTagName.setNameForNonInterned(Portability.newLocalNameFromBuffer(strBuf, strBufLen, interner) // CPPONLY: , false ); tagName = nonInternedTagName; } } containsHyphen = false; clearStrBufAfterUse(); }
private void strBufToElementNameString() { if (containsHyphen) { // We've got a custom element or annotation-xml. @Local String annotationName = ElementName.ANNOTATION_XML.getName(); if (Portability.localEqualsBuffer(annotationName, strBuf, strBufLen)) { tagName = ElementName.ANNOTATION_XML; } else { nonInternedTagName.setNameForNonInterned(Portability.newLocalNameFromBuffer(strBuf, strBufLen, interner) // CPPONLY: , true ); tagName = nonInternedTagName; } } else { tagName = ElementName.elementNameByBuffer(strBuf, strBufLen, interner); if (tagName == null) { nonInternedTagName.setNameForNonInterned(Portability.newLocalNameFromBuffer(strBuf, strBufLen, interner) // CPPONLY: , false ); tagName = nonInternedTagName; } } containsHyphen = false; clearStrBufAfterUse(); }
if (index < 0) { return AttributeName.createAttributeName( Portability.newLocalNameFromBuffer(buf, offset, length, interner) if (!Portability.localEqualsBuffer(name, buf, offset, length)) { return AttributeName.createAttributeName( Portability.newLocalNameFromBuffer(buf, offset, length, interner)
private void attributeNameComplete() throws SAXException { attributeName = AttributeName.nameByBuffer(strBuf, strBufLen, interner); if (attributeName == null) { // [NOCPP[ attributeName = AttributeName.createAttributeName( Portability.newLocalNameFromBuffer(strBuf, strBufLen, interner), namePolicy != XmlViolationPolicy.ALLOW); // ]NOCPP] // CPPONLY: nonInternedAttributeName.setNameForNonInterned(Portability.newLocalNameFromBuffer(strBuf, strBufLen, interner)); // CPPONLY: attributeName = nonInternedAttributeName; } clearStrBufAfterUse(); if (attributes == null) { attributes = new HtmlAttributes(mappingLangToXmlLang); } /* * When the user agent leaves the attribute name state (and before * emitting the tag token, if appropriate), the complete attribute's * name must be compared to the other attributes on the same token; if * there is already an attribute on the token with the exact same name, * then this is a parse error and the new attribute must be dropped, * along with the value that gets associated with it (if any). */ if (attributes.contains(attributeName)) { errDuplicateAttribute(); attributeName = null; } }
private void attributeNameComplete() throws SAXException { attributeName = AttributeName.nameByBuffer(strBuf, strBufLen, interner); if (attributeName == null) { // [NOCPP[ attributeName = AttributeName.createAttributeName( Portability.newLocalNameFromBuffer(strBuf, strBufLen, interner), namePolicy != XmlViolationPolicy.ALLOW); // ]NOCPP] // CPPONLY: nonInternedAttributeName.setNameForNonInterned(Portability.newLocalNameFromBuffer(strBuf, strBufLen, interner)); // CPPONLY: attributeName = nonInternedAttributeName; } clearStrBufAfterUse(); if (attributes == null) { attributes = new HtmlAttributes(mappingLangToXmlLang); } /* * When the user agent leaves the attribute name state (and before * emitting the tag token, if appropriate), the complete attribute's * name must be compared to the other attributes on the same token; if * there is already an attribute on the token with the exact same name, * then this is a parse error and the new attribute must be dropped, * along with the value that gets associated with it (if any). */ if (attributes.contains(attributeName)) { errDuplicateAttribute(); attributeName = null; } }