diff options
Diffstat (limited to 'plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/ejb/internal/impl/ContainerManagedEntityFilter.java')
-rw-r--r-- | plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/ejb/internal/impl/ContainerManagedEntityFilter.java | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/ejb/internal/impl/ContainerManagedEntityFilter.java b/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/ejb/internal/impl/ContainerManagedEntityFilter.java deleted file mode 100644 index 206558b69..000000000 --- a/plugins/org.eclipse.jst.j2ee.core/mofj2ee/org/eclipse/jst/j2ee/ejb/internal/impl/ContainerManagedEntityFilter.java +++ /dev/null @@ -1,101 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.ejb.internal.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.jst.j2ee.ejb.CMPAttribute; -import org.eclipse.jst.j2ee.ejb.ContainerManagedEntity; -import org.eclipse.jst.j2ee.ejb.EJBExtensionFilter; -import org.eclipse.jst.j2ee.ejb.EnterpriseBean; -import org.eclipse.jst.j2ee.ejb.Entity; -import org.eclipse.jst.j2ee.internal.EjbModuleExtensionHelper; -import org.eclipse.jst.j2ee.internal.IEJBModelExtenderManager; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; - - -/** - * Insert the type's description here. Creation date: (11/28/2000 6:28:39 PM) - * @author: Administrator - */ -public abstract class ContainerManagedEntityFilter implements EJBExtensionFilter { - - - /** - * AttributeFilter constructor comment. - */ - public ContainerManagedEntityFilter() { - super(); - } - - /** - * filter method comment. - */ - public abstract List filter(ContainerManagedEntity cmp); - - /** - * All CMPAttributeFilters only operate on ContainerManagedEntityExtension - * objects. - */ - public List filter(EnterpriseBean ejb) { - if (ejb.isEntity() && ((Entity) ejb).isContainerManagedEntity()) return filter((ContainerManagedEntity) ejb); - return new ArrayList(); - } - - protected void filterRoleAttributesByName(List allAttributes, List roleAttributes) { - if (!roleAttributes.isEmpty()) { - int allSize, roleSize; - roleSize = roleAttributes.size(); - CMPAttribute roleAtt, allAtt; - for (int i = 0; i < roleSize; i++) { - roleAtt = (CMPAttribute) roleAttributes.get(i); - allSize = allAttributes.size(); - for (int j = allSize - 1; j != -1; j--) { - allAtt = (CMPAttribute) allAttributes.get(j); - if (roleAtt == allAtt || roleAtt.getName().equals(allAtt.getName())) { - allAttributes.remove(j); - break; - } - } - } - } - } - - protected EjbModuleExtensionHelper getEjbModuleExtHelper(Object context) { - return IEJBModelExtenderManager.INSTANCE.getEJBModuleExtension(context); - } - - protected List getLocalRelationshipRoles(ContainerManagedEntity cmp) { - EjbModuleExtensionHelper modelExtender = null; - if (cmp.getVersionID() >= J2EEVersionConstants.EJB_2_0_ID) - return cmp.getRoles(); - else if ( (modelExtender = getEjbModuleExtHelper(cmp)) != null ){ - return modelExtender.getLocalRelationshipRoles_cmp11(cmp); - } - return Collections.EMPTY_LIST; - } - - protected List getRelationshipRoles(ContainerManagedEntity cmp) { - List roles = new ArrayList(); - collectRelationshipRoles(cmp, getEjbModuleExtHelper(cmp), roles); - return Collections.unmodifiableList(roles); - } - - public void collectRelationshipRoles(ContainerManagedEntity cmp, EjbModuleExtensionHelper extensionHelper, List containerList) { - if(cmp == null) - return; - containerList.addAll(getLocalRelationshipRoles(cmp)); - if(extensionHelper != null) - collectRelationshipRoles((ContainerManagedEntity) extensionHelper.getSuperType(cmp), extensionHelper, containerList); - } -} |