Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.SchemaComponent


        return (ref != null) ? ref.get() : null;
    }

    public SchemaComponent resolveHandle(String handle)
    {
        SchemaComponent result;

        synchronized (_resolvedHandles)
        {
            result = (SchemaComponent)_resolvedHandles.get(handle);
        }
View Full Code Here


        // Now fully javaize everything deeply

        for (int i = 0 , len = allComponents.size() ; i < len ; i++)
        {
            SchemaComponent sc = (SchemaComponent)allComponents.get(i);
            javaizeComponent(sc, componentData, packages);
            // allSeenTypes.addAll(Arrays.asList(gType.getAnonymousTypes()));
        }

        //TODO: check for any real errors:
View Full Code Here

    {
        Set usedNames = new HashSet();

        for (int i = 0 , len = allComponents.size() ; i < len ; i++)
        {
            SchemaComponent sc = (SchemaComponent)allComponents.get(i);
            QName name = sc.getName();

            ComponentInfo ci = getComponentInfo(sc, componentData);

            ci.setFullJavaIntfName(pickFullJavaIntfName(usedNames, name));
            ci.setFullJavaImplName(pickFullJavaImplName(usedNames, ci.getFullJavaIntfName()));

            // Construct a new PackageInfo object for each unique package name
            String pkgname = getPackageName(ci.getFullJavaIntfName());
            if (! packages.containsKey(pkgname))
            {
                PackageInfo pi = new PackageInfo(pkgname);
                packages.put(pkgname, pi);
                pi.setIndexClassName(SchemaTypeCodePrinter.indexClassForSystem(sc.getTypeSystem()));
            }
        }

    }
View Full Code Here

            allComponents.addAll(Arrays.asList(sts.globalElements()));
            allComponents.addAll(Arrays.asList(sts.globalTypes()));

            for (int i = 0, len = allComponents.size() ; i < len ; i++)
            {
                SchemaComponent sc = (SchemaComponent)allComponents.get(i);
                ComponentInfo ci = (ComponentInfo)componentData.get(sc);

                addComponentToConfig(sc, ci, root);

                assert ci != null;
View Full Code Here

                basicMessage = "Definition " + QNameHelper.pretty(itemName) + " not found.";
                break;
        }

        String helpfulMessage = "";
        SchemaComponent foundComponent = findSpelling(itemName);
        QName name;
        if (foundComponent != null)
        {
            name = foundComponent.getName();
            if (name != null)
            {
                String sourceName = null;
                switch (foundComponent.getComponentType())
                {
                    case SchemaComponent.TYPE:
                        sourceName = ((SchemaType)foundComponent).getSourceName();
                        break;
                    case SchemaComponent.ELEMENT:
                        sourceName = ((SchemaGlobalElement)foundComponent).getSourceName();
                        break;
                    case SchemaComponent.ATTRIBUTE:
                        sourceName = ((SchemaGlobalAttribute)foundComponent).getSourceName();
                        break;
                }
                String source = "";
                if (sourceName != null)
                {
                    source = " (in " +  sourceName.substring(sourceName.lastIndexOf('/') + 1) + ")";
                }
               
                if (name.equals(itemName))
                {
                    switch (foundComponent.getComponentType())
                    {
                        case SchemaComponent.TYPE:
                            helpfulMessage = "  Do you mean to refer to the type with that name" + source + "?";
                            break;
                        case SchemaComponent.ELEMENT:
                            helpfulMessage = "  Do you mean to refer to the element with that name" + source + "?";
                            break;
                        case SchemaComponent.ATTRIBUTE:
                            helpfulMessage = "  Do you mean to refer to the attribute with that name" + source + "?";
                            break;
                        case SchemaComponent.ATTRIBUTE_GROUP:
                            helpfulMessage = "  Do you mean to refer to the attribute group with that name" + source + "?";
                            break;
                        case SchemaComponent.MODEL_GROUP:
                            helpfulMessage = "  Do you mean to refer to the model group with that name" + source + "?";
                            break;
                    }
                }
                else
                {
                    switch (foundComponent.getComponentType())
                    {
                        case SchemaComponent.TYPE:
                            helpfulMessage = "  Do you mean to refer to the type named " + QNameHelper.pretty(name) + source + "?";
                            break;
                        case SchemaComponent.ELEMENT:
View Full Code Here

            _componentsToHandles = new LinkedHashMap();
            for (Iterator i = _handlesToRefs.keySet().iterator(); i.hasNext(); )
            {
                String handle = (String)i.next();
//                System.err.println("Writing preexisting handle " + handle);
                SchemaComponent comp = ((SchemaComponent.Ref)_handlesToRefs.get(handle)).getComponent();
                _componentsToHandles.put(comp, handle);
            }
        }
View Full Code Here

        void writeHandlePool(HandlePool pool)
        {
            writeShort(pool._componentsToHandles.size());
            for (Iterator i = pool._componentsToHandles.keySet().iterator(); i.hasNext(); )
            {
                SchemaComponent comp = (SchemaComponent)i.next();
                String handle = (String)pool._componentsToHandles.get(comp);
                int code = fileTypeFromComponentType(comp.getComponentType());
                writeString(handle);
                writeShort(code);
            }
        }
View Full Code Here

        return (ref != null) ? ref.get() : null;
    }

    public SchemaComponent resolveHandle(String handle)
    {
        SchemaComponent result;

        synchronized (_resolvedHandles)
        {
            result = (SchemaComponent)_resolvedHandles.get(handle);
        }
View Full Code Here

            _componentsToHandles = new LinkedHashMap();
            for (Iterator i = _handlesToRefs.keySet().iterator(); i.hasNext(); )
            {
                String handle = (String)i.next();
//                System.err.println("Writing preexisting handle " + handle);
                SchemaComponent comp = ((SchemaComponent.Ref)_handlesToRefs.get(handle)).getComponent();
                _componentsToHandles.put(comp, handle);
            }
        }
View Full Code Here

                assert(false);
                expected = "definition";
                break;
        }

        SchemaComponent foundComponent = findSpelling(itemName);
        QName name;
        if (foundComponent != null)
        {
            name = foundComponent.getName();
            if (name != null)
            {
                switch (foundComponent.getComponentType())
                {
                    case SchemaComponent.TYPE:
                        found = "type";
                        sourceName = ((SchemaType)foundComponent).getSourceName();
                        break;
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.SchemaComponent

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.