Package org.jibx.runtime

Examples of org.jibx.runtime.JiBXException


                System.out.print(prob.getSeverity() >=
                    ValidationProblem.ERROR_LEVEL ? "Error: " : "Warning: ");
                System.out.println(prob.getDescription());
            }
            if (vctx.getErrorCount() > 0 || vctx.getFatalCount() > 0) {
                throw new JiBXException("Errors in binding");
            }
        }
       
        // add all the mapping and format definitions in binding to qualified name maps
        accumulateBindingDefinitions(binding, elemmap, typemap);
View Full Code Here


                }
                bdef.setFactoryLocation(tpack, root);
                return bdef;
               
            } catch (JiBXException e) {
                throw new JiBXException
                    ("\n*** Error during code generation for file '" + fname +
                    "' - please enter a bug report for this error in Jira if " +
                    "the problem is not listed as fixed on the online status " +
                    "page ***\n", e);
            }
           
        } else {
            throw new JiBXException("Binding " + fname +
                " is unusable because of validation errors");
        }
    }
View Full Code Here

        // find a matching static method
        ClassItem method = ClassItem.findStaticMethod(ser, msigs);
       
        // report error if method not found
        if (method == null) {
            throw new JiBXException("Serializer " + ser + " not found");
        } else {
            m_serializer = method;
        }
    }
View Full Code Here

        m_converter =
            ClassItem.findStaticMethod(wsconv, WHITESPACE_CONVERT_SIGNATURES);
       
        // report error if method not found or incompatible
        if (m_converter == null) {
            throw new JiBXException("Whitespace converter " + wsconv + " not found");
        }
    }
View Full Code Here

        ClassItem method =
            ClassItem.findStaticMethod(deser, DESERIALIZER_SIGNATURES);
       
        // report error if method not found or incompatible
        if (method == null) {
            throw new JiBXException("Deserializer " + deser + " not found");
        } else if (ClassItem.isAssignable(method.getTypeName(), m_typeName)) {
            m_deserializer = method;
        } else {
            throw new JiBXException("Deserializer " + deser +
                " returns wrong type");
        }
    }
View Full Code Here

    public void marshal(Object obj, IMarshallingContext ictx)
        throws JiBXException {
       
        // make sure the parameters are as expected
        if (!(obj instanceof Element)) {
            throw new JiBXException("Mapped object not an org.dom4j.Element");
        } else {
            try {
                   
                // marshal element and all content with only leading indentation
                m_xmlWriter = ictx.getXmlWriter();
                m_xmlWriter.indent();
                int indent = ictx.getIndent();
                ictx.setIndent(-1);
                m_defaultNamespaceURI = null;
                marshalElement((Element)obj);
                ictx.setIndent(indent);
               
            } catch (IOException e) {
                throw new JiBXException("Error writing to document", e);
            }
        }
    }
View Full Code Here

     * @see org.jibx.runtime.IUnmarshaller#isPresent(org.jibx.runtime.IUnmarshallingContext)
     */
    public boolean isPresent(IUnmarshallingContext ctx) throws JiBXException {
        if (m_name == null) {
            if (!(ctx instanceof UnmarshallingContext)) {
                throw new JiBXException
                    ("Unmarshalling context not of expected type");
            } else {
                return !((UnmarshallingContext)ctx).isEnd();
            }
        } else {
View Full Code Here

    public Object unmarshal(Object obj, IUnmarshallingContext ictx)
        throws JiBXException {
       
        // verify the entry conditions
        if (!(ictx instanceof UnmarshallingContext)) {
            throw new JiBXException
                ("Unmarshalling context not of expected type");
        } else if (m_name != null && !ictx.isAt(m_uri, m_name)) {
            ((UnmarshallingContext)ictx).throwStartTagNameError(m_uri, m_name);
        }
       
        // position to element start tag
        m_unmarshalContext = (UnmarshallingContext)ictx;
        m_unmarshalContext.toStart();
       
        // unmarshal element to document model
        try {
      return unmarshalElement();
    } catch (IOException e) {
            throw new JiBXException("Error reading from document", e);
    }
    }
View Full Code Here

     * @param name local name part of name
     * @exception JiBXException always thrown
     */
    public void throwStartTagNameError(String ns, String name)
        throws JiBXException {
        throw new JiBXException("Expected " + buildNameString(ns, name) +
            " start tag, found " + currentNameString() + " start tag " +
            buildPositionString());
    }
View Full Code Here

     * @param name local name part of name
     * @exception JiBXException always thrown
     */
    public void throwEndTagNameError(String ns, String name)
        throws JiBXException {
        throw new JiBXException("Expected " + buildNameString(ns, name) +
            " end tag, found " + currentNameString() + " end tag " +
            buildPositionString());
    }
View Full Code Here

TOP

Related Classes of org.jibx.runtime.JiBXException

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.