Package org.jibx.binding.model

Examples of org.jibx.binding.model.ElementBase.type()


     */
    private static void accumulateBindingDefinitions(BindingElement binding, Map elemmap, Map typemap) {
        ArrayList childs = binding.topChildren();
        for (int i = 0; i < childs.size(); i++) {
            ElementBase element = (ElementBase)childs.get(i);
            if (element.type() == ElementBase.INCLUDE_ELEMENT) {
               
                // use recursive call to add nested definitions in included binding
                accumulateBindingDefinitions(((org.jibx.binding.model.IncludeElement)element).getBinding(), elemmap,
                    typemap);
               
View Full Code Here


               
                // use recursive call to add nested definitions in included binding
                accumulateBindingDefinitions(((org.jibx.binding.model.IncludeElement)element).getBinding(), elemmap,
                    typemap);
               
            } else if (element.type() == ElementBase.MAPPING_ELEMENT) {
               
                // handle mapping as type if abstract with type name, or as element if concrete
                MappingElementBase mapping = (MappingElementBase)element;
                String cname = mapping.getClassName();
                if (mapping.isAbstract()) {
View Full Code Here

                   
                    // check for special case of two unwrapped collections with same item-type and no children
                    ArrayList siblings = parent.children();
                    if (siblings.size() > 0 && coll.children().size() == 0 && coll.getName() == null) {
                        ElementBase sibling = (ElementBase)siblings.get(siblings.size()-1);
                        if (sibling.type() == ElementBase.COLLECTION_ELEMENT) {
                            CollectionElement lastcoll = (CollectionElement)sibling;
                            if (lastcoll.children().size() == 0 && lastcoll.getName() == null &&
                                Utility.safeEquals(lastcoll.getItemTypeName(), coll.getItemTypeName())) {
                                throw new IllegalStateException("Need to use wrapper element for collection member '" +
                                    memb.getBaseName() + "' of class " + cust.getName());
View Full Code Here

     */
    private static void accumulateBindingDefinitions(BindingElement binding, Map elemmap, Map typemap) {
        ArrayList childs = binding.topChildren();
        for (int i = 0; i < childs.size(); i++) {
            ElementBase element = (ElementBase)childs.get(i);
            if (element.type() == ElementBase.INCLUDE_ELEMENT) {
               
                // use recursive call to add nested definitions in included binding
                BindingElement inclbinding = ((org.jibx.binding.model.IncludeElement)element).getBinding();
                if (inclbinding != null) {
                    accumulateBindingDefinitions(inclbinding, elemmap,
View Full Code Here

                if (inclbinding != null) {
                    accumulateBindingDefinitions(inclbinding, elemmap,
                        typemap);
                }
               
            } else if (element.type() == ElementBase.MAPPING_ELEMENT) {
               
                // handle mapping as type if abstract with type name, or as element if concrete
                MappingElementBase mapping = (MappingElementBase)element;
                String cname = mapping.getClassName();
                TypeData data = buildClassData(cname, false);
View Full Code Here

                    if (s_logger.isDebugEnabled()) {
                        s_logger.debug("Added class " + cname + " for element " + qname);
                    }
                }
               
            } else if (element.type() == ElementBase.FORMAT_ELEMENT) {
               
                // add named format as simple type definition
                FormatElement format = (FormatElement)element;
                String name = format.getTypeName();
                if (name != null) {
View Full Code Here

     * @return <code>true</code> if no-namespace namespace used, <code>false</code> if not
     */
    public static boolean checkNoNamespace(BindingElement binding) {
        loop: for (Iterator childiter = binding.topChildIterator(); childiter.hasNext();) {
            ElementBase child = (ElementBase)childiter.next();
            switch (child.type()) {
               
                case ElementBase.NAMESPACE_ELEMENT:
                    if (((NamespaceElement)child).getPrefix() == null) {
                        return true;
                    }
View Full Code Here

        boolean mult) {
       
        // handle all nested elements of container
        for (int i = 0; i < comps.size(); i++) {
            ElementBase child = (ElementBase)comps.get(i);
            switch (child.type()) {
               
                case ElementBase.COLLECTION_ELEMENT:
                case ElementBase.STRUCTURE_ELEMENT:
                {
                    defineStructureComponent((StructureElementBase)child,
View Full Code Here

        // process each mapping definition for binding
        m_structureStack.push(binding);
        ArrayList tops = binding.topChildren();
        for (int i = 0; i < tops.size(); i++) {
            ElementBase top = (ElementBase)tops.get(i);
            if (top.type() == ElementBase.MAPPING_ELEMENT) {
               
                // find or create schema for mapped class
                MappingElementBase mapping = (MappingElementBase)top;
                String uri = mapping.getNamespace().getUri();
                Element schema = (Element)m_schemaMap.get(uri);
View Full Code Here

                       
                        // merge contained namespace definitions into set for operation
                        Iterator citer = mapping.topChildIterator();
                        while (citer.hasNext()) {
                            ElementBase child = (ElementBase)citer.next();
                            if (child.type() == ElementBase.NAMESPACE_ELEMENT) {
                                dfltns = mapNamespace((NamespaceElement)child, dfltns, nsmap);
                            } else {
                               break;
                            }
                        }
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.