Example #1
0
 /**
  * Get the data-type associated with the binding
  *
  * @param var
  * @return The data-type, or null if the binding could not be found
  */
 public String getLHSBindingType(final String var) {
   if (this.lhs == null) {
     return null;
   }
   for (int i = 0; i < this.lhs.length; i++) {
     IPattern pat = this.lhs[i];
     if (pat instanceof FromCompositeFactPattern) {
       pat = ((FromCompositeFactPattern) pat).getFactPattern();
     }
     if (pat instanceof FactPattern) {
       final FactPattern p = (FactPattern) pat;
       if (p.isBound() && var.equals(p.getBoundName())) {
         return p.getFactType();
       }
       for (FieldConstraint fc : p.getFieldConstraints()) {
         String type = getFieldBinding(fc, var);
         if (type != null) {
           return type;
         }
       }
     }
   }
   return null;
 }