Examples of IClass


Examples of org.jibx.util.IClass

                mapping.setFactoryName(value.getFactoryMethod());
               
                // generate the mapping type name from item class name and suffix
                String suffix;
                GlobalCustom global = m_generationParameters.getGlobal();
                IClass clas = global.getClassInfo(type);
                if (clas.isImplements("Ljava/util/List;")) {
                    suffix = "List";
                } else if (clas.isImplements("Ljava/util/Set;")) {
                    suffix = "Set";
                } else {
                    suffix = "Collection";
                }
                String itype = value.getItemType();
View Full Code Here

Examples of org.jibx.util.IClass

        if (m_formatContext == null) {
            m_formatContext =
                new ClassHierarchyContext(getContainingFormatContext());
        }
        if (def.isDefaultFormat()) {
            IClass clas = def.getType();
            m_formatContext.addTypedComponent(clas, def, vctx);
        }
        String label = def.getLabel();
        if (label != null) {
            m_formatContext.addNamedComponent(label, def, vctx);
View Full Code Here

Examples of org.jibx.util.IClass

        if (m_templateContext == null) {
            m_templateContext =
                new ClassHierarchyContext(getContainingTemplateContext());
        }
        if (def.isDefaultTemplate()) {
            IClass clas = def.getHandledClass();
            if (vctx.isInBinding() ||
                m_templateContext.getSpecificComponent(clas.getName()) == null) {
                m_templateContext.addTypedComponent(clas, def, vctx);
            }
        }
        if (def.getTypeName() != null) {
            m_templateContext.addNamedComponent(def.getTypeName(),
View Full Code Here

Examples of org.jibx.util.IClass

            if (child == base) {
                continue;
            } else if (child instanceof ValueElement) {
               
                // check value reference to enumeration type
                IClass type = ((ValueElement)child).getType();
                if (isEnumeration(type)) {
                    countEnumUsage(type.getName());
                }
               
            } else if (child instanceof CollectionElement) {
               
                // check for collection item type
                CollectionElement collect = (CollectionElement)child;
                IClass itype = collect.getItemTypeClass();
                if (isEnumeration(itype)) {
                   
                    // collection items are enumeration type, count directly
                    countEnumUsage(itype.getName());
                   
                } else if (!isSimpleValue(itype)) {
                   
                    // find implied mapping, if one defined
                    String type = itype.getName();
                    TemplateElementBase ref = collect.getDefinitions().getSpecificTemplate(type);
                    if (ref instanceof MappingElement) {
                        MappingElement mapref = (MappingElement)ref;
                        MappingDetail detail = forceMappingDetail(mapref);
                        detail.setElement(true);
View Full Code Here

Examples of org.jibx.util.IClass

     *
     * @param name fully-qualified name of class to be found
     * @return class information
     */
    public IClass getRequiredClassInfo(String name) {
        IClass iclas = getClassInfo(name);
        if (iclas == null) {
            throw new IllegalStateException("Internal error: class " + name +
                " cannot be found");
        } else {
            return iclas;
View Full Code Here

Examples of org.jibx.util.IClass

     * @return source information
     */
    private Member getItemSource() {
        if (!m_checkedSource) {
            m_checkedSource = true;
            IClass clas = getContainingClass();
            IClassLocator loc = clas.getLocator();
            if (loc instanceof IClassSourceLocator) {
                IClassSourceLocator sloc = (IClassSourceLocator)loc;
                JavaClass jc = sloc.getSourceInfo(clas.getName());
                if (jc != null) {
                    if (isMethod()) {
                        String mname = getName();
                        JavaMethod[] methods = jc.getMethods();
                        for (int i = 0; i < methods.length; i++) {
View Full Code Here

Examples of org.jibx.util.IClass

        String[] interfaces = clas.getInterfaces();
        for (int i = 0; i < interfaces.length; i++) {
            String name = interfaces[i];
            if (!intfset.contains(name)) {
                intfset.add(name);
                IClass iclas = clas.getLocator().getClassInfo(name);
                if (iclas != null) {
                    accumulateInterfaces(iclas, intfset);
                }
            }
        }
View Full Code Here

Examples of org.jibx.util.IClass

        ValidationContext vctx) {
        String type = clas.getName();
        if (m_typeToComponentMap.put(type, comp) == null) {
           
            // new type, add all interfaces and supertypes to compatible set
            IClass sclas = clas;
            do {
                m_compatibleTypeSet.add(sclas.getName());
                if (vctx.isLookupSupported()) {
                    accumulateInterfaces(sclas, m_compatibleTypeSet);
                }
            } while ((sclas = sclas.getSuperClass()) != null);
           
        } else {
            vctx.addError("Duplicate conversion defined for type " + type,
                comp);
        }
View Full Code Here

Examples of org.jibx.util.IClass

     * none found
     */
    public ElementBase getMostSpecificComponent(IClass clas) {
        ElementBase comp = getSpecificComponent(clas.getName());
        while (comp == null) {
            IClass sclas = clas.getSuperClass();
            if (sclas == null) {
                break;
            }
            clas = sclas;
            comp = getSpecificComponent(clas.getName());
View Full Code Here

Examples of org.jibx.util.IClass

            } catch (JiBXException e) {
                throw new IllegalStateException("Error loading class " + name + ": " + e.getMessage());
            }
        }
        public IClass getRequiredClassInfo(String name) {
            IClass iclas = getClassInfo(name);
            if (iclas == null) {
                throw new IllegalStateException("Internal error: class " + name + " cannot be found");
            } else {
                return iclas;
            }
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.