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
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcheckVersion(String xsdVersion) Get the feature config for this parser (implementations of DocParser should useFeatureConfig.DEFAULT if not set)intReturns the source type handled by this parserparse(InputStream is) Parse a sourceParse a sourceprotected abstract DocBaseparseWorker(Reader reader) voidsetFeatureConfig(FeatureConfig featureConfig) Set the feature config for this parserintValidate a sourcevalidateResult(Reader reader) Validate a sourceintvalidateVersion(Reader reader) Validate a source, it tries to find the xsd version and validate against the specific versionvalidateVersionResult(Reader reader) Validate a source, it tries to find the xsd version and validate against the specific versionprotected abstract DocValidationResultvalidateWorker(Reader reader, boolean parseVersion)
-
Field Details
-
CHECK_VERSION_OK
public static final int CHECK_VERSION_OK- See Also:
-
CHECK_VERSION_WARN
public static final int CHECK_VERSION_WARN- See Also:
-
CHECK_VERSION_ERROR
public static final int CHECK_VERSION_ERROR- See Also:
-
-
Constructor Details
-
AbstractDocParser
protected AbstractDocParser(int sourceType)
-
-
Method Details
-
checkVersion
-
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
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
-
getFeatureConfig
Description copied from interface:DocParserGet the feature config for this parser (implementations of DocParser should useFeatureConfig.DEFAULT if not set)- Specified by:
getFeatureConfigin interfaceDocParser- Returns:
- featuerConfig
-
setFeatureConfig
Description copied from interface:DocParserSet the feature config for this parser- Specified by:
setFeatureConfigin interfaceDocParser- Parameters:
featureConfig-
-
parse
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
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
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
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
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
- Throws:
DocException
-