Package org.apache.commons.collections

Examples of org.apache.commons.collections.Predicate


            isType = name.equals(type);
            // if this isn't a type defined by typeName, see if we can find any
            // types that inherit from the type.
            if (!isType)
            {
                isType = CollectionUtils.find(classifier.getAllGeneralizations(), new Predicate()
                {
                    public boolean evaluate(Object object)
                    {
                        String name = StringUtils.trimToEmpty(
                                ((ModelElementFacade)object).getFullyQualifiedName(true));
View Full Code Here


     * @see org.andromda.metafacades.uml.InstanceFacade#getOwnedInstances()
     */
    protected java.util.Collection handleGetOwnedInstances()
    {
        final Collection ownedElements = new ArrayList(this.metaObject.getOwnedElements());
        CollectionUtils.filter(ownedElements, new Predicate()
        {
            public boolean evaluate(Object object)
            {
                return object instanceof InstanceSpecification;
            }
View Full Code Here

    protected Collection handleGetAttributeLinks()
    {
        // collect the slots
        final List slots = new ArrayList(this.metaObject.getSlots());
        // only retain the slots mapping onto attributes
        CollectionUtils.filter(slots, new Predicate()
        {
            public boolean evaluate(Object object)
            {
                return UmlUtilities.ELEMENT_TRANSFORMER.transform(((Slot)object).getDefiningFeature()) instanceof Attribute;
            }
View Full Code Here

    protected java.util.Collection handleGetLinkEnds()
    {
        // collect the slots
        final List slots = new ArrayList(this.metaObject.getSlots());
        // only retain the slots mapping onto association ends
        CollectionUtils.filter(slots, new Predicate()
        {
            public boolean evaluate(Object object)
            {
                return UmlUtilities.ELEMENT_TRANSFORMER.transform(((Slot)object).getDefiningFeature()) instanceof AssociationEnd;
            }
View Full Code Here

        org.omg.uml.UmlPackage modelPackage,
        final String name)
    {
        return CollectionUtils.find(
            modelPackage.getCore().getModelElement().refAllOfType(),
            new Predicate()
            {
                public boolean evaluate(Object object)
                {
                    return StringUtils.trimToEmpty(((ModelElement)object).getName()).equals(name);
                }
View Full Code Here

        org.omg.uml.modelmanagement.UmlPackage umlPackage,
        final String name)
    {
        return CollectionUtils.find(
            umlPackage.getOwnedElement(),
            new Predicate()
            {
                public boolean evaluate(Object object)
                {
                    return StringUtils.trimToEmpty(((ModelElement)object).getName()).equals(name);
                }
View Full Code Here

            if (StringUtils.isEmpty(viewTypeValue))
            {
                viewType =
                    (String)CollectionUtils.find(
                        classifier.getAllGeneralizations(),
                        new Predicate()
                        {
                            public boolean evaluate(Object object)
                            {
                                return ((ModelElementFacade)object).findTaggedValue(
                                    HibernateProfile.TAGGEDVALUE_EJB_VIEWTYPE) != null;
View Full Code Here

                {
                    return ((GeneralizationFacade)object).getParent();
                }
            });
        CollectionUtils.filter(generalizations,
            new Predicate()
            {
                public boolean evaluate(final Object object)
                {
                    return object instanceof Metafacade;
                }
View Full Code Here

        Collection elements,
        final String name)
    {
        return CollectionUtils.find(
            elements,
            new Predicate()
            {
                public boolean evaluate(Object object)
                {
                    return StringUtils.trimToEmpty(((ModelElement)object).getName()).equals(name);
                }
View Full Code Here

     */
    private Object findModelElement(final String modelElementName)
    {
        Object modelElement = null;
        Collection modelElements = this.model.getModelElements();
        CollectionUtils.filter(modelElements, new Predicate()
        {
            public boolean evaluate(Object object)
            {
                boolean valid = false;
                if (ModelElementFacade.class.isAssignableFrom(object.getClass()))
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.Predicate

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.