Package dap4.core.dmr.parser
Class DOM4Parser
- java.lang.Object
-
- dap4.core.dmr.parser.DOM4Parser
-
- All Implemented Interfaces:
Dap4Parser
public class DOM4Parser extends Object implements Dap4Parser
Implement the Dap4 Parser Using a DOM Parser
-
-
Field Summary
Fields Modifier and Type Field Description protected booleandebugprotected static PrintStreamdebugstreamprotected ErrorResponseerrorresponseprotected DMRFactoryfactoryprotected static intglobaldebuglevelprotected Map<Node,DapGroup>groupmapprotected DapDatasetrootprotected Deque<DapNode>scopestackprotected booleantrace
-
Constructor Summary
Constructors Constructor Description DOM4Parser(DMRFactory factory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddField(DapType t, DapVariable field)protected voidaddField(DapVariable instance, DapVariable field)protected Stringcleanup(String value)protected voiderrorcontext(String value)protected voiderrormessage(String value)protected voiderrorotherinfo(String value)protected voidfillcontainer(Node node, DapStructure parent)protected voidfillgroupdefs(Node domgroup, DapGroup group)protected voidfillgroupvars(Node domgroup, DapGroup group)protected voidfillmetadata(Node node, DapVariable var)DapDatasetgetDMR()ErrorResponsegetErrorResponse()protected booleanisattributeset(Node node)protected booleannotexists(Node n, String name)booleanparse(String input)protected DapVariableparseatomicvar(Node node)protected voidparseattr(Node node, DapNode parent, String prefix)protected voidparseattrset(Node node, DapNode parent)protected voidparseattrset(Node node, DapNode parent, String prefix)protected voidparsedataset(Node rootnode)protected DapDimensionparsedimdef(Node node)protected DapDimensionparsedimref(Node node)protected DapEnumConstparseenumconst(Node node)protected List<DapEnumConst>parseenumconsts(Node enumdef)protected DapEnumerationparseenumdef(Node node)protected DapVariableparseenumvar(Node node)protected voidparseerror(Node node)protected DapGroupparsegroupdefs(Node node)protected DapGroupparsegroupvars(Node node, DapGroup group)protected DapMapparsemap(Node node)protected List<String>parsenamespaces(Node node)protected DapAttributeparseotherxml(Node node)protected voidparseresponse(Node root)protected DapVariableparseseqvar(Node node)protected DapVariableparsestructvar(Node node)protected voidpassReserved(Node node, DapNode dap)Pass reserved xml attributes unchangedprotected Stringpull(Node n, String name)protected voidrecordattr(DapAttribute attr, DapNode parent)protected voidrecorddecl(DapNode n, DapGroup parent)protected voidrecordfield(DapVariable var, DapStructure parent)voidsetDebugLevel(int level)voidsetDebugStream(PrintStream stream)static voidsetGlobalDebugLevel(int level)protected voidtrace(String action)
-
-
-
Field Detail
-
globaldebuglevel
protected static int globaldebuglevel
-
debugstream
protected static PrintStream debugstream
-
factory
protected DMRFactory factory
-
errorresponse
protected ErrorResponse errorresponse
-
root
protected DapDataset root
-
trace
protected boolean trace
-
debug
protected boolean debug
-
-
Constructor Detail
-
DOM4Parser
public DOM4Parser(DMRFactory factory)
-
-
Method Detail
-
setGlobalDebugLevel
public static void setGlobalDebugLevel(int level)
-
setDebugStream
public void setDebugStream(PrintStream stream)
-
setDebugLevel
public void setDebugLevel(int level)
- Specified by:
setDebugLevelin interfaceDap4Parser
-
getErrorResponse
public ErrorResponse getErrorResponse()
- Specified by:
getErrorResponsein interfaceDap4Parser
-
getDMR
public DapDataset getDMR()
- Specified by:
getDMRin interfaceDap4Parser
-
parse
public boolean parse(String input) throws SAXException
- Specified by:
parsein interfaceDap4Parser- Throws:
SAXException
-
trace
protected void trace(String action)
-
addField
protected void addField(DapVariable instance, DapVariable field) throws DapException
- Throws:
DapException
-
addField
protected void addField(DapType t, DapVariable field) throws DapException
- Throws:
DapException
-
recorddecl
protected void recorddecl(DapNode n, DapGroup parent) throws ParseException
- Throws:
ParseException
-
recordfield
protected void recordfield(DapVariable var, DapStructure parent) throws ParseException
- Throws:
ParseException
-
recordattr
protected void recordattr(DapAttribute attr, DapNode parent) throws ParseException
- Throws:
ParseException
-
isattributeset
protected boolean isattributeset(Node node)
-
parseresponse
protected void parseresponse(Node root) throws ParseException
- Throws:
ParseException
-
parsedataset
protected void parsedataset(Node rootnode) throws ParseException
- Throws:
ParseException
-
fillgroupdefs
protected void fillgroupdefs(Node domgroup, DapGroup group) throws ParseException
- Throws:
ParseException
-
fillgroupvars
protected void fillgroupvars(Node domgroup, DapGroup group) throws ParseException
- Throws:
ParseException
-
parsegroupdefs
protected DapGroup parsegroupdefs(Node node) throws DapException
- Throws:
DapException
-
parseenumdef
protected DapEnumeration parseenumdef(Node node) throws ParseException
- Throws:
ParseException
-
parseenumconsts
protected List<DapEnumConst> parseenumconsts(Node enumdef) throws ParseException
- Throws:
ParseException
-
parseenumconst
protected DapEnumConst parseenumconst(Node node) throws ParseException
- Throws:
ParseException
-
parsegroupvars
protected DapGroup parsegroupvars(Node node, DapGroup group) throws DapException
- Throws:
DapException
-
parsedimdef
protected DapDimension parsedimdef(Node node) throws ParseException
- Throws:
ParseException
-
parseenumvar
protected DapVariable parseenumvar(Node node) throws ParseException
- Throws:
ParseException
-
parseatomicvar
protected DapVariable parseatomicvar(Node node) throws ParseException
- Throws:
ParseException
-
parsestructvar
protected DapVariable parsestructvar(Node node) throws ParseException
- Throws:
ParseException
-
parseseqvar
protected DapVariable parseseqvar(Node node) throws ParseException
- Throws:
ParseException
-
fillcontainer
protected void fillcontainer(Node node, DapStructure parent) throws ParseException
- Throws:
ParseException
-
fillmetadata
protected void fillmetadata(Node node, DapVariable var) throws ParseException
- Throws:
ParseException
-
parsedimref
protected DapDimension parsedimref(Node node) throws ParseException
- Throws:
ParseException
-
parsemap
protected DapMap parsemap(Node node) throws ParseException
- Throws:
ParseException
-
parseattr
protected void parseattr(Node node, DapNode parent, String prefix) throws ParseException
- Throws:
ParseException
-
parseattrset
protected void parseattrset(Node node, DapNode parent) throws ParseException
- Throws:
ParseException
-
parseattrset
protected void parseattrset(Node node, DapNode parent, String prefix) throws ParseException
- Throws:
ParseException
-
parsenamespaces
protected List<String> parsenamespaces(Node node) throws ParseException
- Throws:
ParseException
-
parseotherxml
protected DapAttribute parseotherxml(Node node) throws ParseException
- Throws:
ParseException
-
parseerror
protected void parseerror(Node node) throws ParseException
- Throws:
ParseException
-
errormessage
protected void errormessage(String value) throws ParseException
- Throws:
ParseException
-
errorcontext
protected void errorcontext(String value) throws ParseException
- Throws:
ParseException
-
errorotherinfo
protected void errorotherinfo(String value) throws ParseException
- Throws:
ParseException
-
passReserved
protected void passReserved(Node node, DapNode dap) throws ParseException
Pass reserved xml attributes unchanged- Parameters:
node-dap-- Throws:
ParseException
-
-