diff options
Diffstat (limited to 'source/com/c2kernel/property/PropertyUtility.java')
| -rw-r--r-- | source/com/c2kernel/property/PropertyUtility.java | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/source/com/c2kernel/property/PropertyUtility.java b/source/com/c2kernel/property/PropertyUtility.java deleted file mode 100644 index f8e714c..0000000 --- a/source/com/c2kernel/property/PropertyUtility.java +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************
- *
- * $Revision: 1.4 $
- * $Date: 2004/10/21 08:02:26 $
- *
- * Copyright (C) 2001 CERN - European Organization for Nuclear Research
- * All rights reserved.
- **************************************************************************/
-
-package com.c2kernel.property;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import com.c2kernel.persistency.ClusterStorage;
-import com.c2kernel.persistency.outcome.Outcome;
-import com.c2kernel.process.Gateway;
-import com.c2kernel.utils.CastorHashMap;
-import com.c2kernel.utils.CastorXMLUtility;
-import com.c2kernel.utils.Logger;
-
-
-public class PropertyUtility
-{
- static public String getValue(ArrayList<PropertyDescription> pdlist, String name)
- {
- for (PropertyDescription pd : pdlist) {
- if ( name.equalsIgnoreCase(pd.getName()) )
- return pd.getDefaultValue();
- }
- return null;
- }
-
- static public String getNames(ArrayList<PropertyDescription> pdlist)
- {
- StringBuffer names = new StringBuffer();
- for (PropertyDescription value : pdlist)
- names.append( value.getDefaultValue()).append(" ");
- return names.toString();
- }
-
- static public String getClassIdNames(ArrayList<PropertyDescription> pdlist)
- {
- StringBuffer names = new StringBuffer();
-
- for (Iterator<PropertyDescription> iter = pdlist.iterator(); iter.hasNext();) {
- PropertyDescription pd = iter.next();
- if (pd.getIsClassIdentifier())
- names.append(pd.getName());
- if (iter.hasNext())
- names.append(",");
- }
- return names.toString();
- }
-
-
- static public PropertyDescriptionList getPropertyDescriptionOutcome(int entityKey)
- {
- try
- {
- Outcome outc = (Outcome) Gateway.getStorage().get(entityKey, ClusterStorage.VIEWPOINT+"/PropertyDescription/last/data", null);
- return (PropertyDescriptionList)CastorXMLUtility.unmarshall(outc.getData());
- }
- catch (Exception ex)
- {
- Logger.error(ex);
- return null;
- }
- }
-
- static public CastorHashMap createProperty(PropertyDescriptionList pdList)
- {
- CastorHashMap props = new CastorHashMap();
- for (int i=0; i< pdList.list.size();i++)
- {
- PropertyDescription pd = pdList.list.get(i);
- if (pd.getIsClassIdentifier())
- props.put(pd.getName(),pd.getDefaultValue());
- }
- return props;
- }
-
-}
|
