Updated warp manifest obj naming to bit width type
This commit is contained in:
parent
810c626663
commit
623fc32ab1
|
@ -70,8 +70,8 @@ import love.distributedrebirth.nx01.redsea.hyper.model.HyperFlowerAnther;
|
|||
import love.distributedrebirth.nx01.redsea.hyper.local.HyperLocalFileSystem;
|
||||
import love.distributedrebirth.nx01.warp.fault.BassFaultAnchor;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestTheMimeType;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX0TheMimeType;
|
||||
|
||||
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
|
||||
|
||||
|
@ -263,14 +263,14 @@ public class Java3Seed extends PrintStream {
|
|||
if (file.equals("/META-INF/MANIFEST.MF")) {
|
||||
System.out.println("jar: " + jar.getName());
|
||||
InputStream in = jar.get(path).getAsset().openStream();
|
||||
WarpManifest3 manifest = WarpManifestorDriver.亞.readV1Stream(in);
|
||||
WarpManifestX8 manifest = WarpManifestorDriver.亞.readV1Stream(in);
|
||||
in.close();
|
||||
jar.delete(path);
|
||||
manifest.withAttribute("Manifest-Toilet-Cleaned-By", Java3Seed.class.getName());
|
||||
manifest.withAttribute("Manifest-Toilet-Cleaned-Date", toiletCleanDate);
|
||||
jar.add(new StringAsset(WarpManifestorDriver.亞.writeV1String(manifest)), "/META-INF/"+WarpManifestTheMimeType.MANIFEST_1.getQFileName());
|
||||
jar.add(new StringAsset(WarpManifestorDriver.亞.writeV2String(manifest)), "/META-INF/"+WarpManifestTheMimeType.MANIFEST_2.getQFileName());
|
||||
jar.add(new ByteArrayAsset(WarpManifestorDriver.亞.writeV3Array(manifest)), "/META-INF/"+WarpManifestTheMimeType.MANIFEST_3.getQFileName());
|
||||
jar.add(new StringAsset(WarpManifestorDriver.亞.writeV1String(manifest)), "/META-INF/"+WarpManifestX0TheMimeType.MANIFEST_1.getQFileName());
|
||||
jar.add(new StringAsset(WarpManifestorDriver.亞.writeV2String(manifest)), "/META-INF/"+WarpManifestX0TheMimeType.MANIFEST_2.getQFileName());
|
||||
jar.add(new ByteArrayAsset(WarpManifestorDriver.亞.writeV3Array(manifest)), "/META-INF/"+WarpManifestX0TheMimeType.MANIFEST_3.getQFileName());
|
||||
convertedManifests++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ import java.util.function.Consumer;
|
|||
import love.distributedrebirth.nx01.warp.fault.sitra.SitraManifestGenerator;
|
||||
import love.distributedrebirth.nx01.warp.fault.sitra.SitraManifestSectionWhitePaper;
|
||||
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoGrowlFactory;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
|
||||
/// Bass fault anchor (which replaces; Exception/RuntimeException)
|
||||
///
|
||||
|
@ -129,7 +129,7 @@ abstract public class BassFaultAnchor extends BassFaultAnchorSignalStore {
|
|||
return ZilLaLaManyfestoGrowlFactory.亞.buildFaultScreamBase64(toZilLaLaManyfesto(), this);
|
||||
}
|
||||
|
||||
public final WarpManifest3 toZilLaLaManyfesto() {
|
||||
public final WarpManifestX8 toZilLaLaManyfesto() {
|
||||
return SitraManifestGenerator.亞.buildSignalTraceManifest(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -37,8 +37,8 @@ import java.util.Map;
|
|||
import java.util.Optional;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.fault.BassFaultAnchor;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3Section;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8Section;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.iomf.ScopicManifestConstants;
|
||||
|
||||
/// Sitra manifest generator.
|
||||
|
@ -50,13 +50,13 @@ public enum SitraManifestGenerator {
|
|||
|
||||
private static final String SITRA_VALUE_NULL = "null";
|
||||
|
||||
public WarpManifest3 buildSignalTraceManifest(BassFaultAnchor fault) {
|
||||
public WarpManifestX8 buildSignalTraceManifest(BassFaultAnchor fault) {
|
||||
String message = fault.getLocalizedMessage();
|
||||
if (message != null) {
|
||||
message = escapeSignalValue(message);
|
||||
}
|
||||
String uuidDate = DateTimeFormatter.RFC_1123_DATE_TIME.format(ZonedDateTime.ofInstant(Instant.now(), ZoneOffset.UTC));
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute(ZilLaLaManyfestoHeader.MAIN_FAULT_MANYFESTO_VCROSS, ZilLaLaManyfesto.MANYFESTO_VERSION);
|
||||
manifest.withAttribute(ZilLaLaManyfestoHeader.MAIN_FAULT_MANYFESTO_AFOUR, ZilLaLaManyfesto.MANYFESTO_A4_JAVA);
|
||||
manifest.withAttribute(ZilLaLaManyfestoHeader.MAIN_FAULT_UUID_WM_ONE, SitraManifestUUIDCrematorium.亞.burnWaterMarkOne().toString());
|
||||
|
@ -81,7 +81,7 @@ public enum SitraManifestGenerator {
|
|||
continue;
|
||||
}
|
||||
Map<String, String> signals = signalsOpt.get();
|
||||
WarpManifest3Section section = manifest.makeSection(traceKey.getName());
|
||||
WarpManifestX8Section section = manifest.makeSection(traceKey.getName());
|
||||
if (SitraManifestSectionWhitePaper.class.equals(traceKey)) {
|
||||
section.withAttribute(ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_GOAL, ZilLaLaManyfestoSectionGoal.PAPER.toString());
|
||||
} else {
|
||||
|
@ -113,7 +113,7 @@ public enum SitraManifestGenerator {
|
|||
}
|
||||
Map<String, String> signals = new LinkedHashMap<>();
|
||||
report.fillReport(fault, signals);
|
||||
WarpManifest3Section section = manifest.makeSection(report.getClass().getName());
|
||||
WarpManifestX8Section section = manifest.makeSection(report.getClass().getName());
|
||||
for (String signalKey : signals.keySet()) {
|
||||
String signalValue = signals.get(signalKey);
|
||||
String attributeBody = signalValue==null?SITRA_VALUE_NULL:escapeSignalValue(signalValue);
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
package love.distributedrebirth.nx01.warp.fault.sitra;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestTheMimeType;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX0TheMimeType;
|
||||
|
||||
/// ZilLaLa manyfesto protocol constants to build or parse the manifest data uri.
|
||||
///
|
||||
|
@ -39,6 +39,6 @@ public enum ZilLaLaManyfesto {
|
|||
public static final String MANYFESTO_A4_JAVA = "java";
|
||||
public static final String MANYFESTO_A4_ERLANG = "erlang";
|
||||
|
||||
public static final String ZILLALA_URI_PREFIX_DATA64 = "data:" + WarpManifestTheMimeType.MANIFEST_3.getQName() + ";base64,";
|
||||
public static final String ZILLALA_URI_PREFIX_DATA64 = "data:" + WarpManifestX0TheMimeType.MANIFEST_3.getQName() + ";base64,";
|
||||
public static final String ZILLALA_URI_PREFIX_NOSTR_TLV_GZ = "nostr:zillala"; // TODO: nostr link to replay to inject bug + TLV for gz sitra manifest payload
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.Base64;
|
|||
|
||||
import love.distributedrebirth.nx01.warp.fault.BassFaultAnchor;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
|
||||
/// ZilLaLa manyfesto protocol constants to build or parse the manifest data uri.
|
||||
///
|
||||
|
@ -44,7 +44,7 @@ public enum ZilLaLaManyfestoGrowlFactory {
|
|||
/// Multiple characters seen as a slug to indicate that words are eaten.
|
||||
private static final String VALUE_CUTOFF = "...";
|
||||
|
||||
public String buildFaultScream(WarpManifest3 manifest, BassFaultAnchor fault) {
|
||||
public String buildFaultScream(WarpManifestX8 manifest, BassFaultAnchor fault) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
buf.append(fault.getClass().getSimpleName());
|
||||
String messageShort = buildCutDottedMessage(fault);
|
||||
|
@ -59,7 +59,7 @@ public enum ZilLaLaManyfestoGrowlFactory {
|
|||
}
|
||||
|
||||
@Deprecated
|
||||
public String buildFaultScreamBase64(WarpManifest3 manifest, BassFaultAnchor fault) {
|
||||
public String buildFaultScreamBase64(WarpManifestX8 manifest, BassFaultAnchor fault) {
|
||||
byte[] traceManifestBytes = WarpManifestorDriver.亞.writeV3Array(manifest); // TODO: Upgrade to version 6 or 7 ??
|
||||
String trace64 = Base64.getEncoder().encodeToString(traceManifestBytes); // FIXME: report as "normal" text in nostr event
|
||||
StringBuilder buf = new StringBuilder();
|
||||
|
|
|
@ -34,7 +34,7 @@ import love.distributedrebirth.nx01.warp.fault.BassFaultAnchor;
|
|||
import love.distributedrebirth.nx01.warp.fault.FaultBeanInstantiation;
|
||||
import love.distributedrebirth.nx01.warp.fault.FaultBeanState;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
|
||||
/// @author للَّٰهِilLצسُو
|
||||
/// @version ©Δ∞ 仙上主天
|
||||
|
@ -113,7 +113,7 @@ public class FaultSignalTraceTest {
|
|||
}
|
||||
Assertions.assertNotNull(error);
|
||||
Assertions.assertNotNull(error.getMessage());
|
||||
WarpManifest3 manifest = error.toZilLaLaManyfesto();
|
||||
WarpManifestX8 manifest = error.toZilLaLaManyfesto();
|
||||
String sitraText = WarpManifestorDriver.亞.writeV2String(manifest);
|
||||
//System.out.println(sitraText);
|
||||
Assertions.assertNotNull(sitraText);
|
||||
|
|
|
@ -42,13 +42,13 @@ import java.util.Objects;
|
|||
import org.x4o.o2o.io.tlv.TLVChainOctalSex;
|
||||
import org.x4o.o2o.io.tlv.TLVChainSexTeenBit;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest2;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest2HeaderField;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest2Section;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest4;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestTheMimeType;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestTheVersion;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX0;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX0HeaderField;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX0Section;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX18;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX0TheMimeType;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX0TheVersion;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestContent;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestContentStringHandler;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
|
||||
|
@ -70,21 +70,21 @@ import love.distributedrebirth.nx01.warp.manifestor.scopic.iomf4.ScopicManifest4
|
|||
public enum WarpManifestorDriver {
|
||||
亞;
|
||||
|
||||
public WarpManifest3 readV1String(String input) {
|
||||
public WarpManifestX8 readV1String(String input) {
|
||||
return readV1Array(input.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
public WarpManifest3 readV1Buffer(ByteBuffer input) {
|
||||
public WarpManifestX8 readV1Buffer(ByteBuffer input) {
|
||||
return readV1Array(input.array());
|
||||
}
|
||||
|
||||
public WarpManifest3 readV1Array(byte[] input) {
|
||||
public WarpManifestX8 readV1Array(byte[] input) {
|
||||
return readV1Stream(new ByteArrayInputStream(input));
|
||||
}
|
||||
|
||||
public WarpManifest3 readV1Stream(InputStream input) {
|
||||
WarpManifest3 result = new WarpManifest3();
|
||||
ScopicManifestContentStringHandler handler = new ScopicManifestContentStringHandler(result, WarpManifestTheVersion.VERSION_1_0);
|
||||
public WarpManifestX8 readV1Stream(InputStream input) {
|
||||
WarpManifestX8 result = new WarpManifestX8();
|
||||
ScopicManifestContentStringHandler handler = new ScopicManifestContentStringHandler(result, WarpManifestX0TheVersion.VERSION_1_0);
|
||||
ScopicManifestContentReader reader = new ScopicManifestContentReader(handler, ScopicManifestContentReader.FORCE_VERSION_1_0);
|
||||
try {
|
||||
reader.parse(input);
|
||||
|
@ -94,21 +94,21 @@ public enum WarpManifestorDriver {
|
|||
return result;
|
||||
}
|
||||
|
||||
public WarpManifest3 readV2String(String input) {
|
||||
public WarpManifestX8 readV2String(String input) {
|
||||
return readV2Array(input.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
public WarpManifest3 readV2Buffer(ByteBuffer input) {
|
||||
public WarpManifestX8 readV2Buffer(ByteBuffer input) {
|
||||
return readV2Array(input.array());
|
||||
}
|
||||
|
||||
public WarpManifest3 readV2Array(byte[] input) {
|
||||
public WarpManifestX8 readV2Array(byte[] input) {
|
||||
return readV2Stream(new ByteArrayInputStream(input));
|
||||
}
|
||||
|
||||
public WarpManifest3 readV2Stream(InputStream input) {
|
||||
WarpManifest3 result = new WarpManifest3();
|
||||
ScopicManifestContentStringHandler handler = new ScopicManifestContentStringHandler(result, WarpManifestTheVersion.VERSION_1_0, WarpManifestTheVersion.VERSION_2_0);
|
||||
public WarpManifestX8 readV2Stream(InputStream input) {
|
||||
WarpManifestX8 result = new WarpManifestX8();
|
||||
ScopicManifestContentStringHandler handler = new ScopicManifestContentStringHandler(result, WarpManifestX0TheVersion.VERSION_1_0, WarpManifestX0TheVersion.VERSION_2_0);
|
||||
ScopicManifestContentReader reader = new ScopicManifestContentReader(handler);
|
||||
try {
|
||||
reader.parse(input);
|
||||
|
@ -118,22 +118,22 @@ public enum WarpManifestorDriver {
|
|||
return result;
|
||||
}
|
||||
|
||||
public WarpManifest3 readV3Buffer(ByteBuffer input) {
|
||||
public WarpManifestX8 readV3Buffer(ByteBuffer input) {
|
||||
return readV3Array(input.array());
|
||||
}
|
||||
|
||||
public WarpManifest3 readV3Array(byte[] input) {
|
||||
public WarpManifestX8 readV3Array(byte[] input) {
|
||||
return readV3Stream(new ByteArrayInputStream(input));
|
||||
}
|
||||
|
||||
public WarpManifest3 readV3Stream(InputStream input) {
|
||||
WarpManifest3 result = new WarpManifest3();
|
||||
ScopicManifestContentStringHandler handler = new ScopicManifestContentStringHandler(result, WarpManifestTheVersion.VERSION_3_0);
|
||||
public WarpManifestX8 readV3Stream(InputStream input) {
|
||||
WarpManifestX8 result = new WarpManifestX8();
|
||||
ScopicManifestContentStringHandler handler = new ScopicManifestContentStringHandler(result, WarpManifestX0TheVersion.VERSION_3_0);
|
||||
ScopicManifest3ContentReader reader = new ScopicManifest3ContentReader(handler);
|
||||
TLVChainSexTeenBit chain = new TLVChainSexTeenBit();
|
||||
try {
|
||||
WarpManifestTheMimeType mimeType = WarpManifestTheMimeType.magicMarkerRead(input, WarpManifestTheMimeType.MARKER_3_LENGTH);
|
||||
if (!WarpManifestTheMimeType.MANIFEST_3.equals(mimeType)) {
|
||||
WarpManifestX0TheMimeType mimeType = WarpManifestX0TheMimeType.magicMarkerRead(input, WarpManifestX0TheMimeType.MARKER_3_LENGTH);
|
||||
if (!WarpManifestX0TheMimeType.MANIFEST_3.equals(mimeType)) {
|
||||
throw new ScopicManifestException("Invalid stream magic marker: " + mimeType); // TODO: move and change magicMarkerRead(in,enum)
|
||||
}
|
||||
chain.dataReadStream(input);
|
||||
|
@ -144,22 +144,22 @@ public enum WarpManifestorDriver {
|
|||
return result;
|
||||
}
|
||||
|
||||
public WarpManifest4 readV4Buffer(ByteBuffer input) {
|
||||
public WarpManifestX18 readV4Buffer(ByteBuffer input) {
|
||||
return readV4Array(input.array());
|
||||
}
|
||||
|
||||
public WarpManifest4 readV4Array(byte[] input) {
|
||||
public WarpManifestX18 readV4Array(byte[] input) {
|
||||
return readV4Stream(new ByteArrayInputStream(input));
|
||||
}
|
||||
|
||||
public WarpManifest4 readV4Stream(InputStream input) {
|
||||
WarpManifest4 result = new WarpManifest4();
|
||||
public WarpManifestX18 readV4Stream(InputStream input) {
|
||||
WarpManifestX18 result = new WarpManifestX18();
|
||||
ScopicManifest4ContentHandler handler = new ScopicManifest4ContentHandler(result);
|
||||
ScopicManifest4ContentReader reader = new ScopicManifest4ContentReader(handler);
|
||||
TLVChainOctalSex chain = new TLVChainOctalSex();
|
||||
try {
|
||||
WarpManifestTheMimeType mimeType = WarpManifestTheMimeType.magicMarkerRead(input, WarpManifestTheMimeType.MARKER_4_LENGTH);
|
||||
if (!WarpManifestTheMimeType.MANIFEST_4.equals(mimeType)) {
|
||||
WarpManifestX0TheMimeType mimeType = WarpManifestX0TheMimeType.magicMarkerRead(input, WarpManifestX0TheMimeType.MARKER_4_LENGTH);
|
||||
if (!WarpManifestX0TheMimeType.MANIFEST_4.equals(mimeType)) {
|
||||
throw new ScopicManifestException("Invalid stream magic marker: " + mimeType); // TODO: move and change magicMarkerRead(in,enum)
|
||||
}
|
||||
chain.dataReadStream(input);
|
||||
|
@ -170,20 +170,20 @@ public enum WarpManifestorDriver {
|
|||
return result;
|
||||
}
|
||||
|
||||
public WarpManifest3 readViniString(String input) {
|
||||
public WarpManifestX8 readViniString(String input) {
|
||||
return readViniArray(input.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
public WarpManifest3 readViniBuffer(ByteBuffer input) {
|
||||
public WarpManifestX8 readViniBuffer(ByteBuffer input) {
|
||||
return readViniArray(input.array());
|
||||
}
|
||||
|
||||
public WarpManifest3 readViniArray(byte[] input) {
|
||||
public WarpManifestX8 readViniArray(byte[] input) {
|
||||
return readViniStream(new ByteArrayInputStream(input));
|
||||
}
|
||||
|
||||
public WarpManifest3 readViniStream(InputStream input) {
|
||||
WarpManifest3 result = new WarpManifest3();
|
||||
public WarpManifestX8 readViniStream(InputStream input) {
|
||||
WarpManifestX8 result = new WarpManifestX8();
|
||||
ScopicManifestContentStringHandler handler = new ScopicManifestContentStringHandler(result);
|
||||
ScopicIniContentReader reader = new ScopicIniContentReader(handler);
|
||||
try {
|
||||
|
@ -195,23 +195,23 @@ public enum WarpManifestorDriver {
|
|||
}
|
||||
|
||||
// An "geniface" for complex generics would be nice, note all this generics is only to add 2 default methods in a interface...
|
||||
private <T, M extends WarpManifest2<T, M, H, S>, H extends WarpManifest2HeaderField<T, H>, S extends WarpManifest2Section<T, H, S>> void strobelight(WarpManifest2<T, M, H, S> manifest, ScopicManifestContent<T> writer, T version) {
|
||||
private <T, M extends WarpManifestX0<T, M, H, S>, H extends WarpManifestX0HeaderField<T, H>, S extends WarpManifestX0Section<T, H, S>> void strobelight(WarpManifestX0<T, M, H, S> manifest, ScopicManifestContent<T> writer, T version) {
|
||||
writer.strobeManifestStart();
|
||||
writer.strobeManifestDeclaration(Objects.requireNonNull(version, "Can't print null version"));
|
||||
for (WarpManifest2HeaderField<T, H> mainAttr : manifest.getAttributes()) {
|
||||
for (WarpManifestX0HeaderField<T, H> mainAttr : manifest.getAttributes()) {
|
||||
Objects.requireNonNull(mainAttr.getName(), "Can't print null attribute name");
|
||||
for (T remarkValue : mainAttr.getRemarks()) {
|
||||
writer.strobeRemarkContent(remarkValue);
|
||||
}
|
||||
writer.strobeMainAttribute(mainAttr.getName(), mainAttr.getBody());
|
||||
}
|
||||
for (WarpManifest2Section<T, H, S> section : manifest.getSections()) {
|
||||
for (WarpManifestX0Section<T, H, S> section : manifest.getSections()) {
|
||||
Objects.requireNonNull(section.getName(), "Can't print null section name");
|
||||
for (T remarkValue : section.getRemarks()) {
|
||||
writer.strobeRemarkContent(remarkValue);
|
||||
}
|
||||
writer.strobeSectionHeader(section.getName());
|
||||
for (WarpManifest2HeaderField<T, H> sectionAttr : section.getAttributes()) {
|
||||
for (WarpManifestX0HeaderField<T, H> sectionAttr : section.getAttributes()) {
|
||||
Objects.requireNonNull(sectionAttr.getName(), "Can't print null section attribute name");
|
||||
for (T remarkValue : sectionAttr.getRemarks()) {
|
||||
writer.strobeRemarkContent(remarkValue);
|
||||
|
@ -222,87 +222,87 @@ public enum WarpManifestorDriver {
|
|||
writer.strobeManifestEnd();
|
||||
}
|
||||
|
||||
public String writeV1String(WarpManifest3 manifest) {
|
||||
public String writeV1String(WarpManifestX8 manifest) {
|
||||
StringWriter writer = new StringWriter();
|
||||
writeV1StreamChar(manifest, writer);
|
||||
return writer.toString();
|
||||
}
|
||||
|
||||
public void writeV1Stream(WarpManifest3 manifest, OutputStream output) {
|
||||
public void writeV1Stream(WarpManifestX8 manifest, OutputStream output) {
|
||||
writeV1StreamChar(manifest, new OutputStreamWriter(output, StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
public void writeV1StreamChar(WarpManifest3 manifest, Writer output) {
|
||||
strobelight(manifest, new ScopicManifestContentWriter(output), WarpManifestTheVersion.VERSION_1_0.getQName());
|
||||
public void writeV1StreamChar(WarpManifestX8 manifest, Writer output) {
|
||||
strobelight(manifest, new ScopicManifestContentWriter(output), WarpManifestX0TheVersion.VERSION_1_0.getQName());
|
||||
}
|
||||
|
||||
public String writeV2String(WarpManifest3 manifest) {
|
||||
public String writeV2String(WarpManifestX8 manifest) {
|
||||
StringWriter writer = new StringWriter();
|
||||
writeV2StreamChar(manifest, writer);
|
||||
return writer.toString();
|
||||
}
|
||||
|
||||
public void writeV2Stream(WarpManifest3 manifest, OutputStream output) {
|
||||
public void writeV2Stream(WarpManifestX8 manifest, OutputStream output) {
|
||||
writeV2StreamChar(manifest, new OutputStreamWriter(output, StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
public void writeV2StreamChar(WarpManifest3 manifest, Writer output) {
|
||||
strobelight(manifest, new ScopicManifestContentWriter(output), WarpManifestTheVersion.VERSION_2_0.getQName());
|
||||
public void writeV2StreamChar(WarpManifestX8 manifest, Writer output) {
|
||||
strobelight(manifest, new ScopicManifestContentWriter(output), WarpManifestX0TheVersion.VERSION_2_0.getQName());
|
||||
}
|
||||
|
||||
public ByteBuffer writeV3Buffer(WarpManifest3 manifest) {
|
||||
public ByteBuffer writeV3Buffer(WarpManifestX8 manifest) {
|
||||
return ByteBuffer.wrap(writeV3Array(manifest));
|
||||
}
|
||||
|
||||
public byte[] writeV3Array(WarpManifest3 manifest) {
|
||||
public byte[] writeV3Array(WarpManifestX8 manifest) {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
writeV3Stream(manifest, baos);
|
||||
return baos.toByteArray();
|
||||
}
|
||||
|
||||
public void writeV3Stream(WarpManifest3 manifest, OutputStream output) {
|
||||
public void writeV3Stream(WarpManifestX8 manifest, OutputStream output) {
|
||||
TLVChainSexTeenBit chain = new TLVChainSexTeenBit();
|
||||
strobelight(manifest, new ScopicManifest3ContentWriter(chain), WarpManifestTheVersion.VERSION_3_0.getQName());
|
||||
strobelight(manifest, new ScopicManifest3ContentWriter(chain), WarpManifestX0TheVersion.VERSION_3_0.getQName());
|
||||
try {
|
||||
WarpManifestTheMimeType.magicMarkerWrite(output, WarpManifestTheMimeType.MANIFEST_3);
|
||||
WarpManifestX0TheMimeType.magicMarkerWrite(output, WarpManifestX0TheMimeType.MANIFEST_3);
|
||||
chain.dataWriteStream(output);
|
||||
} catch (IOException e) {
|
||||
throw new ScopicManifestException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public ByteBuffer writeV4Buffer(WarpManifest4 manifest) {
|
||||
public ByteBuffer writeV4Buffer(WarpManifestX18 manifest) {
|
||||
return ByteBuffer.wrap(writeV4Array(manifest));
|
||||
}
|
||||
|
||||
public byte[] writeV4Array(WarpManifest4 manifest) {
|
||||
public byte[] writeV4Array(WarpManifestX18 manifest) {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
writeV4Stream(manifest, baos);
|
||||
return baos.toByteArray();
|
||||
}
|
||||
|
||||
public void writeV4Stream(WarpManifest4 manifest, OutputStream output) {
|
||||
public void writeV4Stream(WarpManifestX18 manifest, OutputStream output) {
|
||||
TLVChainOctalSex chain = new TLVChainOctalSex();
|
||||
strobelight(manifest, new ScopicManifest4ContentWriter(chain), WarpManifestTheVersion.VERSION_4_0);
|
||||
strobelight(manifest, new ScopicManifest4ContentWriter(chain), WarpManifestX0TheVersion.VERSION_4_0);
|
||||
try {
|
||||
WarpManifestTheMimeType.magicMarkerWrite(output, WarpManifestTheMimeType.MANIFEST_4);
|
||||
WarpManifestX0TheMimeType.magicMarkerWrite(output, WarpManifestX0TheMimeType.MANIFEST_4);
|
||||
chain.dataWriteStream(output);
|
||||
} catch (IOException e) {
|
||||
throw new ScopicManifestException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public String writeViniString(WarpManifest3 manifest) {
|
||||
public String writeViniString(WarpManifestX8 manifest) {
|
||||
StringWriter writer = new StringWriter();
|
||||
writeViniStreamChar(manifest, writer);
|
||||
return writer.toString();
|
||||
}
|
||||
|
||||
public void writeViniStream(WarpManifest3 manifest, OutputStream output) {
|
||||
public void writeViniStream(WarpManifestX8 manifest, OutputStream output) {
|
||||
writeViniStreamChar(manifest, new OutputStreamWriter(output, StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
public void writeViniStreamChar(WarpManifest3 manifest, Writer output) {
|
||||
public void writeViniStreamChar(WarpManifestX8 manifest, Writer output) {
|
||||
strobelight(manifest, new ScopicIniContentWriter(output), ScopicIniConstants.VERSION_NEW_TESTAMENT);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,19 +30,19 @@ package love.distributedrebirth.nx01.warp.manifestor.manifest;
|
|||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/// Warp manifest2 model.
|
||||
/// Warp manifest 0 bit model.
|
||||
///
|
||||
/// @author للَّٰهِilLצسُو
|
||||
/// @version ©Δ∞ 仙上主天
|
||||
public interface WarpManifest2<T, M extends WarpManifest2<T, M, H, S>, H extends WarpManifest2HeaderField<T, H>, S extends WarpManifest2Section<T, H, S>> {
|
||||
public interface WarpManifestX0<T, M extends WarpManifestX0<T, M, H, S>, H extends WarpManifestX0HeaderField<T, H>, S extends WarpManifestX0Section<T, H, S>> {
|
||||
|
||||
List<H> getAttributes();
|
||||
|
||||
H makeAttribute(T name, T body);
|
||||
|
||||
WarpManifest2<T, M, H, S> withAttribute(T name, T body);
|
||||
WarpManifestX0<T, M, H, S> withAttribute(T name, T body);
|
||||
|
||||
WarpManifest2<T, M, H, S> withAttributes(List<H> attrbutes);
|
||||
WarpManifestX0<T, M, H, S> withAttributes(List<H> attrbutes);
|
||||
|
||||
default boolean hasAttribute(T attributeName) {
|
||||
for (H attr : getAttributes()) {
|
|
@ -29,11 +29,11 @@ package love.distributedrebirth.nx01.warp.manifestor.manifest;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
/// Warp manifest2 name value pair entry.
|
||||
/// Warp manifest 0 bit name value pair entry.
|
||||
///
|
||||
/// @author للَّٰهِilLצسُو
|
||||
/// @version ©Δ∞ 仙上主天
|
||||
public interface WarpManifest2HeaderField<T, H extends WarpManifest2HeaderField<T, H>> {
|
||||
public interface WarpManifestX0HeaderField<T, H extends WarpManifestX0HeaderField<T, H>> {
|
||||
|
||||
T getName();
|
||||
|
|
@ -30,11 +30,11 @@ package love.distributedrebirth.nx01.warp.manifestor.manifest;
|
|||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/// Warp manifest2 section.
|
||||
/// Warp manifest 0 bit section.
|
||||
///
|
||||
/// @author للَّٰهِilLצسُو
|
||||
/// @version ©Δ∞ 仙上主天
|
||||
public interface WarpManifest2Section<T, H extends WarpManifest2HeaderField<T, H>, S extends WarpManifest2Section<T, H, S>> {
|
||||
public interface WarpManifestX0Section<T, H extends WarpManifestX0HeaderField<T, H>, S extends WarpManifestX0Section<T, H, S>> {
|
||||
|
||||
T getName();
|
||||
|
|
@ -35,11 +35,11 @@ import java.util.Optional;
|
|||
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
|
||||
|
||||
/// Warp manifest schema of the mime types and magic markers.
|
||||
/// Warp manifest 0 bit schema of the mime types and magic markers.
|
||||
///
|
||||
/// @author للَّٰهِilLצسُو
|
||||
/// @version ©Δ∞ 仙上主天
|
||||
public enum WarpManifestTheMimeType {
|
||||
public enum WarpManifestX0TheMimeType {
|
||||
|
||||
MANIFEST_1 ("application/manifest", "MF", null),
|
||||
MANIFEST_2 ("application/manifest2", "MF2", null),
|
||||
|
@ -56,7 +56,7 @@ public enum WarpManifestTheMimeType {
|
|||
private final String qExtension;
|
||||
private final byte[] qMagicMarker;
|
||||
|
||||
private WarpManifestTheMimeType(String qName, String qExtension, byte[] qMagicMarker) {
|
||||
private WarpManifestX0TheMimeType(String qName, String qExtension, byte[] qMagicMarker) {
|
||||
this.qName = qName;
|
||||
this.qExtension = qExtension;
|
||||
this.qMagicMarker = qMagicMarker;
|
||||
|
@ -78,8 +78,8 @@ public enum WarpManifestTheMimeType {
|
|||
return qMagicMarker;
|
||||
}
|
||||
|
||||
static public Optional<WarpManifestTheMimeType> valueOfQName(String qName) {
|
||||
for (WarpManifestTheMimeType mimeType : WarpManifestTheMimeType.values()) {
|
||||
static public Optional<WarpManifestX0TheMimeType> valueOfQName(String qName) {
|
||||
for (WarpManifestX0TheMimeType mimeType : WarpManifestX0TheMimeType.values()) {
|
||||
if (mimeType.getQName().equals(qName)) {
|
||||
return Optional.of(mimeType);
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ public enum WarpManifestTheMimeType {
|
|||
return Optional.empty();
|
||||
}
|
||||
|
||||
static public WarpManifestTheMimeType magicMarkerRead(InputStream input, int markerLength) throws IOException {
|
||||
static public WarpManifestX0TheMimeType magicMarkerRead(InputStream input, int markerLength) throws IOException {
|
||||
byte[] magicPrefix;
|
||||
if (markerLength == MARKER_3_LENGTH) {
|
||||
magicPrefix = input.readNBytes(markerLength);
|
||||
|
@ -96,7 +96,7 @@ public enum WarpManifestTheMimeType {
|
|||
} else {
|
||||
throw new ScopicManifestException("Unsupported marker length: " + markerLength);
|
||||
}
|
||||
for (WarpManifestTheMimeType mimeType : WarpManifestTheMimeType.values()) {
|
||||
for (WarpManifestX0TheMimeType mimeType : WarpManifestX0TheMimeType.values()) {
|
||||
if (mimeType.getQMagicMarker() == null) {
|
||||
continue;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ public enum WarpManifestTheMimeType {
|
|||
throw new ScopicManifestException("Unsupported marker: " + Arrays.toString(magicPrefix));
|
||||
}
|
||||
|
||||
static public void magicMarkerWrite(OutputStream output, WarpManifestTheMimeType marker) throws IOException {
|
||||
static public void magicMarkerWrite(OutputStream output, WarpManifestX0TheMimeType marker) throws IOException {
|
||||
if (marker.getQMagicMarker() == null) {
|
||||
return;
|
||||
}
|
|
@ -33,11 +33,11 @@ import java.util.Optional;
|
|||
import org.x4o.o2o.octal.PrimordialOctalOrangeJuiceCord;
|
||||
import org.x4o.o2o.octal.PrimordialOctalOrangeString;
|
||||
|
||||
/// Warp manifest schema of the version.
|
||||
/// Warp manifest 0 bit schema of the version.
|
||||
///
|
||||
/// @author للَّٰهِilLצسُو
|
||||
/// @version ©Δ∞ 仙上主天
|
||||
public enum WarpManifestTheVersion {
|
||||
public enum WarpManifestX0TheVersion {
|
||||
|
||||
/// Format: teapot-ascii
|
||||
VERSION_1_0("1.0"),
|
||||
|
@ -62,7 +62,7 @@ public enum WarpManifestTheVersion {
|
|||
|
||||
private final String qName;
|
||||
|
||||
private WarpManifestTheVersion(String qName) {
|
||||
private WarpManifestX0TheVersion(String qName) {
|
||||
this.qName = qName;
|
||||
}
|
||||
|
||||
|
@ -70,8 +70,8 @@ public enum WarpManifestTheVersion {
|
|||
return qName;
|
||||
}
|
||||
|
||||
public static Optional<WarpManifestTheVersion> valueOfQName(String qName) {
|
||||
for (WarpManifestTheVersion version : WarpManifestTheVersion.values()) {
|
||||
public static Optional<WarpManifestX0TheVersion> valueOfQName(String qName) {
|
||||
for (WarpManifestX0TheVersion version : WarpManifestX0TheVersion.values()) {
|
||||
if (version.getQName().equals(qName)) {
|
||||
return Optional.of(version);
|
||||
}
|
|
@ -32,58 +32,58 @@ import java.util.List;
|
|||
|
||||
import org.x4o.o2o.octal.PrimordialOctalOrangeJuiceCord;
|
||||
|
||||
/// Warp manifest4 model.
|
||||
/// Warp manifest 18 bit model.
|
||||
///
|
||||
/// @author للَّٰهِilLצسُو
|
||||
/// @version ©Δ∞ 仙上主天
|
||||
public final class WarpManifest4 implements WarpManifest2<PrimordialOctalOrangeJuiceCord, WarpManifest4, WarpManifest4HeaderField, WarpManifest4Section> {
|
||||
public final class WarpManifestX18 implements WarpManifestX0<PrimordialOctalOrangeJuiceCord, WarpManifestX18, WarpManifestX18HeaderField, WarpManifestX18Section> {
|
||||
|
||||
private final List<WarpManifest4HeaderField> attributes;
|
||||
private final List<WarpManifest4Section> sections;
|
||||
private final List<WarpManifestX18HeaderField> attributes;
|
||||
private final List<WarpManifestX18Section> sections;
|
||||
|
||||
public WarpManifest4() {
|
||||
public WarpManifestX18() {
|
||||
this.attributes = new ArrayList<>();
|
||||
this.sections = new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WarpManifest4HeaderField> getAttributes() {
|
||||
public List<WarpManifestX18HeaderField> getAttributes() {
|
||||
return attributes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest4HeaderField makeAttribute(PrimordialOctalOrangeJuiceCord name, PrimordialOctalOrangeJuiceCord body) {
|
||||
WarpManifest4HeaderField result = new WarpManifest4HeaderField(name, body);
|
||||
public WarpManifestX18HeaderField makeAttribute(PrimordialOctalOrangeJuiceCord name, PrimordialOctalOrangeJuiceCord body) {
|
||||
WarpManifestX18HeaderField result = new WarpManifestX18HeaderField(name, body);
|
||||
this.attributes.add(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest4 withAttribute(PrimordialOctalOrangeJuiceCord name, PrimordialOctalOrangeJuiceCord body) {
|
||||
public WarpManifestX18 withAttribute(PrimordialOctalOrangeJuiceCord name, PrimordialOctalOrangeJuiceCord body) {
|
||||
makeAttribute(name, body);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest4 withAttributes(List<WarpManifest4HeaderField> attributes) {
|
||||
public WarpManifestX18 withAttributes(List<WarpManifestX18HeaderField> attributes) {
|
||||
this.attributes.addAll(attributes);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WarpManifest4Section> getSections() {
|
||||
public List<WarpManifestX18Section> getSections() {
|
||||
return this.sections;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest4Section makeSection(PrimordialOctalOrangeJuiceCord sectionName) {
|
||||
WarpManifest4Section result = new WarpManifest4Section(sectionName);
|
||||
public WarpManifestX18Section makeSection(PrimordialOctalOrangeJuiceCord sectionName) {
|
||||
WarpManifestX18Section result = new WarpManifestX18Section(sectionName);
|
||||
this.sections.add(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest4 withSections(List<WarpManifest4Section> sections) {
|
||||
public WarpManifestX18 withSections(List<WarpManifestX18Section> sections) {
|
||||
this.sections.addAll(sections);
|
||||
return this;
|
||||
}
|
|
@ -32,21 +32,21 @@ import java.util.List;
|
|||
|
||||
import org.x4o.o2o.octal.PrimordialOctalOrangeJuiceCord;
|
||||
|
||||
/// Warp manifest4 name value pair entry.
|
||||
/// Warp manifest 18 bit name value pair entry.
|
||||
///
|
||||
/// @author للَّٰهِilLצسُو
|
||||
/// @version ©Δ∞ 仙上主天
|
||||
public final class WarpManifest4HeaderField implements WarpManifest2HeaderField<PrimordialOctalOrangeJuiceCord, WarpManifest4HeaderField> {
|
||||
public final class WarpManifestX18HeaderField implements WarpManifestX0HeaderField<PrimordialOctalOrangeJuiceCord, WarpManifestX18HeaderField> {
|
||||
|
||||
private PrimordialOctalOrangeJuiceCord name;
|
||||
private PrimordialOctalOrangeJuiceCord body;
|
||||
private final List<PrimordialOctalOrangeJuiceCord> remarks;
|
||||
|
||||
public WarpManifest4HeaderField() {
|
||||
public WarpManifestX18HeaderField() {
|
||||
this.remarks = new ArrayList<>();
|
||||
}
|
||||
|
||||
public WarpManifest4HeaderField(PrimordialOctalOrangeJuiceCord name, PrimordialOctalOrangeJuiceCord body) {
|
||||
public WarpManifestX18HeaderField(PrimordialOctalOrangeJuiceCord name, PrimordialOctalOrangeJuiceCord body) {
|
||||
this();
|
||||
this.name = name;
|
||||
this.body = body;
|
||||
|
@ -78,13 +78,13 @@ public final class WarpManifest4HeaderField implements WarpManifest2HeaderField<
|
|||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest4HeaderField withRemark(PrimordialOctalOrangeJuiceCord remark) {
|
||||
public WarpManifestX18HeaderField withRemark(PrimordialOctalOrangeJuiceCord remark) {
|
||||
this.remarks.add(remark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest4HeaderField withRemarks(List<PrimordialOctalOrangeJuiceCord> remarks) {
|
||||
public WarpManifestX18HeaderField withRemarks(List<PrimordialOctalOrangeJuiceCord> remarks) {
|
||||
this.remarks.addAll(remarks);
|
||||
return this;
|
||||
}
|
|
@ -32,22 +32,22 @@ import java.util.List;
|
|||
|
||||
import org.x4o.o2o.octal.PrimordialOctalOrangeJuiceCord;
|
||||
|
||||
/// Warp manifest4 section.
|
||||
/// Warp manifest 18 bit section.
|
||||
///
|
||||
/// @author للَّٰهِilLצسُو
|
||||
/// @version ©Δ∞ 仙上主天
|
||||
public final class WarpManifest4Section implements WarpManifest2Section<PrimordialOctalOrangeJuiceCord, WarpManifest4HeaderField, WarpManifest4Section> {
|
||||
public final class WarpManifestX18Section implements WarpManifestX0Section<PrimordialOctalOrangeJuiceCord, WarpManifestX18HeaderField, WarpManifestX18Section> {
|
||||
|
||||
private PrimordialOctalOrangeJuiceCord name;
|
||||
private final List<WarpManifest4HeaderField> attributes;
|
||||
private final List<WarpManifestX18HeaderField> attributes;
|
||||
private final List<PrimordialOctalOrangeJuiceCord> remarks;
|
||||
|
||||
public WarpManifest4Section() {
|
||||
public WarpManifestX18Section() {
|
||||
this.attributes = new ArrayList<>();
|
||||
this.remarks = new ArrayList<>();
|
||||
}
|
||||
|
||||
public WarpManifest4Section(PrimordialOctalOrangeJuiceCord name) {
|
||||
public WarpManifestX18Section(PrimordialOctalOrangeJuiceCord name) {
|
||||
this();
|
||||
this.name = name;
|
||||
}
|
||||
|
@ -63,26 +63,26 @@ public final class WarpManifest4Section implements WarpManifest2Section<Primordi
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<WarpManifest4HeaderField> getAttributes() {
|
||||
public List<WarpManifestX18HeaderField> getAttributes() {
|
||||
return attributes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest4HeaderField makeAttribute(PrimordialOctalOrangeJuiceCord name, PrimordialOctalOrangeJuiceCord body) {
|
||||
WarpManifest4HeaderField result = new WarpManifest4HeaderField(name, body);
|
||||
public WarpManifestX18HeaderField makeAttribute(PrimordialOctalOrangeJuiceCord name, PrimordialOctalOrangeJuiceCord body) {
|
||||
WarpManifestX18HeaderField result = new WarpManifestX18HeaderField(name, body);
|
||||
attributes.add(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest4Section withAttribute(PrimordialOctalOrangeJuiceCord name, PrimordialOctalOrangeJuiceCord body) {
|
||||
WarpManifest4HeaderField result = new WarpManifest4HeaderField(name, body);
|
||||
public WarpManifestX18Section withAttribute(PrimordialOctalOrangeJuiceCord name, PrimordialOctalOrangeJuiceCord body) {
|
||||
WarpManifestX18HeaderField result = new WarpManifestX18HeaderField(name, body);
|
||||
attributes.add(result);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest4Section withAttributes(List<WarpManifest4HeaderField> attributes) {
|
||||
public WarpManifestX18Section withAttributes(List<WarpManifestX18HeaderField> attributes) {
|
||||
this.attributes.addAll(attributes);
|
||||
return this;
|
||||
}
|
||||
|
@ -93,13 +93,13 @@ public final class WarpManifest4Section implements WarpManifest2Section<Primordi
|
|||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest4Section withRemark(PrimordialOctalOrangeJuiceCord remark) {
|
||||
public WarpManifestX18Section withRemark(PrimordialOctalOrangeJuiceCord remark) {
|
||||
this.remarks.add(remark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest4Section withRemarks(List<PrimordialOctalOrangeJuiceCord> remarks) {
|
||||
public WarpManifestX18Section withRemarks(List<PrimordialOctalOrangeJuiceCord> remarks) {
|
||||
this.remarks.addAll(remarks);
|
||||
return this;
|
||||
}
|
|
@ -30,58 +30,58 @@ package love.distributedrebirth.nx01.warp.manifestor.manifest;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/// Warp manifest3 model.
|
||||
/// Warp manifest 8 bit model.
|
||||
///
|
||||
/// @author للَّٰهِilLצسُو
|
||||
/// @version ©Δ∞ 仙上主天
|
||||
public final class WarpManifest3 implements WarpManifest2<String, WarpManifest3, WarpManifest3HeaderField, WarpManifest3Section> {
|
||||
public final class WarpManifestX8 implements WarpManifestX0<String, WarpManifestX8, WarpManifestX8HeaderField, WarpManifestX8Section> {
|
||||
|
||||
private final List<WarpManifest3HeaderField> attributes;
|
||||
private final List<WarpManifest3Section> sections;
|
||||
private final List<WarpManifestX8HeaderField> attributes;
|
||||
private final List<WarpManifestX8Section> sections;
|
||||
|
||||
public WarpManifest3() {
|
||||
public WarpManifestX8() {
|
||||
this.attributes = new ArrayList<>();
|
||||
this.sections = new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WarpManifest3HeaderField> getAttributes() {
|
||||
public List<WarpManifestX8HeaderField> getAttributes() {
|
||||
return this.attributes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest3HeaderField makeAttribute(String name, String body) {
|
||||
WarpManifest3HeaderField result = new WarpManifest3HeaderField(name, body);
|
||||
public WarpManifestX8HeaderField makeAttribute(String name, String body) {
|
||||
WarpManifestX8HeaderField result = new WarpManifestX8HeaderField(name, body);
|
||||
this.attributes.add(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest3 withAttribute(String name, String body) {
|
||||
public WarpManifestX8 withAttribute(String name, String body) {
|
||||
makeAttribute(name, body);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest3 withAttributes(List<WarpManifest3HeaderField> attributes) {
|
||||
public WarpManifestX8 withAttributes(List<WarpManifestX8HeaderField> attributes) {
|
||||
this.attributes.addAll(attributes);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WarpManifest3Section> getSections() {
|
||||
public List<WarpManifestX8Section> getSections() {
|
||||
return this.sections;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest3Section makeSection(String sectionName) {
|
||||
WarpManifest3Section result = new WarpManifest3Section(sectionName);
|
||||
public WarpManifestX8Section makeSection(String sectionName) {
|
||||
WarpManifestX8Section result = new WarpManifestX8Section(sectionName);
|
||||
this.sections.add(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest3 withSections(List<WarpManifest3Section> sections) {
|
||||
public WarpManifestX8 withSections(List<WarpManifestX8Section> sections) {
|
||||
this.sections.addAll(sections);
|
||||
return this;
|
||||
}
|
|
@ -30,21 +30,21 @@ package love.distributedrebirth.nx01.warp.manifestor.manifest;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/// Warp manifest3 name value pair entry.
|
||||
/// Warp manifest 8 bit name value pair entry.
|
||||
///
|
||||
/// @author للَّٰهِilLצسُو
|
||||
/// @version ©Δ∞ 仙上主天
|
||||
public final class WarpManifest3HeaderField implements WarpManifest2HeaderField<String, WarpManifest3HeaderField> {
|
||||
public final class WarpManifestX8HeaderField implements WarpManifestX0HeaderField<String, WarpManifestX8HeaderField> {
|
||||
|
||||
private String name;
|
||||
private String body;
|
||||
private final List<String> remarks;
|
||||
|
||||
public WarpManifest3HeaderField() {
|
||||
public WarpManifestX8HeaderField() {
|
||||
this.remarks = new ArrayList<>();
|
||||
}
|
||||
|
||||
public WarpManifest3HeaderField(String name, String body) {
|
||||
public WarpManifestX8HeaderField(String name, String body) {
|
||||
this();
|
||||
this.name = name;
|
||||
this.body = body;
|
||||
|
@ -76,13 +76,13 @@ public final class WarpManifest3HeaderField implements WarpManifest2HeaderField<
|
|||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest3HeaderField withRemark(String remark) {
|
||||
public WarpManifestX8HeaderField withRemark(String remark) {
|
||||
this.remarks.add(remark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest3HeaderField withRemarks(List<String> remarks) {
|
||||
public WarpManifestX8HeaderField withRemarks(List<String> remarks) {
|
||||
this.remarks.addAll(remarks);
|
||||
return this;
|
||||
}
|
|
@ -30,22 +30,22 @@ package love.distributedrebirth.nx01.warp.manifestor.manifest;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/// Warp manifest3 section.
|
||||
/// Warp manifest 8 bit section.
|
||||
///
|
||||
/// @author للَّٰهِilLצسُو
|
||||
/// @version ©Δ∞ 仙上主天
|
||||
public final class WarpManifest3Section implements WarpManifest2Section<String, WarpManifest3HeaderField, WarpManifest3Section> {
|
||||
public final class WarpManifestX8Section implements WarpManifestX0Section<String, WarpManifestX8HeaderField, WarpManifestX8Section> {
|
||||
|
||||
private String name;
|
||||
private final List<WarpManifest3HeaderField> attributes;
|
||||
private final List<WarpManifestX8HeaderField> attributes;
|
||||
private final List<String> remarks;
|
||||
|
||||
public WarpManifest3Section() {
|
||||
public WarpManifestX8Section() {
|
||||
this.attributes = new ArrayList<>();
|
||||
this.remarks = new ArrayList<>();
|
||||
}
|
||||
|
||||
public WarpManifest3Section(String name) {
|
||||
public WarpManifestX8Section(String name) {
|
||||
this();
|
||||
this.name = name;
|
||||
}
|
||||
|
@ -61,26 +61,26 @@ public final class WarpManifest3Section implements WarpManifest2Section<String,
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<WarpManifest3HeaderField> getAttributes() {
|
||||
public List<WarpManifestX8HeaderField> getAttributes() {
|
||||
return attributes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest3HeaderField makeAttribute(String name, String body) {
|
||||
WarpManifest3HeaderField result = new WarpManifest3HeaderField(name, body);
|
||||
public WarpManifestX8HeaderField makeAttribute(String name, String body) {
|
||||
WarpManifestX8HeaderField result = new WarpManifestX8HeaderField(name, body);
|
||||
this.attributes.add(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest3Section withAttribute(String name, String body) {
|
||||
WarpManifest3HeaderField result = new WarpManifest3HeaderField(name, body);
|
||||
public WarpManifestX8Section withAttribute(String name, String body) {
|
||||
WarpManifestX8HeaderField result = new WarpManifestX8HeaderField(name, body);
|
||||
this.attributes.add(result);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest3Section withAttributes(List<WarpManifest3HeaderField> attributes) {
|
||||
public WarpManifestX8Section withAttributes(List<WarpManifestX8HeaderField> attributes) {
|
||||
this.attributes.addAll(attributes);
|
||||
return this;
|
||||
}
|
||||
|
@ -91,13 +91,13 @@ public final class WarpManifest3Section implements WarpManifest2Section<String,
|
|||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest3Section withRemark(String remark) {
|
||||
public WarpManifestX8Section withRemark(String remark) {
|
||||
this.remarks.add(remark);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarpManifest3Section withRemarks(List<String> remarks) {
|
||||
public WarpManifestX8Section withRemarks(List<String> remarks) {
|
||||
this.remarks.addAll(remarks);
|
||||
return this;
|
||||
}
|
|
@ -32,9 +32,9 @@ import java.util.List;
|
|||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3Section;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestTheVersion;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8Section;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX0TheVersion;
|
||||
|
||||
/// Stroboscopic manifest 1 and 2 content handler.
|
||||
///
|
||||
|
@ -42,12 +42,12 @@ import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestTheVers
|
|||
/// @version ©Δ∞ 仙上主天
|
||||
public class ScopicManifestContentStringHandler implements ScopicManifestContent<String> {
|
||||
|
||||
private final WarpManifest3 manifest;
|
||||
private WarpManifest3Section currentSection;
|
||||
private final WarpManifestX8 manifest;
|
||||
private WarpManifestX8Section currentSection;
|
||||
private List<String> remarks;
|
||||
private WarpManifestTheVersion[] supportedVersions;
|
||||
private WarpManifestX0TheVersion[] supportedVersions;
|
||||
|
||||
public ScopicManifestContentStringHandler(WarpManifest3 manifest, WarpManifestTheVersion... supportedVersions) {
|
||||
public ScopicManifestContentStringHandler(WarpManifestX8 manifest, WarpManifestX0TheVersion... supportedVersions) {
|
||||
this.manifest = manifest;
|
||||
this.remarks = new ArrayList<>();
|
||||
this.supportedVersions = supportedVersions;
|
||||
|
@ -58,12 +58,12 @@ public class ScopicManifestContentStringHandler implements ScopicManifestContent
|
|||
if (supportedVersions.length == 0) {
|
||||
return; // no check requested
|
||||
}
|
||||
Optional<WarpManifestTheVersion> manifestVersion = WarpManifestTheVersion.valueOfQName(version);
|
||||
Optional<WarpManifestX0TheVersion> manifestVersion = WarpManifestX0TheVersion.valueOfQName(version);
|
||||
if (manifestVersion.isEmpty()) {
|
||||
throw new ScopicManifestException("Unknown manifest version: " + version);
|
||||
}
|
||||
WarpManifestTheVersion versionParsed = manifestVersion.get();
|
||||
for (WarpManifestTheVersion supportedVersion : supportedVersions) {
|
||||
WarpManifestX0TheVersion versionParsed = manifestVersion.get();
|
||||
for (WarpManifestX0TheVersion supportedVersion : supportedVersions) {
|
||||
if (supportedVersion.equals(versionParsed)) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -37,8 +37,8 @@ import java.util.PrimitiveIterator;
|
|||
|
||||
import org.x4o.o2o.io.sax3.XMLConstants;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3HeaderField;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestTheVersion;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8HeaderField;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX0TheVersion;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestContent;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
|
||||
|
||||
|
@ -51,7 +51,7 @@ public class ScopicManifestContentReader {
|
|||
static public final boolean FORCE_VERSION_1_0 = true;
|
||||
private final ScopicManifestContent<String> handler;
|
||||
private final boolean forceV1;
|
||||
private WarpManifestTheVersion version;
|
||||
private WarpManifestX0TheVersion version;
|
||||
|
||||
public ScopicManifestContentReader(ScopicManifestContent<String> handler) {
|
||||
this(handler, false);
|
||||
|
@ -66,11 +66,11 @@ public class ScopicManifestContentReader {
|
|||
try (BufferedReader in = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8))) {
|
||||
handler.strobeManifestStart();
|
||||
String line = in.readLine();
|
||||
WarpManifest3HeaderField fieldVersion = parseLine(line);
|
||||
WarpManifestX8HeaderField fieldVersion = parseLine(line);
|
||||
version = parseVersion(fieldVersion);
|
||||
handler.strobeManifestDeclaration(version.getQName());
|
||||
WarpManifest3HeaderField fieldPrev = null;
|
||||
WarpManifest3HeaderField field = null;
|
||||
WarpManifestX8HeaderField fieldPrev = null;
|
||||
WarpManifestX8HeaderField field = null;
|
||||
boolean isContinuation = false;
|
||||
String currentName = null;
|
||||
StringBuilder currentBody = new StringBuilder();
|
||||
|
@ -140,19 +140,19 @@ public class ScopicManifestContentReader {
|
|||
}
|
||||
}
|
||||
|
||||
private WarpManifestTheVersion parseVersion(WarpManifest3HeaderField fieldVersion) {
|
||||
private WarpManifestX0TheVersion parseVersion(WarpManifestX8HeaderField fieldVersion) {
|
||||
if (!ScopicManifestConstants.ATTR_MANIFEST_VERSION.equalsIgnoreCase(fieldVersion.getName())) {
|
||||
throw new ScopicManifestException("Wrong magic version: " + fieldVersion.getName()); // NOTE: on V3 input this should fail, name == null
|
||||
}
|
||||
Optional<WarpManifestTheVersion> versionOpt = WarpManifestTheVersion.valueOfQName(fieldVersion.getBody());
|
||||
Optional<WarpManifestX0TheVersion> versionOpt = WarpManifestX0TheVersion.valueOfQName(fieldVersion.getBody());
|
||||
if (versionOpt.isEmpty()) {
|
||||
throw new ScopicManifestException("Missing manifest version: " + fieldVersion.getBody());
|
||||
}
|
||||
WarpManifestTheVersion versionFile = versionOpt.get();
|
||||
if (WarpManifestTheVersion.VERSION_1_0.equals(versionFile)) {
|
||||
WarpManifestX0TheVersion versionFile = versionOpt.get();
|
||||
if (WarpManifestX0TheVersion.VERSION_1_0.equals(versionFile)) {
|
||||
return versionFile;
|
||||
}
|
||||
if (WarpManifestTheVersion.VERSION_2_0.equals(versionFile)) {
|
||||
if (WarpManifestX0TheVersion.VERSION_2_0.equals(versionFile)) {
|
||||
if (forceV1) {
|
||||
throw new ScopicManifestException("Illegal manifest V2 version in V1 mode: " + version);
|
||||
}
|
||||
|
@ -161,17 +161,17 @@ public class ScopicManifestContentReader {
|
|||
throw new ScopicManifestException("Unsupported manifest version: " + version);
|
||||
}
|
||||
|
||||
private WarpManifest3HeaderField parseLine(String line) {
|
||||
private WarpManifestX8HeaderField parseLine(String line) {
|
||||
int splitIdx = line.indexOf(ScopicManifestConstants.PART_ATTR_SEPERATOR);
|
||||
if (splitIdx == -1) {
|
||||
return new WarpManifest3HeaderField(line, line);
|
||||
return new WarpManifestX8HeaderField(line, line);
|
||||
}
|
||||
String name = line.substring(0, splitIdx);
|
||||
if (WarpManifestTheVersion.VERSION_2_0.equals(version)) {
|
||||
if (WarpManifestX0TheVersion.VERSION_2_0.equals(version)) {
|
||||
name = normalizeV2NameString(name);
|
||||
}
|
||||
String body = line.substring(splitIdx + 2, line.length());
|
||||
return new WarpManifest3HeaderField(name, body);
|
||||
return new WarpManifestX8HeaderField(name, body);
|
||||
}
|
||||
|
||||
private String normalizeV2NameString(String value) {
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.Arrays;
|
|||
import java.util.PrimitiveIterator;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestTheVersion;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX0TheVersion;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestContent;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestDuplicateDetector;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestDuplicatePart;
|
||||
|
@ -78,7 +78,7 @@ public class ScopicManifestContentWriter implements ScopicManifestContent<String
|
|||
throw new ScopicManifestException("Declaration already printed.");
|
||||
}
|
||||
printedDeclaration = true;
|
||||
if (WarpManifestTheVersion.VERSION_1_0.getQName().equals(version)) {
|
||||
if (WarpManifestX0TheVersion.VERSION_1_0.getQName().equals(version)) {
|
||||
printVersion1 = true;
|
||||
}
|
||||
if (version.length() > ScopicManifestConstants.ATTR_MANIFEST_VERSION_MAX_LENGHT) {
|
||||
|
|
|
@ -34,7 +34,7 @@ import java.util.Optional;
|
|||
import org.x4o.o2o.io.tlv.TLVChainSexTeenBit;
|
||||
import org.x4o.o2o.io.tlv.TLVChainSexTeenBitFrame;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestTheVersion;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX0TheVersion;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestContent;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
|
||||
|
||||
|
@ -62,14 +62,14 @@ public class ScopicManifest3ContentReader {
|
|||
throw new ScopicManifestException("Wrong magic version: 0x" + Integer.toHexString(frameVersion.getSegmentPrologSmurf()));
|
||||
}
|
||||
String fieldVersion = frameVersion.getSegmentChainString();
|
||||
Optional<WarpManifestTheVersion> versionOpt = WarpManifestTheVersion.valueOfQName(fieldVersion);
|
||||
Optional<WarpManifestX0TheVersion> versionOpt = WarpManifestX0TheVersion.valueOfQName(fieldVersion);
|
||||
if (versionOpt.isEmpty()) {
|
||||
throw new ScopicManifestException("Unsupported version: " + fieldVersion);
|
||||
}
|
||||
if (!versionOpt.get().equals(WarpManifestTheVersion.VERSION_3_0)) {
|
||||
if (!versionOpt.get().equals(WarpManifestX0TheVersion.VERSION_3_0)) {
|
||||
throw new ScopicManifestException("Mismatched version: " + fieldVersion);
|
||||
}
|
||||
handler.strobeManifestDeclaration(WarpManifestTheVersion.VERSION_3_0.getQName());
|
||||
handler.strobeManifestDeclaration(WarpManifestX0TheVersion.VERSION_3_0.getQName());
|
||||
while (chainIterator.hasNext()) {
|
||||
TLVChainSexTeenBitFrame frame = chainIterator.next();
|
||||
if (ScopicManifest3FrameTLV.MAIN_ATTRIBUTE_NAME.ordinalFrameTypeSmurf() == frame.getSegmentPrologSmurf()) {
|
||||
|
|
|
@ -33,9 +33,9 @@ import java.util.Objects;
|
|||
|
||||
import org.x4o.o2o.octal.PrimordialOctalOrangeJuiceCord;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest4;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest4Section;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestTheVersion;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX18;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX18Section;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX0TheVersion;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestContent;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
|
||||
|
||||
|
@ -45,18 +45,18 @@ import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestExcepti
|
|||
/// @version ©Δ∞ 仙上主天
|
||||
public class ScopicManifest4ContentHandler implements ScopicManifestContent<PrimordialOctalOrangeJuiceCord> {
|
||||
|
||||
private final WarpManifest4 manifest;
|
||||
private WarpManifest4Section currentSection;
|
||||
private final WarpManifestX18 manifest;
|
||||
private WarpManifestX18Section currentSection;
|
||||
private List<PrimordialOctalOrangeJuiceCord> remarks;
|
||||
|
||||
public ScopicManifest4ContentHandler(WarpManifest4 manifest) {
|
||||
public ScopicManifest4ContentHandler(WarpManifestX18 manifest) {
|
||||
this.manifest = manifest;
|
||||
this.remarks = new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void strobeManifestDeclaration(PrimordialOctalOrangeJuiceCord version) {
|
||||
if (WarpManifestTheVersion.VERSION_4_0.equals(version)) {
|
||||
if (WarpManifestX0TheVersion.VERSION_4_0.equals(version)) {
|
||||
return;
|
||||
}
|
||||
throw new ScopicManifestException("Unsupported manifest version: " + version);
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.x4o.o2o.io.tlv.TLVChainOctalSex;
|
|||
import org.x4o.o2o.io.tlv.TLVChainOctalSexFrame;
|
||||
import org.x4o.o2o.octal.PrimordialOctalOrangeJuiceCord;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestTheVersion;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX0TheVersion;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestContent;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
|
||||
|
||||
|
@ -62,8 +62,8 @@ public class ScopicManifest4ContentReader {
|
|||
throw new ScopicManifestException("Wrong magic version: 0y" + frameVersion.getSegmentProlog());
|
||||
}
|
||||
PrimordialOctalOrangeJuiceCord fieldVersion = frameVersion.getSegmentChainAtoms();
|
||||
if (!WarpManifestTheVersion.VERSION_4_0.equals(fieldVersion)) {
|
||||
throw new ScopicManifestException("Mismatched version: " + fieldVersion + " requested: " + WarpManifestTheVersion.VERSION_4_0);
|
||||
if (!WarpManifestX0TheVersion.VERSION_4_0.equals(fieldVersion)) {
|
||||
throw new ScopicManifestException("Mismatched version: " + fieldVersion + " requested: " + WarpManifestX0TheVersion.VERSION_4_0);
|
||||
}
|
||||
handler.strobeManifestDeclaration(frameVersion.getSegmentChainAtoms());
|
||||
while (chainIterator.hasNext()) {
|
||||
|
|
|
@ -31,8 +31,8 @@ import org.junit.jupiter.api.Assertions;
|
|||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3Section;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8Section;
|
||||
|
||||
/// @author للَّٰهِilLצسُو
|
||||
/// @version ©Δ∞ 仙上主天s
|
||||
|
@ -40,11 +40,11 @@ public class WarpManifestChinaTest {
|
|||
|
||||
@Test
|
||||
public void testFullChineesium() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.makeAttribute("書", "乞丐歌本").withRemark("同義詞 乞丐歌集");
|
||||
manifest.makeAttribute("年", "一千五百八十一").withRemark("與中國年份時間不同的年份時間");
|
||||
manifest.makeAttribute("描述", "起司頭押韻詞海盜歌曲歌詞");
|
||||
WarpManifest3Section section = null;
|
||||
WarpManifestX8Section section = null;
|
||||
|
||||
section = manifest.makeSection("第一節").withRemark("所以這是一個可選的額外元信息文本");
|
||||
section.makeAttribute("一號線", "威廉斯·範·納蘇韋").withRemark("章魚有八隻手臂");
|
||||
|
@ -200,6 +200,6 @@ public class WarpManifestChinaTest {
|
|||
Assertions.assertNotNull(output);
|
||||
System.out.println(output);
|
||||
System.out.println("=========");
|
||||
System.out.println(WarpManifestorDriver.亞.writeViniString(new WarpManifest3().withSections(manifest.getSections())));
|
||||
System.out.println(WarpManifestorDriver.亞.writeViniString(new WarpManifestX8().withSections(manifest.getSections())));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.junit.jupiter.api.Assertions;
|
|||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
|
||||
/// @author للَّٰهِilLצسُو
|
||||
/// @version ©Δ∞ 仙上主天
|
||||
|
@ -39,7 +39,7 @@ public class WarpManifestorDriverTest {
|
|||
|
||||
@Test
|
||||
public void testWriteSimple() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.makeAttribute("foo", "bar");
|
||||
manifest.makeSection("my1").withAttribute("foo1", "bar1");
|
||||
String output = WarpManifestorDriver.亞.writeV2String(manifest);
|
||||
|
@ -51,7 +51,7 @@ public class WarpManifestorDriverTest {
|
|||
public void testLineWrapAsLastLine() {
|
||||
String checkWrap = "https://github.com/shrinkwrap/resolver/shrinkwrap-resolver-spi-maven-archive";
|
||||
String checkWrapLast = "http://www.jboss.org/shrinkwrap-resolver-parent/shrinkwrap-resolver-spi-maven-archive";
|
||||
WarpManifest3 manitest = WarpManifestorDriver.亞.readV2Stream(getClass().getResourceAsStream("test-line-wrap.mf"));
|
||||
WarpManifestX8 manitest = WarpManifestorDriver.亞.readV2Stream(getClass().getResourceAsStream("test-line-wrap.mf"));
|
||||
Assertions.assertNotNull(manitest);
|
||||
Assertions.assertEquals(21, manitest.getAttributes().size());
|
||||
Assertions.assertEquals("Implementation-Title", manitest.getAttributes().get(0).getName());
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.junit.jupiter.api.Assertions;
|
|||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
|
||||
/// @author للَّٰهِilLצسُو
|
||||
/// @version ©Δ∞ 仙上主天
|
||||
|
@ -39,7 +39,7 @@ public class WarpManifestorVIniTest {
|
|||
|
||||
@Test
|
||||
public void testViniReadSystemdService() {
|
||||
WarpManifest3 manitest = WarpManifestorDriver.亞.readViniStream(getClass().getResourceAsStream("ini/test-ntp.service"));
|
||||
WarpManifestX8 manitest = WarpManifestorDriver.亞.readViniStream(getClass().getResourceAsStream("ini/test-ntp.service"));
|
||||
Assertions.assertNotNull(manitest);
|
||||
Assertions.assertEquals(3, manitest.getSections().size());
|
||||
Assertions.assertEquals("Network Time Service", manitest.getSectionAttributeBodyPrivate("Unit", "Description"));
|
||||
|
@ -49,7 +49,7 @@ public class WarpManifestorVIniTest {
|
|||
|
||||
@Test
|
||||
public void testViniReadSimple() {
|
||||
WarpManifest3 manitest = WarpManifestorDriver.亞.readViniStream(getClass().getResourceAsStream("ini/test-simple.ini"));
|
||||
WarpManifestX8 manitest = WarpManifestorDriver.亞.readViniStream(getClass().getResourceAsStream("ini/test-simple.ini"));
|
||||
Assertions.assertNotNull(manitest);
|
||||
Assertions.assertEquals(3, manitest.getSections().size());
|
||||
|
||||
|
@ -70,7 +70,7 @@ public class WarpManifestorVIniTest {
|
|||
|
||||
@Test
|
||||
public void testViniReadFruitFolding() {
|
||||
WarpManifest3 manitest = WarpManifestorDriver.亞.readViniStream(getClass().getResourceAsStream("ini/test-fruit-folding.ini"));
|
||||
WarpManifestX8 manitest = WarpManifestorDriver.亞.readViniStream(getClass().getResourceAsStream("ini/test-fruit-folding.ini"));
|
||||
Assertions.assertNotNull(manitest);
|
||||
Assertions.assertEquals(6, manitest.getSections().size());
|
||||
|
||||
|
@ -94,7 +94,7 @@ public class WarpManifestorVIniTest {
|
|||
|
||||
@Test
|
||||
public void testViniWriteFruitFolding() {
|
||||
WarpManifest3 manitest = WarpManifestorDriver.亞.readViniStream(getClass().getResourceAsStream("ini/test-fruit-folding.ini"));
|
||||
WarpManifestX8 manitest = WarpManifestorDriver.亞.readViniStream(getClass().getResourceAsStream("ini/test-fruit-folding.ini"));
|
||||
Assertions.assertNotNull(manitest);
|
||||
String strini = WarpManifestorDriver.亞.writeViniString(manitest);
|
||||
Assertions.assertTrue(strini.contains("target region = Bay Area"));
|
||||
|
@ -108,7 +108,7 @@ public class WarpManifestorVIniTest {
|
|||
|
||||
@Test
|
||||
public void testViniReadEscQuote() {
|
||||
WarpManifest3 manitest = WarpManifestorDriver.亞.readViniStream(getClass().getResourceAsStream("ini/test-esc-quote.ini"));
|
||||
WarpManifestX8 manitest = WarpManifestorDriver.亞.readViniStream(getClass().getResourceAsStream("ini/test-esc-quote.ini"));
|
||||
Assertions.assertNotNull(manitest);
|
||||
Assertions.assertEquals(3, manitest.getSections().size());
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.junit.jupiter.api.Assertions;
|
|||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
|
||||
|
||||
/// @author للَّٰهِilLצسُو
|
||||
|
@ -46,7 +46,7 @@ public class WarpManifestBigBodyTest {
|
|||
for (int i=0;i<512;i++) {
|
||||
buf.append("1234");
|
||||
}
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("long-longer-longggger", buf.toString());
|
||||
String output = WarpManifestorDriver.亞.writeV1String(manifest);
|
||||
Assertions.assertNotNull(output);
|
||||
|
@ -62,7 +62,7 @@ public class WarpManifestBigBodyTest {
|
|||
for (int i=0;i<512;i++) {
|
||||
buf.append("1234");
|
||||
}
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("long-longer-longggger", buf.toString());
|
||||
String output = WarpManifestorDriver.亞.writeV2String(manifest);
|
||||
Assertions.assertNotNull(output);
|
||||
|
@ -72,7 +72,7 @@ public class WarpManifestBigBodyTest {
|
|||
Assertions.assertEquals(2071, lines[1].getBytes(StandardCharsets.UTF_8).length);
|
||||
|
||||
String outputV1 = WarpManifestorDriver.亞.writeV1String(manifest);
|
||||
WarpManifest3 manitestV1 = WarpManifestorDriver.亞.readV2String(outputV1);
|
||||
WarpManifestX8 manitestV1 = WarpManifestorDriver.亞.readV2String(outputV1);
|
||||
Assertions.assertNotNull(manitestV1);
|
||||
Assertions.assertEquals(1, manitestV1.getAttributes().size());
|
||||
}
|
||||
|
@ -83,11 +83,11 @@ public class WarpManifestBigBodyTest {
|
|||
for (int i=0;i<65535;i++) {
|
||||
buf.append("0");
|
||||
}
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("limit-lines", buf.toString());
|
||||
byte[] output = WarpManifestorDriver.亞.writeV3Array(manifest);
|
||||
Assertions.assertNotNull(output);
|
||||
WarpManifest3 manifestClone = WarpManifestorDriver.亞.readV3Array(output);
|
||||
WarpManifestX8 manifestClone = WarpManifestorDriver.亞.readV3Array(output);
|
||||
Assertions.assertEquals(manifest.getAttributes().get(0).getBody(), manifestClone.getAttributes().get(0).getBody());
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
manifest.withAttribute("limit-lines", "1" + buf.toString());
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.junit.jupiter.api.Assertions;
|
|||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
|
||||
|
||||
/// @author للَّٰهِilLצسُو
|
||||
|
@ -40,7 +40,7 @@ public class WarpManifestBodyIllegalTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV1BodyNewLine() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo", "bar\n");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV1String(manifest);
|
||||
|
@ -49,7 +49,7 @@ public class WarpManifestBodyIllegalTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV1BodyLineFeed() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo", "bar\r");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV1String(manifest);
|
||||
|
@ -58,7 +58,7 @@ public class WarpManifestBodyIllegalTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV1BodyNull() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo", "bar\u0000");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV1String(manifest);
|
||||
|
@ -67,7 +67,7 @@ public class WarpManifestBodyIllegalTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV2BodyNewLine() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo", "bar\n");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV2String(manifest);
|
||||
|
@ -76,7 +76,7 @@ public class WarpManifestBodyIllegalTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV2BodyLineFeed() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo", "bar\r");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV2String(manifest);
|
||||
|
@ -85,7 +85,7 @@ public class WarpManifestBodyIllegalTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV2BodyNull() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo", "bar\u0000");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV2String(manifest);
|
||||
|
@ -94,7 +94,7 @@ public class WarpManifestBodyIllegalTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV3BodyNewLine() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo", "bar\n");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV3Array(manifest);
|
||||
|
@ -103,7 +103,7 @@ public class WarpManifestBodyIllegalTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV3BodyLineFeed() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo", "bar\r");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV3Array(manifest);
|
||||
|
@ -112,7 +112,7 @@ public class WarpManifestBodyIllegalTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV3BodyNull() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo", "bar\u0000");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV3Array(manifest);
|
||||
|
|
|
@ -34,8 +34,8 @@ import org.junit.jupiter.api.Test;
|
|||
import org.x4o.o2o.octal.PrimordialOctalOrangeString;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest4;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX18;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
|
||||
|
||||
/// @author للَّٰهِilLצسُو
|
||||
|
@ -44,7 +44,7 @@ public class WarpManifestNameDupTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV1DuplicateMainAttribute() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo", "bar1");
|
||||
manifest.withAttribute("foo", "bar2");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
|
@ -54,7 +54,7 @@ public class WarpManifestNameDupTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV1DuplicateSection() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.makeSection("junit");
|
||||
manifest.makeSection("junit");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
|
@ -64,7 +64,7 @@ public class WarpManifestNameDupTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV1DuplicateSectionAttribute() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.makeSection("junit").withAttribute("foo", "bar1").withAttribute("foo", "bar1");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV1String(manifest);
|
||||
|
@ -73,7 +73,7 @@ public class WarpManifestNameDupTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV2DuplicateMainAttribute() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo", "bar1");
|
||||
manifest.withAttribute("foo", "bar2");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
|
@ -83,7 +83,7 @@ public class WarpManifestNameDupTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV2DuplicateSection() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.makeSection("junit");
|
||||
manifest.makeSection("junit");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
|
@ -93,7 +93,7 @@ public class WarpManifestNameDupTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV2DuplicateSectionAttribute() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.makeSection("junit").withAttribute("foo", "bar1").withAttribute("foo", "bar1");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV2String(manifest);
|
||||
|
@ -102,7 +102,7 @@ public class WarpManifestNameDupTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV3DuplicateMainAttribute() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo", "bar1");
|
||||
manifest.withAttribute("foo", "bar2");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
|
@ -112,7 +112,7 @@ public class WarpManifestNameDupTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV3DuplicateSection() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.makeSection("junit");
|
||||
manifest.makeSection("junit");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
|
@ -122,7 +122,7 @@ public class WarpManifestNameDupTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV3DuplicateSectionAttribute() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.makeSection("junit").withAttribute("foo", "bar1").withAttribute("foo", "bar1");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV3Array(manifest);
|
||||
|
@ -131,7 +131,7 @@ public class WarpManifestNameDupTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV4DuplicateMainAttribute() {
|
||||
WarpManifest4 manifest = new WarpManifest4();
|
||||
WarpManifestX18 manifest = new WarpManifestX18();
|
||||
manifest.withAttribute(PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)), PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)));
|
||||
manifest.withAttribute(PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)), PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)));
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
|
@ -141,7 +141,7 @@ public class WarpManifestNameDupTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV4DuplicateSection() {
|
||||
WarpManifest4 manifest = new WarpManifest4();
|
||||
WarpManifestX18 manifest = new WarpManifestX18();
|
||||
manifest.makeSection(PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)));
|
||||
manifest.makeSection(PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)));
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
|
@ -151,7 +151,7 @@ public class WarpManifestNameDupTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV4DuplicateSectionAttribute() {
|
||||
WarpManifest4 manifest = new WarpManifest4();
|
||||
WarpManifestX18 manifest = new WarpManifestX18();
|
||||
manifest.makeSection(PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)))
|
||||
.withAttribute(PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)), PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)))
|
||||
.withAttribute(PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)), PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(1, 2, 3)));
|
||||
|
|
|
@ -34,8 +34,8 @@ import org.junit.jupiter.api.Test;
|
|||
import org.x4o.o2o.octal.PrimordialOctalOrangeString;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest4;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX18;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
|
||||
|
||||
/// @author للَّٰهِilLצسُو
|
||||
|
@ -44,7 +44,7 @@ public class WarpManifestNameEmptyTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV1NameEmpty() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("", "bar");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV1String(manifest);
|
||||
|
@ -53,7 +53,7 @@ public class WarpManifestNameEmptyTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV2NameEmpty() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("", "bar");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV2String(manifest);
|
||||
|
@ -62,7 +62,7 @@ public class WarpManifestNameEmptyTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV3NameEmpty() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("", "bar");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV3Array(manifest);
|
||||
|
@ -71,7 +71,7 @@ public class WarpManifestNameEmptyTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV4NameEmpty() {
|
||||
WarpManifest4 manifest = new WarpManifest4();
|
||||
WarpManifestX18 manifest = new WarpManifestX18();
|
||||
manifest.withAttribute(PrimordialOctalOrangeString.valueOfEmpty(), PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(12,34)));
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV4Array(manifest);
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.junit.jupiter.api.Assertions;
|
|||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
|
||||
|
||||
/// @author للَّٰهِilLצسُو
|
||||
|
@ -40,7 +40,7 @@ public class WarpManifestNameForbidCharTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV1NameNewLine() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo\n", "bar");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV1String(manifest);
|
||||
|
@ -49,7 +49,7 @@ public class WarpManifestNameForbidCharTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV1NameLineFeed() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo\r", "bar");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV1String(manifest);
|
||||
|
@ -58,7 +58,7 @@ public class WarpManifestNameForbidCharTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV1NameNull() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo\u0000", "bar");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV1String(manifest);
|
||||
|
@ -67,7 +67,7 @@ public class WarpManifestNameForbidCharTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV2NameNewLine() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo\n", "bar");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV2String(manifest);
|
||||
|
@ -76,7 +76,7 @@ public class WarpManifestNameForbidCharTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV2NameLineFeed() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo\r", "bar");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV2String(manifest);
|
||||
|
@ -85,7 +85,7 @@ public class WarpManifestNameForbidCharTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV2NameNull() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo\u0000", "bar");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV2String(manifest);
|
||||
|
@ -94,7 +94,7 @@ public class WarpManifestNameForbidCharTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV3NameNewLine() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo\n", "bar");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV3Array(manifest);
|
||||
|
@ -103,7 +103,7 @@ public class WarpManifestNameForbidCharTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV3NameLineFeed() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo\r", "bar");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV3Array(manifest);
|
||||
|
@ -112,7 +112,7 @@ public class WarpManifestNameForbidCharTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV3NameNull() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo\u0000", "bar");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV3Array(manifest);
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.junit.jupiter.api.Assertions;
|
|||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
|
||||
|
||||
/// @author للَّٰهِilLצسُو
|
||||
|
@ -44,7 +44,7 @@ public class WarpManifestNameLimitTest {
|
|||
for (int i=0;i<70;i++) {
|
||||
buf.append("0");
|
||||
}
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute(buf.toString(), "foo");
|
||||
WarpManifestorDriver.亞.writeV1String(manifest);
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
|
@ -59,7 +59,7 @@ public class WarpManifestNameLimitTest {
|
|||
for (int i=0;i<65535;i++) {
|
||||
buf.append("0");
|
||||
}
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.makeAttribute(buf.toString(), "foo").withRemark("remarkable");
|
||||
String output = WarpManifestorDriver.亞.writeV2String(manifest);
|
||||
Assertions.assertNotNull(output);
|
||||
|
@ -77,7 +77,7 @@ public class WarpManifestNameLimitTest {
|
|||
for (int i=0;i<65535;i++) {
|
||||
buf.append("0");
|
||||
}
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.makeAttribute(buf.toString(), "foo").withRemark("remarkable");
|
||||
byte[] output = WarpManifestorDriver.亞.writeV3Array(manifest);
|
||||
Assertions.assertNotNull(output);
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.junit.jupiter.api.Assertions;
|
|||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
|
||||
|
||||
/// @author للَّٰهِilLצسُو
|
||||
|
@ -40,7 +40,7 @@ public class WarpManifestNameSeperatorTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV1NameSeperator() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo:", "bar");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV1String(manifest);
|
||||
|
@ -49,7 +49,7 @@ public class WarpManifestNameSeperatorTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV2OutputSeperator() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("ju n it:", "junit:");
|
||||
String output = WarpManifestorDriver.亞.writeV2String(manifest);
|
||||
Assertions.assertNotNull(output);
|
||||
|
@ -59,11 +59,11 @@ public class WarpManifestNameSeperatorTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV3OutputSeperator() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("ju n it:", "junit:");
|
||||
byte[] output = WarpManifestorDriver.亞.writeV3Array(manifest);
|
||||
Assertions.assertNotNull(output);
|
||||
WarpManifest3 manitest = WarpManifestorDriver.亞.readV3Array(output);
|
||||
WarpManifestX8 manitest = WarpManifestorDriver.亞.readV3Array(output);
|
||||
Assertions.assertNotNull(manitest);
|
||||
Assertions.assertEquals(1, manitest.getAttributes().size());
|
||||
Assertions.assertEquals("ju n it:", manitest.getAttributes().get(0).getName());
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.junit.jupiter.api.Assertions;
|
|||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
|
||||
|
||||
/// @author للَّٰهِilLצسُو
|
||||
|
@ -40,7 +40,7 @@ public class WarpManifestNameUnicodeTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV1NameUnicode() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo", "仙上主天");
|
||||
WarpManifestorDriver.亞.writeV1String(manifest);
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
|
@ -51,7 +51,7 @@ public class WarpManifestNameUnicodeTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV2NameUnicode() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo", "仙上主天");
|
||||
manifest.withAttribute("仙上主天", "bar");
|
||||
String output = WarpManifestorDriver.亞.writeV2String(manifest);
|
||||
|
@ -61,7 +61,7 @@ public class WarpManifestNameUnicodeTest {
|
|||
Assertions.assertEquals("foo: 仙上主天", lines[1]);
|
||||
Assertions.assertEquals("仙上主天: bar", lines[2]);
|
||||
|
||||
WarpManifest3 manitest = WarpManifestorDriver.亞.readV2String(output);
|
||||
WarpManifestX8 manitest = WarpManifestorDriver.亞.readV2String(output);
|
||||
Assertions.assertNotNull(manitest);
|
||||
Assertions.assertEquals(2, manitest.getAttributes().size());
|
||||
Assertions.assertEquals("foo", manitest.getAttributes().get(0).getName());
|
||||
|
@ -74,12 +74,12 @@ public class WarpManifestNameUnicodeTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV3NameUnicode() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.withAttribute("foo", "仙上主天");
|
||||
manifest.withAttribute("仙上主天", "bar");
|
||||
byte[] output = WarpManifestorDriver.亞.writeV3Array(manifest);
|
||||
Assertions.assertNotNull(output);
|
||||
WarpManifest3 manitest = WarpManifestorDriver.亞.readV3Array(output);
|
||||
WarpManifestX8 manitest = WarpManifestorDriver.亞.readV3Array(output);
|
||||
Assertions.assertNotNull(manitest);
|
||||
Assertions.assertEquals(2, manitest.getAttributes().size());
|
||||
Assertions.assertEquals("foo", manitest.getAttributes().get(0).getName());
|
||||
|
|
|
@ -34,8 +34,8 @@ import org.junit.jupiter.api.Test;
|
|||
import org.x4o.o2o.octal.PrimordialOctalOrangeString;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest4;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX18;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.scopic.ScopicManifestException;
|
||||
|
||||
/// @author للَّٰهِilLצسُو
|
||||
|
@ -44,7 +44,7 @@ public class WarpManifestSectionNameEmptyTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV1SectionNameEmpty() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.makeSection("").withAttribute("foo", "bar");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV1String(manifest);
|
||||
|
@ -53,7 +53,7 @@ public class WarpManifestSectionNameEmptyTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV2SectionNameEmpty() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.makeSection("").withAttribute("foo", "bar");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV2String(manifest);
|
||||
|
@ -62,7 +62,7 @@ public class WarpManifestSectionNameEmptyTest {
|
|||
|
||||
@Test
|
||||
public void testWriteV3SectionNameEmpty() {
|
||||
WarpManifest3 manifest = new WarpManifest3();
|
||||
WarpManifestX8 manifest = new WarpManifestX8();
|
||||
manifest.makeSection("").withAttribute("foo", "bar");
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV3Array(manifest);
|
||||
|
@ -72,7 +72,7 @@ public class WarpManifestSectionNameEmptyTest {
|
|||
@Test
|
||||
public void testWriteV4SectionNameEmpty() {
|
||||
PrimordialOctalOrangeString foobar = PrimordialOctalOrangeString.valueOfSmurfs(Arrays.asList(123,456,789));
|
||||
WarpManifest4 manifest = new WarpManifest4();
|
||||
WarpManifestX18 manifest = new WarpManifestX18();
|
||||
manifest.makeSection(PrimordialOctalOrangeString.valueOfEmpty()).withAttribute(foobar, foobar);
|
||||
Assertions.assertThrows(ScopicManifestException.class, () -> {
|
||||
WarpManifestorDriver.亞.writeV4Array(manifest);
|
||||
|
|
|
@ -39,7 +39,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
|||
import love.distributedrebirth.nx01.warp.fault.BassFaultAnchor;
|
||||
import love.distributedrebirth.nx01.warp.fault.FaultStreamDelegate;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifest3;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
|
||||
/// Generic fault handler for human interaction.
|
||||
///
|
||||
|
@ -62,7 +62,7 @@ public class ZilLaLaFaultFilter extends HttpFilter {
|
|||
throw error;
|
||||
}
|
||||
BassFaultAnchor fault = wrap(error);
|
||||
WarpManifest3 report = fault.toZilLaLaManyfesto();
|
||||
WarpManifestX8 report = fault.toZilLaLaManyfesto();
|
||||
|
||||
// TODO: repack and forward to UI form to inspect AND connect+send into a NOSTR
|
||||
// relay
|
||||
|
|
Loading…
Reference in a new issue