Ejemplo n.º 1
0
  public final void getPropertyValueInternal(
      final Property property, final PropertyAcc pas, final boolean fromInstanceSlaveCall)
      throws InvalidModelException {
    /*
     * First see if the property is defined locally in the instance. Such
     * local property associations arise from component property
     * associations in the declarative spec, from explicit programmatic
     * setting of the property, or as cached results from earlier property
     * lookups.
     */
    if (pas.addLocal(this)) {
      return;
    }

    /*
     * If we don't find the property locally we defer to the declarative
     * specifications.
     */
    getPropertyValueFromDeclarativeModel(property, pas);

    /*
     * If we still don't have a value, and the property is "inherit", get it
     * from the enclosing component instance. Don't short-circuit this step
     * because the property caching during instantiation doesn't catch
     * contained property values that may be attached to an ancestor
     * instance and that might be inherited by this instance.
     */
    if (property.isInherit()) {
      final NamedElement ph = (NamedElement) eContainer();
      if (ph != null) {
        ph.getPropertyValueInternal(property, pas, false);
      }
    }
  }
Ejemplo n.º 2
0
 /**
  * Get the property value from the declarative model elements associated with the instance object.
  * This implementation works for everything but ConnectionInstances; this method is overridden in
  * ConnectionInstance to handle the problem of dealing with all the connections that make up the
  * semantic connection.
  *
  * @param property The property to lookup
  * @param pva The property value accumulator to use to build the property value
  * @throws InvalidModelException Thrown if the property value cannot be retrieved because the
  *     model is incomplete or otherwise invalid.
  */
 protected void getPropertyValueFromDeclarativeModel(
     final Property property, final PropertyAcc pas) throws InvalidModelException {
   // apv.pushCurrentComponent(getContainingComponentInstanceOrSelf());
   try {
     final List<? extends NamedElement> compDecls = getInstantiatedObjects();
     // Here we assume compDecls is empty or has only one element
     if (!compDecls.isEmpty()) {
       final NamedElement compDecl = compDecls.get(0);
       if (compDecl == null) return;
       compDecl.getPropertyValueInternal(property, pas, true);
     }
   } finally {
     // apv.popCurrentComponent();
   }
 }