Examples of EList


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

     * @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

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

     * @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

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

     * @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

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

        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

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

        }
    }


    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

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

        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

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

        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

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

     * @param particle the particle
     * @return a set of global definitions that this particle relies upon.
     */
    protected Collection getGlobalDependencies(XSDParticle particle) {
        Set set = new HashSet();
        EList contents = particle.eContents();
        for (int i = 0; i < contents.size(); i++) {
            XSDParticleContent particleContent = (XSDParticleContent) contents.get(i);
            if (particleContent instanceof XSDModelGroup) {
                XSDModelGroupImpl modelGroup = (XSDModelGroupImpl) particleContent;
                set.addAll(getGlobalDependencies(modelGroup));
            } else if (particleContent instanceof XSDElementDeclaration) {
                XSDElementDeclaration elementDecl = (XSDElementDeclaration) particleContent;
View Full Code Here

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

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

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

     * Helper method to return whether a given atribute is globally defined or not.
     * @param attribute the attribute in question.
     * @return see above.
     */
    protected boolean isGlobalAttributeDeclaration(XSDAttributeDeclaration attribute) {
        EList attributes = _schema.getAttributeDeclarations();
        return attributes.contains(attribute);
    }
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.