Package org.jibx.runtime

Examples of org.jibx.runtime.JiBXException


     * @throws JiBXException if attribute not present
     */
    public String attributeText(String ns, String name) throws JiBXException {
        String value = getAttributeValue(ns, name);
        if (value == null) {
            throw new JiBXException("Missing required attribute " +
                buildNameString(ns, name) + " " + buildPositionString());
        } else {
            return value;
        }
    }
View Full Code Here


            map.put(id, holder);
            holder.addBackFill(fill);
        } else if (obj instanceof BackFillHolder) {
            ((BackFillHolder)obj).addBackFill(fill);
        } else {
            throw new JiBXException
                ("Internal operation error (back fill error) " +
                buildPositionString());
        }
    }
View Full Code Here

            BackFillHolder holder = (BackFillHolder)prior;
            String xclass = holder.getExpectedClass();
            if (xclass == null || xclass.equals(obj.getClass().getName())) {
                holder.defineValue(obj);
            } else {
                throw new JiBXException("ID object has wrong type " +
                    buildPositionString());
            }
        } else if (prior != null) {
            throw new JiBXException("Duplicate ID definition " +
                buildPositionString());
        }
    }
View Full Code Here

     */
    public void addUnmarshalling(String mapname, String ns, String name,
        String cname) throws JiBXException {
        int index = m_classIndexMap.get(mapname);
        if (index < 0) {
            throw new JiBXException("No unmarshal mapping defined for class " + mapname);
        }
        m_namespaces[index] = ns;
        m_names[index] = name;
        m_transientUnmarshallerClasses[index-m_transientBase] = cname;
        if (m_transientUnmarshalMap != null && name != null) {
View Full Code Here

     * @throws JiBXException if unknown mapping name
     */
    public void removeUnmarshalling(String mapname) throws JiBXException {
        int index = m_classIndexMap.get(mapname);
        if (index < 0) {
            throw new JiBXException("No unmarshal mapping defined for class " + mapname);
        }
        if (m_transientUnmarshalMap != null && m_names[index] != null) {
            Object value = m_transientUnmarshalMap.get(m_names[index]);
            if (value instanceof Integer) {
                m_transientUnmarshalMap.remove(m_names[index]);
View Full Code Here

            } else {
               
                // load transient unmarshaller class directly
                mname = m_transientUnmarshallerClasses[index-m_transientBase];
                if (mname == null) {
                    throw new JiBXException("No unmarshaller defined for class " + m_factory.getMappedClasses()[index]);
                }
                clas = m_factory.loadClass(mname);
               
            }
            try {
               
                // make sure we have a class
                if (clas == null) {
                    throw new JiBXException("Unable to load unmarshaller class " + mname);
                }
               
                // create and cache an instance of the class
                IUnmarshaller m = (IUnmarshaller)clas.newInstance();
                m_unmarshallers[index] = m;
               
            } catch (JiBXException e) {
                throw e;
            } catch (Exception e) {
                throw new JiBXException("Unable to create unmarshaller of class " + mname + ":", e);
            }

        }
        return m_unmarshallers[index];
    }
View Full Code Here

    public IUnmarshaller getUnmarshaller(String mapname) throws JiBXException {
        int index = m_classIndexMap.get(mapname);
        if (index >= 0) {
            return getUnmarshaller(index);
        } else {
            throw new JiBXException("No unmarshal mapping defined for class " + mapname);
        }
    }
View Full Code Here

    public Object unmarshalElement(Class clas) throws JiBXException {
        String name = toStart();
        IUnmarshaller unmarshal =
            getUnmarshaller(m_reader.getNamespace(), name);
        if (unmarshal == null) {
            throw new JiBXException("No unmarshaller for element " +
                currentNameString() + " " + buildPositionString());
        } else {
            Object obj = unmarshal.unmarshal(null, this);
            if (!clas.isInstance(obj)) {
                throw new JiBXException("Element " + name +
                    " not compatible with expected type " + clas.getName() +
                    " " + buildPositionString());
            }
            return obj;
        }
View Full Code Here

    public Object unmarshalElement() throws JiBXException {
        String name = toStart();
        IUnmarshaller unmarshal =
            getUnmarshaller(m_reader.getNamespace(), name);
        if (unmarshal == null) {
            throw new JiBXException("No unmarshaller for element " +
                currentNameString() + " " + buildPositionString());
        } else {
            return unmarshal.unmarshal(null, this);
        }
    }
View Full Code Here

     *
     * @param msg exception message text
     * @exception JiBXException always thrown
     */
    public void throwStartTagException(String msg) throws JiBXException {
        throw new JiBXException(msg + " at tag " + currentNameString() +
            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.