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 boolean
debug
protected static PrintStream
debugstream
protected ErrorResponse
errorresponse
protected DMRFactory
factory
protected static int
globaldebuglevel
protected Map<Node,DapGroup>
groupmap
protected DapDataset
root
protected Deque<DapNode>
scopestack
protected boolean
trace
-
Constructor Summary
Constructors Constructor Description DOM4Parser(DMRFactory factory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addField(DapType t, DapVariable field)
protected void
addField(DapVariable instance, DapVariable field)
protected String
cleanup(String value)
protected void
errorcontext(String value)
protected void
errormessage(String value)
protected void
errorotherinfo(String value)
protected void
fillcontainer(Node node, DapStructure parent)
protected void
fillgroupdefs(Node domgroup, DapGroup group)
protected void
fillgroupvars(Node domgroup, DapGroup group)
protected void
fillmetadata(Node node, DapVariable var)
DapDataset
getDMR()
ErrorResponse
getErrorResponse()
protected boolean
isattributeset(Node node)
protected boolean
notexists(Node n, String name)
boolean
parse(String input)
protected DapVariable
parseatomicvar(Node node)
protected void
parseattr(Node node, DapNode parent, String prefix)
protected void
parseattrset(Node node, DapNode parent)
protected void
parseattrset(Node node, DapNode parent, String prefix)
protected void
parsedataset(Node rootnode)
protected DapDimension
parsedimdef(Node node)
protected DapDimension
parsedimref(Node node)
protected DapEnumConst
parseenumconst(Node node)
protected List<DapEnumConst>
parseenumconsts(Node enumdef)
protected DapEnumeration
parseenumdef(Node node)
protected DapVariable
parseenumvar(Node node)
protected void
parseerror(Node node)
protected DapGroup
parsegroupdefs(Node node)
protected DapGroup
parsegroupvars(Node node, DapGroup group)
protected DapMap
parsemap(Node node)
protected List<String>
parsenamespaces(Node node)
protected DapAttribute
parseotherxml(Node node)
protected void
parseresponse(Node root)
protected DapVariable
parseseqvar(Node node)
protected DapVariable
parsestructvar(Node node)
protected void
passReserved(Node node, DapNode dap)
Pass reserved xml attributes unchangedprotected String
pull(Node n, String name)
protected void
recordattr(DapAttribute attr, DapNode parent)
protected void
recorddecl(DapNode n, DapGroup parent)
protected void
recordfield(DapVariable var, DapStructure parent)
void
setDebugLevel(int level)
void
setDebugStream(PrintStream stream)
static void
setGlobalDebugLevel(int level)
protected void
trace(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:
setDebugLevel
in interfaceDap4Parser
-
getErrorResponse
public ErrorResponse getErrorResponse()
- Specified by:
getErrorResponse
in interfaceDap4Parser
-
getDMR
public DapDataset getDMR()
- Specified by:
getDMR
in interfaceDap4Parser
-
parse
public boolean parse(String input) throws SAXException
- Specified by:
parse
in 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
-
-