Package org.apache.openjpa.json

Examples of org.apache.openjpa.json.JSON


    }

    public void encode(Object obj, JPAServletContext ctx) {
        if (obj instanceof OpenJPAStateManager) {
            try {
                JSON result = encodeManagedInstance((OpenJPAStateManager)obj,
                    ctx.getPersistenceContext().getMetamodel());
                PrintWriter writer = ctx.getResponse().getWriter();
                writer.println(result.toString());
            } catch (Exception e) {
                throw new ProcessingException(ctx, e);
            }
        } else {
            throw new RuntimeException(this + " does not know how to encode " + obj);
View Full Code Here


        return;
    }
   
    public JSON writeOut(Collection<OpenJPAStateManager> sms, Metamodel model, String title, String desc,
        String uri, OutputStream out) throws IOException {
        JSON json = encode(sms,model);
        out.write(json.toString().getBytes());
        return json;
    }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.json.JSON

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.