public ModifierHelperChainer(EStructuralFeature feature, EObject owner, Object value) { helper = new ModifierHelper(); if (owner != null) helper.setOwner(owner); helper.setFeature(feature); if (value != null) helper.setValue(value); }
/** * J2EEModifierHelper constructor comment. */ public ModifierHelper(ModifierHelper anOwnerHelper, EStructuralFeature aFeature, Object aValue) { setOwnerHelper(anOwnerHelper); setFeature(aFeature); setValue(aValue); }
protected EObject createObjectFromHelper(ModifierHelper aHelper) { return aHelper.createNewObjectFromFeature(); }
/** * J2EEModifierHelper constructor comment. */ public ModifierHelper(EObject anOwner, EStructuralFeature aFeature, Object aValue) { setOwner(anOwner); setFeature(aFeature); setValue(aValue); }
/** * J2EEModifierHelper constructor comment. */ public ModifierHelper(OwnerProvider anOwnerProvider, EStructuralFeature aFeature, Object aValue) { setOwnerProvider(anOwnerProvider); setFeature(aFeature); setValue(aValue); }
/** * return modifier helper that will create a method element with method type and param * associated with the methodSig and a new methodtransacton for a transtype. */ public static ModifierHelper createMethodElementHelper(EnterpriseBean bean, String methodType, String methodSig, String transType) { if (bean == null) return null; ModifierHelper ownerHelper = createMethodTransactionHelper((EJBJar) bean.eContainer(), transType); ModifierHelper tempHelper = new ModifierHelper(); tempHelper.setOwnerHelper(ownerHelper); tempHelper.setFeature(getEjbPackage().getMethodTransaction_MethodElements()); tempHelper.addAttribute(getEjbPackage().getMethodElement_Type(), methodType); int index = methodSig.indexOf("(");//$NON-NLS-1$ String methodName = methodSig; String methodParms = null; if (index > -1) { methodName = methodSig.substring(0, index); methodParms = methodSig.substring(index + 1, methodSig.length() - 1); } if (methodParms != null) methodParms = methodParms.replace(',', ' '); tempHelper.addAttribute(getEjbPackage().getMethodElement_Name(), methodName); if (methodParms != null) tempHelper.addAttribute(getEjbPackage().getMethodElement_Parms(), methodParms); tempHelper.addAttribute(getEjbPackage().getMethodElement_EnterpriseBean(), bean); return tempHelper; }
/** * Create a helper that will create a new MethodTransaction with * * @aTransType. */ public static ModifierHelper createMethodTransactionHelper(EJBJar anEJBJar, String aTransType) { if (anEJBJar == null) return null; ModifierHelper helper = new ModifierHelper(); setAssemblyDescriptorOwnerHelper(helper, anEJBJar); helper.setFeature(getEjbPackage().getAssemblyDescriptor_MethodTransactions()); helper.addAttribute(getEjbPackage().getMethodTransaction_TransactionAttribute(), aTransType); return helper; }
/** * return modifier helper that will create a method element with method type and param * associated with the methodSig and the methodpermission will be derived from the security * role. */ public static ModifierHelper createMethodElementAsCopyHelper(MethodElement element, SecurityRole role) { if (role == null) return null; ModifierHelper tempHelper = new ModifierHelper(); setMethodPermissionOwnerHelper(tempHelper, role); tempHelper.setFeature(getEjbPackage().getMethodPermission_MethodElements()); tempHelper.setValue(EtoolsCopyUtility.createCopy(element)); return tempHelper; }
public void setOwnerBasedOnType(Object owner) { if (owner instanceof EObject) helper.setOwner((EObject) owner); else if (owner instanceof ModifierHelper) helper.setOwnerHelper((ModifierHelper) owner); } }
protected Object getValue(ModifierHelper aHelper) { if (aHelper.mustCreateValue()) { Object value = createValueFromHelper(aHelper); aHelper.setValue(value); } return aHelper.getValue(); }
/** * Treat an empty String as a null value. Creation date: (4/6/2001 3:28:16 PM) * * @param newValue * java.lang.Object */ public void setValueFromWidget(String newValue) { Object data = newValue; if (newValue != null && newValue.length() == 0) data = null; setValue(data); if (data == null) doUnsetValue(); else shouldUnsetValue = false; }
public static ModifierHelper createMethodPermissionHelper(SecurityRole role) { if (role == null) return null; AssemblyDescriptor assembly = (AssemblyDescriptor) role.eContainer(); EStructuralFeature sf = EjbPackage.eINSTANCE.getAssemblyDescriptor_MethodPermissions(); ModifierHelper tempHelper = new ModifierHelper(assembly, sf, null); tempHelper.addAttribute(getEjbPackage().getMethodPermission_Roles(), role); return tempHelper; }
/** * Insert the method's description here. Creation date: (4/6/2001 3:28:16 PM) * * @param newValue * java.lang.Object */ public void setValue(java.lang.Object newValue) { try { primSetValue(convertValue(newValue)); } catch (FeatureValueConversionException featureException) { Logger.getLogger().logError(featureException); primSetValue(null); } }
public static ModifierHelper createAssemblyDescriptorHelper(EJBJar anEJBJar) { if (anEJBJar == null || anEJBJar.getAssemblyDescriptor() != null) return null; EjbPackage pack = EjbFactoryImpl.getPackage(); EStructuralFeature sf = pack.getEJBJar_AssemblyDescriptor(); return new ModifierHelper(anEJBJar, sf, null); }
/** * Insert the method's description here. Creation date: (4/6/2001 3:28:16 PM) * * @return java.util.HashMap */ public void addAttribute(EStructuralFeature aFeature, Object aValue) { if (aFeature != null && aValue != null) getAttributes().put(aFeature, aValue); }
/** * return modifier helper that will create a method element with method type and param * associated with the methodSig and the methodpermission will be derived from the security * role. */ public static ModifierHelper createMethodElementHelper(EnterpriseBean bean, SecurityRole role, String methodType, String methodSig) { if (role == null) return null; ModifierHelper tempHelper = new ModifierHelper(); setMethodPermissionOwnerHelper(tempHelper, role); tempHelper.setFeature(getEjbPackage().getMethodPermission_MethodElements()); tempHelper.addAttribute(getEjbPackage().getMethodElement_Type(), methodType); int index = methodSig.indexOf("(");//$NON-NLS-1$ String methodName = methodSig; String methodParms = null; if (index > -1) { methodName = methodSig.substring(0, index); methodParms = methodSig.substring(index + 1, methodSig.length() - 1); } if (methodParms != null) methodParms = methodParms.replace(',', ' '); tempHelper.addAttribute(getEjbPackage().getMethodElement_Name(), methodName); if (methodParms != null) tempHelper.addAttribute(getEjbPackage().getMethodElement_Parms(), methodParms); tempHelper.addAttribute(getEjbPackage().getMethodElement_EnterpriseBean(), bean); return tempHelper; }
/** * Set the owner of * * @helper to be the existing AssemblyDescriptor from * @anEJBJar or set the ownerHelper of * @helper for the creation of a new AssemblyDescriptor when one does not exist. */ public static void setAssemblyDescriptorOwnerHelper(ModifierHelper helper, EJBJar anEJBJar) { ModifierHelper ownerHelper = J2EEModifierHelperCreator.createAssemblyDescriptorHelper(anEJBJar); if (ownerHelper == null) helper.setOwner(anEJBJar.getAssemblyDescriptor()); else helper.setOwnerHelper(ownerHelper); }
protected void setNewObjectAttributes(EObject anObject, ModifierHelper aHelper) { HashMap attributes = aHelper.getAttributes(); Iterator it = attributes.keySet().iterator(); EStructuralFeature feature; Object value = null; while (it.hasNext()) { feature = (EStructuralFeature) it.next(); value = attributes.get(feature); setObjectAttribute(anObject, feature, value, false); } }
/** * Set the owner of * * @helper to be the existing AssemblyDescriptor from * @anEJBJar or set the ownerHelper of * @helper for the creation of a new AssemblyDescriptor when one does not exist. */ public static void setMethodPermissionOwnerHelper(ModifierHelper helper, SecurityRole role) { List roleList = new ArrayList(1); roleList.add(role); MethodPermission permission = ((AssemblyDescriptor) role.eContainer()).getMethodPermission(roleList); ModifierHelper ownerHelper = null; if (permission == null) ownerHelper = J2EEModifierHelperCreator.createMethodPermissionHelper(role); if (ownerHelper == null) helper.setOwner(permission); else helper.setOwnerHelper(ownerHelper); }