public class HSDocParameters
extends java.lang.Object
prefixesand
sufficesfor HML/SiGML documents, in accordance with the values of these parameters.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SIGML_BASE_URI_ALT
Alternative base URI for SiGML.
|
static java.lang.String |
SIGML_BASE_URI_STD
(De facto) Standard base URI for SiGML -- at UEA.
|
static java.lang.String |
STD_HML_PREFIX
Standard HML document prefix, as a (multi-line) string.
|
static java.lang.String |
STD_HML_SUFFIX
Standard HML document suffix, as a (single-line) string.
|
static java.lang.String |
STD_SIGML_PREFIX
Standard SiGML document prefix, as a (multi-line) string.
|
static java.lang.String |
STD_SIGML_SUFFIX
Standard SiGML document suffix, as a (single-line) string.
|
Constructor and Description |
---|
HSDocParameters() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getEncoding(java.lang.String enc)
Returns the given encoding if it is non-null, or the standard
XML encoding otherwise.
|
static java.lang.String |
getH2SDocURI(java.lang.String h2sd)
Returns the given HML-to-SiGML XSLT transform URI (for a whole
HML document), or the standard one otherwise.
|
static java.lang.String |
getH2SSignsURI(java.lang.String h2ss)
Returns the given HML-to-SiGML XSLT transform URI (for a single
HML sign), or the standard one otherwise.
|
static java.lang.String |
getHMLDTD(java.lang.String hdtd)
Returns the given HML DTD system ID string if it is non-null, or
the standard one otherwise.
|
static java.lang.String |
getHMLHeader(java.lang.String htag)
Returns the HML header for the standard encoding and HML DTD system
ID and the given document element tag, in the form of a multi-line
string;
the header consists of the XML and document type declarations.
|
static java.lang.String |
getHMLHeader(java.lang.String henc,
java.lang.String hdtd,
java.lang.String htag)
Returns the HML header for the given encoding, HML DTD system
ID and document element tag, as a multi-line string;
the header consists of the XML and document type declarations.
|
static java.lang.String |
getHMLPrefix(java.lang.String henc,
java.lang.String hdtd,
java.lang.String htag)
Returns the HML prefix for the given encoding, HML DTD system
ID and document element tag, as defined for
getHMLPrefixLines(String,String,String) ,
in the form of a single (multi-line) string. |
static java.lang.String[] |
getHMLPrefixLines(java.lang.String henc,
java.lang.String hdtd,
java.lang.String htag)
Returns the sequence of HML document prefix lines
for a document with the given encoding, DTD system ID and
document element tag.
|
static java.lang.String |
getHMLSuffix(java.lang.String htag)
Returns the HML suffix for the given HML document element
tag, as defined for
getHMLSuffixLine(String) ,
in the form of a one-line string including a line terminator. |
static java.lang.String[] |
getHMLSuffixLine(java.lang.String htag)
Returns the sequence of HML document suffix lines
(actually a singleton sequence)
for a document with the given document element tag, or the standard
HML document element tag if the given value is
null . |
static java.lang.String |
getHMLTag(java.lang.String htag)
Returns the given HML element tag if it is non-null, or the standard
HML element otherwise.
|
static java.lang.String |
getSiGMLDTD(java.lang.String sdtd)
Returns the given SiGML DTD system ID string if it is non-null, or
the standard one otherwise.
|
static java.lang.String |
getSiGMLHeader(java.lang.String stag)
Returns the SiGML header for the standard encoding and SiGML DTD
system ID and the given document element tag, in the form of a
multi-line string;
the header consists of the XML and document type declarations.
|
static java.lang.String |
getSiGMLHeader(java.lang.String senc,
java.lang.String sdtd,
java.lang.String stag)
Returns the SiGML header for the given encoding, SiGML DTD system
ID and document element tag, as a multi-line string;
the header consists of the XML and document type declarations.
|
static java.lang.String |
getSiGMLPrefix(java.lang.String stag)
Returns the SiGML preix for the given SiGML document element
tag, as defined for
getSiGMLPrefixLines(String,String,String) ,
in the form of a one-line string including a line terminator. |
static java.lang.String |
getSiGMLPrefix(java.lang.String senc,
java.lang.String sdtd,
java.lang.String stag)
Returns the SiGML prefix for the given encoding, SiGML DTD system
ID and document element tag, as defined for
getSiGMLPrefixLines(String,String,String) ,
in the form of a single (multi-line) string. |
static java.lang.String[] |
getSiGMLPrefixLines(java.lang.String senc,
java.lang.String sdtd,
java.lang.String stag)
Returns the sequence of SiGML document prefix lines
for a document with the given encoding, DTD system ID and
document element tag.
|
static java.lang.String |
getSiGMLSuffix(java.lang.String stag)
Returns the SiGML suffix for the given SiGML document element
tag, as defined for
getSiGMLSuffixLine(String) ,
in the form of a one-line string including a line terminator. |
static java.lang.String[] |
getSiGMLSuffixLine(java.lang.String stag)
Returns the sequence of SiGML document suffix lines
(actually a singleton sequence)
for a document with the given document element tag, or the standard
HML document element tag if the given value is
null . |
static java.lang.String |
getSiGMLTag(java.lang.String stag)
Returns the given SiGML element tag if it is non-null, or the
standard SiGML element otherwise.
|
static java.lang.String |
getSiGMLXMLDecl(java.lang.String senc)
Returns the SiGML XML declaration line (with EOL) for the given
endocding.
|
static java.lang.String |
wrapHMLDocBodyEls(java.lang.String bodyels)
Returns the string given by putting the wrapping the given HML
document body text with the standard HML prefix and suffix,
with prefix and suffix defined as for
getHMLPrefixLines(String,String,String) and
getHMLSuffix(String) , |
static java.lang.String |
wrapSiGMLDocBodyEls(java.lang.String bodyels)
Returns the string given by putting the wrapping the given SiGML
document body text with the standard SiGML prefix and suffix,
with prefix and suffix defined as for
getSiGMLPrefixLines(String,String,String) and
getSiGMLSuffix(String) , |
static void |
writeHMLPrefix(java.io.OutputStream hmls,
java.lang.String henc,
java.lang.String hdtd,
java.lang.String htag)
Constructs an HML document prefix for the given encoding,
DTD system ID and document element tag, using the standard value
in each case if the given value is
null , and writes
the result to the given output stream, using the specified encoding. |
static void |
writeHMLSuffix(java.io.OutputStream hmls,
java.lang.String henc,
java.lang.String htag)
Constructs an HML document suffix for the given encoding
and document element tag, using the standard value
in each case if the given value is
null , and writes
the result to the given output stream, using the specified encoding. |
static void |
writeSiGMLPrefix(java.io.OutputStream sigmls,
java.lang.String senc,
java.lang.String sdtd,
java.lang.String stag)
Constructs a SiGML document prefix for the given encoding,
DTD system ID and document element tag, using the standard value
in each case if the given value is
null , and writes
the result to the given output stream, using the specified encoding. |
static void |
writeSiGMLSuffix(java.io.OutputStream sigmls,
java.lang.String senc,
java.lang.String stag)
Constructs a SiGML document suffix for the given encoding
and document element tag, using the standard value
in each case if the given value is
null , and writes
the result to the given output stream, using the specified encoding. |
public static final java.lang.String SIGML_BASE_URI_STD
public static final java.lang.String SIGML_BASE_URI_ALT
public static final java.lang.String STD_HML_PREFIX
public static final java.lang.String STD_HML_SUFFIX
public static final java.lang.String STD_SIGML_PREFIX
public static final java.lang.String STD_SIGML_SUFFIX
public static final java.lang.String getEncoding(java.lang.String enc)
public static final java.lang.String getHMLTag(java.lang.String htag)
public static final java.lang.String getSiGMLTag(java.lang.String stag)
public static final java.lang.String getHMLDTD(java.lang.String hdtd)
public static final java.lang.String getSiGMLDTD(java.lang.String sdtd)
public static final java.lang.String getH2SDocURI(java.lang.String h2sd)
public static final java.lang.String getH2SSignsURI(java.lang.String h2ss)
public static void writeHMLPrefix(java.io.OutputStream hmls, java.lang.String henc, java.lang.String hdtd, java.lang.String htag) throws java.io.IOException
null
, and writes
the result to the given output stream, using the specified encoding.
The prefix is as defined for
getHMLPrefixLines(String,String,String)
.java.io.IOException
public static void writeHMLSuffix(java.io.OutputStream hmls, java.lang.String henc, java.lang.String htag) throws java.io.IOException
null
, and writes
the result to the given output stream, using the specified encoding.
The document suffix consists of the closing tag for the
document element.java.io.IOException
public static java.lang.String wrapHMLDocBodyEls(java.lang.String bodyels)
getHMLPrefixLines(String,String,String)
and
getHMLSuffix(String)
,public static java.lang.String getHMLHeader(java.lang.String htag)
null
then the standard HML document
element tag is used.public static java.lang.String getHMLHeader(java.lang.String henc, java.lang.String hdtd, java.lang.String htag)
null
then
the standard value is used.public static java.lang.String getHMLPrefix(java.lang.String henc, java.lang.String hdtd, java.lang.String htag)
getHMLPrefixLines(String,String,String)
,
in the form of a single (multi-line) string.public static java.lang.String getHMLSuffix(java.lang.String htag)
getHMLSuffixLine(String)
,
in the form of a one-line string including a line terminator.public static java.lang.String[] getHMLPrefixLines(java.lang.String henc, java.lang.String hdtd, java.lang.String htag)
null
then the standard value is used.
The prefix consists of the XML declaration, the document type
declaration and the document element start tag.public static java.lang.String[] getHMLSuffixLine(java.lang.String htag)
null
.
The suffix just consists of the end tag for the document element.public static void writeSiGMLPrefix(java.io.OutputStream sigmls, java.lang.String senc, java.lang.String sdtd, java.lang.String stag) throws java.io.IOException
null
, and writes
the result to the given output stream, using the specified encoding.
The prefix is as defined for
getSiGMLPrefixLines(String,String,String)
.java.io.IOException
public static void writeSiGMLSuffix(java.io.OutputStream sigmls, java.lang.String senc, java.lang.String stag) throws java.io.IOException
null
, and writes
the result to the given output stream, using the specified encoding.
The document suffix consists of the closing tag for the
document element.java.io.IOException
public static java.lang.String wrapSiGMLDocBodyEls(java.lang.String bodyels)
getSiGMLPrefixLines(String,String,String)
and
getSiGMLSuffix(String)
,public static java.lang.String getSiGMLXMLDecl(java.lang.String senc)
public static java.lang.String getSiGMLHeader(java.lang.String stag)
null
then the standard SiGML
document element tag is used.public static java.lang.String getSiGMLHeader(java.lang.String senc, java.lang.String sdtd, java.lang.String stag)
null
then
the standard value is used.public static java.lang.String getSiGMLPrefix(java.lang.String senc, java.lang.String sdtd, java.lang.String stag)
getSiGMLPrefixLines(String,String,String)
,
in the form of a single (multi-line) string.public static java.lang.String getSiGMLPrefix(java.lang.String stag)
getSiGMLPrefixLines(String,String,String)
,
in the form of a one-line string including a line terminator.public static java.lang.String getSiGMLSuffix(java.lang.String stag)
getSiGMLSuffixLine(String)
,
in the form of a one-line string including a line terminator.public static java.lang.String[] getSiGMLPrefixLines(java.lang.String senc, java.lang.String sdtd, java.lang.String stag)
null
then the standard value is used.
The prefix consists of the XML declaration, the document type
declaration and the document element start tag.public static java.lang.String[] getSiGMLSuffixLine(java.lang.String stag)
null
.
The suffix just consists of the end tag for the document element.