Package org.custommonkey.xmlunit
Class DoctypeSupport
- java.lang.Object
-
- org.custommonkey.xmlunit.DoctypeSupport
-
final class DoctypeSupport extends java.lang.ObjectContains 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 classDoctypeSupport.IntBufferReadable(package private) static interfaceDoctypeSupport.Readable
-
Field Summary
Fields Modifier and Type Field Description private DoctypeSupport.ReadableafterDoctypeprivate DoctypeSupport.ReadablebeforeDoctypeprivate DoctypeSupport.Readabledecl(package private) static java.lang.StringDOCTYPE(package private) static java.lang.StringDOCTYPE_CLOSE_DECLprivate static int[]DOCTYPE_INTS(package private) static java.lang.StringDOCTYPE_OPEN_DECLprivate booleanhasSplitprivate DoctypeSupport.Readableoriginal(package private) static java.lang.StringSYSTEM
-
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) intread()Reads the next character from the declaration.private int[]readUntilCloseCharIsReached()private voidsplit()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.IOExceptionReads 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
-
-