Package com.dtrules.interpreter

Examples of com.dtrules.interpreter.RName


        //Ignore the mapping "key" attribute.
        if(name.equals(IREntity.mappingKey))return unreferenced;
       
        for(int i=0; i< refs.size(); i++){
            if(refs.get(i).equals(NOT_REF)){
                RName entityName = entities.get(i).getName();
                // Ignore self references.
                if(!entityName.equals(name)){
                  unreferenced.add(entityName.stringValue()+"."+name.stringValue());
               
            }
        }
        return unreferenced;
    }
View Full Code Here


//      Ignore the mapping "key" attribute.
        if(name.equals(IREntity.mappingKey))return attribs;
       
        for(int i=0; i< refs.size(); i++){
            if(refs.get(i).equals(POSSIBLE_REF)){
                RName entityName = entities.get(i).getName();
                // Ignore self references.
                if(!entityName.equals(name)){
                    attribs.add(entityName.stringValue()+"."+name.stringValue());
               
            }
        }
        return attribs;
    }
View Full Code Here

      super("sortentities");
    }

    public void arrayExecute(DTState state) throws RulesException {
      boolean asc = state.datapop().booleanValue();
      RName rname = state.datapop().rNameValue();
      RArray rarray = state.datapop().rArrayValue();
      ArrayList<IRObject> array = rarray.arrayValue();
      if (state.testState(DTState.TRACE)) {
        state.traceInfo("sortentities", "length", array.size() + "",
            "by", rname.stringValue(), "arrayID", rarray.getID()
                + "", asc ? "true" : "false");
      }
      REntity temp = null;
      int size = array.size();
      int greaterthan = asc ? 1 : -1;
View Full Code Here

       */
      public static class NewXmlAttribute extends ROperator {
          NewXmlAttribute(){super("newxmlattribute"); }
          @Override
            public void arrayExecute(DTState state) throws RulesException {
                RName     name      = state.datapop().rNameValue();
                XMLTag    xmlNode   = new XMLTag(name.stringValue(),null);
                RXmlValue xmlValue  = new RXmlValue(state,xmlNode);
               
                state.datapush(xmlValue);
            }
View Full Code Here

     public static class NewTable extends ROperator {
         NewTable(){ super("newtable");}
        
         public void arrayExecute(DTState state) throws RulesException {
             String type  = state.datapop().stringValue();
             RName  name  = state.datapop().rNameValue();
             RTable table = RTable.newRTable(state.getSession().getEntityFactory(),name,"");
             state.datapush(table);
         }
View Full Code Here

    static class Sortentities extends ROperator {
      Sortentities() {super("sortentities");}
     
      public void execute(DTState state) throws RulesException {
        boolean asc  = state.datapop().booleanValue();
        RName rname = state.datapop().rNameValue();
        RArray rarray  = state.datapop().rArrayValue();
        ArrayList<IRObject> array = rarray.arrayValue();
        if(state.testState(DTState.TRACE)){
                 state.traceInfo("sortentities",
                         "length",   array.size()+"",
                         "by",       rname.stringValue(),
                         "arrayID",  rarray.getID()+"",
                         asc ? "true" : "false");
              }
        REntity temp = null;
        int size = array.size();
View Full Code Here

            throw new RuntimeException(e);
      }
     
      Iterator<RName> es = this.map.entities.keySet().iterator();
      while(es.hasNext()){
        RName  ename = (RName) es.next();            
         try {
        IREntity e     = findEntity(ename.stringValue().toLowerCase(),null,null);
        state.entitypush(e);
       } catch (RulesException e) {
              state.traceInfo("error", "Failed to initialize the Entity Stack (Failed on "+ename+")\n"+e);
          throw new RuntimeException(e)
       }
View Full Code Here

     * @param o
     * @param n
     */
    protected static void alias (IRObject o ,String n) {
        try {
            RName rn = RName.getRName(n);
            if(primitives.containsAttribute(rn)){
                System.err.println("Duplicate Operators defined for " + rn.stringValue());
              throw new RuntimeException("Duplicate definitions for " + rn.stringValue());
            }
            primitives.addAttribute(rn, "", o, false, true, o.type(),null,"operator","","");
            primitives.put(null, rn,o);
        } catch (RulesException e) {
            System.err.println("An Error occured in alias building the primitives Entity: "+n);
View Full Code Here

    }     
   
    if ((attr = (String) attribs.get("set attribute"))!=null){       
      // Look and see if we have an attribute name defined.
       
          RName a = RName.getRName(attr);                
          IRObject value;
                    
                    IREntity enclosingEntity = session.getState().findEntity(a);
                    if(enclosingEntity!=null){
                       
View Full Code Here

     * @param o
     * @param n
     */
    public static void override (IRObject o ,String n) {
        try {
            RName rn = RName.getRName(n);
            primitives.addAttribute(rn, "", o, false, true, o.type(),null,"operator","","");
            IRObject op = primitives.get(rn);
            if(op instanceof ROperator && o instanceof ROperator ){ // Operator overwriting operator.
                ROperator rop = (ROperator) op;                     // Don't overwrite if the existing operator is
                ROperator ro  = (ROperator) o;                      // a higher priority
View Full Code Here

TOP

Related Classes of com.dtrules.interpreter.RName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.