Package org.jibx.schema.elements

Examples of org.jibx.schema.elements.SimpleTypeElement


                {
                    // replace type only if global type definition
                    if (parent.isGlobal()) {
                        GlobalExtension global = (GlobalExtension)parent.getExtension();
                        if (!global.isIncluded()) {
                            SimpleTypeElement type = (SimpleTypeElement)parent;
                            ComponentExtension parentext = (ComponentExtension)type.getExtension();
                            parentext.setOverrideType(derive.getBase());
                            return true;
                        }
                    }
                    break;
View Full Code Here


            for (int i = 0; i < count; i++) {
                SchemaBase child = topcomp.getChild(i);
                if (child instanceof OpenAttrBase) {
                   
                    // child schema component must be an inline simple type definition
                    SimpleTypeElement simple = (SimpleTypeElement)child;
                    boolean keeper = false;
                    SchemaBase derivation = simple.getDerivation();
                    QName repltype = null;
                    if (derivation != null) {
                       
                        // keep the inline definition by default, but check for replacement cases
                        keeper = true;
View Full Code Here

            try {
                namemeth.setAccessible(true);
            } catch (RuntimeException e) { /* deliberately empty */
            }
            Object[] values = (Object[])valsmeth.invoke(null, (Object[])null);
            SimpleTypeElement simple = new SimpleTypeElement();
            SimpleRestrictionElement restr = new SimpleRestrictionElement();
            restr.setBase(Types.STRING_QNAME);
            for (int i = 0; i < values.length; i++) {
                Enumeration enumel = new Enumeration();
                enumel.setValue(namemeth.invoke(values[i], (Object[])null).toString());
                restr.getFacetsList().add(enumel);
            }
            simple.setDerivation(restr);
            addDocumentation(detail.getCustom().getClassInformation(), simple);
            return simple;
        } catch (SecurityException e) {
            e.printStackTrace();
        } catch (NoSuchMethodException e) {
View Full Code Here

        Collection simples = m_detailDirectory.getSimpleDetails();
        for (Iterator iter = simples.iterator(); iter.hasNext();) {
            EnumDetail detail = (EnumDetail)iter.next();
            if (detail.isGlobal()) {
                ClassCustom custom = detail.getCustom();
                SimpleTypeElement type = buildSimpleType(custom.getClassInformation());
                type.setName(custom.getTypeName());
                SchemaHolder hold = findSchema(custom.getNamespace());
                hold.getSchema().getTopLevelChildren().add(type);
                m_classSimpletypes.put(custom.getName(), custom.getTypeQName());
            }
        }
View Full Code Here

     * @param comp
     * @return <code>true</code> if an enumeration definition, <code>false</code> if not
     */
    public static boolean isEnumeration(AnnotatedBase comp) {
        if (comp.type() == SchemaBase.SIMPLETYPE_TYPE) {
            SimpleTypeElement type = (SimpleTypeElement)comp;
            if (type.getDerivation().type() == SchemaBase.RESTRICTION_TYPE) {
                SimpleRestrictionElement restrict = (SimpleRestrictionElement)type.getDerivation();
                FilteredSegmentList facets = restrict.getFacetsList();
                for (int i = 0; i < facets.size(); i++) {
                    FacetElement facet = (FacetElement)facets.get(i);
                    if (facet.type() == SchemaBase.ENUMERATION_TYPE) {
                        return true;
View Full Code Here

TOP

Related Classes of org.jibx.schema.elements.SimpleTypeElement

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.