Class DocumentXpp3Reader
- java.lang.Object
-
- org.apache.maven.doxia.document.io.xpp3.DocumentXpp3Reader
-
public class DocumentXpp3Reader extends java.lang.ObjectClass DocumentXpp3Reader.- Version:
- $Revision$ $Date$
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceDocumentXpp3Reader.ContentTransformer
-
Field Summary
Fields Modifier and Type Field Description private booleanaddDefaultEntitiesIf set the parser will be loaded with all single characters from the XHTML specification.DocumentXpp3Reader.ContentTransformercontentTransformerField contentTransformer.
-
Constructor Summary
Constructors Constructor Description DocumentXpp3Reader()DocumentXpp3Reader(DocumentXpp3Reader.ContentTransformer contentTransformer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleancheckFieldWithDuplicate(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, java.lang.String tagName, java.lang.String alias, java.util.Set parsed)Method checkFieldWithDuplicate.private voidcheckUnknownAttribute(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, java.lang.String attribute, java.lang.String tagName, boolean strict)Method checkUnknownAttribute.private voidcheckUnknownElement(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict)Method checkUnknownElement.booleangetAddDefaultEntities()Returns the state of the "add default entities" flag.private booleangetBooleanValue(java.lang.String s, java.lang.String attribute, org.codehaus.plexus.util.xml.pull.XmlPullParser parser)Method getBooleanValue.private booleangetBooleanValue(java.lang.String s, java.lang.String attribute, org.codehaus.plexus.util.xml.pull.XmlPullParser parser, java.lang.String defaultValue)Method getBooleanValue.private bytegetByteValue(java.lang.String s, java.lang.String attribute, org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict)Method getByteValue.private chargetCharacterValue(java.lang.String s, java.lang.String attribute, org.codehaus.plexus.util.xml.pull.XmlPullParser parser)Method getCharacterValue.private java.util.DategetDateValue(java.lang.String s, java.lang.String attribute, java.lang.String dateFormat, org.codehaus.plexus.util.xml.pull.XmlPullParser parser)Method getDateValue.private java.util.DategetDateValue(java.lang.String s, java.lang.String attribute, org.codehaus.plexus.util.xml.pull.XmlPullParser parser)Method getDateValue.private doublegetDoubleValue(java.lang.String s, java.lang.String attribute, org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict)Method getDoubleValue.private floatgetFloatValue(java.lang.String s, java.lang.String attribute, org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict)Method getFloatValue.private intgetIntegerValue(java.lang.String s, java.lang.String attribute, org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict)Method getIntegerValue.private longgetLongValue(java.lang.String s, java.lang.String attribute, org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict)Method getLongValue.private java.lang.StringgetRequiredAttributeValue(java.lang.String s, java.lang.String attribute, org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict)Method getRequiredAttributeValue.private shortgetShortValue(java.lang.String s, java.lang.String attribute, org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict)Method getShortValue.private java.lang.StringgetTrimmedValue(java.lang.String s)Method getTrimmedValue.private java.lang.StringinterpolatedTrimmed(java.lang.String value, java.lang.String context)Method interpolatedTrimmed.private intnextTag(org.codehaus.plexus.util.xml.pull.XmlPullParser parser)Method nextTag.private DocumentAuthorparseDocumentAuthor(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict)Method parseDocumentAuthor.private DocumentCoverparseDocumentCover(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict)Method parseDocumentCover.private DocumentHyperlinkBehaviourparseDocumentHyperlinkBehaviour(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict)Method parseDocumentHyperlinkBehaviour.private DocumentMetaparseDocumentMeta(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict)Method parseDocumentMeta.private DocumentModelparseDocumentModel(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict)Method parseDocumentModel.private DocumentStatisticparseDocumentStatistic(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict)Method parseDocumentStatistic.private DocumentTemplateparseDocumentTemplate(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict)Method parseDocumentTemplate.private DocumentTOCparseDocumentTOC(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict)Method parseDocumentTOC.private DocumentTOCItemparseDocumentTOCItem(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict)Method parseDocumentTOCItem.DocumentModelread(java.io.InputStream in)Method read.DocumentModelread(java.io.InputStream in, boolean strict)Method read.DocumentModelread(java.io.Reader reader)DocumentModelread(java.io.Reader reader, boolean strict)private DocumentModelread(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict)Method read.voidsetAddDefaultEntities(boolean addDefaultEntities)Sets the state of the "add default entities" flag.
-
-
-
Field Detail
-
addDefaultEntities
private boolean addDefaultEntities
If set the parser will be loaded with all single characters from the XHTML specification. The entities used:- http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent
- http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent
- http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent
-
contentTransformer
public final DocumentXpp3Reader.ContentTransformer contentTransformer
Field contentTransformer.
-
-
Constructor Detail
-
DocumentXpp3Reader
public DocumentXpp3Reader()
-
DocumentXpp3Reader
public DocumentXpp3Reader(DocumentXpp3Reader.ContentTransformer contentTransformer)
-
-
Method Detail
-
checkFieldWithDuplicate
private boolean checkFieldWithDuplicate(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, java.lang.String tagName, java.lang.String alias, java.util.Set parsed) throws org.codehaus.plexus.util.xml.pull.XmlPullParserExceptionMethod checkFieldWithDuplicate.- Parameters:
parser- a parser object.parsed- a parsed object.alias- a alias object.tagName- a tagName object.- Returns:
- boolean
- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
checkUnknownAttribute
private void checkUnknownAttribute(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, java.lang.String attribute, java.lang.String tagName, boolean strict) throws org.codehaus.plexus.util.xml.pull.XmlPullParserException, java.io.IOExceptionMethod checkUnknownAttribute.- Parameters:
parser- a parser object.strict- a strict object.tagName- a tagName object.attribute- a attribute object.- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.java.io.IOException- IOException if any.
-
checkUnknownElement
private void checkUnknownElement(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict) throws org.codehaus.plexus.util.xml.pull.XmlPullParserException, java.io.IOExceptionMethod checkUnknownElement.- Parameters:
parser- a parser object.strict- a strict object.- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.java.io.IOException- IOException if any.
-
getAddDefaultEntities
public boolean getAddDefaultEntities()
Returns the state of the "add default entities" flag.- Returns:
- boolean
-
getBooleanValue
private boolean getBooleanValue(java.lang.String s, java.lang.String attribute, org.codehaus.plexus.util.xml.pull.XmlPullParser parser) throws org.codehaus.plexus.util.xml.pull.XmlPullParserExceptionMethod getBooleanValue.- Parameters:
s- a s object.parser- a parser object.attribute- a attribute object.- Returns:
- boolean
- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
getBooleanValue
private boolean getBooleanValue(java.lang.String s, java.lang.String attribute, org.codehaus.plexus.util.xml.pull.XmlPullParser parser, java.lang.String defaultValue) throws org.codehaus.plexus.util.xml.pull.XmlPullParserExceptionMethod getBooleanValue.- Parameters:
s- a s object.defaultValue- a defaultValue object.parser- a parser object.attribute- a attribute object.- Returns:
- boolean
- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
getByteValue
private byte getByteValue(java.lang.String s, java.lang.String attribute, org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict) throws org.codehaus.plexus.util.xml.pull.XmlPullParserExceptionMethod getByteValue.- Parameters:
s- a s object.strict- a strict object.parser- a parser object.attribute- a attribute object.- Returns:
- byte
- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
getCharacterValue
private char getCharacterValue(java.lang.String s, java.lang.String attribute, org.codehaus.plexus.util.xml.pull.XmlPullParser parser) throws org.codehaus.plexus.util.xml.pull.XmlPullParserExceptionMethod getCharacterValue.- Parameters:
s- a s object.parser- a parser object.attribute- a attribute object.- Returns:
- char
- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
getDateValue
private java.util.Date getDateValue(java.lang.String s, java.lang.String attribute, org.codehaus.plexus.util.xml.pull.XmlPullParser parser) throws org.codehaus.plexus.util.xml.pull.XmlPullParserExceptionMethod getDateValue.- Parameters:
s- a s object.parser- a parser object.attribute- a attribute object.- Returns:
- Date
- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
getDateValue
private java.util.Date getDateValue(java.lang.String s, java.lang.String attribute, java.lang.String dateFormat, org.codehaus.plexus.util.xml.pull.XmlPullParser parser) throws org.codehaus.plexus.util.xml.pull.XmlPullParserExceptionMethod getDateValue.- Parameters:
s- a s object.parser- a parser object.dateFormat- a dateFormat object.attribute- a attribute object.- Returns:
- Date
- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
getDoubleValue
private double getDoubleValue(java.lang.String s, java.lang.String attribute, org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict) throws org.codehaus.plexus.util.xml.pull.XmlPullParserExceptionMethod getDoubleValue.- Parameters:
s- a s object.strict- a strict object.parser- a parser object.attribute- a attribute object.- Returns:
- double
- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
getFloatValue
private float getFloatValue(java.lang.String s, java.lang.String attribute, org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict) throws org.codehaus.plexus.util.xml.pull.XmlPullParserExceptionMethod getFloatValue.- Parameters:
s- a s object.strict- a strict object.parser- a parser object.attribute- a attribute object.- Returns:
- float
- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
getIntegerValue
private int getIntegerValue(java.lang.String s, java.lang.String attribute, org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict) throws org.codehaus.plexus.util.xml.pull.XmlPullParserExceptionMethod getIntegerValue.- Parameters:
s- a s object.strict- a strict object.parser- a parser object.attribute- a attribute object.- Returns:
- int
- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
getLongValue
private long getLongValue(java.lang.String s, java.lang.String attribute, org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict) throws org.codehaus.plexus.util.xml.pull.XmlPullParserExceptionMethod getLongValue.- Parameters:
s- a s object.strict- a strict object.parser- a parser object.attribute- a attribute object.- Returns:
- long
- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
getRequiredAttributeValue
private java.lang.String getRequiredAttributeValue(java.lang.String s, java.lang.String attribute, org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict) throws org.codehaus.plexus.util.xml.pull.XmlPullParserExceptionMethod getRequiredAttributeValue.- Parameters:
s- a s object.strict- a strict object.parser- a parser object.attribute- a attribute object.- Returns:
- String
- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
getShortValue
private short getShortValue(java.lang.String s, java.lang.String attribute, org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict) throws org.codehaus.plexus.util.xml.pull.XmlPullParserExceptionMethod getShortValue.- Parameters:
s- a s object.strict- a strict object.parser- a parser object.attribute- a attribute object.- Returns:
- short
- Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
getTrimmedValue
private java.lang.String getTrimmedValue(java.lang.String s)
Method getTrimmedValue.- Parameters:
s- a s object.- Returns:
- String
-
interpolatedTrimmed
private java.lang.String interpolatedTrimmed(java.lang.String value, java.lang.String context)Method interpolatedTrimmed.- Parameters:
value- a value object.context- a context object.- Returns:
- String
-
nextTag
private int nextTag(org.codehaus.plexus.util.xml.pull.XmlPullParser parser) throws java.io.IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserExceptionMethod nextTag.- Parameters:
parser- a parser object.- Returns:
- int
- Throws:
java.io.IOException- IOException if any.org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
read
public DocumentModel read(java.io.Reader reader, boolean strict) throws java.io.IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException
- Parameters:
reader- a reader object.strict- a strict object.- Returns:
- DocumentModel
- Throws:
java.io.IOException- IOException if any.org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.- See Also:
ReaderFactory.newXmlReader(java.io.InputStream)
-
read
public DocumentModel read(java.io.Reader reader) throws java.io.IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException
- Parameters:
reader- a reader object.- Returns:
- DocumentModel
- Throws:
java.io.IOException- IOException if any.org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.- See Also:
ReaderFactory.newXmlReader(java.io.InputStream)
-
read
public DocumentModel read(java.io.InputStream in, boolean strict) throws java.io.IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException
Method read.- Parameters:
in- a in object.strict- a strict object.- Returns:
- DocumentModel
- Throws:
java.io.IOException- IOException if any.org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
read
public DocumentModel read(java.io.InputStream in) throws java.io.IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException
Method read.- Parameters:
in- a in object.- Returns:
- DocumentModel
- Throws:
java.io.IOException- IOException if any.org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
parseDocumentAuthor
private DocumentAuthor parseDocumentAuthor(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict) throws java.io.IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException
Method parseDocumentAuthor.- Parameters:
parser- a parser object.strict- a strict object.- Returns:
- DocumentAuthor
- Throws:
java.io.IOException- IOException if any.org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
parseDocumentCover
private DocumentCover parseDocumentCover(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict) throws java.io.IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException
Method parseDocumentCover.- Parameters:
parser- a parser object.strict- a strict object.- Returns:
- DocumentCover
- Throws:
java.io.IOException- IOException if any.org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
parseDocumentHyperlinkBehaviour
private DocumentHyperlinkBehaviour parseDocumentHyperlinkBehaviour(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict) throws java.io.IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException
Method parseDocumentHyperlinkBehaviour.- Parameters:
parser- a parser object.strict- a strict object.- Returns:
- DocumentHyperlinkBehaviour
- Throws:
java.io.IOException- IOException if any.org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
parseDocumentMeta
private DocumentMeta parseDocumentMeta(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict) throws java.io.IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException
Method parseDocumentMeta.- Parameters:
parser- a parser object.strict- a strict object.- Returns:
- DocumentMeta
- Throws:
java.io.IOException- IOException if any.org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
parseDocumentModel
private DocumentModel parseDocumentModel(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict) throws java.io.IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException
Method parseDocumentModel.- Parameters:
parser- a parser object.strict- a strict object.- Returns:
- DocumentModel
- Throws:
java.io.IOException- IOException if any.org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
parseDocumentStatistic
private DocumentStatistic parseDocumentStatistic(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict) throws java.io.IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException
Method parseDocumentStatistic.- Parameters:
parser- a parser object.strict- a strict object.- Returns:
- DocumentStatistic
- Throws:
java.io.IOException- IOException if any.org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
parseDocumentTOC
private DocumentTOC parseDocumentTOC(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict) throws java.io.IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException
Method parseDocumentTOC.- Parameters:
parser- a parser object.strict- a strict object.- Returns:
- DocumentTOC
- Throws:
java.io.IOException- IOException if any.org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
parseDocumentTOCItem
private DocumentTOCItem parseDocumentTOCItem(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict) throws java.io.IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException
Method parseDocumentTOCItem.- Parameters:
parser- a parser object.strict- a strict object.- Returns:
- DocumentTOCItem
- Throws:
java.io.IOException- IOException if any.org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
parseDocumentTemplate
private DocumentTemplate parseDocumentTemplate(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict) throws java.io.IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException
Method parseDocumentTemplate.- Parameters:
parser- a parser object.strict- a strict object.- Returns:
- DocumentTemplate
- Throws:
java.io.IOException- IOException if any.org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
read
private DocumentModel read(org.codehaus.plexus.util.xml.pull.XmlPullParser parser, boolean strict) throws java.io.IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException
Method read.- Parameters:
parser- a parser object.strict- a strict object.- Returns:
- DocumentModel
- Throws:
java.io.IOException- IOException if any.org.codehaus.plexus.util.xml.pull.XmlPullParserException- XmlPullParserException if any.
-
setAddDefaultEntities
public void setAddDefaultEntities(boolean addDefaultEntities)
Sets the state of the "add default entities" flag.- Parameters:
addDefaultEntities- a addDefaultEntities object.
-
-