public class DMRPrinter
extends java.lang.Object
WARNING: the printDMR code in some cases duplicates code in dap4.dap4.Dap4Print; so changes here should be propagated.
Modifier and Type | Field and Description |
---|---|
static boolean |
ALLOWFIELDMAPS |
protected CEConstraint |
ce |
protected DapDataset |
dmr |
protected ResponseFormat |
format |
protected static java.lang.String[] |
GROUPSPECIAL |
protected static int |
NILFLAGS |
protected static int |
NONAME |
protected static int |
NONNIL |
protected static int |
PERLINE |
protected IndentWriter |
printer |
protected static java.lang.String[] |
RESERVEDTAGS |
protected boolean |
testing |
protected static java.lang.String[] |
VARSPECIAL |
protected java.io.PrintWriter |
writer |
protected static int |
XMLESCAPED |
Modifier | Constructor and Description |
---|---|
protected |
DMRPrinter() |
|
DMRPrinter(DapDataset dmr,
CEConstraint ce,
java.io.PrintWriter writer,
ResponseFormat format) |
|
DMRPrinter(DapDataset dmr,
java.io.PrintWriter writer) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
static java.lang.String |
fqnXMLEscape(java.lang.String fqn)
XML escape a dap fqn
and converting '"' to "
Assumes backslash escapes are in effect for '/' and '.'
|
protected static java.lang.String |
getPrintValue(java.lang.Object value) |
protected static boolean |
hasDimensions(DapVariable var) |
protected static boolean |
hasMaps(DapVariable var) |
protected boolean |
hasMetadata(DapNode node) |
void |
print()
Print a DapDataset:
- as DMR
- optionally constrained
|
protected void |
printContainerAttribute(DapAttribute attr) |
protected void |
printMetadata(DapNode node) |
void |
printNode(DapNode node)
Print an arbitrary DapNode and its subnodes
as if it is being sent to a client with
optional constraint; inclusions are determined
by the view.
|
protected void |
printOtherXML(DapAttribute attr) |
protected void |
printReserved(DapNode node) |
protected void |
printXMLAttribute(java.lang.String name,
java.lang.String value,
int flags)
PrintXMLAttributes helper function
|
void |
testprint()
Same as print() except certain items of
information are suppressed.
|
protected static final int NILFLAGS
protected static final int PERLINE
protected static final int NONAME
protected static final int NONNIL
protected static final int XMLESCAPED
protected static final java.lang.String[] GROUPSPECIAL
protected static final java.lang.String[] VARSPECIAL
protected static final java.lang.String[] RESERVEDTAGS
public static final boolean ALLOWFIELDMAPS
protected java.io.PrintWriter writer
protected IndentWriter printer
protected DapDataset dmr
protected CEConstraint ce
protected ResponseFormat format
protected boolean testing
protected DMRPrinter()
public DMRPrinter(DapDataset dmr, java.io.PrintWriter writer)
public DMRPrinter(DapDataset dmr, CEConstraint ce, java.io.PrintWriter writer, ResponseFormat format)
public void flush()
public void close()
public void print() throws java.io.IOException
java.io.IOException
public void testprint() throws java.io.IOException
java.io.IOException
public void printNode(DapNode node) throws java.io.IOException
Handling newlines is a bit tricky because they may be embedded for e.g. groups, enums, etc. So the rule is that the last newline is elided and left for the caller to print. Exceptions: printMetadata printDimrefs, printMaps
node
- - the node to printjava.io.IOException
- Note that the PrintWriter is global.protected void printXMLAttribute(java.lang.String name, java.lang.String value, int flags) throws DapException
name
- value
- flags
- DapException
protected void printReserved(DapNode node) throws DapException
DapException
protected void printMetadata(DapNode node) throws java.io.IOException
java.io.IOException
protected void printContainerAttribute(DapAttribute attr)
protected void printOtherXML(DapAttribute attr)
public static java.lang.String fqnXMLEscape(java.lang.String fqn)
fqn
- the backslash escaped fqnprotected static java.lang.String getPrintValue(java.lang.Object value)
protected boolean hasMetadata(DapNode node)
protected static boolean hasMaps(DapVariable var)
protected static boolean hasDimensions(DapVariable var)