Package org.andromda.metafacades.uml

Examples of org.andromda.metafacades.uml.ClassifierFacade


        buffer.append(this.getName());

        // generalizations
        for (final Iterator iterator = this.getAllGeneralizations().iterator(); iterator.hasNext();)
        {
            ClassifierFacade classifier = (ClassifierFacade)iterator.next();
            buffer.append(classifier.getName());
        }

        // declared fields
        for (final Iterator iterator = this.getAttributes().iterator(); iterator.hasNext();)
        {
View Full Code Here


    /**
     * @see org.andromda.metafacades.uml.AttributeFacade#isEnumerationLiteral()
     */
    protected boolean handleIsEnumerationLiteral()
    {
        final ClassifierFacade owner = this.getOwner();
        return (owner != null) && owner.isEnumeration();
    }
View Full Code Here

    /**
     * @see org.andromda.metafacades.uml.ClassifierFacade#getNonArray()
     */
    protected Object handleGetNonArray()
    {
        ClassifierFacade nonArrayType = (ClassifierFacade)this.THIS();

        String arraySuffix = this.getArraySuffix();

        if (this.getFullyQualifiedName().indexOf(arraySuffix) != -1)
        {
View Full Code Here

    /**
     * @see org.andromda.metafacades.uml.ClassifierFacade#getArray()
     */
    protected Object handleGetArray()
    {
        ClassifierFacade arrayType = (ClassifierFacade)this.THIS();
        if (this.metaObject instanceof PrimitiveType)
        {
            String name = this.getFullyQualifiedName(true);
            if (name.indexOf(this.getArraySuffix()) == -1)
            {
View Full Code Here

                final DependencyFacade abstraction = (DependencyFacade)abstractionIterator.next();
                final ModelElementFacade element = abstraction.getTargetElement();

                if (element instanceof ClassifierFacade)
                {
                    final ClassifierFacade classifier = (ClassifierFacade)element;
                    if (classifier.isInterface())
                    {
                        interfaceAbstractions.add(classifier);
                    }
                }
            }
View Full Code Here

    protected java.lang.String handleGetMessageKey()
    {
        final StringBuffer messageKey = new StringBuffer();
        if (!this.isNormalizeMessages())
        {
            final ClassifierFacade owner = this.getOwner();
            if (owner != null)
            {
                messageKey.append(StringUtilsHelper.toResourceMessageKey(owner.getName()));
                messageKey.append('.');
            }
        }
        final String name = this.getName();
        if (name != null && name.trim().length() > 0)
View Full Code Here

    /**
     * @see org.andromda.cartridges.jsf.metafacades.JSFAttribute#getDummyValue()
     */
    protected String handleGetDummyValue()
    {
        final ClassifierFacade type = this.getType();
        if (type != null)
        {
            final String typeName = type.getFullyQualifiedName();
            final String name = this.getName();
            if ("java.lang.String".equals(typeName))
            {
                return "\"" + name + "-test" + "\"";
            }
            if ("java.util.Date".equals(typeName))
            {
                return "new java.util.Date()";
            }
            if ("java.sql.Date".equals(typeName))
            {
                return "new java.sql.Date(new java.util.Date().getTime())";
            }
            if ("java.sql.Timestamp".equals(typeName))
            {
                return "new java.sql.Timestamp(new Date().getTime())";
            }
            if ("java.util.Calendar".equals(typeName))
            {
                return "java.util.Calendar.getInstance()";
            }
            if ("int".equals(typeName))
            {
                return "(int)" + name.hashCode();
            }
            if ("boolean".equals(typeName))
            {
                return "false";
            }
            if ("long".equals(typeName))
            {
                return "(long)" + name.hashCode();
            }
            if ("char".equals(typeName))
            {
                return "(char)" + name.hashCode();
            }
            if ("float".equals(typeName))
            {
                return "(float)" + name.hashCode() / hashCode();
            }
            if ("double".equals(typeName))
            {
                return "(double)" + name.hashCode() / hashCode();
            }
            if ("short".equals(typeName))
            {
                return "(short)" + name.hashCode();
            }
            if ("byte".equals(typeName))
            {
                return "(byte)" + name.hashCode();
            }
            if ("java.lang.Integer".equals(typeName))
            {
                return "new Integer((int)" + name.hashCode() + ")";
            }
            if ("java.lang.Boolean".equals(typeName))
            {
                return "Boolean.FALSE";
            }
            if ("java.lang.Long".equals(typeName))
            {
                return "new Long((long)" + name.hashCode() + ")";
            }
            if ("java.lang.Character".equals(typeName))
            {
                return "new Character(char)" + name.hashCode() + ")";
            }
            if ("java.lang.Float".equals(typeName))
            {
                return "new Float((float)" + name.hashCode() / hashCode() + ")";
            }
            if ("java.lang.Double".equals(typeName))
            {
                return "new Double((double)" + name.hashCode() / hashCode() + ")";
            }
            if ("java.lang.Short".equals(typeName))
            {
                return "new Short((short)" + name.hashCode() + ")";
            }
            if ("java.lang.Byte".equals(typeName))
            {
                return "new Byte((byte)" + name.hashCode() + ")";
            }

            //if (type.isArrayType()) return constructDummyArray();
            if (type.isSetType())
            {
                return "new java.util.HashSet(java.util.Arrays.asList(" + constructDummyArray() + "))";
            }
            if (type.isCollectionType())
            {
                return "java.util.Arrays.asList(" + constructDummyArray() + ")";
            }

            // maps and others types will simply not be treated
View Full Code Here

            selectable = this.isInputMultibox() || this.isInputSelect() || this.isInputRadio();
            if (!selectable)
            {
                if (ownerParameter.isActionParameter())
                {
                    final ClassifierFacade type = this.getType();
                    if (type != null)
                    {
                        final String name = this.getName();
                        final String typeName = type.getFullyQualifiedName();
   
                        // - if the parameter is not selectable but on a targetting page it IS selectable we must
                        //   allow the user to set the backing list too                
                        final Collection views = ownerParameter.getAction().getTargetViews();
                        for (final Iterator iterator = views.iterator(); iterator.hasNext() && !selectable;)
                        {
                            final FrontEndView view = (FrontEndView)iterator.next();
                            final Collection parameters = view.getAllActionParameters();
                            for (final Iterator parameterIterator = parameters.iterator();
                                parameterIterator.hasNext() && !selectable;)
                            {
                                final Object object = parameterIterator.next();
                                if (object instanceof JSFParameter)
                                {
                                    final JSFParameter parameter = (JSFParameter)object;
                                    final String parameterName = parameter.getName();
                                    final ClassifierFacade parameterType = parameter.getType();
                                    if (parameterType != null)
                                    {
                                        final String parameterTypeName = parameterType.getFullyQualifiedName();
                                        if (name.equals(parameterName) && typeName.equals(parameterTypeName))
                                        {
                                            selectable =
                                                parameter.isInputMultibox() || parameter.isInputSelect() ||
                                                parameter.isInputRadio();
View Full Code Here

    protected boolean handleIsInputCheckbox()
    {
        boolean checkbox = this.isInputType(JSFGlobals.INPUT_CHECKBOX);
        if (!checkbox && this.getInputType().length() == 0)
        {
            final ClassifierFacade type = this.getType();
            checkbox = type != null ? type.isBooleanType() : false;
        }
        return checkbox;
    }
View Full Code Here

     * @see org.andromda.cartridges.jsf.metafacades.JSFAttribute#isInputFile()
     */
    protected boolean handleIsInputFile()
    {
        boolean file = false;
        ClassifierFacade type = getType();
        if (type != null)
        {
            file = type.isFileType();
        }
        return file;
    }
View Full Code Here

TOP

Related Classes of org.andromda.metafacades.uml.ClassifierFacade

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.