Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Include Page
FELIX:apache-felix-ipojo-headerFELIX:
apache-felix-ipojo-header

...

During the manipulation process, iPOJO gathers information about the manipulated classes. These metadata are stored inside the bundle manifest and are used to avoid reflection on the manipulated class. By using these metadata, your handler can check that the implementation class contains required fields, methods, check implemented interfaces...

Div
classtoc
Table of Contents
maxLevel4
minLevel2

...

Contained information

Manipulation metadata contains:

...

From the manipulation metadata, you can query manipulation information by using following methods:

  • Wiki MarkupMethodMetadata\[\] getMethods() : Get all methodsunmigrated-wiki-markup
  • FieldMetadata\[\] getFields() : Get all fields
  • Wiki MarkupString\[\] getInterfaces() : Get all implemented interfaces
  • FieldMetadata getField(String name) : Look for the field with the given name. Returns null if not found.
  • FieldMetadata getField(String name, String type): Look for the field with the given name and type. Returns null if not found.
  • boolean isInterfaceImplemented(String itf) : Is the given interface name implemented by the manipulated class.
  • MethodMetadata getMethod(String name) : Look for the method with the given name. Returns null if not found. Returns the first found if several method match.
  • Wiki MarkupMethodMetadata\[\] getMethods(String name) : Look for all methods with the given name. Returns an empty array if not found.
  • Wiki MarkupMethodMetadata getMethod(String name, String\[\] types) : Look for the method with the given name and argument type list. Returns null if not found.

From a Field Metadata object, you can obtain the field name, type, and 'reflective' type. From a Method Metadata object, you can obtain the method name, the argument type array, and the returned type ('void' for void method).

...

When querying field (or a method argument) type, the API will return returns following code identifieridentifiers:

  • For primitive types : int, long, short, byte, char, double, float, boolean
  • Wiki MarkupFor primitives type arrays : int\[\], long\[\], short\[\], byte\[\], char\[\], double\[\], float\[\], boolean\[\]
  • For object : qualified class name as java.lang.String
  • Wiki MarkupFor object arrays : the qualified class name of the content type followed by \ [\] as java.lang.String\[\]

Array types are different from Java internal/reflective array types. To get the internal/reflective array type for field type you can use the getReflectiveType method.

Include Page
FELIX:apache-felix-ipojo-footerFELIX:
apache-felix-ipojo-footer