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 dap4.core.ce.CEConstraint |
ce |
protected dap4.core.dmr.DapDataset |
dmr |
protected dap4.core.util.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 dap4.core.util.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(dap4.core.dmr.DapDataset dmr,
dap4.core.ce.CEConstraint ce,
java.io.PrintWriter writer,
dap4.core.util.ResponseFormat format) |
|
DMRPrinter(dap4.core.dmr.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(dap4.core.dmr.DapVariable var) |
protected static boolean |
hasMaps(dap4.core.dmr.DapVariable var) |
protected boolean |
hasMetadata(dap4.core.dmr.DapNode node) |
void |
print()
Print a DapDataset:
- as DMR
- optionally constrained
|
protected void |
printContainerAttribute(dap4.core.dmr.DapAttribute attr) |
protected void |
printMetadata(dap4.core.dmr.DapNode node) |
void |
printNode(dap4.core.dmr.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(dap4.core.dmr.DapAttribute attr) |
protected void |
printReserved(dap4.core.dmr.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 dap4.core.util.IndentWriter printer
protected dap4.core.dmr.DapDataset dmr
protected dap4.core.ce.CEConstraint ce
protected dap4.core.util.ResponseFormat format
protected boolean testing
protected DMRPrinter()
public DMRPrinter(dap4.core.dmr.DapDataset dmr,
java.io.PrintWriter writer)
public DMRPrinter(dap4.core.dmr.DapDataset dmr,
dap4.core.ce.CEConstraint ce,
java.io.PrintWriter writer,
dap4.core.util.ResponseFormat format)
public void flush()
public void close()
public void print()
throws java.io.IOException
java.io.IOExceptionpublic void testprint()
throws java.io.IOException
java.io.IOExceptionpublic void printNode(dap4.core.dmr.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 dap4.core.util.DapException
name - value - flags - dap4.core.util.DapExceptionprotected void printReserved(dap4.core.dmr.DapNode node)
throws dap4.core.util.DapException
dap4.core.util.DapExceptionprotected void printMetadata(dap4.core.dmr.DapNode node)
throws java.io.IOException
java.io.IOExceptionprotected void printContainerAttribute(dap4.core.dmr.DapAttribute attr)
protected void printOtherXML(dap4.core.dmr.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(dap4.core.dmr.DapNode node)
protected static boolean hasMaps(dap4.core.dmr.DapVariable var)
protected static boolean hasDimensions(dap4.core.dmr.DapVariable var)