Renamed and cleaned manifest V5 XML tag enum
This commit is contained in:
parent
5104767aa1
commit
05f977e3ca
|
@ -92,18 +92,18 @@ public class ScopicManifest5ContentParser extends ContentWriterAdapter {
|
|||
|
||||
@Override
|
||||
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
|
||||
if (ScopicManifest5FrameElement.ATTRIBUTE.name().equals(localName)) {
|
||||
attrName = attributes.getValue(XMLConstants.NULL_NS_URI, ScopicManifest5FrameElement.ATTRIBUTE_NAME);
|
||||
if (ScopicManifest5FrameTag.ATTRIBUTE.name().equals(localName)) {
|
||||
attrName = attributes.getValue(XMLConstants.NULL_NS_URI, ScopicManifest5FrameTag.ATTRIBUTE_NAME);
|
||||
return;
|
||||
}
|
||||
if (ScopicManifest5FrameElement.SECTION.name().equals(localName)) {
|
||||
if (ScopicManifest5FrameTag.SECTION.name().equals(localName)) {
|
||||
attrMain = false;
|
||||
String sectionName = attributes.getValue(XMLConstants.NULL_NS_URI, ScopicManifest5FrameElement.SECTION_NAME);
|
||||
String sectionName = attributes.getValue(XMLConstants.NULL_NS_URI, ScopicManifest5FrameTag.SECTION_NAME);
|
||||
handler.strobeSectionHeader(sectionName);
|
||||
return;
|
||||
}
|
||||
if (ScopicManifest5FrameElement.MANIFEST.name().equals(localName)) {
|
||||
String version = attributes.getValue(XMLConstants.NULL_NS_URI, ScopicManifest5FrameElement.MANIFEST_VERSION);
|
||||
if (ScopicManifest5FrameTag.MANIFEST.name().equals(localName)) {
|
||||
String version = attributes.getValue(XMLConstants.NULL_NS_URI, ScopicManifest5FrameTag.MANIFEST_VERSION);
|
||||
handler.strobeManifestDeclaration(version);
|
||||
return;
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ public class ScopicManifest5ContentParser extends ContentWriterAdapter {
|
|||
|
||||
@Override
|
||||
public void endElement(String uri, String localName, String qName) throws SAXException {
|
||||
if (ScopicManifest5FrameElement.ATTRIBUTE.name().equals(localName)) {
|
||||
if (ScopicManifest5FrameTag.ATTRIBUTE.name().equals(localName)) {
|
||||
if (attrMain) {
|
||||
handler.strobeMainAttribute(attrName, attrValue.toString());
|
||||
} else {
|
||||
|
@ -121,7 +121,7 @@ public class ScopicManifest5ContentParser extends ContentWriterAdapter {
|
|||
attrValue = new StringBuilder();
|
||||
return;
|
||||
}
|
||||
if (ScopicManifest5FrameElement.SECTION.name().equals(localName)) {
|
||||
if (ScopicManifest5FrameTag.SECTION.name().equals(localName)) {
|
||||
attrMain = true; // Support normal xml tree layout
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ import love.distributedrebirth.nx01.warp.manifestor.scopic.iomf.ScopicManifestCo
|
|||
/// @version ©Δ∞ 仙上主天
|
||||
public class ScopicManifest5ContentWriter implements ScopicManifestContent<String> {
|
||||
|
||||
private final ContentWriterTagWrapper<ScopicManifest5FrameElement, ContentWriter> writer;
|
||||
private final ContentWriterTagWrapper<ScopicManifest5FrameTag, ContentWriter> writer;
|
||||
private final ScopicManifestDuplicateDetector<String> duplicateDetector;
|
||||
private boolean openSection = false;
|
||||
|
||||
|
@ -70,8 +70,8 @@ public class ScopicManifest5ContentWriter implements ScopicManifestContent<Strin
|
|||
}
|
||||
try {
|
||||
AttributesImpl atts = new AttributesImpl();
|
||||
atts.addAttribute ("", ScopicManifest5FrameElement.MANIFEST_VERSION, "", "", WarpManifestX0TheVersion.VERSION_5_0.getQName());
|
||||
writer.printTagStart(ScopicManifest5FrameElement.MANIFEST, atts);
|
||||
atts.addAttribute ("", ScopicManifest5FrameTag.MANIFEST_VERSION, "", "", WarpManifestX0TheVersion.VERSION_5_0.getQName());
|
||||
writer.printTagStart(ScopicManifest5FrameTag.MANIFEST, atts);
|
||||
} catch (SAXException e) {
|
||||
throw new ScopicManifestException(e);
|
||||
}
|
||||
|
@ -89,11 +89,11 @@ public class ScopicManifest5ContentWriter implements ScopicManifestContent<Strin
|
|||
duplicateDetector.clearPart(ScopicManifestDuplicatePart.SECTION_ATTRIBUTE);
|
||||
try {
|
||||
if (openSection) {
|
||||
writer.printTagEnd(ScopicManifest5FrameElement.SECTION);
|
||||
writer.printTagEnd(ScopicManifest5FrameTag.SECTION);
|
||||
}
|
||||
AttributesImpl atts = new AttributesImpl();
|
||||
atts.addAttribute ("", ScopicManifest5FrameElement.SECTION_NAME, "", "", sectionName);
|
||||
writer.printTagStart(ScopicManifest5FrameElement.SECTION, atts);
|
||||
atts.addAttribute ("", ScopicManifest5FrameTag.SECTION_NAME, "", "", sectionName);
|
||||
writer.printTagStart(ScopicManifest5FrameTag.SECTION, atts);
|
||||
openSection = true;
|
||||
} catch (SAXException e) {
|
||||
throw new ScopicManifestException(e);
|
||||
|
@ -120,10 +120,10 @@ public class ScopicManifest5ContentWriter implements ScopicManifestContent<Strin
|
|||
duplicateDetector.clearAll();
|
||||
try {
|
||||
if (openSection) {
|
||||
writer.printTagEnd(ScopicManifest5FrameElement.SECTION);
|
||||
writer.printTagEnd(ScopicManifest5FrameTag.SECTION);
|
||||
openSection = false;
|
||||
}
|
||||
writer.printTagEnd(ScopicManifest5FrameElement.MANIFEST);
|
||||
writer.printTagEnd(ScopicManifest5FrameTag.MANIFEST);
|
||||
writer.endDocument();
|
||||
} catch (SAXException e) {
|
||||
throw new ScopicManifestException(e);
|
||||
|
@ -136,10 +136,10 @@ public class ScopicManifest5ContentWriter implements ScopicManifestContent<Strin
|
|||
}
|
||||
try {
|
||||
AttributesImpl atts = new AttributesImpl();
|
||||
atts.addAttribute ("", ScopicManifest5FrameElement.ATTRIBUTE_NAME, "", "", name);
|
||||
writer.printTagStart(ScopicManifest5FrameElement.ATTRIBUTE, atts);
|
||||
atts.addAttribute ("", ScopicManifest5FrameTag.ATTRIBUTE_NAME, "", "", name);
|
||||
writer.printTagStart(ScopicManifest5FrameTag.ATTRIBUTE, atts);
|
||||
writer.printCharacters(value);
|
||||
writer.printTagEnd(ScopicManifest5FrameElement.ATTRIBUTE);
|
||||
writer.printTagEnd(ScopicManifest5FrameTag.ATTRIBUTE);
|
||||
} catch (SAXException e) {
|
||||
throw new ScopicManifestException(e);
|
||||
}
|
||||
|
|
|
@ -27,27 +27,13 @@
|
|||
|
||||
package love.distributedrebirth.nx01.warp.manifestor.scopic.iomf5;
|
||||
|
||||
import org.x4o.o2o.io.tlv.TLVChainSexTeenBitFrameType;
|
||||
|
||||
/// @author للَّٰهِilLצسُو
|
||||
/// @version ©Δ∞ 仙上主天
|
||||
public enum ScopicManifest5FrameElement {
|
||||
public enum ScopicManifest5FrameTag {
|
||||
|
||||
MANIFEST,
|
||||
ATTRIBUTE,
|
||||
SECTION,
|
||||
|
||||
/*
|
||||
META_DECLARATION_VERSION (22), // SYN Synchronize
|
||||
META_REMARK_CONTENT (7), // BEL Bell
|
||||
|
||||
MAIN_ATTRIBUTE_NAME (2), // STX Start of Text
|
||||
MAIN_ATTRIBUTE_BODY (3), // ETX End of Text
|
||||
|
||||
SECTION_HEADER_NAME (1), // SOH Start of Heading
|
||||
SECTION_ATTRIBUTE_NAME (5), // ENQ Enquiry
|
||||
SECTION_ATTRIBUTE_BODY (6), // ACK Acknowledge
|
||||
*/
|
||||
;
|
||||
|
||||
static public final String MANIFEST_VERSION = "VERSION";
|
Loading…
Reference in a new issue