Package org.apache.log4j.joran.spi

Examples of org.apache.log4j.joran.spi.Interpreter


    ruleStore.addRule(new Pattern("*/computation/literal"), new LiteralAction());
    ruleStore.addRule(new Pattern("*/computation/add"), new AddAction());
    ruleStore.addRule(new Pattern("*/computation/multiply"), new MultiplyAction());
   
    // Create a new Joran Interpreter and hand it our simple rule store.
    Interpreter ji = new Interpreter(ruleStore);

    // Create a SAX parser
    SAXParserFactory spf = SAXParserFactory.newInstance();
    SAXParser saxParser = spf.newSAXParser();

    // Parse the file given as the application's first argument and
    // set the SAX ContentHandler to the Joran Interpreter we just created.
    saxParser.parse(args[0], ji);
   
    // The file has been parsed and interpreted. We now print any errors that
    // might have occured.
    List errorList = ji.getExecutionContext().getErrorList();
    if(errorList.size() > 0) {
      System.out.println("The following errors occured:");
      for(int i = 0; i < errorList.size(); i++) {
        System.out.println("\t"+errorList.get(i));
      }
View Full Code Here

TOP

Related Classes of org.apache.log4j.joran.spi.Interpreter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.