Java Code Examples for java.lang.reflect.AccessibleObject.getAnnotation()

The following are Jave code examples for showing how to use getAnnotation() of the java.lang.reflect.AccessibleObject class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: firebase-admin-java   File: CustomClassMapper.java   View Source Code Vote up 5 votes
private static String annotatedName(AccessibleObject obj) {
  if (obj.isAnnotationPresent(PropertyName.class)) {
    PropertyName annotation = obj.getAnnotation(PropertyName.class);
    return annotation.value();
  }

  return null;
}
 
Example 2
Project: JavaGraph   File: Help.java   View Source Code Vote up 5 votes
/**
 * Creates a syntax help object from the annotations of a reflection object.
 */
public static Help createHelp(AccessibleObject source, Map<String,String> tokenMap) {
    Syntax syntax = source.getAnnotation(Syntax.class);
    ToolTipHeader header = source.getAnnotation(ToolTipHeader.class);
    ToolTipBody body = source.getAnnotation(ToolTipBody.class);
    ToolTipPars pars = source.getAnnotation(ToolTipPars.class);
    return createHelp(source, syntax, header, body, pars, tokenMap);
}
 
Example 3
Project: OpenJSharp   File: CallerSensitiveDetector.java   View Source Code Vote up 4 votes
@Override
boolean isCallerSensitive(final AccessibleObject ao) {
    return ao.getAnnotation(CALLER_SENSITIVE_ANNOTATION_CLASS) != null;
}
 
Example 4
Project: jsf-sdk   File: AbstractTemplateBuilder.java   View Source Code Vote up 4 votes
public static boolean isAnnotated(AccessibleObject accessibleObject, Class<? extends Annotation> with) {
    return accessibleObject.getAnnotation(with) != null;
}