Package org.custommonkey.xmlunit
Class DoctypeSupport
- java.lang.Object
-
- org.custommonkey.xmlunit.DoctypeSupport
-
final class DoctypeSupport extends java.lang.Object
Contains some common code for DoctypeReader and DoctypeInputStream.When used with DoctypeInputStream it assumes that the whole DOCTYPE declaration consists of US-ASCII characters.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
DoctypeSupport.IntBufferReadable
(package private) static interface
DoctypeSupport.Readable
-
Field Summary
Fields Modifier and Type Field Description private DoctypeSupport.Readable
afterDoctype
private DoctypeSupport.Readable
beforeDoctype
private DoctypeSupport.Readable
decl
(package private) static java.lang.String
DOCTYPE
(package private) static java.lang.String
DOCTYPE_CLOSE_DECL
private static int[]
DOCTYPE_INTS
(package private) static java.lang.String
DOCTYPE_OPEN_DECL
private boolean
hasSplit
private DoctypeSupport.Readable
original
(package private) static java.lang.String
SYSTEM
-
Constructor Summary
Constructors Constructor Description DoctypeSupport(java.lang.String name, java.lang.String systemId, DoctypeSupport.Readable original, boolean characters, java.lang.String encoding)
Encapsulates a DOCTYPE declaration for the given name and system id.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) int
read()
Reads the next character from the declaration.private int[]
readUntilCloseCharIsReached()
private void
split()
Reads enough of the original Readable to know where to place the declaration.
-
-
-
Field Detail
-
DOCTYPE_OPEN_DECL
static final java.lang.String DOCTYPE_OPEN_DECL
- See Also:
- Constant Field Values
-
DOCTYPE_CLOSE_DECL
static final java.lang.String DOCTYPE_CLOSE_DECL
- See Also:
- Constant Field Values
-
DOCTYPE
static final java.lang.String DOCTYPE
- See Also:
- Constant Field Values
-
SYSTEM
static final java.lang.String SYSTEM
- See Also:
- Constant Field Values
-
DOCTYPE_INTS
private static final int[] DOCTYPE_INTS
-
hasSplit
private boolean hasSplit
-
original
private final DoctypeSupport.Readable original
-
decl
private DoctypeSupport.Readable decl
-
beforeDoctype
private DoctypeSupport.Readable beforeDoctype
-
afterDoctype
private DoctypeSupport.Readable afterDoctype
-
-
Constructor Detail
-
DoctypeSupport
DoctypeSupport(java.lang.String name, java.lang.String systemId, DoctypeSupport.Readable original, boolean characters, java.lang.String encoding)
Encapsulates a DOCTYPE declaration for the given name and system id.
-
-
Method Detail
-
read
int read() throws java.io.IOException
Reads the next character from the declaration.- Returns:
- -1 if the end of the declaration has been reached.
- Throws:
java.io.IOException
-
split
private void split() throws java.io.IOException
Reads enough of the original Readable to know where to place the declaration. Fills beforeDecl and afterDecl from the data read ahead. Swallows the original DOCTYPE if there is one.- Throws:
java.io.IOException
-
readUntilCloseCharIsReached
private int[] readUntilCloseCharIsReached() throws java.io.IOException
- Throws:
java.io.IOException
-
-