Package org.omg.uml.foundation.core

Examples of org.omg.uml.foundation.core.UmlClass


            String tableName = tableRs.getString("TABLE_NAME");
            if (StringUtils.isNotBlank(this.tableNamePattern))
            {
                if (tableName.matches(this.tableNamePattern))
                {
                    UmlClass umlClass = this.createClass(modelPackage, metadata, corePackage, tableName);
                    this.classes.put(tableName, umlClass);
                }
            }
            else
            {
                UmlClass umlClass = this.createClass(modelPackage, metadata, corePackage, tableName);
                this.classes.put(tableName, umlClass);
            }
        }
        DbUtils.closeQuietly(tableRs);
        if (this.classes.isEmpty())
        {
            String schemaName = "";
            if (StringUtils.isNotEmpty(this.schema))
            {
                schemaName = " '" + this.schema + "' ";
            }
            StringBuffer warning = new StringBuffer("WARNING! No tables found in schema");
            warning.append(schemaName);
            if (StringUtils.isNotEmpty(this.tableNamePattern))
            {
                warning.append(" matching pattern --> '" + this.tableNamePattern + "'");
            }
            logger.warn(warning);
        }

        // add all attributes and associations to the modelPackage
        Iterator tableNameIt = this.classes.keySet().iterator();
        while (tableNameIt.hasNext())
        {
            String tableName = (String)tableNameIt.next();
            UmlClass umlClass = (UmlClass)classes.get(tableName);
            if (logger.isInfoEnabled())
            {
                logger.info("created class --> '" + umlClass.getName() + "'");
            }

            // create and add all associations to the package
            modelPackage.getOwnedElement().addAll(this.createAssociations(metadata, corePackage, tableName));

            // create and add all the attributes
            umlClass.getFeature().addAll(this.createAttributes(metadata, corePackage, tableName));

            modelPackage.getOwnedElement().add(umlClass);
        }
    }
View Full Code Here


        DatabaseMetaData metadata,
        CorePackage corePackage,
        String tableName)
    {
        String className = SqlToModelNameFormatter.toClassName(tableName);
        UmlClass umlClass =
            corePackage.getUmlClass().createUmlClass(
                className, VisibilityKindEnum.VK_PUBLIC, false, false, false, false, false);

        umlClass.getStereotype().addAll(this.getOrCreateStereotypes(corePackage, this.classStereotypes, "Classifier"));

        if (StringUtils.isNotEmpty(this.tableTaggedValue))
        {
            // add the tagged value for the table name
            TaggedValue taggedValue = this.createTaggedValue(corePackage, this.tableTaggedValue, tableName);
            if (taggedValue != null)
            {
                umlClass.getTaggedValue().add(taggedValue);
            }
        }

        return umlClass;
    }
View Full Code Here

        Model model = (Model)(modelManagementPackage.getModel().refAllOfType().iterator().next());

        // look for a class with the name 'org.EntityBean'
        String[] fullyQualifiedName = {"org", "andromda", "ClassA"};

        UmlClass umlClass = (UmlClass)getModelElement(
                model,
                fullyQualifiedName,
                0);

        // create an attribute
View Full Code Here

     * Returns the first class this method can find with the given tagged value or hyperlink. Both arguments are used to
     * look for the tagged value but only <code>value</code> is used to search for the hyperlink.
     */
    static UmlClass findClassWithTaggedValueOrHyperlink(String tag, String value)
    {
        UmlClass classWithTaggedValue = null;

        Collection classes = getModel().getCore().getUmlClass().refAllOfType();
        for (final Iterator classIterator = classes.iterator(); classIterator.hasNext() && classWithTaggedValue == null;)
        {
            // loop over all classes
            UmlClass clazz = (UmlClass)classIterator.next();
            if (isTagPresent(clazz, tag, value) || isHyperlinkPresent(clazz, value))
            {
                classWithTaggedValue = clazz;
            }
        }
View Full Code Here

TOP

Related Classes of org.omg.uml.foundation.core.UmlClass

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.