Class OBFLWsNormalizer
- java.lang.Object
-
- org.daisy.dotify.formatter.impl.obfl.XMLParserBase
-
- org.daisy.dotify.formatter.impl.obfl.OBFLWsNormalizer
-
public class OBFLWsNormalizer extends XMLParserBase
Provides a whitespace normalizer for OBFL-files.
-
-
Constructor Summary
Constructors Constructor Description OBFLWsNormalizer(XMLEventReader input, XMLEventFactory eventFactory)
Creates a new OBFLWsNormalizer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
boolean
hasNext()
boolean
isWritingOften()
Returns true if the output stream is updated often.static void
main(String[] args)
XMLEvent
nextEvent()
void
parse(XMLOutputFactory outputFactory, OutputStream out)
Parses for whitespace.void
setWritingOften(boolean writingOften)
Sets an intention to write to the output stream often, if true.-
Methods inherited from class org.daisy.dotify.formatter.impl.obfl.XMLParserBase
beginWS, endWS, equalsElement, equalsEnd, equalsStart, isSpace, normalizeSpace
-
-
-
-
Constructor Detail
-
OBFLWsNormalizer
public OBFLWsNormalizer(XMLEventReader input, XMLEventFactory eventFactory)
Creates a new OBFLWsNormalizer.- Parameters:
input
- the input XMLEventReader. Note that the underlying stream might not be closed after parsing, due to limitations in the StaX implementation.eventFactory
- the xml event factory
-
-
Method Detail
-
hasNext
public boolean hasNext()
-
nextEvent
public XMLEvent nextEvent() throws XMLStreamException
- Throws:
XMLStreamException
-
close
public void close() throws XMLStreamException
- Throws:
XMLStreamException
-
parse
public void parse(XMLOutputFactory outputFactory, OutputStream out)
Parses for whitespace.- Parameters:
outputFactory
- an xml output factoryout
- the output stream
-
isWritingOften
public boolean isWritingOften()
Returns true if the output stream is updated often.- Returns:
- true if the output stream is updated often, false otherwise
-
setWritingOften
public void setWritingOften(boolean writingOften)
Sets an intention to write to the output stream often, if true. Since this can affect performance, it is configurable.- Parameters:
writingOften
- pass true to write often, false otherwise
-
main
public static void main(String[] args)
- Parameters:
args
- the arguments
-
-