Codota Logo
AnnotationFactory
Code IndexAdd Codota to your IDE (free)

How to use
AnnotationFactory
in
libcore.reflect

Best Java code snippets using libcore.reflect.AnnotationFactory (Showing top 20 results out of 315)

  • Common ways to obtain AnnotationFactory
private void myMethod () {
AnnotationFactory a =
  • Codota IconClass klzz;AnnotationMember[] values;new AnnotationFactory(klzz, values)
  • Smart code suggestions by Codota
}
origin: robovm/robovm

/**
 * Provides a new annotation instance.
 * @param annotationType the annotation type definition
 * @param elements name-value pairs representing elements of the annotation
 * @return a new annotation instance
 */
public static <A extends Annotation> A createAnnotation(Class<? extends Annotation> annotationType,
                            AnnotationMember[] elements) {
  AnnotationFactory factory = new AnnotationFactory(annotationType, elements);
  return (A) Proxy.newProxyInstance(annotationType.getClassLoader(),
                   new Class[]{annotationType}, factory);
}
origin: robovm/robovm

  return klazz;
} else if ("toString".equals(name)) {
  return toString();
} else if ("hashCode".equals(name)) {
  return hashCode();
return Boolean.valueOf(equals(args[0]));
origin: robovm/robovm

/**
 * New instances should not be created directly, use factory method
 * {@link #createAnnotation(Class, AnnotationMember[]) createAnnotation()}
 * instead.
 *
 * @param klzz class defining the annotation type
 * @param values actual element values
 */
private AnnotationFactory(Class<? extends Annotation> klzz, AnnotationMember[] values) {
  klazz = klzz;
  AnnotationMember[] defs = getElementsDescription(klazz);
  if (values == null) {
    elements = defs;
  } else {
    //merge default and actual values
    elements = new AnnotationMember[defs.length];
    next: for (int i = elements.length - 1; i >= 0; i--) {
      for (AnnotationMember val : values) {
        if (val.name.equals(defs[i].name)) {
          elements[i] = val.setDefinition(defs[i]);
          continue next;
        }
      }
      elements[i] = defs[i];
    }
  }
}
origin: MobiVM/robovm

  return klazz;
} else if ("toString".equals(name)) {
  return toString();
} else if ("hashCode".equals(name)) {
  return hashCode();
return Boolean.valueOf(equals(args[0]));
origin: robovm/robovm

AnnotationMember[] defs = getElementsDescription(klazz);
AnnotationMember[] old = elements;
List<AnnotationMember> merged = new ArrayList<AnnotationMember>(defs.length + old.length);
origin: ibinti/bugvm

/**
 * Provides a new annotation instance.
 * @param annotationType the annotation type definition
 * @param elements name-value pairs representing elements of the annotation
 * @return a new annotation instance
 */
public static <A extends Annotation> A createAnnotation(Class<? extends Annotation> annotationType,
                            AnnotationMember[] elements) {
  AnnotationFactory factory = new AnnotationFactory(annotationType, elements);
  return (A) Proxy.newProxyInstance(annotationType.getClassLoader(),
                   new Class[]{annotationType}, factory);
}
origin: FlexoVM/flexovm

  return klazz;
} else if ("toString".equals(name)) {
  return toString();
} else if ("hashCode".equals(name)) {
  return hashCode();
return Boolean.valueOf(equals(args[0]));
origin: MobiVM/robovm

/**
 * New instances should not be created directly, use factory method
 * {@link #createAnnotation(Class, AnnotationMember[]) createAnnotation()}
 * instead.
 *
 * @param klzz class defining the annotation type
 * @param values actual element values
 */
private AnnotationFactory(Class<? extends Annotation> klzz, AnnotationMember[] values) {
  klazz = klzz;
  AnnotationMember[] defs = getElementsDescription(klazz);
  if (values == null) {
    elements = defs;
  } else {
    //merge default and actual values
    elements = new AnnotationMember[defs.length];
    next: for (int i = elements.length - 1; i >= 0; i--) {
      for (AnnotationMember val : values) {
        if (val.name.equals(defs[i].name)) {
          elements[i] = val.setDefinition(defs[i]);
          continue next;
        }
      }
      elements[i] = defs[i];
    }
  }
}
origin: MobiVM/robovm

/**
 * Provides a new annotation instance.
 * @param annotationType the annotation type definition
 * @param elements name-value pairs representing elements of the annotation
 * @return a new annotation instance
 */
public static <A extends Annotation> A createAnnotation(Class<? extends Annotation> annotationType,
                            AnnotationMember[] elements) {
  AnnotationFactory factory = new AnnotationFactory(annotationType, elements);
  return (A) Proxy.newProxyInstance(annotationType.getClassLoader(),
                   new Class[]{annotationType}, factory);
}
origin: ibinti/bugvm

  return klazz;
} else if ("toString".equals(name)) {
  return toString();
} else if ("hashCode".equals(name)) {
  return hashCode();
return Boolean.valueOf(equals(args[0]));
origin: ibinti/bugvm

/**
 * New instances should not be created directly, use factory method
 * {@link #createAnnotation(Class, AnnotationMember[]) createAnnotation()}
 * instead.
 *
 * @param klzz class defining the annotation type
 * @param values actual element values
 */
private AnnotationFactory(Class<? extends Annotation> klzz, AnnotationMember[] values) {
  klazz = klzz;
  AnnotationMember[] defs = getElementsDescription(klazz);
  if (values == null) {
    elements = defs;
  } else {
    //merge default and actual values
    elements = new AnnotationMember[defs.length];
    next: for (int i = elements.length - 1; i >= 0; i--) {
      for (AnnotationMember val : values) {
        if (val.name.equals(defs[i].name)) {
          elements[i] = val.setDefinition(defs[i]);
          continue next;
        }
      }
      elements[i] = defs[i];
    }
  }
}
origin: com.mobidevelop.robovm/robovm-rt

/**
 * Provides a new annotation instance.
 * @param annotationType the annotation type definition
 * @param elements name-value pairs representing elements of the annotation
 * @return a new annotation instance
 */
public static <A extends Annotation> A createAnnotation(Class<? extends Annotation> annotationType,
                            AnnotationMember[] elements) {
  AnnotationFactory factory = new AnnotationFactory(annotationType, elements);
  return (A) Proxy.newProxyInstance(annotationType.getClassLoader(),
                   new Class[]{annotationType}, factory);
}
origin: com.mobidevelop.robovm/robovm-rt

  return klazz;
} else if ("toString".equals(name)) {
  return toString();
} else if ("hashCode".equals(name)) {
  return hashCode();
return Boolean.valueOf(equals(args[0]));
origin: com.bugvm/bugvm-rt

/**
 * New instances should not be created directly, use factory method
 * {@link #createAnnotation(Class, AnnotationMember[]) createAnnotation()}
 * instead.
 *
 * @param klzz class defining the annotation type
 * @param values actual element values
 */
private AnnotationFactory(Class<? extends Annotation> klzz, AnnotationMember[] values) {
  klazz = klzz;
  AnnotationMember[] defs = getElementsDescription(klazz);
  if (values == null) {
    elements = defs;
  } else {
    //merge default and actual values
    elements = new AnnotationMember[defs.length];
    next: for (int i = elements.length - 1; i >= 0; i--) {
      for (AnnotationMember val : values) {
        if (val.name.equals(defs[i].name)) {
          elements[i] = val.setDefinition(defs[i]);
          continue next;
        }
      }
      elements[i] = defs[i];
    }
  }
}
origin: com.bugvm/bugvm-rt

/**
 * Provides a new annotation instance.
 * @param annotationType the annotation type definition
 * @param elements name-value pairs representing elements of the annotation
 * @return a new annotation instance
 */
public static <A extends Annotation> A createAnnotation(Class<? extends Annotation> annotationType,
                            AnnotationMember[] elements) {
  AnnotationFactory factory = new AnnotationFactory(annotationType, elements);
  return (A) Proxy.newProxyInstance(annotationType.getClassLoader(),
                   new Class[]{annotationType}, factory);
}
origin: com.bugvm/bugvm-rt

  return klazz;
} else if ("toString".equals(name)) {
  return toString();
} else if ("hashCode".equals(name)) {
  return hashCode();
return Boolean.valueOf(equals(args[0]));
origin: com.mobidevelop.robovm/robovm-rt

/**
 * New instances should not be created directly, use factory method
 * {@link #createAnnotation(Class, AnnotationMember[]) createAnnotation()}
 * instead.
 *
 * @param klzz class defining the annotation type
 * @param values actual element values
 */
private AnnotationFactory(Class<? extends Annotation> klzz, AnnotationMember[] values) {
  klazz = klzz;
  AnnotationMember[] defs = getElementsDescription(klazz);
  if (values == null) {
    elements = defs;
  } else {
    //merge default and actual values
    elements = new AnnotationMember[defs.length];
    next: for (int i = elements.length - 1; i >= 0; i--) {
      for (AnnotationMember val : values) {
        if (val.name.equals(defs[i].name)) {
          elements[i] = val.setDefinition(defs[i]);
          continue next;
        }
      }
      elements[i] = defs[i];
    }
  }
}
origin: com.gluonhq/robovm-rt

/**
 * Provides a new annotation instance.
 * @param annotationType the annotation type definition
 * @param elements name-value pairs representing elements of the annotation
 * @return a new annotation instance
 */
public static <A extends Annotation> A createAnnotation(Class<? extends Annotation> annotationType,
                            AnnotationMember[] elements) {
  AnnotationFactory factory = new AnnotationFactory(annotationType, elements);
  return (A) Proxy.newProxyInstance(annotationType.getClassLoader(),
                   new Class[]{annotationType}, factory);
}
origin: com.gluonhq/robovm-rt

  return klazz;
} else if ("toString".equals(name)) {
  return toString();
} else if ("hashCode".equals(name)) {
  return hashCode();
return Boolean.valueOf(equals(args[0]));
origin: com.gluonhq/robovm-rt

/**
 * New instances should not be created directly, use factory method
 * {@link #createAnnotation(Class, AnnotationMember[]) createAnnotation()}
 * instead.
 *
 * @param klzz class defining the annotation type
 * @param values actual element values
 */
private AnnotationFactory(Class<? extends Annotation> klzz, AnnotationMember[] values) {
  klazz = klzz;
  AnnotationMember[] defs = getElementsDescription(klazz);
  if (values == null) {
    elements = defs;
  } else {
    //merge default and actual values
    elements = new AnnotationMember[defs.length];
    next: for (int i = elements.length - 1; i >= 0; i--) {
      for (AnnotationMember val : values) {
        if (val.name.equals(defs[i].name)) {
          elements[i] = val.setDefinition(defs[i]);
          continue next;
        }
      }
      elements[i] = defs[i];
    }
  }
}
libcore.reflectAnnotationFactory

Javadoc

The annotation implementation based on dynamically generated proxy instances. It conforms to all requirements stated in public APIs, see in particular java.lang.reflect.AnnotatedElementand java.lang.annotation.Annotation. Namely, annotation instances are immutable and serializable; they provide conforming access to annotation member values and required implementations of methods declared in Annotation interface.

Most used methods

  • <init>
    New instances should not be created directly, use factory method #createAnnotation(Class,AnnotationM
  • equals
    Returns true if the specified object represents the same annotation instance. That is, if it impleme
  • getElementsDescription
    Reflects specified annotation type and returns an array of member element definitions with default v
  • hashCode
    Returns a hash code composed as a sum of hash codes of member elements, including elements with defa
  • toString
    Provides detailed description of this annotation instance, including all member name-values pairs.

Popular in Java

  • Making http post requests using okhttp
  • startActivity (Activity)
  • getSystemService (Context)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now