Search in sources :

Example 6 with InspectingVisitor

use of org.activityinfo.i18n.tools.parser.InspectingVisitor in project activityinfo by bedatadriven.

the class Push method execute.

public void execute() throws IOException {
    List<ResourceClassTerm> terms = Lists.newArrayList();
    for (String className : Project.INSTANCE.getResourceClasses()) {
        ResourceClass resourceClass = new ResourceClass(Project.INSTANCE.getSourceDirectory(), className);
        InspectingVisitor visitor = resourceClass.inspect();
        terms.addAll(visitor.getTerms());
    }
    if (dryRun) {
        Project.INSTANCE.getTranslationSource().dumpNewTerms(terms);
    } else {
        Project.INSTANCE.getTranslationSource().updateTerms(terms, purge);
    }
}
Also used : ResourceClassTerm(org.activityinfo.i18n.tools.model.ResourceClassTerm) InspectingVisitor(org.activityinfo.i18n.tools.parser.InspectingVisitor) ResourceClass(org.activityinfo.i18n.tools.model.ResourceClass)

Aggregations

InspectingVisitor (org.activityinfo.i18n.tools.parser.InspectingVisitor)6 ResourceClass (org.activityinfo.i18n.tools.model.ResourceClass)3 ResourceClassTerm (org.activityinfo.i18n.tools.model.ResourceClassTerm)3 ParseException (com.github.javaparser.ParseException)1 CompilationUnit (com.github.javaparser.ast.CompilationUnit)1 File (java.io.File)1 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1 ValidatingVisitor (org.activityinfo.i18n.tools.parser.ValidatingVisitor)1