Package org.fugerit.java.doc.base.parser
Class AbstractDocParser
- java.lang.Object
-
- org.fugerit.java.doc.base.parser.AbstractDocParser
-
- All Implemented Interfaces:
DocParser
- Direct Known Subclasses:
DocXmlParser
public abstract class AbstractDocParser extends Object implements DocParser
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractDocParser(int sourceType)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intgetSourceType()Returns the source type handled by this parserDocBaseparse(InputStream is)Parse a sourceDocBaseparse(Reader reader)Parse a sourceprotected abstract DocBaseparseWorker(Reader reader)intvalidate(Reader reader)Validate a sourceDocValidationResultvalidateResult(Reader reader)Validate a sourceintvalidateVersion(Reader reader)Validate a source, it tries to find the xsd version and validate against the specific versionDocValidationResultvalidateVersionResult(Reader reader)Validate a source, it tries to find the xsd version and validate against the specific versionprotected abstract DocValidationResultvalidateWorker(Reader reader, boolean parseVersion)
-
-
-
Method Detail
-
getSourceType
public int getSourceType()
Description copied from interface:DocParserReturns the source type handled by this parser- Specified by:
getSourceTypein interfaceDocParser- Returns:
- the
intrepresentation of the source type handled by this parserDocFacadeSource
-
parse
public DocBase parse(InputStream is) throws DocException
Description copied from interface:DocParserParse a source- Specified by:
parsein interfaceDocParser- Parameters:
is- the source stream- Returns:
- the parsed document
- Throws:
DocException- in case of problems
-
parse
public DocBase parse(Reader reader) throws DocException
Description copied from interface:DocParserParse a source- Specified by:
parsein interfaceDocParser- Parameters:
reader- the source reader- Returns:
- the parsed document
- Throws:
DocException- in case of problems
-
validateResult
public DocValidationResult validateResult(Reader reader) throws DocException
Description copied from interface:DocParserValidate a source- Specified by:
validateResultin interfaceDocParser- Parameters:
reader- the source reader- Returns:
- the result of the validation
- Throws:
DocException- in case of problems
-
validate
public int validate(Reader reader) throws DocException
Description copied from interface:DocParserValidate a source- Specified by:
validatein interfaceDocParser- Parameters:
reader- the source reader- Returns:
- the result of the validation (
0in case of success) - Throws:
DocException- in case of problems
-
validateVersionResult
public DocValidationResult validateVersionResult(Reader reader) throws DocException
Description copied from interface:DocParserValidate a source, it tries to find the xsd version and validate against the specific version- Specified by:
validateVersionResultin interfaceDocParser- Parameters:
reader- the source reader- Returns:
- the result of the validation
- Throws:
DocException- in case of problems
-
validateVersion
public int validateVersion(Reader reader) throws DocException
Description copied from interface:DocParserValidate a source, it tries to find the xsd version and validate against the specific version- Specified by:
validateVersionin interfaceDocParser- Parameters:
reader- the source reader- Returns:
- the result of the validation as an
int(0in case of success) - Throws:
DocException- in case of problems
-
validateWorker
protected abstract DocValidationResult validateWorker(Reader reader, boolean parseVersion) throws DocException
- Throws:
DocException
-
parseWorker
protected abstract DocBase parseWorker(Reader reader) throws DocException
- Throws:
DocException
-
-