/** * Returns the annotations associated with this field. * * @return an array of annotation-type objects. * @see #getAvailableAnnotations() * @since 3.1 */ public Object[] getAnnotations() throws ClassNotFoundException { return getAnnotations(false); }
/** * Returns the annotations associated with this field. * * @return an array of annotation-type objects. * @see #getAvailableAnnotations() * @since 3.1 */ @Override public Object[] getAnnotations() throws ClassNotFoundException { return getAnnotations(false); }
/** * Returns the annotations associated with this field. * If any annotations are not on the classpath, they are not included * in the returned array. * * @return an array of annotation-type objects. * @see #getAnnotations() * @since 3.3 */ public Object[] getAvailableAnnotations(){ try { return getAnnotations(true); } catch (ClassNotFoundException e) { throw new RuntimeException("Unexpected exception", e); } }
/** * Returns the annotations associated with this field. * If any annotations are not on the classpath, they are not included * in the returned array. * * @return an array of annotation-type objects. * @see #getAnnotations() * @since 3.3 */ @Override public Object[] getAvailableAnnotations(){ try { return getAnnotations(true); } catch (ClassNotFoundException e) { throw new RuntimeException("Unexpected exception", e); } }
private boolean addDocIfAPI( StringBuilder sb, CtField ctf, CtClass cc, boolean first ) throws NotFoundException, CannotCompileException { String name = ctf.getName(); Object[] as; try { as = ctf.getAnnotations(); } catch( ClassNotFoundException ex) { throw new NotFoundException("getAnnotations throws ", ex); } API api = null; for(Object o : as) if(o instanceof API) api = (API) o; if( api != null ) { String help = api.help(); int min = api.since(); int max = api.until(); if( min < 1 || min > 1000000 ) throw new CannotCompileException("Found field '"+name+"' but 'since' < 1 or 'since' > 1000000"); if( max < min || (max > 1000000 && max != Integer.MAX_VALUE) ) throw new CannotCompileException("Found field '"+name+"' but 'until' < "+min+" or 'until' > 1000000"); if( first ) first = false; else sb.append(","); boolean input = isInput(ctf.getType(), api); sb.append("new water.api.DocGen$FieldDoc(\""+name+"\",\""+help+"\","+min+","+max+","+ctf.getType().getName()+".class,"+input+","+api.required()+",water.api.ParamImportance."+api.importance()+",water.api.Direction."+api.direction()+",\""+api.path()+"\","+ api.type().getName()+".class,\""+api.valid()+"\", \""+api.enabled()+"\",\""+api.visible()+"\")"); } return first; }
/** * Returns the annotations associated with this field. * * @return an array of annotation-type objects. * @see #getAvailableAnnotations() * @since 3.1 */ public Object[] getAnnotations() throws ClassNotFoundException { return getAnnotations(false); }
/** * Returns the annotations associated with this field. * * @return an array of annotation-type objects. * @see #getAvailableAnnotations() * @since 3.1 */ public Object[] getAnnotations() throws ClassNotFoundException { return getAnnotations(false); }
/** * Returns the annotations associated with this field. * * @return an array of annotation-type objects. * @see #getAvailableAnnotations() * @since 3.1 */ public Object[] getAnnotations() throws ClassNotFoundException { return getAnnotations(false); }
/** * Returns the annotations associated with this field. * * @return an array of annotation-type objects. * @see #getAvailableAnnotations() * @since 3.1 */ public Object[] getAnnotations() throws ClassNotFoundException { return getAnnotations(false); }
/** * Returns the annotations associated with this field. * * @return an array of annotation-type objects. * @see #getAvailableAnnotations() * @since 3.1 */ public Object[] getAnnotations() throws ClassNotFoundException { return getAnnotations(false); }
/** * Returns the annotations associated with this field. * If any annotations are not on the classpath, they are not included * in the returned array. * * @return an array of annotation-type objects. * @see #getAnnotations() * @since 3.3 */ public Object[] getAvailableAnnotations(){ try { return getAnnotations(true); } catch (ClassNotFoundException e) { throw new RuntimeException("Unexpected exception", e); } }
/** * Returns the annotations associated with this field. * If any annotations are not on the classpath, they are not included * in the returned array. * * @return an array of annotation-type objects. * @see #getAnnotations() * @since 3.3 */ public Object[] getAvailableAnnotations(){ try { return getAnnotations(true); } catch (ClassNotFoundException e) { throw new RuntimeException("Unexpected exception", e); } }
/** * Returns the annotations associated with this field. * If any annotations are not on the classpath, they are not included * in the returned array. * * @return an array of annotation-type objects. * @see #getAnnotations() * @since 3.3 */ public Object[] getAvailableAnnotations(){ try { return getAnnotations(true); } catch (ClassNotFoundException e) { throw new RuntimeException("Unexpected exception", e); } }
/** * Returns the annotations associated with this field. * If any annotations are not on the classpath, they are not included * in the returned array. * * @return an array of annotation-type objects. * @see #getAnnotations() * @since 3.3 */ public Object[] getAvailableAnnotations(){ try { return getAnnotations(true); } catch (ClassNotFoundException e) { throw new RuntimeException("Unexpected exception", e); } }
/** * Returns the annotations associated with this field. * If any annotations are not on the classpath, they are not included * in the returned array. * * @return an array of annotation-type objects. * @see #getAnnotations() * @since 3.3 */ public Object[] getAvailableAnnotations(){ try { return getAnnotations(true); } catch (ClassNotFoundException e) { throw new RuntimeException("Unexpected exception", e); } }
public static boolean isNullable(CtField field) { try { for (Object annotation : field.getAnnotations()) { Class annotationClass = Annotation.class; //workaround for robolectric //https://github.com/robolectric/robolectric/pull/1240 Method method = annotationClass.getMethod("annotationType"); Class type = (Class) method.invoke(annotation); if ("Nullable".equals(type.getSimpleName())) return true; } } catch (Exception e) { throw new RuntimeException(e); } return false; } }
public static void deepFields(CtClass clazz, KevoreeFactory factory, TypeDefinition currentTypeDefinition) throws Exception { for (CtField field : clazz.getDeclaredFields()) { try { for (Object annotation : field.getAnnotations()) { if (annotation instanceof org.kevoree.annotation.KevoreeInject) { boolean checkType = false;