Package org.eclipse.emf.common.util

Examples of org.eclipse.emf.common.util.EList


    /**
     * Prints diagnostic messages.
     * @param schema
     */
    private static void printDiagnostics(XSDSchema schema) {
        EList diagnositcs = schema.getAllDiagnostics();
        System.out.println("diagnositcs.size() = " + diagnositcs.size());
        for (int i = 0; i < diagnositcs.size(); i++) {
            XSDDiagnosticImpl diag = (XSDDiagnosticImpl) diagnositcs.get(i);
            System.out.println(diag.getMessage());

            if (diag.getNode() != null) {
                System.out.println("\tnode name : " + diag.getNode().getLocalName());
                NamedNodeMap map = diag.getNode().getAttributes();
View Full Code Here


    public Set getGlobalTypeNames() {
        if (_schema == null) {
            return null;
        }
        Set returns = new HashSet();
        EList list = _schema.getTypeDefinitions();
        for (int i = 0; i < list.size(); i++) {
            XSDTypeDefinition definition = (XSDTypeDefinition) list.get(i);
            returns.add(definition.getName());
        }
        return returns;
    }
View Full Code Here

    public Set getGlobalElementNames() {
        if (_schema == null) {
            return null;
        }
        Set returns = new HashSet();
        EList list = _schema.getElementDeclarations();
        for (int i = 0; i < list.size(); i++) {
            XSDElementDeclaration element = (XSDElementDeclaration) list.get(i);
            returns.add(element.getName());
        }
        return returns;
    }
View Full Code Here

     * @param typeName
     * @return
     */
    protected XSDTypeDefinition getTypeDefinition(String typeName) {
        if (_schema != null) {
            EList list = _schema.getTypeDefinitions();
            for (int i = 0; i < list.size(); i++) {
                XSDTypeDefinition typeDeclaration = (XSDTypeDefinition) list.get(i);
                if (typeDeclaration.getName().equals(typeName)) {
                    return typeDeclaration;
                }
            }
        }
View Full Code Here

     * @param elementName
     * @return
     */
    protected XSDElementDeclaration getElementDefinition(String elementName) {
        if (_schema != null) {
            EList list = _schema.getElementDeclarations();
            for (int i = 0; i < list.size(); i++) {
                XSDElementDeclaration elementDeclaration = (XSDElementDeclaration) list.get(i);
                if (elementDeclaration.getName().equals(elementName)) {
                    return elementDeclaration;
                }
            }
        }
View Full Code Here

     * @param typeName
     * @return
     */
    protected XSDTypeDefinition getOriginalTypeDefinition(String typeName) {
        if (_schema != null) {
            EList list = _schema.getTypeDefinitions();
            for (int i = 0; i < list.size(); i++) {
                XSDTypeDefinition typeDeclaration = (XSDTypeDefinition) list.get(i);
                if (typeDeclaration.getName().equals(typeName)) {
                    return typeDeclaration;
                }
            }
        }
View Full Code Here

        XSDComplexTypeDefinition clonedTypeDef = (XSDComplexTypeDefinition)
                origCompTypeDef.cloneConcreteComponent(false, false);
        XSDParticle clonedContent = buildSelfContainedCopy((XSDParticle) origCompTypeDef.getContent());
        clonedTypeDef.setContent(clonedContent);

        EList originAttrList = origCompTypeDef.getAttributeContents();
        for (int i = 0; i < originAttrList.size(); i++) {
            XSDAttributeUse origAttUse = (XSDAttributeUse) originAttrList.get(i);
            XSDAttributeUse clonedAttUse = buildSelfContainedCopy(origAttUse);
            clonedTypeDef.getAttributeContents().add(clonedAttUse);
        }
        return clonedTypeDef;
    }
View Full Code Here

        }
    }


    private XSDParticle buildSelfContainedCopy(XSDParticle originalParticle) {
        EList contents = originalParticle.eContents();
        XSDParticle clonedParticle = _xsdFactory.createXSDParticle();
        for (int i = 0; i < contents.size(); i++) {
            XSDParticleContent origParticleContent = (XSDParticleContent) contents.get(i);
            if (origParticleContent instanceof XSDModelGroup) {
                XSDModelGroupImpl origModelGroup = (XSDModelGroupImpl) origParticleContent;
                clonedParticle.setContent(buildSelfContainedCopy(origModelGroup));
            } else if (origParticleContent instanceof XSDElementDeclaration) {
                XSDElementDeclaration origElementDecl = (XSDElementDeclaration) origParticleContent;
View Full Code Here

        XSDCompositor compositor = origModelGroup.getCompositor();
        String compositorName = compositor.getName();
        if (compositorName.equals("sequence")
                || compositorName.equals("choice")
                || compositorName.equals("group")) {
            EList elements = origModelGroup.getContents();
            for (int i = 0; i < elements.size(); i++) {
                XSDParticle particle = (XSDParticle) elements.get(i);
                clonedModelGroup.getContents().add(buildSelfContainedCopy(particle));
            }
        }
        return clonedModelGroup;
    }
View Full Code Here

        if (typeDef instanceof XSDComplexTypeDefinition) {
            XSDComplexTypeDefinition complexType = (XSDComplexTypeDefinition) typeDef;
            XSDParticle particle = (XSDParticle) complexType.getContent();
            set.addAll(getGlobalDependencies(particle));

            EList attributes = complexType.getAttributeContents();
            for (int i = 0; i < attributes.size(); i++) {
                XSDAttributeUse attribute = (XSDAttributeUse) attributes.get(i);
                XSDAttributeDeclaration attDecl = attribute.getAttributeDeclaration();
                set.addAll(getGlobalDependencies(attDecl));
            }
        } else if (typeDef instanceof XSDSimpleTypeDefinition) {
            XSDSimpleTypeDefinition simpleType = (XSDSimpleTypeDefinition) typeDef;
View Full Code Here

TOP

Related Classes of org.eclipse.emf.common.util.EList

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.