Package org.dmd.dms.generated.dmo

Examples of org.dmd.dms.generated.dmo.RuleDataDMO


              if ( (ruleName != null) && (ruleName.equals("dmvIncludeOrExclude")) ){
                DebugInfo.debug("HERE");
              }
             
            ClassDefinition ruleDataCD   = sm.cdef(uco.getConstructionClass());
            RuleDataDMO   dmo     = (RuleDataDMO) dmofactory.createObject(uco);
            RuleDefinition  ruleDEF    = ruleDataCD.getRuleDefinition();

            DynamicInitIF rule = (DynamicInitIF) ruleDEF.newRuleInstance();
            rule.setRuleData(dmo);
           
            parsedRulesDMOs.put(dmo.getObjectName(), dmo);
            ruleInstances.put(dmo.getObjectName(), (RuleIF) rule);
          } catch (ResultException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
          } catch (DmcValueException e) {
            // TODO Auto-generated catch block
View Full Code Here


        globalRules = new ArrayList<RuleDataDMO>();
      ArrayList<DmcObject> referring = getDMO().getReferringObjects();
      if (referring != null){
        for(DmcObject obj: referring){
          if (obj instanceof RuleDataDMO){
            RuleDataDMO rd = (RuleDataDMO) obj;
           
            // We only look at attribute rules - they will always have
            // the applyToAttribute attribute.
            if (rd.get(MetaDMSAG.__applyToAttribute) != null){
              if (rd.getApplyToClass() == null)
                globalRules.add(rd);
              else
                classRules.add(rd);
            }
          }
View Full Code Here

      }
     
      if (referring != null){
        for(DmcObject obj: referring){
          if (obj instanceof RuleDataDMO){
            RuleDataDMO rd = (RuleDataDMO) obj;
           
            if (rd.get(MetaDMSAG.__applyToAttribute) == null)
              classRules.add(rd);
          }
        }
      }
      }
View Full Code Here

            if (ucoIT != null){
          while(ucoIT.hasNext()){
            DmcUncheckedObject   uco = ucoIT.next();
            ClassDefinition   ruleDataCD   = sm.cdef(uco.getConstructionClass());
            RuleDefinition    ruleDEF    = ruleDataCD.getRuleDefinition();
            RuleDataDMO     ruledata  = null;
            SourceInfo      source    = getSource(uco);
           
            try{
              ruledata = (RuleDataDMO) dmofactory.createObject(uco);
//              DebugInfo.debug("Parsed and instantiated:\n\n" + ruledata.toOIF());
            }
            catch(ClassNotFoundException cnf){
              // This may be thrown from TypeDefinition when trying to instantiate a
              // holder for an attribute. This would likely result from not having
              // the compiled output of a previous code generation run specified on
              // the class path for the dmogen call that's checking the rules
              StringBuffer sb = new StringBuffer();
              sb.append(cnf.getMessage() + "\n\n");
              sb.append("You probably need to augment the following classpath:\n");
              ClassLoader cl = ClassLoader.getSystemClassLoader();
                  URL[] urls = ((URLClassLoader)cl).getURLs();
                  for(URL url: urls){
                    sb.append(url.getFile() + "\n");
                  }
                  sb.append("\nwith the classpath info for the missing class.");

              DmcRuleException ex = new DmcRuleException(sb.toString(), null);
              ex.source(source);
             
              if (rc == null)
                rc = new DmcRuleExceptionSet();
              rc.add(ex);
             
              // This is a show stopper, so just fire it now.
              throw(rc);
            }
            catch(DmcValueException dve){
              // If a value for an attribute doesn't pass the basic tests, we'll
              // get one of these, just repackage it as a rule exception
              DmcRuleException ex = new DmcRuleException(dve.getMessage(), null);
              ex.source(source);

              if (rc == null)
                rc = new DmcRuleExceptionSet();
              rc.add(ex);             
            }
            catch(ResultException rex){
              // If we can't find a class or attribute, we'll get one of these
              DmcRuleException ex = new DmcRuleException(rex.getMessage(), null);
              ex.source(source);

              if (rc == null)
                rc = new DmcRuleExceptionSet();
              rc.add(ex)
             
//              System.err.println(ex.toString());
            }
           
            if (ruledata == null)
              continue;
           
            try{
              ruledata.resolveReferences(sm);
            }
            catch(DmcValueExceptionSet ex){
              System.err.println(ex.toString() + "\nFile: " + ruledata.getFile() + "  Line: " + ruledata.getLineNumber());
            }
             
            try{
              DynamicInitIF rule = (DynamicInitIF) ruleDEF.newRuleInstance();
              rule.setRuleData(ruledata);
View Full Code Here

    }
   
    for(SchemaDefinition sd: allSchemasByName.values()){
      Iterator<RuleDataDMO> rules = sd.getParsedRulesDMOs(sm);
      while(rules.hasNext()){
        RuleDataDMO rule = rules.next();
        try {
          rule.resolveReferences(sm);
        } catch (DmcValueExceptionSet e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      }
View Full Code Here

    out.write("<!-- " + DebugInfo.getWhereWeAreNow() + " -->\n");
   
    definitionName(out, rd);
   
    for(RuleIF rule: rules){
      RuleDataDMO ruleDMO = rule.getRuleDataDMO();
     
      out.write("    <tr>\n");

      out.write("      <td class=\"spacer\"> </td>\n");
     
      out.write("      <td colspan=\"3\" class=\"ruleDetailTitle\">\n");
      out.write("      <a name =\"" + ruleDMO.getRuleName() + "\">\n");
      out.write("        " + rule.getRuleTitle() + "\n");
      out.write("      </a>\n");
      out.write("      </td>\n");
     
      out.write("    </tr>\n");
     
      DmcTypeClassDefinitionREFSV   applyToClass   = (DmcTypeClassDefinitionREFSV) ruleDMO.get(MetaDMSAG.__applyToClass);
      DmcTypeAttributeDefinitionREFSV  applyToAttr   = (DmcTypeAttributeDefinitionREFSV) ruleDMO.get(MetaDMSAG.__applyToAttribute);
      DmcTypeStringSV          description   = (DmcTypeStringSV) ruleDMO.get(MetaDMSAG.__description);
     
      if (applyToClass != null){
        out.write("    <tr>\n");
        out.write("      <td class=\"spacer\"> </td>\n");
        out.write("      <td class=\"spacer\"> </td>\n");
        out.write("      <td> Apply to class: </td>\n");
        out.write("      <td> " + applyToClass.getSV().getObjectName() + " </td>\n");
        out.write("    </tr>\n");
      }
     
      if (applyToAttr != null){
        out.write("    <tr>\n");
        out.write("      <td class=\"spacer\"> </td>\n");
        out.write("      <td class=\"spacer\"> </td>\n");
        out.write("      <td> Apply to attribute: </td>\n");
        out.write("      <td> " + applyToAttr.getSV().getObjectName() + " </td>\n");
        out.write("    </tr>\n");
      }
     
      if (description != null){
        out.write("    <tr>\n");
        out.write("      <td class=\"spacer\"> </td>\n");
        out.write("      <td class=\"spacer\"> </td>\n");
        out.write("      <td> Description: </td>\n");
        out.write("      <td> " + ruleDMO.getDescriptionWithNewlines() + " </td>\n");
        out.write("    </tr>\n");
      }
     
      StringBuffer sb = new StringBuffer();
      Iterator<DmcAttribute<?>> attrList = ruleDMO.getAttributeIterator();
      while(attrList.hasNext()){
        DmcAttribute<?> attr = attrList.next();
       
        if (!skip.contains(attr.getAttributeInfo())){
          sb.append("    <tr>\n");
View Full Code Here

//       
//      }
     
      Iterator<RuleDataDMO> rules = cd.getClassRules();
      while(rules.hasNext()){
        RuleDataDMO rd = rules.next();
       
//        DebugInfo.debug(rd.toOIF());
//        boolean dumpRule = false;
//        if (rd.getApplyToClass() == null)
//          dumpRule = true;
//        else{
//          ClassDefinition atc = schema.cdef(rd.getApplyToClass().getObjectName().getNameString());
//          if (cd.isInstanceOfThis(atc))
//            dumpRule = true;
//        }
//       
//        if (cd.isInstanceOfThis(atc)){
          // We only display the rule if it's applicable to this class or
          // if we're derived from the applyToClass
          out.write("<tr> <td class=\"attributeRule\">\n");
          out.write("<a class=\"blackText\" href=\"" + rd.getDefinedIn().getObjectName() + ".html#" + rd.getRuleName() + "\"> " + rd.getRuleTitle() + " </a>");
          out.write("</td> </tr>\n\n");
         
         
//        }
      }
View Full Code Here

      sb.append("<!-- " + DebugInfo.getWhereWeAreNow() + " -->\n\n");
      sb.append("<table>\n");
     
      Iterator<RuleDataDMO> rules = ad.getGlobalRules();
      while(rules.hasNext()){
        RuleDataDMO rd = rules.next();
       
        sb.append("<tr> <td class=\"attributeRule\">\n");
        sb.append("<a class=\"blackText\" href=\"" + rd.getDefinedIn().getObjectName() + ".html#" + rd.getRuleName() + "\"> " + rd.getRuleTitle() + " </a>");
        sb.append("</td> </tr>\n\n");
      }
     
      rules = ad.getClassRules();
      while(rules.hasNext()){
        RuleDataDMO rd = rules.next();
       
        ClassDefinition atc = schema.cdef(rd.getApplyToClass().getObjectName().getNameString());
       
        if (cd.isInstanceOfThis(atc)){
          // We only display the rule if it's applicable to this class or
          // if we're derived from the applyToClass
          sb.append("<tr> <td class=\"attributeRule\">\n");
          sb.append("<a class=\"blackText\" href=\"" + rd.getDefinedIn().getObjectName() + ".html#" + rd.getRuleName() + "\"> " + rd.getRuleTitle() + " </a>");
          sb.append("</td> </tr>\n\n");
         
         
        }
      }
View Full Code Here

     
      if (referring != null){
        out.write("<p/>\n");
        for(DmcObject obj: referring){
          if (obj instanceof RuleDataDMO){
            RuleDataDMO rd = (RuleDataDMO) obj;
            out.write(rd.getRuleTitle() + "\n<p/>");
          }
//          if (obj instanceof RuleDataDMO){
//           
//          }
//          DebugInfo.debug("REF FROM: " + obj.getClass().getName());
View Full Code Here

TOP

Related Classes of org.dmd.dms.generated.dmo.RuleDataDMO

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.