Examples of IUnmarshallingContext


Examples of org.jibx.runtime.IUnmarshallingContext

            return false;
        }
        IBindingFactory bfact = BindingDirectory.getFactory(mclas);
       
        // unmarshal document to construct objects
        IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
        Object obj = uctx.unmarshalDocument(new FileInputStream(fin), null);
        if (!mclas.isInstance(obj)) {
            System.err.println("Unmarshalled result not expected type");
            return false;
        }
       
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext

            m_global.setAddConstructors(true);
            m_global.setForceClasses(true);
            m_global.setMapAbstract(Boolean.TRUE);
        } else {
            IBindingFactory fact = BindingDirectory.getFactory(WsdlCustom.class);
            IUnmarshallingContext ictx = fact.createUnmarshallingContext();
            FileInputStream is = new FileInputStream(path);
            ictx.setDocument(is, null);
            ictx.setUserContext(vctx);
            ((IUnmarshallable)m_global).unmarshal(ictx);
        }
       
        // find or build WSDL customization
        WsdlCustom custom = null;
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext

     * @throws JiBXException on unrecoverable error in schemas
     * @throws IOException on error reading schemas
     */
    private SchemaElement[] load(List list) throws JiBXException, IOException {
        IBindingFactory factory = BindingDirectory.getFactory(SchemaUtils.XS_PREFIX_BINDING, SchemaElement.class);
        IUnmarshallingContext ictx = factory.createUnmarshallingContext();
        int count = list.size();
        SchemaElement[] schemas = new SchemaElement[count];
        int fill = 0;
        for (Iterator iter = list.iterator(); iter.hasNext();) {
           
            // unmarshal document to construct schema structure
            UrlResolver resolver = (UrlResolver)iter.next();
            ictx.setDocument(resolver.getContent(), resolver.getName(), null);
            ictx.setUserContext(m_validationContext);
            Object obj = ictx.unmarshalElement();
           
            // set resolver for use during schema processing
            SchemaElement schema = (SchemaElement)obj;
            schemas[fill++] = schema;
            schema.setResolver(resolver);
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext

     * @throws IOException on error reading schemas
     */
    public static SchemaElement[] load(Collection resolves, String uri, ValidationContext vctx)
    throws JiBXException, IOException {
        IBindingFactory factory = BindingDirectory.getFactory(SchemaUtils.XS_PREFIX_BINDING, SchemaElement.class);
        IUnmarshallingContext ictx = factory.createUnmarshallingContext();
        int count = resolves.size();
        int offset = 0;
        SchemaElement[] schemas = new SchemaElement[count];
        for (Iterator iter = resolves.iterator(); iter.hasNext();) {
           
            // unmarshal document to construct schema structure
            ISchemaResolver resolver = (ISchemaResolver)iter.next();
            ictx.setDocument(resolver.getContent(), resolver.getName(), null);
            ictx.setUserContext(vctx);
            SchemaElement schema = new SchemaElement();
            ((IUnmarshallable)schema).unmarshal(ictx);
           
            // set resolver for use during schema processing
            schemas[offset++] = schema;
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext

        }
    try {
           
            // unmarshal customer information from file
            IBindingFactory bfact = BindingDirectory.getFactory(Order.class);
            IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
            FileInputStream in = new FileInputStream(args[0]);
            Order order = (Order)uctx.unmarshalDocument(in, null);
           
            // compute the total amount of the order
            float total = 0.0f;
            for (Iterator<Item> iter = order.getItems().iterator(); iter.hasNext();) {
                Item item = iter.next();
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext

     * @param vctx validation context
     * @return schema element
     * @throws Exception
     */
    protected SchemaElement readSchema(InputStream is, ValidationContext vctx) throws Exception {
        final IUnmarshallingContext ictx = m_bindingFactory.createUnmarshallingContext();
        ictx.setDocument(is, null);
        ictx.setUserContext(vctx);
        SchemaElement schema = (SchemaElement)ictx.unmarshalElement();
        m_nameRegister = schema.getRegister();
        return schema;
    }
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext

     */
    protected SchemasetCustom loadCustomization(String text) throws Exception {
        SchemasetCustom custom = new SchemasetCustom((SchemasetCustom)null);
        IBindingFactory fact = BindingDirectory.getFactory("xsdcodegen_customs_binding",
            "org.jibx.schema.codegen.custom");
        IUnmarshallingContext ictx = fact.createUnmarshallingContext();
        ictx.setDocument(new StringReader(text));
        ictx.setUserContext(m_validationContext);
        ((IUnmarshallable)custom).unmarshal(ictx);
        return custom;
    }
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext

        // load customizations and check for errors
        ValidationContext vctx = new ValidationContext();
        m_customRoot = new SchemasetCustom((SchemasetCustom)null);
        if (path != null) {
            IBindingFactory fact = BindingDirectory.getFactory(SchemasetCustom.class);
            IUnmarshallingContext ictx = fact.createUnmarshallingContext();
            FileInputStream is = new FileInputStream(path);
            ictx.setDocument(is, null);
            ictx.setUserContext(vctx);
            ((IUnmarshallable)m_customRoot).unmarshal(ictx);
        }
        ArrayList probs = vctx.getProblems();
        if (probs.size() > 0) {
            for (int i = 0; i < probs.size(); i++) {
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext

            custom = new SchemasetCustom((SchemasetCustom)null);
        } else {
           
            // unmarshal either a <schema-set> or <schema> element
            IBindingFactory fact = BindingDirectory.getFactory(SchemasetCustom.class);
            IUnmarshallingContext ictx = fact.createUnmarshallingContext();
            FileInputStream is = new FileInputStream(path);
            ictx.setDocument(is, null);
            ictx.setUserContext(vctx);
            Object obj = ictx.unmarshalElement();
            if (obj instanceof SchemasetCustom) {
                custom = (SchemasetCustom)obj;
            } else if (obj instanceof SchemaCustom) {
                custom = new SchemasetCustom((SchemaCustom)obj);
            } else {
View Full Code Here

Examples of org.jibx.runtime.IUnmarshallingContext

        }
    try {
           
            // unmarshal customer information from file
            IBindingFactory bfact = BindingDirectory.getFactory(Order.class);
            IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
            FileInputStream in = new FileInputStream(args[0]);
            Order order = (Order)uctx.unmarshalDocument(in, null);
           
            // compute the total amount of the order
            float total = 0.0f;
            for (Iterator iter = order.getItems().iterator(); iter.hasNext();) {
                Item item = (Item)iter.next();
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.