public final class SpaceNormalizer extends SpaceProcessor
This class also processes the contents of elements marked as being read-only (e.g. included elements).
Constructor and Description |
---|
SpaceNormalizer(DocumentType documentType)
Constructs a whitespace processor using specified document type.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doProcessSpace(Element element) |
DocumentType |
getDocumentType()
Returns the document type used by this whitespace processor.
|
void |
processSpace(Element element)
Removes ignoreable whitespace from specified element and
all its descendants.
|
void |
processSpace(Element element,
ElementType elementType,
Element parent)
Removes ignoreable whitespace from specified element
and its descendants.
|
void |
setDocumentType(DocumentType documentType)
Specifies the document type used by this whitespace processor.
|
doProcessSpaceInDescendants, processSpace
public SpaceNormalizer(DocumentType documentType)
null
, in which case
an AnyDocumentType is used.AnyDocumentType
public void setDocumentType(DocumentType documentType)
null
, in which case
an AnyDocumentType is used.AnyDocumentType
public DocumentType getDocumentType()
public void processSpace(Element element)
SpaceProcessor
processSpace
in class SpaceProcessor
public void processSpace(Element element, ElementType elementType, Element parent)
This low-level form will work even if element is not yet
attached to document. Note that parent, if not
null
, must be attached to document.
element
- element to be processedelementType
- type of elementparent
- parent of elementprotected void doProcessSpace(Element element)
doProcessSpace
in class SpaceProcessor