Package org.dmd.dmc.util

Examples of org.dmd.dmc.util.NamedStringArray


        }
        else
          out.write(prefix + dmoName + ".set" + anCapped + "(\"" + obj.getSV(an) + "\");\n");
      }
      else{
        NamedStringArray values = obj.get(an);
        for(String value: values){
          out.write(prefix + dmoName + ".add" + anCapped + "(\"" + value + "\");\n");
        }
      }
    }
View Full Code Here


    classDef.addValue("internallyGenerated", "true");
    classDef.addValue("ruleDefinition", name);
    classDef.addValue("must", "ruleTitle");
    classDef.addValue("may", "description");

    NamedStringArray must = uco.get("must");
    if (must != null) {
      for (String attr : must) {
        classDef.addValue("must", attr);
      }
    }

    NamedStringArray may = uco.get("may");
    if (may != null) {
      for (String attr : may) {
        classDef.addValue("may", attr);
      }
    }
View Full Code Here

   * @throws ResultException
   * @throws DmcValueException
   */
  private void dumpEnumClass(String od, DmcUncheckedObject enumObj)
      throws IOException, ResultException, DmcValueException {
    NamedStringArray al = null;
    BufferedWriter enumClassDef = null;
    TreeMap<Integer, EnumValue> byId = new TreeMap<Integer, EnumValue>();
    TreeMap<String, EnumValue> byName = new TreeMap<String, EnumValue>();

    String cp = "org.dmd.dms";
View Full Code Here

      // objName = objName + "DEF";
      // }

      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

  }

  private void dumpDMWClasses(String dmwdir) throws ResultException {
    DmcUncheckedObject go;
    DmcUncheckedObject attrObj;
    NamedStringArray must;
    NamedStringArray may;
    ArrayList<String> atlist;
    String currAttr;
    String cn;
    String classType;
    String baseClass;
View Full Code Here

    if (derivedFrom != null) {
      DmcUncheckedObject base = classDefs.get(derivedFrom);
      getAllMustAndMay(base, must, may);
    }

    NamedStringArray mustAttr = uco.get("must");
    if (mustAttr != null) {
      for (String name : mustAttr) {
        must.add(name);

        DmcUncheckedObject attrDef = attributeDefs.get(name);
        String attrType = attrDef.getSV("type");
        DmcUncheckedObject typeDef = typeDefs.get(attrType);

        // If this is an object reference, the type won't be in types -
        // skip it
        if (typeDef == null)
          continue;

        String primitiveType = typeDef.getSV("primitiveType");

        if (primitiveType != null) {
          if (primitiveType.startsWith("org.dmd.dmc.types"))
            needPrimitiveTypeImport = true;
        }
      }
    }

    NamedStringArray mayAttr = uco.get("may");
    if (mayAttr != null) {
      for (String name : mayAttr) {
        may.add(name);

        DmcUncheckedObject attrDef = attributeDefs.get(name);
View Full Code Here

  }

  ArrayList<Field> getComplexTypeFields(DmcUncheckedObject ct) {
    ArrayList<Field> rc = new ArrayList<Field>();

    NamedStringArray fields = ct.get("field");
    for (String field : fields) {
      field = field.trim();
      field = field.replaceAll("(\\s)+", " ");
      int c1pos = field.indexOf(" ");
      int c2pos = field.indexOf(" ", c1pos + 1);
View Full Code Here

   * @throws ResultException
   */
  boolean hasAnyEnumAttributes(DmcUncheckedObject classdef)
      throws ResultException {
    boolean rc = false;
    NamedStringArray must = classdef.get("must");
    NamedStringArray may = classdef.get("may");
    ArrayList<String> atlist = new ArrayList<String>();

    if (must != null) {
      for (String attrName : must)
        atlist.add(attrName);
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());
          DmcAttribute<?> attr = dmo.get(ai);
         
          // 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

   
    ImportManager factoryImports = new ImportManager();
   
    for(DmcUncheckedObject rule: ruleDefs.values()){
        String name = GenUtility.capTheName(rule.getSV("name"));
        NamedStringArray categories = rule.get("ruleCategory");
       
        String scope = rule.getSV("ruleScope");
        String type = rule.getSV("ruleType");
       
        ImportManager baseImports = new ImportManager();
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.