Package org.dmd.dmc.util

Examples of org.dmd.dmc.util.NamedStringArray


    for(DmcUncheckedObject category: ruleCategoryDefs.values()){
        String         name           = GenUtility.capTheName(category.getSV("name"));
        String         ruleType         = category.getSV("ruleType");
        String         classInfoFromParam    = category.getSV("classInfoFromParam");
        String         attributeInfoFromParam  = category.getSV("attributeInfoFromParam");
        NamedStringArray  ruleImports        = category.get("ruleImport");
        Boolean        isAttributeRule     = false;
       
        if (ruleType.equals("ATTRIBUTE"))
          isAttributeRule = true;
       
        NamedStringArray categories = category.get("ruleParam");
               
        ImportManager baseImports = new ImportManager();
           
        baseImports.addImport("org.dmd.dmc.rules.DmcRuleExceptionSet", "Rule type");
        baseImports.addImport("org.dmd.dmc.rules.RuleIF", "All rules implement this");
View Full Code Here


     * @param sd The schema about to be loaded.
     * @throws ResultException 
     * @throws DmcValueException
     */
  public void schemaPreAdd(DmcUncheckedObject sd) throws ResultException, DmcValueException {
      NamedStringArray attr = sd.get(MetaSchema._schemaExtension.getName().getNameString());
     
       if (attr != null){
        Class<?> extclass;
//        Iterator<String> extList = attr.getMV();
       
View Full Code Here

//      DmcAttributeInfo ai = DmcOmni.instance().getInfo(ad.getDmdID());
     
      if (ai == null)
        throw(new IllegalStateException("Unknown attribute id: " + ad.getDmdID() + " for attribute: " + ad.getName()));
     
      NamedStringArray values = null;
     
      switch(ad.getValueType()){
      case SINGLE:
        values = uco.get(n);
       
        try {
          // Try to get the attribute
          DmcAttribute<?> attr = dmo.get(ad.getName().getNameString());
         
          // If we can't find the attribute container, create it
          if (attr == null)
            attr = ad.getType().getAttributeHolder(ai);
         
          // Set the value
          attr.set(values.get(0));
         
          // Store the attribute
          dmo.set(ai, attr);
        } catch (InstantiationException e) {
          e.printStackTrace();
View Full Code Here

      if (derivedFrom != null){
        DmcUncheckedObject base = classDefs.get(derivedFrom);
        getAllMustAndMay(base, must, may, classDefs);
      }
     
      NamedStringArray mustAttr = uco.get("must");
      if (mustAttr != null){
        for(String name: mustAttr){
          must.add(name);
        }
      }
     
      NamedStringArray mayAttr = uco.get("may");
      if (mayAttr != null){
        for(String name: mayAttr){
          may.add(name);
        }
      }
View Full Code Here

   
    objName = obj.getSV("ruleName") + "Data";
   
    Iterator<String> attributeNames = obj.getAttributeNames();
    while(attributeNames.hasNext()){
      NamedStringArray attr = obj.get(attributeNames.next());
      attrName = attr.getName();
      if (attrName == null){
        DebugInfo.debug("Attr name null");
        continue;
      }
      attrDef  = attributeDefs.get(attrName);
View Full Code Here

//      DebugInfo.debug("DmoCompactSchemaFormatter.setAttributeValues() " + cd.getName() + " is extensible");
//    }
   
    Iterator<String> attributeNames = obj.getAttributeNames();
    while(attributeNames.hasNext()){
      NamedStringArray attr = obj.get(attributeNames.next());
      attrName = attr.getName();
      if (attrName == null){
        DebugInfo.debugWithTrace("Attr name null");
        continue;
      }
      attrDef  = sm.isAttribute(attrName);
     
      if (attrDef == null){
        ResultException ex = new ResultException();
        ex.addError("Unknown attribute: " + attrName);
        ex.result.lastResult().fileName(obj.getSV(MetaDMSAG.__file.name));
        ex.result.lastResult().lineNumber(obj.lineNumber);
        throw(ex);
      }
     
        StringBuffer   attrNameCapped   = new StringBuffer();
        attrNameCapped.append(attrName);
        attrNameCapped.setCharAt(0,Character.toUpperCase(attrNameCapped.charAt(0)));

        if (cd.isAllowedAttribute(new StringName(attrName))){
        if (attrDef.getValueType() == ValueTypeEnum.SINGLE){
          String value = obj.getSV(attrName);
                out.write("            _" + pf.sprintf(objName));
          out.write(".set" + attrNameCapped + "(");
          out.write("\"" + value + "\");\n");
        }
        else{
          for(String value: attr){
                  out.write("            _" + pf.sprintf(objName));
            out.write(".add" + attrNameCapped + "(");
            out.write("\"" + value + "\");\n");
          }
        }
      }
      else{
//        DebugInfo.debug("Extra attribute: " + attrName);
        out.write(attrDef.getValueModificationStatement(uniqueNum,"            ","            _" + objName, obj.get(attr.getName())));
        uniqueNum++;
      }
     
//      if (attrDef.getValueType() == ValueTypeEnum.SINGLE)
//        multiValued = false;
View Full Code Here

                ex.result.addResult(Result.ERROR,"Could not retrieve DmcAttributeInfo for: " + n);
                throw(ex);
        }
      }
     
      NamedStringArray values = null;
     
      switch(ad.getValueType()){
      case SINGLE:
        values = uco.get(n);
       
        try {
          // Try to get the attribute
          DmcAttribute<?> attr = dmo.get(ad.getName().getNameString());
         
          // If we can't find the attribute container, create it
          if (attr == null)
            attr = ad.getType().getAttributeHolder(ai);
         
          // Set the value
          attr.set(values.get(0));
         
          // Store the attribute
          dmo.set(ai, attr);
        } catch (InstantiationException e) {
          e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.dmd.dmc.util.NamedStringArray

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.