Package org.nuiton.i18n.plugin.parser
Class AbstractFileParser
java.lang.Object
org.nuiton.i18n.plugin.parser.AbstractFileParser
- All Implemented Interfaces:
FileParser
- Direct Known Subclasses:
AbstractParserXmlMojo.XmlFileParser,ParserGWTJavaMojo.GWTJavaFileParser,ParserJavaMojo.JavaFileParser,ParserStruts2Mojo.Struts2JspFileParser
A abstract implementation of a
FileParser with no logic.- Since:
- 1.2
- Author:
- Tony Chemit - chemit@codelutin.com
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractFileParser(org.apache.maven.plugin.logging.Log log, String encoding, org.nuiton.io.SortedProperties oldParser, Pattern acceptKeyPattern, boolean showTouchedFiles) -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()clean file parser.protected voidfinalize()Gets encoding used to read and write files.org.apache.maven.plugin.logging.LoggetLog()org.nuiton.io.SortedPropertiesTODO As we do not used anylonger old language, we should directly TODO use only a set of keys, no need to keep i18n value...booleanbooleanprotected FileprepareFile(File file) To prepare the file (if any thing to be done before scanning it).protected voidregisterKey(String key) Method to invoke when a i18n key was detected .protected voidsetTouched(boolean touched) Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuiton.i18n.plugin.parser.FileParser
parseFile, parseLine
-
Field Details
-
acceptKeyPattern
-
-
Constructor Details
-
AbstractFileParser
-
-
Method Details
-
isShowTouchedFiles
public boolean isShowTouchedFiles() -
isTouched
public boolean isTouched()- Specified by:
isTouchedin interfaceFileParser- Returns:
trueif file was touched (says contains at least one i18n key)
-
getResult
public org.nuiton.io.SortedProperties getResult()Description copied from interface:FileParserTODO As we do not used anylonger old language, we should directly TODO use only a set of keys, no need to keep i18n value...- Specified by:
getResultin interfaceFileParser- Returns:
- the results of i18n keys found for the given file
-
getEncoding
Description copied from interface:FileParserGets encoding used to read and write files.- Specified by:
getEncodingin interfaceFileParser- Returns:
- the encoding
-
destroy
public void destroy()Description copied from interface:FileParserclean file parser.- Specified by:
destroyin interfaceFileParser
-
finalize
-
getLog
public org.apache.maven.plugin.logging.Log getLog() -
registerKey
Method to invoke when a i18n key was detected .- Parameters:
key- the i18n key to register
-
setTouched
protected void setTouched(boolean touched) -
prepareFile
To prepare the file (if any thing to be done before scanning it). By default do nothing, use directly the input file.- Parameters:
file- the incoming file- Returns:
- the real file to process
- Throws:
IOException- if any IO problem while preparing file- Since:
- 2.1
-