// process args
Arg[] args = bean.args();
if (args.length > 0) {
for (int i = 0; i < args.length; i++) {
Targument targ = createTargument(args[i]);
if (targ != null) {
props.add(targ);
}
}
}
Field[] fields = clazz.getDeclaredFields();
for (int i = 0; i < fields.length; i++) {
if (fields[i].isAnnotationPresent(Inject.class)) {
if (fields[i].isAnnotationPresent(Reference.class)) {
// the field is also annotated with @Reference
Reference ref = (Reference)fields[i].getAnnotation(Reference.class);
Treference tref = generateTref(ref, reflMap);
components.add(tref);
} else if (fields[i].isAnnotationPresent(ReferenceList.class)) {
// the field is also annotated with @ReferenceList
ReferenceList ref = (ReferenceList)fields[i].getAnnotation(ReferenceList.class);
TreferenceList tref = generateTrefList(ref, reflMap);
components.add(tref);
} else {
Tproperty tp = createTproperty(fields[i].getName(), fields[i].getAnnotation(Inject.class));
props.add(tp);
}
}
}
// check if the bean also declares init, destroy or inject annotation on methods
Method[] methods = clazz.getDeclaredMethods();
for (int i = 0; i < methods.length; i++) {
if (methods[i].isAnnotationPresent(Init.class)) {
tbean.setInitMethod(methods[i].getName());
} else if (methods[i].isAnnotationPresent(Destroy.class)) {
tbean.setDestroyMethod(methods[i].getName());
} else if (methods[i].isAnnotationPresent(Inject.class)) {
String propertyName = convertFromMethodName(methods[i].getName());
Tproperty tp = createTproperty(propertyName, methods[i].getAnnotation(Inject.class));
props.add(tp);
} else if (methods[i].isAnnotationPresent(Arg.class)) {
Targument targ = createTargument(methods[i].getAnnotation(Arg.class));
props.add(targ);
}
}
// check if the bean also declares service