Search in sources :

Example 1 with ClassAdUnParser

use of org.apache.asterix.external.classad.ClassAdUnParser in project asterixdb by apache.

the class FunctionalTester method print_expr.

/*********************************************************************
     * Function: print_expr
     * Purpose:
     *
     * @throws HyracksDataException
     *********************************************************************/
public static void print_expr(ExprTree tree, State state, Parameters parameters, ClassAdObjectPool objectPool) throws HyracksDataException {
    AMutableCharArrayString output = new AMutableCharArrayString();
    if (state.format == PrintFormat.print_Compact) {
        ClassAdUnParser unparser = new ClassAdUnParser(objectPool);
        unparser.unparse(output, tree);
    } else if (state.format == PrintFormat.print_Pretty) {
        PrettyPrint unparser = new PrettyPrint(objectPool);
        unparser.unparse(output, tree);
    } else if (state.format == PrintFormat.print_XML) {
    /*
                                                            * ClassAdXMLUnParser unparser = new
                                                            * ClassAdXMLUnParser();
                                                            * unparser.SetCompactSpacing(true);
                                                            * unparser.Unparse(output, tree);
                                                            * } else if (state.format ==
                                                            * PrintFormat.print_XMLPretty) {
                                                            * ClassAdXMLUnParser unparser = new
                                                            * ClassAdXMLUnParser();
                                                            * unparser.SetCompactSpacing(false);
                                                            * unparser.Unparse(output, tree);
                                                            */
    }
    System.out.println(output);
}
Also used : PrettyPrint(org.apache.asterix.external.classad.PrettyPrint) ClassAdUnParser(org.apache.asterix.external.classad.ClassAdUnParser) AMutableCharArrayString(org.apache.asterix.external.classad.AMutableCharArrayString)

Aggregations

AMutableCharArrayString (org.apache.asterix.external.classad.AMutableCharArrayString)1 ClassAdUnParser (org.apache.asterix.external.classad.ClassAdUnParser)1 PrettyPrint (org.apache.asterix.external.classad.PrettyPrint)1