Search in sources :

Example 1 with ValidatingVisitor

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

the class Pull method validateMessages.

private TranslationSet validateMessages(ResourceClass resourceClass, CompilationUnit cu, TranslationSet translationSet) throws IOException {
    InspectingVisitor inspector = new InspectingVisitor(resourceClass.getJavaSourceFile().getName());
    inspector.visit(cu, null);
    for (ResourceClassTerm resourceClassTerm : inspector.getTerms()) {
        checkForNewline(resourceClassTerm, translationSet);
    }
    if (!inspector.isMessageSubtype()) {
        return translationSet;
    }
    ValidatingVisitor validator = new ValidatingVisitor(translationSet);
    validator.visit(cu, null);
    return validator.getValidatedSet();
}
Also used : ResourceClassTerm(org.activityinfo.i18n.tools.model.ResourceClassTerm) ValidatingVisitor(org.activityinfo.i18n.tools.parser.ValidatingVisitor) InspectingVisitor(org.activityinfo.i18n.tools.parser.InspectingVisitor)

Aggregations

ResourceClassTerm (org.activityinfo.i18n.tools.model.ResourceClassTerm)1 InspectingVisitor (org.activityinfo.i18n.tools.parser.InspectingVisitor)1 ValidatingVisitor (org.activityinfo.i18n.tools.parser.ValidatingVisitor)1