Package org.dmd.dmc

Examples of org.dmd.dmc.DmcNamedObjectIF


   */
  public void resolveReferences(DmcNameResolverIF rx) throws DmcValueException {
    if (getAttributeInfo().valueType == ValueTypeEnum.SINGLE){
      HELPER ref = getSV();
      if (ref.getObject() == null){
        DmcNamedObjectIF obj = (DmcNamedObjectIF) rx.findNamedDMO(ref.getObjectName());
        if (obj == null)
          throw(new DmcValueException("Could not resolve reference to: " + ref.getObjectName() + " via attribute: " + getName()));
         
        ref.setObject(obj);
      }
    }
    else{
      Iterator<HELPER> it = getMV();
      if (it != null){
        while(it.hasNext()){
          HELPER ref = it.next();
          if (ref.getObject() == null){
            DmcNamedObjectIF obj = (DmcNamedObjectIF) rx.findNamedDMO(ref.getObjectName());
            if (obj == null)
              throw(new DmcValueException("Could not resolve reference to: " + ref.getObjectName() + " via attribute: " + getName()));
             
            ref.setObject(obj);
          }
View Full Code Here


        return(fieldTag);
    }

    @SuppressWarnings({"unchecked", "rawtypes"})
    public void resolve(DmcNameResolverIF resolver, String attrName) throws DmcValueException {
        DmcNamedObjectIF  obj = null;

        if (!attribute.isResolved()){
            obj = resolver.findNamedObject(attribute.getObjectName());
            if (obj == null)
                throw(new DmcValueException("Could not resolve reference to: " + attribute.getObjectName() + " via attribute: " + attrName));
View Full Code Here

        return(description);
    }

    @SuppressWarnings({"unchecked", "rawtypes"})
    public void resolve(DmcNameResolverIF resolver, String attrName) throws DmcValueException {
        DmcNamedObjectIF  obj = null;

        if (!type.isResolved()){
            obj = resolver.findNamedObject(type.getObjectName());
            if (obj == null)
                throw(new DmcValueException("Could not resolve reference to: " + type.getObjectName() + " via attribute: " + attrName));
View Full Code Here

public class TestLogger implements DmcLoggerIF {

  @Override
  public void logDeadReference(DmcObject referrer, DmcAttribute<?> viaAttribute, DmcObjectName referenceTo) {
    DmcNamedObjectIF from = (DmcNamedObjectIF) referrer;
    System.out.println("Couldn't resolve reference from " + from.getObjectName() + " via " + viaAttribute.getName() + " to " + referenceTo);
   
  }
View Full Code Here

  // DmcNameResolverIF
 
  @Override
  public DmcObject findNamedDMO(DmcObjectName name){
    DmcNamedObjectIF obj = data.get(name);
    if (obj == null)
      return(null);
   
    if (obj instanceof DmcObject)
      return (DmcObject) (obj);
View Full Code Here

    return(((DmcContainerIF)obj).getDmcObject());
  }

  @Override
  public DmcNamedObjectIF findNamedObject(DmcObjectName name) {
    DmcNamedObjectIF obj = data.get(name);
    if (obj == null)
      return(null);
    return (obj);
  }
View Full Code Here

    return(rc);
  }

  @Override
  public DmcNamedObjectIF findNamedObject(DmcObjectName name) {
    DmcNamedObjectIF   rc   = null;
    MvwDefinition    d   = allDefs.get(name);
   
    if (d == null){
      // Fall back and check the schema
      rc = schema.findNamedObject(name);
View Full Code Here

  @Override
  public DmcNamedObjectIF findNamedObject(DmcObjectName name, int attributeID) {
    if (attributeID == MetaDMSAG.__internalTypeRef.id){
//      DebugInfo.debug("internal type ref: " + name.getNameString());
      DmcNamedObjectIF def = (DmcNamedObjectIF)internalTypeDefs.get(name);
      return(def);
    }
    else if (attributeID == MetaDMSAG.__type.id){
//      DebugInfo.debug("type " + name.getNameString());
      DmcNamedObjectIF def = (DmcNamedObjectIF)internalTypeDefs.get(name);
      if (def != null)
        return(def);
    }
    else if (attributeID == MetaDMSAG.__internalTypeDefList.id){
//      DebugInfo.debug("internalTypeDefList " + name.getNameString());
      DmcNamedObjectIF def = (DmcNamedObjectIF)internalTypeDefs.get(name);
      if (def != null)
        return(def);
    }
    else if (attributeID == MetaDMSAG.__enumDefList.id){
//      DebugInfo.debug("enumDefList " + name.getNameString());
      DmcNamedObjectIF def = (DmcNamedObjectIF)enumDefs.get(name);
      if (def != null)
        return(def);
    }
    else if (attributeID == MetaDMSAG.__extendedReferenceTypeDefList.id){
//      DebugInfo.debug("extendedReferenceTypeDefList " + name.getNameString());
      DmcNamedObjectIF def = (DmcNamedObjectIF)extendedReferenceTypeDefs.get(name);
      if (def != null)
        return(def);
    }
    else if (attributeID == MetaDMSAG.__complexTypeDefList.id){
//      DebugInfo.debug("complexTypeDefList " + name.getNameString());
      DmcNamedObjectIF def = (DmcNamedObjectIF)complexTypeDefs.get(name);
      if (def != null)
        return(def);
    }
   
    // Added this after working on rules. Had a case where allowedType was defined as
    // type TypeDefinition but got DmcValueException when referring to AttributeDefinition.
    // This occurred because allowedType was not specified in the list above - so, to make
    // things extensible, added this chunk of code.
    AttributeDefinition ad = attrByID.get(attributeID);
    if (ad != null){
      if (ad.getDMO().getType().getObjectName().getNameString().equals(MetaDMSAG.__type_TypeDefinition.name)){
        DmcNamedObjectIF def = (DmcNamedObjectIF)internalTypeDefs.get(name);
        if (def != null)
          return(def);             
      }
    }
   
View Full Code Here

    return rc;
  }

  @Override
  public DmcNamedObjectIF findNamedObject(DmcObjectName name) {
    DmcNamedObjectIF rc = schema.findNamedObject(name);
   
    if (rc == null)
      return(cache.findNamedObject(name));
   
    return(rc);
View Full Code Here

  }

  @Override
  public DmcNamedObjectIF findNamedObject(DmcObjectName name, int attributeID) {
    // Don't actually use the attribute ID here
    DmcNamedObjectIF rc = schema.findNamedObject(name);
   
    if (rc == null)
      return(cache.findNamedObject(name));
   
    return(rc);
View Full Code Here

TOP

Related Classes of org.dmd.dmc.DmcNamedObjectIF

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.