Code example for Method

Methods: getNamegetParameterTypes

0
    { 
        if ((injectable==null) || (method==null))
            return; 
        //check the injection target actually has a matching method 
        //TODO: think about this, they have to be assignable 
        injectable.getClass().getMethod(method.getName(), method.getParameterTypes());    
    } 
     
    private void validateInjection (Field field, Object injectable) 
    throws NoSuchFieldException 
    { 
        if ((field==null) || (injectable==null))
            return; 
 
        Field f = injectable.getClass().getField(field.getName());
        if (!f.getType().isAssignableFrom(field.getType()))
            throw new NoSuchFieldException("Mismatching type of field: "+f.getType().getName()+" v "+field.getType().getName());
    }    
}