Package org.jvnet.hk2.config

Examples of org.jvnet.hk2.config.ConfigModel$Property


                    MetafacadeConstants.NAMESPACE_SCOPE_OPERATOR,
                    true);
            if (modelElement instanceof Type)
            {
                Type element = (Type)modelElement;
                final Property property = umlClass.createOwnedAttribute(
                        name,
                        element,
                        1,
                        1);
                VisibilityKind kind = VisibilityKind.PUBLIC_LITERAL;
                if (visibility.equalsIgnoreCase("package"))
                {
                    kind = VisibilityKind.PACKAGE_LITERAL;
                }
                if (visibility.equalsIgnoreCase("private"))
                {
                    kind = VisibilityKind.PRIVATE_LITERAL;
                }
                if (visibility.equalsIgnoreCase("protected"))
                {
                    kind = VisibilityKind.PROTECTED_LITERAL;
                }
                property.setVisibility(kind);
                Stereotype stereotype =
                    UmlUtilities.findApplicableStereotype(
                        property,
                        UMLProfile.STEREOTYPE_IDENTIFIER);
                if (stereotype == null)
                {
                    throw new MetafacadeException("Could not apply '" + UMLProfile.STEREOTYPE_IDENTIFIER + "' to " +
                        property + ", the stereotype could not be found");
                }
                property.apply(stereotype);
            }
        }
    }
View Full Code Here


    public boolean equals(final Object obj)
    {
        if (obj instanceof Attribute)
        {
            Property other = ((AttributeImpl)obj).property;
            return this.property.equals(other);
        }
        if (obj instanceof AssociationEnd)
        {
            Property other = ((AssociationEndImpl)obj).property;
            return this.property.equals(other);
        }
        return this.property.equals(obj);
    }
View Full Code Here

        for (final Iterator memberIterator = members.iterator(); memberIterator.hasNext();)
        {
            final Object nextCandidate = memberIterator.next();
            if (nextCandidate instanceof Property)
            {
                final Property property = (Property)nextCandidate;

                if (property.getAssociation() == null)
                {
                    if (logger.isDebugEnabled())
                    {
                        logger.debug("Attribute found for " + classifier.getName() + ": " + property.getName());
                        if (attributeMap.containsKey(property.getName()))
                        {
                            logger.warn(
                                "An attribute with this name has already been registered, overriding: " +
                                property.getName());
                        }
                    }

                    // property represents an association end
                    attributeMap.put(
                        property.getName(),
                        property);
                }
            }
        }
View Full Code Here

                Property.class,
                classifier.getModel());

        for (final Iterator propertyIterator = allProperties.iterator(); propertyIterator.hasNext();)
        {
            final Property property = (Property)propertyIterator.next();

            // only treat association ends, ignore attributes
            if (property.getAssociation() != null && isAssociationEndAttachedToType(
                    classifier,
                    property,
                    follow))
            {
                associationEnds.add(property);
View Full Code Here

            {
                for (Iterator tvIt = getAttributes(
                            stereo,
                            true).iterator(); tvIt.hasNext();)
                {
                    Property tagProperty = (Property)tvIt.next();
                    String tagName = tagProperty.getName();
                    if (!tagName.startsWith("base$"))
                    {
                        if (element.hasValue(
                                stereo,
                                tagName))
View Full Code Here

            throw new MetafacadeImplsException("Incorrect metafacade mapping for " + this.toString());
        }
        boolean isEntityAssociation = true;
        for (Iterator ends = ((Association)this.metaObject).getMemberEnds().iterator(); ends.hasNext();)
        {
            final Property prop = (Property)ends.next();
            final Type propertyType = prop.getType();
            if (propertyType == null || !UmlUtilities.containsStereotype(
                    propertyType,
                    UMLProfile.STEREOTYPE_ENTITY))
            {
                isEntityAssociation = false;
View Full Code Here

    public boolean equals(final Object object)
    {
        if (object instanceof Attribute)
        {
            Property other = ((AttributeImpl)object).property;
            return this.property.equals(other);
        }
        if (object instanceof AssociationEnd)
        {
            Property other = ((AssociationEndImpl)object).property;
            return this.property.equals(other);
        }
        return this.property.equals(object);
    }
View Full Code Here

        // System.out.println(" root "+ root );
        Dom dom1 = Dom.unwrap(entity);
        Dom root = dom1.document.getRoot();
        document = dom1.document;

        ConfigModel rootModel = root.model;


        //+ Domain domain = Domain.class.cast(RestService.getHabitat().getComponent(Domain.class.getName(), ""));
        try {
            generateSingle(rootModel);
View Full Code Here

                System.out.println("proxy.getElement(a).isCollection() " + a);
            } else {
                ConfigModel.Node node = (ConfigModel.Node) prop;
                //String childbeanName = getBeanName(a);

                ConfigModel childModel = node.getModel();

                String getterName = getBeanName(a);

                System.out.println("Model.targetTypeName" + model.targetTypeName);
                System.out.println("newModel.targetTypeName" + childModel.targetTypeName);
                System.out.println("ConfigModel.Node node isCollection=" + prop.isCollection());
                System.out.println("ConfigModel.Node node isLeaf=" + prop.isLeaf());
                System.out.println("ConfigModel.Node node xlmname=" + prop.xmlName());
                if (childModel.targetTypeName.endsWith("Named")) {
                    a = "application";
                    getterName = "Applications";
                    try {
                        Class<?> subType = childModel.classLoaderHolder.get().loadClass(childModel.targetTypeName); ///  a shoulf be the typename


                        List<ConfigModel> lcm = document.getAllModelsImplementing(subType);
                        if (lcm != null) {
                            for (ConfigModel childmodel : lcm) {
                                System.out.println("***childmodel.targetTypeName" + childmodel.targetTypeName);
                                if (childmodel.targetTypeName.equals("com.sun.enterprise.config.serverbeans.Application")) {
                                    childModel = childmodel;
                                }
                            }
                        }
                    } catch (Exception e) {
                        Logger.getLogger(GeneratorResource.class.getName()).log(Level.SEVERE, e.getMessage());
                    }


                }

                String childbeanName = childModel.targetTypeName.substring(childModel.targetTypeName.lastIndexOf(".") + 1,
                        childModel.targetTypeName.length());

                if (!childModel.targetTypeName.endsWith("Resource")) {
                    String prefix = "";
                    if (prop.isCollection()) {
                        prefix = "List";
                    }

                    if (a.equals("*")) {
                        getterName = childbeanName + "s";
                    }

                    out.write("\t@Path(\"" + childModel.getTagName() + "/\")\n");
                    out.write("\tpublic " + prefix + childbeanName + "Resource get" + childbeanName + "Resource() {\n");

                    out.write("\t\t" + prefix + childbeanName + "Resource resource = resourceContext.getResource(" + prefix + childbeanName + "Resource.class);\n");
                    out.write("\t\tresource.setEntity(getEntity().get" + getterName + "() );\n");
                    out.write("\t\treturn resource;\n");
View Full Code Here

        Map<String, String> links = new TreeMap<String, String>();

        for (String elementName : dom.model.getElementNames()) { //for each element
            if (elementName.equals("*")) {
                ConfigModel.Node node = (ConfigModel.Node) dom.model.getElement(elementName);
                ConfigModel childModel = node.getModel();
                List<ConfigModel> lcm = getRealChildConfigModels(childModel, dom.document);

                Collections.sort(lcm, new ConfigModelComparator());
                if (lcm != null) {
                    for (ConfigModel cmodel : lcm) {
View Full Code Here

TOP

Related Classes of org.jvnet.hk2.config.ConfigModel$Property

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.