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 protected
AbstractDocParser(int sourceType)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
getSourceType()
Returns the source type handled by this parserDocBase
parse(InputStream is)
Parse a sourceDocBase
parse(Reader reader)
Parse a sourceprotected abstract DocBase
parseWorker(Reader reader)
int
validate(Reader reader)
Validate a sourceDocValidationResult
validateResult(Reader reader)
Validate a sourceint
validateVersion(Reader reader)
Validate a source, it tries to find the xsd version and validate against the specific versionDocValidationResult
validateVersionResult(Reader reader)
Validate a source, it tries to find the xsd version and validate against the specific versionprotected abstract DocValidationResult
validateWorker(Reader reader, boolean parseVersion)
-
-
-
Method Detail
-
getSourceType
public int getSourceType()
Description copied from interface:DocParser
Returns the source type handled by this parser- Specified by:
getSourceType
in interfaceDocParser
- Returns:
- the
int
representation of the source type handled by this parserDocFacadeSource
-
parse
public DocBase parse(InputStream is) throws DocException
Description copied from interface:DocParser
Parse a source- Specified by:
parse
in 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:DocParser
Parse a source- Specified by:
parse
in 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:DocParser
Validate a source- Specified by:
validateResult
in 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:DocParser
Validate a source- Specified by:
validate
in interfaceDocParser
- Parameters:
reader
- the source reader- Returns:
- the result of the validation (
0
in case of success) - Throws:
DocException
- in case of problems
-
validateVersionResult
public DocValidationResult validateVersionResult(Reader reader) throws DocException
Description copied from interface:DocParser
Validate a source, it tries to find the xsd version and validate against the specific version- Specified by:
validateVersionResult
in 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:DocParser
Validate a source, it tries to find the xsd version and validate against the specific version- Specified by:
validateVersion
in interfaceDocParser
- Parameters:
reader
- the source reader- Returns:
- the result of the validation as an
int
(0
in 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
-
-