Examples of startObject()


Examples of org.elasticsearch.common.xcontent.XContentBuilder.startObject()

        assertThat(builder.string(), equalTo("{\"test\":\"value\"}"));
    }

    @Test public void testOverloadedList() throws Exception {
        XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON);
        builder.startObject().field("test", Lists.newArrayList("1", "2")).endObject();
        assertThat(builder.string(), equalTo("{\"test\":[\"1\",\"2\"]}"));
    }

    @Test public void testWritingBinaryToStream() throws Exception {
        FastByteArrayOutputStream bos = new FastByteArrayOutputStream();
View Full Code Here

Examples of org.elasticsearch.common.xcontent.XContentBuilder.startObject()

        System.out.println("DATA: " + sData);
    }

    @Test public void testFieldCaseConversion() throws Exception {
        XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON).fieldCaseConversion(CAMELCASE);
        builder.startObject().field("test_name", "value").endObject();
        assertThat(builder.string(), equalTo("{\"testName\":\"value\"}"));

        builder = XContentFactory.contentBuilder(XContentType.JSON).fieldCaseConversion(UNDERSCORE);
        builder.startObject().field("testName", "value").endObject();
        assertThat(builder.string(), equalTo("{\"test_name\":\"value\"}"));
View Full Code Here

Examples of org.elasticsearch.common.xcontent.XContentBuilder.startObject()

        XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON).fieldCaseConversion(CAMELCASE);
        builder.startObject().field("test_name", "value").endObject();
        assertThat(builder.string(), equalTo("{\"testName\":\"value\"}"));

        builder = XContentFactory.contentBuilder(XContentType.JSON).fieldCaseConversion(UNDERSCORE);
        builder.startObject().field("testName", "value").endObject();
        assertThat(builder.string(), equalTo("{\"test_name\":\"value\"}"));
    }
}
View Full Code Here

Examples of org.fcrepo.server.utilities.ServerUtilitySerializer.startObject()

            } else { // logging style output
                response.setContentType("text/plain; charset=UTF-8");
                ServerUtilitySerializer ser = new ServerUtilitySerializer(pw);
                for (String curpid : pids) {
                    ser.startObject(curpid);
                    for (String curdsID : datastreams) {
                        ser.startDatastream(curdsID);
                        Date[] versions;
                        try {
                            versions = apimDefault.modifyDatastreamControlGroup(context, curpid, curdsID, controlGroup, addXMLHeader, reformat, setMIMETypeCharset);
View Full Code Here

Examples of org.jnode.assembler.NativeStream.startObject()

            /* Write static initializer code */
            emitStaticInitializerCalls(os, bootClasses, clInitCaller);

            // This is the end of the image
            X86BinaryAssembler.ObjectInfo dummyObjectAtEnd =
                os.startObject(loadClass(VmMethodCode.class));
            pageAlign(os);
            dummyObjectAtEnd.markEnd();
            os.setObjectRef(imageEnd);
            os.setObjectRef(bootHeapEnd);

View Full Code Here

Examples of org.jnode.assembler.x86.X86Assembler.startObject()

            final X86Assembler os = (X86Assembler) nos;
            final EntryPoints context = getEntryPoints();
            // Create the helper
            final X86CompilerHelper ih = new X86CompilerHelper(os, null, context, isBootstrap);
            // Start an "object"
            final NativeStream.ObjectInfo objectInfo = os.startObject(context.getVmMethodCodeClass());
            // Start the code creation
            cm.setCodeStart(os.setObjectRef(new Label(method.getMangledName() + "$$start")));

            // Setup call to {@link VmMethod#recompileMethod(int, int)}
            final VmType<?> declClass = method.getDeclaringClass();
View Full Code Here

Examples of org.jnode.assembler.x86.X86Assembler.startObject()

            final X86Assembler os = (X86Assembler) nos;
            // Create the helper
            final X86CompilerHelper helper = new X86CompilerHelper(os, null,
                context, isBootstrap);
            // Start an "object"
            final NativeStream.ObjectInfo objectInfo = os.startObject(context
                .getVmMethodCodeClass());
            // Start the code creation
            cm.setCodeStart(os.setObjectRef(new Label(method.getMangledName()
                + "$$abstract-start")));
            // Call abstract method error method
View Full Code Here

Examples of org.jnode.assembler.x86.X86BinaryAssembler.startObject()

    protected void emitStaticInitializerCalls(NativeStream nativeOs,
                                              VmType<?>[] bootClasses, Object clInitCaller)
        throws ClassNotFoundException {

        final X86BinaryAssembler os = (X86BinaryAssembler) nativeOs;
        X86BinaryAssembler.ObjectInfo initCallerObject = os
            .startObject(loadClass(VmMethodCode.class));

        os.setObjectRef(clInitCaller);

        // Call VmClass.loadFromBootClassArray
View Full Code Here

Examples of org.jvnet.sorcerer.util.JsonWriter.startObject()

    }

    public void generateProjectJs(final Map<String, String> cus, PrintWriter w) throws IOException {
        try {
            final JsonWriter jw = new JsonWriter(w);
            jw.startObject();
            jw.property("name", "Project"); // TODO
            jw.propertyUnquoted("linker", "linker.self");
            jw.property("sources", new JsonWriter.Writable() {
                public void write(JsonWriter w) {
                    for (Map.Entry<String, String> entry : cus.entrySet()) {
View Full Code Here

Examples of org.openjena.atlas.json.io.JSWriter.startObject()

    {
        JSWriter out = new JSWriter(outStream) ;
       
        out.startOutput() ;

        out.startObject() ;
        out.key(kHead) ;
        out.startObject() ;
        out.finishObject() ;
        out.pair(kBoolean, result) ;
        out.finishObject() ;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.