Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.SchemaComponent


                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


                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

            _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

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

    public SchemaComponent resolveHandle(String handle)
    {
        SchemaComponent result;

        synchronized (_resolvedHandles)
        {
            result = (SchemaComponent)_resolvedHandles.get(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

        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

            _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

                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

        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

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.