Examples of FieldMetaData


Examples of org.apache.felix.ipojo.parser.FieldMetadata

    AtomicImplementationDeclaration primitive = (AtomicImplementationDeclaration) declaration;
    for (PropertyDefinition definition : primitive.getPropertyDefinitions()) {

      if (definition.getField() != null) {
        FieldMetadata field = getPojoMetadata().getField(definition.getField());
        getInstanceManager().register(field,this);
      }

      if (definition.getCallback() != null) {
        getInstanceManager().addCallback(new PropertyCallback(getInstanceManager(), definition));
View Full Code Here

Examples of org.apache.felix.ipojo.parser.FieldMetadata

      if (definition.getInjected() == InjectedPropertyPolicy.EXTERNAL)
        continue;
     
      if (definition.getField() != null) {
        FieldMetadata field = getPojoMetadata().getField(definition.getField());
       
        Object fieldValue  = getInstanceManager().getFieldValue(field.getFieldName());
       
        if (definition.getInjected() == InjectedPropertyPolicy.INTERNAL)
          onSet(getInstanceManager().getPojoObject(), field.getFieldName(), fieldValue);
       
        if (definition.getInjected() == InjectedPropertyPolicy.BOTH) {
          Object apamValue  = component.getPropertyObject(definition.getName());
         
          if (apamValue == null)
            onSet(getInstanceManager().getPojoObject(), field.getFieldName(), fieldValue);
        }

      }

    }   
View Full Code Here

Examples of org.apache.felix.ipojo.parser.FieldMetadata

    }

    /*
     * Get iPojo metadata
     */
    FieldMetadata fieldIPojoMetadata = null;
    if ((pojoMetadata != null) && (pojoMetadata.getField(fieldName) != null)) {
      fieldIPojoMetadata = pojoMetadata.getField(fieldName);
    }

    if (fieldIPojoMetadata != null) {
      return fieldIPojoMetadata.getFieldType();
    }

    throw new NoSuchFieldException("unavailable field " + fieldName);

    }
View Full Code Here

Examples of org.apache.felix.ipojo.parser.FieldMetadata

    }

    /*
     * Get iPojo metadata
     */
    FieldMetadata fieldIPojoMetadata = null;
    if ((pojoMetadata != null) && (pojoMetadata.getField(fieldName) != null)) {
      fieldIPojoMetadata = pojoMetadata.getField(fieldName);
    }

    if (fieldIPojoMetadata != null) {

      /*
       * Verify if it is a collection
       */
      String collectionType = getCollectionType(fieldIPojoMetadata);
      if (collectionType != null) {
        return collectionType;
      }

      /*
       * Verify if it is a message
       */
      String messageType = getMessageType(fieldIPojoMetadata);
      if (messageType != null) {
        return messageType;
      }

      /*
       * Otherwise we just return the raw type
       */
      return fieldIPojoMetadata.getFieldType();
    }

    throw new NoSuchFieldException("unavailable field " + fieldName);

  }
View Full Code Here

Examples of org.apache.felix.ipojo.parser.FieldMetadata

    }
   
    /*
     * Get iPojo metadata
     */
    FieldMetadata fieldIPojoMetadata = null;
    if ((pojoMetadata != null) && (pojoMetadata.getField(fieldName) != null)) {
      fieldIPojoMetadata = pojoMetadata.getField(fieldName);
    }

    if (fieldIPojoMetadata != null) {
View Full Code Here

Examples of org.apache.felix.ipojo.parser.FieldMetadata

    }

    /*
     * Get iPojo metadata
     */
    FieldMetadata fieldIPojoMetadata = null;
    if ((pojoMetadata != null) && (pojoMetadata.getField(fieldName) != null)) {
      fieldIPojoMetadata = pojoMetadata.getField(fieldName);
    }

    if (fieldIPojoMetadata != null) {
View Full Code Here

Examples of org.apache.felix.ipojo.parser.FieldMetadata

     * TODO We keep a reference to the class of the field, this may prevent the class loader from being
     * garbage collected and the class from being updated. We need to verify what is the behavior of OSGi
     * when the class of a field is updated, and adjust this implementation accordingly.
     */
   
    FieldMetadata field = factory.getPojoMetadata().getField(injection.getName());
    String fieldType   = FieldMetadata.getReflectionType(field.getFieldType());
   
    this.fieldClass   = factory.loadClass(fieldType);
    this.isCollection   = injection.acceptMultipleProviders();
   
    /*
 
View Full Code Here

Examples of org.apache.felix.ipojo.parser.FieldMetadata

                + injection.getName() + " :"
                            + error.getLocalizedMessage());
                }

                if (injection instanceof InjectedField) {
                    FieldMetadata field = getPojoMetadata().getField(injection.getName());
                    if (field != null)
                        getInstanceManager().register(field, interceptor);
                }
            }
    }
View Full Code Here

Examples of org.apache.felix.ipojo.parser.FieldMetadata

            String id = field;
            if (deps[i].containsAttribute("id")) {
                id = deps[i].getAttribute("id");
            }

            FieldMetadata fieldmeta = manipulation.getField(field);
            if (fieldmeta == null) {
                error("The field " + field + " does not exist in the class " + getInstanceManager().getClassName());
                return;
            }

            boolean agg = false;
            boolean collection = false;
            String spec = fieldmeta.getFieldType();
            if (spec.endsWith("[]")) {
                agg = true;
                spec = spec.substring(0, spec.length() - 2);
            } else if (Collection.class.getName().equals(spec)) {
                agg = true;
View Full Code Here

Examples of org.apache.openjpa.meta.FieldMetaData

    /**
     * Set a field's fetch group.
     */
    private void parseFetchAttribute(ClassMetaData meta,
        org.apache.openjpa.meta.FetchGroup fg, FetchAttribute attr) {
        FieldMetaData field = meta.getDeclaredField(attr.name());
        if (field == null
            || field.getManagement() != FieldMetaData.MANAGE_PERSISTENT)
            throw new MetaDataException(_loc.get("bad-fg-field", fg.getName(),
                meta, attr.name()));

        field.setInFetchGroup(fg.getName(), true);
        if (attr.recursionDepth() != Integer.MIN_VALUE)
            fg.setRecursionDepth(field, attr.recursionDepth());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.