|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.MatchingTask
org.enhydra.xml.xmlc.taskdef.Xmlc
org.barracudamvc.taskdefs.Localize
Ant task to invoke the localize HTML template files. Supports all the attributes found in the Xmlc taskdef. This is a reworking of the original Localize taskdef--the taskdef reads the master templates, generates locale templates from it using straight text substitution (previously we actually compiled the master template via XMLC and then parsed the resulting DOM object, which caused all kinds of problems because of Tidy bugs/quirks). At any rate, once the templates are generated, and then we invoke XMLC on everything. There is probably room to improve the performance of this thing (I haven't done any optimization)
Nested Class Summary |
Nested classes inherited from class org.enhydra.xml.xmlc.taskdef.Xmlc |
org.enhydra.xml.xmlc.taskdef.Xmlc.BooleanAttribute |
Field Summary | |
static String[] |
countryCodes
|
File |
masterDir
|
File |
masterFile
|
protected boolean |
tidy
|
Fields inherited from class org.enhydra.xml.xmlc.taskdef.Xmlc |
classPath, cmdl, compile, destDir, forceBuild, keep, logHdr, logLevel, ML, options, packageDir, packageName, performExec, srcDir, srcDirName, srcOutDir, srcOutDirName, upToDate, verbose, xmlcArgs |
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask |
fileset |
Fields inherited from class org.apache.tools.ant.Task |
description, location, target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
project |
Constructor Summary | |
Localize()
|
Method Summary | |
protected boolean |
embeddedInToken(String str,
int fpos,
String stoken,
String etoken)
|
void |
execute()
Execute the task. |
protected boolean |
isQualified(String str,
int fpos)
|
static void |
main(String[] args)
|
protected String |
qualifiedStrReplace(String str,
String str1,
String str2)
Replace occurrences of str1 in string str with str2, but only if the str1 is qualified (ie. not embedded in an 'id=""' or 'class=""' attribute) |
void |
setMasterlocaledir(String masterDir)
Set the Master Locale Directory by accesssing the build.xml file |
void |
setMasterlocalefile(String masterFile)
Set the Master Locale File Name by accessing the build.xml file |
void |
setTidy(org.enhydra.xml.xmlc.taskdef.Xmlc.BooleanAttribute itidy)
Run tidy on the localized templates |
protected String |
strReplace(String str,
String str1,
String str2)
Replace occurrences of str1 in string str with str2 |
Methods inherited from class org.enhydra.xml.xmlc.taskdef.Xmlc |
createArg, setArgs, setClasspath, setCompile, setDestdir, setForce, setKeep, setMarkup, setOptions, setPackagedir, setPackagename, setPerformexec, setSourceout, setSrcdir, setVerbose |
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask |
add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
getProject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean tidy
public File masterFile
public File masterDir
public static final String[] countryCodes
Constructor Detail |
public Localize()
Method Detail |
public void setTidy(org.enhydra.xml.xmlc.taskdef.Xmlc.BooleanAttribute itidy)
itidy
- Set "true" for tidypublic void setMasterlocaledir(String masterDir)
masterDir
- the location of the Master Localization Filepublic void setMasterlocalefile(String masterFile)
masterFile
- the given name of the Master Localization Filepublic void execute() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
protected String qualifiedStrReplace(String str, String str1, String str2)
protected String strReplace(String str, String str1, String str2)
protected boolean isQualified(String str, int fpos)
protected boolean embeddedInToken(String str, int fpos, String stoken, String etoken)
public static void main(String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |