Package fr.imag.adele.apam.declarations

Examples of fr.imag.adele.apam.declarations.PropertyDefinition


      error("invalid state property "+quoted(state.getIdentifier())+", declaring component "+state.getDeclaringComponent().getName()+" is not an implementation");
      return null;
    }
   
    // Attribute state must be defined on the implementation.
    PropertyDefinition property = declaring.getPropertyDefinition(state.getIdentifier());
    if (property == null) {
      error("invalid state property "+quoted(state.getIdentifier())+", not declared in component "+state.getDeclaringComponent().getName());
      return null;
    }
View Full Code Here


    // getDeclaration().getPropertyDefinition(attr);
    // if (definition != null) {
    // return definition;
    // }

    PropertyDefinition definition = null;
    Component group = this; // .getGroup();
    while (group != null) {
      definition = group.getDeclaration().getPropertyDefinition(attr);
      if (definition != null) {
        return definition;
View Full Code Here

    return null;
  }

  @Override
  public AttrType getAttrType(String attr) {
    PropertyDefinition attrDef = getAttrDefinition(attr);
    if (attrDef == null) {
      if (Attribute.isFinalAttribute(attr)) {
        return Attribute.splitType("string");
      }
      return null;
    }
    return Attribute.splitType(attrDef.getType());
  }
View Full Code Here

    /*
     *  First add the valid attributes.
     */
    for (Map.Entry<String, String> initialProperty : fullInitialProperties.entrySet()) {
     
      PropertyDefinition def = validDef(initialProperty.getKey(), true);
      if (def != null) {
        Object val = Attribute.checkAttrType(initialProperty.getKey(), initialProperty.getValue(), def.getType());
        if (val != null) {
          put(initialProperty.getKey(), val);
        }
      }
    }
View Full Code Here

    }
    return getGroup().isSingleton();
  }

  public boolean isSubstitute(String attr) {
    PropertyDefinition def = getDeclaration().getPropertyDefinition(attr);
    return (def != null && def.hasDefaultValue() && (def.getDefaultValue().charAt(0) == '$' || def.getDefaultValue().charAt(0) == '@'));
  }
View Full Code Here

   */
  private static final void addProperty(ComponentDeclaration component, String property, String type, String value) {
   
    /*
     */
    PropertyDefinition defintition = component.getPropertyDefinition(property);
    if (defintition == null) {
      defintition = new PropertyDefinition(component.getReference(), property, type, null);
      component.getPropertyDefinitions().add(defintition);
    }

    String currentValue = component.getProperty(property);
    if (currentValue == null) {
View Full Code Here

   */
  private static final void addProperty(ComponentDeclaration component, String property, String type, String value) {
   
    /*
     */
    PropertyDefinition defintition = component.getPropertyDefinition(property);
    if (defintition == null) {
      defintition = new PropertyDefinition(component.getReference(), property, type, null);
      component.getPropertyDefinitions().add(defintition);
    }

    String currentValue = component.getProperty(property);
    if (currentValue == null) {
View Full Code Here

    /*
     * Add a property to identify iPOJO factories
     */
   
    declaration.getPropertyDefinitions().add( new PropertyDefinition(declaration.getReference(), "ipojo.factory","boolean", null));
    declaration.getProperties().put("ipojo.factory","true");
   
    declaration.getPropertyDefinitions().add( new PropertyDefinition(declaration.getReference(), "factory.name","string", null));
    declaration.getProperties().put("factory.name", factory.getName());

    /*
     * Add the list of provided interfaces
     */
    for (String providedIntereface : factory.getComponentDescription().getprovidedServiceSpecification()) {
      declaration.getProvidedResources().add(new InterfaceReference(providedIntereface));
    }
   
    /*
     * Add the list of factory properties
     */
    for(PropertyDescription  property : factory.getComponentDescription().getProperties()) {
      if (property.isImmutable()) {
        declaration.getPropertyDefinitions().add( new PropertyDefinition(declaration.getReference(), property.getName(),"string", null));
        declaration.getProperties().put(property.getName(), property.getValue());
      }
    }
   
    this.factory     = factory;
View Full Code Here

   
    boolean first = true;
    for (Map.Entry<String,Object> property : application.getAllProperties().entrySet()) {
     
     
      PropertyDefinition definition = application.getPropertyDefinition(property.getKey());
     
      /*
       * skip internal properties
       */
      if (definition == null)
View Full Code Here

        callback = parseString(component.getName(), definition, ATT_METHOD, false);
        injected = parseInjectedPropertyPolicy(component.getName(), definition);

      }

      component.getPropertyDefinitions().add(new PropertyDefinition(component.getReference(), name, type, defaultValue, field, callback, injected));

    }
  }
View Full Code Here

TOP

Related Classes of fr.imag.adele.apam.declarations.PropertyDefinition

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.