|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.lint.DoctypeInterpolator
public class DoctypeInterpolator
Attempts to check that a DOCTYPE declaration is present in an input stream representing XML. If it is not, one is inserted. The algorithm used here isn't bulletproof, but should work in most sensible cases, and fail noisily if it can't do it. It copes with a number of not-too-weird XML encodings.
Constructor Summary | |
---|---|
DoctypeInterpolator()
|
Method Summary | |
---|---|
InputStream |
getStreamWithDoctype(BufferedInputStream in)
Returns an input stream which is a copy of a given one, except that if the given one doesn't include a DOCTYPE declaration, one is inserted. |
String |
getVotableVersion()
Returns the value of the version attribute of the top-level VOTABLE element, if there was one and it was encountered. |
static void |
main(String[] args)
Filter program which takes a stream on standard output and writes to standard output including the DOCTYPE. |
void |
message(String msg)
Presents a processing message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DoctypeInterpolator()
Method Detail |
---|
public InputStream getStreamWithDoctype(BufferedInputStream in) throws IOException
in
- original input stream
IllegalStateException
- if this method has already been called
on this object
IOException
public String getVotableVersion()
public void message(String msg)
msg
- message textpublic static void main(String[] args) throws IOException
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |