@SuppressWarnings("unchecked")
protected AbstractXmlBinding<Object> createXmlBinder(Protocol protocol, Object o) {
try {
Class<? extends AbstractXmlBinding> classBinding = null;
Params params = new Params();
for (ISetProperty property : lstProp) {
params.addPropertyValue(property.getProperty(), property.getValue());
}
Annotation[] annotations = o.getClass().getAnnotations();
for (Annotation annotation : annotations) {
ABinder abstractXmlBinding = annotation.annotationType().getAnnotation( ABinder.class );
if ( abstractXmlBinding != null ) {
classBinding = abstractXmlBinding.value();
Method[] mm = annotation.annotationType().getDeclaredMethods();
for( Method m : mm )
{
Class tClass = m.getReturnType();
AParam aParam = (AParam) tClass.getComponentType().getAnnotation( AParam.class );
if ( aParam!=null ) {
Annotation[] aValue = (Annotation[]) m.invoke(annotation);
for (Annotation ref : aValue) {
Method mv = ref.annotationType().getDeclaredMethod("value");
Object v = mv.invoke(ref);
params.addParameter(aParam.type(), v);
}
}
}
}
}