Package org.dmd.dmr.server.base.extended

Examples of org.dmd.dmr.server.base.extended.HierarchicObject


        super(new HierarchicObjectDMO(mods), org.dmd.dmr.server.base.generated.DmrBaseSchemaAG._HierarchicObject);
    }

    // Generated from: org.dmd.dmg.generators.BaseDMWGeneratorNewest.dumpWrapper(BaseDMWGeneratorNewest.java:491)
    public HierarchicObject getModificationRecorder(){
        HierarchicObject rc = new HierarchicObject();
        rc.setFQN(getFQN());
        rc.setModifier(new DmcTypeModifierMV(MetaDMSAG.__modify));
        return(rc);
    }
View Full Code Here


    public HierarchicObjectDMW(HierarchicObjectDMO obj) {
        super(obj, org.dmd.dmr.server.base.generated.DmrBaseSchemaAG._HierarchicObject);
    }

    public HierarchicObject cloneIt() {
        HierarchicObject rc = new HierarchicObject();
        rc.setDmcObject(getDMO().cloneIt());
        return(rc);
    }
View Full Code Here

  protected TreeMap<DmcHierarchicObjectName,HierarchicObject>  data;
 
  FullyQualifiedName nameKey;
 
  public HierarchicDataCache(){
    root = new HierarchicObject();
    data = new TreeMap<DmcHierarchicObjectName, HierarchicObject>();
    nameKey = new FullyQualifiedName();
  }
View Full Code Here

      root.addSubComponent(ho);
     
      data.put(ho.getFQN(), ho);
    }
    else{
      HierarchicObject parent = find(ho.getFQN().getParentName());
     
      if (parent == null){
        // We don't have the parent in the cache, so just add the
        // object as an orphan
        data.put(ho.getFQN(), ho);
      }
      else{
        // we have the parent, but check to see if the object already
        // knows its parent object. If not, add it to the object.
        if (ho.getParentObject() == null)
          parent.addSubComponent(ho);
       
        data.put(ho.getFQN(), ho);
      }
    }
  }
View Full Code Here

      }
    }
  }
 
  public void deleteObject(DmcHierarchicObjectName FQN){
    HierarchicObject ho = find(FQN);
   
    if (ho != null){
      try {
        ho.getParentObject().removeSubComponent(ho);
      } catch (ResultException e) {
        e.printStackTrace();
      } catch (DmcValueException e) {
        e.printStackTrace();
      }
View Full Code Here

    return(data.get(name));
  }

  @Override
  public DmcObject findNamedDMO(DmcObjectName name) {
    HierarchicObject ho = data.get(name);
   
    if (ho == null)
      return null;
   
    return(ho.getDmcObject());
  }
View Full Code Here

  @Override
  public void handleObject(DmcUncheckedObject uco, String infile, int lineNumber) throws ResultException, DmcValueException {
    DmcHierarchicObjectName      fqn      = null;
    DmcHierarchicObjectName      parentFqn  = null;
    HierarchicObject   newEntry   = null;
    HierarchicObject   parentEntry  = null;
    HierarchicObject   currObj   = null;
   
    try {
      currObj = (HierarchicObject) factory.createWrapper(uco);
     
      DebugInfo.debug("Loaded:\n\n" + currObj.toOIF(15));
    } catch (ClassNotFoundException e) {
      ResultException ex = new ResultException("Unknown object class: " + uco.classes.get(0));
      ex.result.lastResult().fileName(infile);
      ex.result.lastResult().lineNumber(lineNumber);
      throw(ex);
    }
    catch (ResultException ex){
      ex.setLocationInfo(infile, lineNumber);
      throw(ex);
    }
   
    // We always set the file and line info in case we need it for error reporting,
    // but we strip it out in resolveReferences() if it's not required
    currObj.setLineNumber(lineNumber);
    currObj.setFile(infile);

    if (currObj.getFQN() == null){
      ResultException ex = new ResultException();
      ex.addError("Missing FQN for object.");
      ex.setLocationInfo(currObj.getFile(), currObj.getLineNumber());
      throw(ex);
    }
   
    fqn = currObj.getFQN();
   
    if (currObj.getFQN().getParentName() != null)
      parentFqn = currObj.getFQN().getParentName();
   
    if (parentFqn == null){
      // We have a top level object
      currObj.setParentObject(null);
      cache.addObject(currObj);
    }
    else{
      if (cache.find(fqn) == null){
        parentEntry = cache.find(parentFqn);
     
        if (parentEntry == null){
          ResultException ex = new ResultException();
          ex.addError("Missing parent: " + parentFqn + " for object: " + fqn);
          ex.setLocationInfo(currObj.getFile(), currObj.getLineNumber());
          throw(ex);
        }
        else{
          newEntry = currObj;
          newEntry.setParentObject(parentEntry);
         
          cache.addObject(currObj);
        }
      }
      else{
        ResultException ex = new ResultException();
        ex.addError("Duplicate FQN: " + fqn);
        ex.setLocationInfo(currObj.getFile(), currObj.getLineNumber());
        throw(ex);
      }
   
      System.out.println("HierarchyParser read:\n" + newEntry.getFQN());
     
View Full Code Here

  @Override
  public void handleObject(DmcUncheckedObject uco, String infile, int lineNumber) throws ResultException, DmcValueException {
    DmcHierarchicObjectName      fqn      = null;
    DmcHierarchicObjectName      parentFqn  = null;
    HierarchicObject   newEntry   = null;
    HierarchicObject   parentEntry  = null;
    HierarchicObject   currObj   = null;
   
    try {
      currObj = (HierarchicObject) factory.createWrapper(uco);
    } catch (ClassNotFoundException e) {
      ResultException ex = new ResultException("Unknown object class: " + uco.classes.get(0));
      ex.result.lastResult().fileName(infile);
      ex.result.lastResult().lineNumber(lineNumber);
      throw(ex);
    }
    catch (ResultException ex){
      ex.setLocationInfo(infile, lineNumber);
      throw(ex);
    }
   
    currObj.setLineNumber(lineNumber);
    currObj.setFile(infile);

    if (currObj.getFQN() == null){
      ResultException ex = new ResultException();
      ex.addError("Missing FQN for object.");
      ex.setLocationInfo(currObj.getFile(), currObj.getLineNumber());
      throw(ex);
    }
   
    fqn = currObj.getFQN();
   
    if (currObj.getFQN().getParentName() != null)
      parentFqn = currObj.getFQN().getParentName();
   
    if (parentFqn == null){
      if (root == null){
        root = currObj;
        root.setParentObject(null);
       
        keyMap.put(fqn,root);
      }
      else{
        // The only time that parent should be null is when we're dealing with the
        // root object - otherwise, it's an error
        ResultException ex = new ResultException();
        ex.addError("Missing parent for object:" + fqn);
        ex.setLocationInfo(currObj.getFile(), currObj.getLineNumber());
        throw(ex);
      }
    }
    else{
      if (keyMap.get(fqn) == null){
        parentEntry = keyMap.get(parentFqn);
     
        if (parentEntry == null){
          ResultException ex = new ResultException();
          ex.addError("Missing parent: " + parentFqn + " for object: " + fqn);
          ex.setLocationInfo(currObj.getFile(), currObj.getLineNumber());
          throw(ex);
        }
        else{
          newEntry = currObj;
          newEntry.setParentObject(parentEntry);
         
          keyMap.put(fqn, newEntry);
        }
      }
      else{
        ResultException ex = new ResultException();
        ex.addError("Duplicate fqn: " + fqn);
        ex.setLocationInfo(currObj.getFile(), currObj.getLineNumber());
        throw(ex);
      }
   
      System.out.println("HierarchyParser read:\n" + newEntry.getFQN());
    }
View Full Code Here

TOP

Related Classes of org.dmd.dmr.server.base.extended.HierarchicObject

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.