1 2 5 14 package org.jacorb.trading.util; 15 16 import org.omg.CORBA.*; 17 import org.omg.CosTrading.*; 18 import org.omg.CosTradingDynamic.*; 19 20 public class PropUtil 21 { 22 private PropUtil() 23 { 24 } 25 26 27 public static Any getPropertyValue(Property prop) 28 { 29 Any result = null; 30 31 if (isDynamicProperty(prop.value.type())) { 32 33 try { 34 DynamicProp dp = DynamicPropHelper.extract(prop.value); 35 36 result = dp.eval_if.evalDP(prop.name, dp.returned_type, dp.extra_info); 38 } 39 catch (DPEvalFailure e) { 40 } 42 catch (org.omg.CORBA.SystemException e) { 43 } 45 catch (java.lang.NullPointerException e) { 46 } 48 } 49 else 50 result = prop.value; 51 52 return result; 53 } 54 55 56 public static boolean hasDynamicProperties(Property[] props) 57 { 58 boolean result = false; 59 60 for (int i = 0; i < props.length && ! result; i++) 61 result = isDynamicProperty(props[i].value.type()); 62 63 return result; 64 } 65 66 67 public static boolean isDynamicProperty(TypeCode tc) 68 { 69 boolean result = false; 70 result = tc.equal(DynamicPropHelper.type()); 71 72 return result; 73 } 74 } 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | Popular Tags |