public StructuredTextCSV( Datafile datafile, String regexopen, String regexclose, String open, String close) { super(datafile); this.open = open; this.close = close; regex_open = ByteSearch.create(regexopen); regex_close = ByteSearch.create(regexclose); }
public StructuredTextCSV( BufferReaderWriter reader, String regexopen, String regexclose, String open, String close) { super(reader); this.open = open; this.close = close; regex_open = ByteSearch.create(regexopen); regex_close = ByteSearch.create(regexclose); }
public IntField(String label, String open, String close, String openlabel, String closelabel) { this( getRoot(), label, ByteSearch.create(open), ByteSearch.create(close), openlabel, closelabel); }
public IntField( FolderNode parent, String label, String open, String close, String openlabel, String closelabel) { this(parent, label, ByteSearch.create(open), ByteSearch.create(close), openlabel, closelabel); }
public JsonField addJson( FolderNode parent, String label, String open, String close, String openlabel, String closelabel) { return addJson( parent, label, ByteSearch.create(open), ByteSearch.create(close), openlabel, closelabel); }
public DoubleArrayField addDoubleArray( FolderNode parent, String label, String open, String close, String openlabel, String closelabel) { return addDoubleArray( parent, label, ByteSearch.create(open), ByteSearch.create(close), openlabel, closelabel); }
public FolderNode addNode( FolderNode parent, String label, String open, String close, String openlabel, String closelabel) { return addNode( parent, label, ByteSearch.create(open), ByteSearch.create(close), openlabel, closelabel); }
public JsonArrayField addJsonArray( String label, Type clazz, String open, String close, String openlabel, String closelabel) { return addJsonArray( getRoot(), label, clazz, ByteSearch.create(open), ByteSearch.create(close), openlabel, closelabel); }
@Override public void rebuildBeforeFirstUse() { Node lastNode = getRoot(); while (lastNode instanceof FolderNode) { FolderNode foldernode = (FolderNode) lastNode; lastNode = foldernode.orderedfields.get(foldernode.orderedfields.size() - 1); } lastNode.closelabel = ""; lastNode.setOpenClose(ByteSearch.create(""), ByteSearch.create("$")); if (log.isTraceEnabled()) { dumpStructure(); } }
public JsonArrayField addJsonArray( FolderNode parent, String label, Type clazz, String open, String close, String openlabel, String closelabel) { return addJsonArray( parent, label, clazz, ByteSearch.create(open), ByteSearch.create(close), openlabel, closelabel); }
@Override public ByteSearchSection process(Content content, ByteSearchSection section) { ByteSearchPosition end = endmarker.findPos(section); if (end.found() && end.start > section.innerstart) { return content.addSectionPos( outputsection, content.content, section.start, section.innerstart, end.start, end.end); } return null; }
private void check(String content) { if (!checked && open != null && open != ByteSearch.EMPTY) { if (open.match(content)) { log.fatalexception( new RuntimeException(), "StructuredTextFile.JsonField value matches open tag: [%s]\n%s", open.toString(), content); } if (close != null && close.exists(content)) { ByteSearchPosition findPos = close.findPos(content); if (findPos.notEmpty()) { log.fatalexception( new RuntimeException(), "StructuredTextFile.JsonField value matches close tag: [%s]\n%s", close.toString(), content); } } checked = true; } }
@Override public ByteSearchSection process(Content content, ByteSearchSection section) { int tagclose = findQuoteSafeTagEnd(section); if (tagclose > -1) { ByteSearchPosition end = endmarker.findPos(section, tagclose); if (end.found()) { ByteSearchSection s = content.addSectionPos( outputsection, content.content, section.start, tagclose, end.start, end.end); return s; } } return null; }
/** * Marks <headline> sections. * * <p> * * @author jbpvuurens */ public class MarkHeadline extends SectionMarker { public static Log log = new Log(MarkHeadline.class); public ByteSearch endmarker = ByteSearch.create("</headline>"); public MarkHeadline(Extractor extractor, String inputsection, String outputsection) { super(extractor, inputsection, outputsection); } @Override public ByteRegex getStartMarker() { return new ByteRegex("<headline>"); } @Override public ByteSearchSection process(Content content, ByteSearchSection section) { ByteSearchPosition end = endmarker.findPos(section); if (end.found() && end.start > section.innerstart) { return content.addSectionPos( outputsection, content.content, section.start, section.innerstart, end.start, end.end); } return null; } }
public JsonField addJson( String label, String open, String close, String openlabel, String closelabel) { return addJson( getRoot(), label, ByteSearch.create(open), ByteSearch.create(close), openlabel, closelabel); }
@Override public FolderNode createRoot() { return addNode(null, "root", ByteSearch.create(""), ByteSearch.create("($|\n)"), "", "\n"); }
public Long128Field addLong128( String label, String open, String close, String openlabel, String closelabel) { return addLong128( getRoot(), label, ByteSearch.create(open), ByteSearch.create(close), openlabel, closelabel); }
protected ByteSearch match() { return ByteSearch.create(".*"); }
public DoubleArrayField addDoubleArray( String label, String open, String close, String openlabel, String closelabel) { return addDoubleArray( getRoot(), label, ByteSearch.create(open), ByteSearch.create(close), openlabel, closelabel); }
public FolderNode addNode( String label, String open, String close, String openlabel, String closelabel) { return addNode( getRoot(), label, ByteSearch.create(open), ByteSearch.create(close), openlabel, closelabel); }