Exemplo n.º 1
0
 /**
  * Get a non-modal boolean property value. Returns a given default value if no property value
  * exists. Throws an exception if an error occurs.
  *
  * @param ph The property holder from which to retrieve the property value.
  * @param pd The property to retrieve.
  * @param defaultVal The value to return if the property has no value.
  * @return The boolean value of the property.
  */
 public static boolean getBooleanValue(
     final NamedElement ph, final Property pd, final boolean defaultVal) {
   try {
     final PropertyExpression pv = getSimplePropertyValue(ph, pd);
     final BooleanLiteral v = (BooleanLiteral) pv;
     return v.getValue();
   } catch (PropertyLookupException e) {
     return defaultVal;
   }
 }