Package org.hibernate.annotations.common.annotationfactory

Examples of org.hibernate.annotations.common.annotationfactory.AnnotationProxy


  public void setUp() {
    descriptor = new AnnotationDescriptor( TestAnnotation.class );
    descriptor.setValue( "stringElement", "x" );
    descriptor.setValue( "booleanElement", false );
    descriptor.setValue( "someOtherElement", "y" );
    ann = new AnnotationProxy( descriptor );
  }
View Full Code Here


  public void testConstructionFailsIfYouDoNotAssignValuesToAllTheElementsWithoutADefault() {
    try {
      AnnotationDescriptor desc = new AnnotationDescriptor( TestAnnotation.class );
      desc.setValue( "stringElement", "x" );
      desc.setValue( "booleanElement", false );
      new AnnotationProxy( desc );
      fail();
    }
    catch (Exception e) {
      assertEquals( "No value provided for someOtherElement", e.getMessage() );
    }
View Full Code Here

  public void testConstructionFailsIfYouDefineElementsThatAreNotInTheAnnotationInterface() {
    try {
      AnnotationDescriptor desc = new AnnotationDescriptor( Deprecated.class );
      desc.setValue( "wrongElement", "xxx" );
      new AnnotationProxy( desc );
      fail();
    }
    catch (Exception e) {
      assertTrue( e.getMessage().contains( "unknown elements" ) );
    }
View Full Code Here

  public void testThrowsARuntimeExceptionIfYouUseAnElementWhichIsNotInTheAnnotationInterface() {
    AnnotationDescriptor elements = new AnnotationDescriptor( TestAnnotation.class );
    elements.setValue( "anOddElement", "x" );
    try {
      new AnnotationProxy( elements );
      fail();
    }
    catch (RuntimeException e) {
    }
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public static <T extends Annotation> T create(AnnotationDescriptor descriptor, ClassLoader classLoader) {
    //TODO round 34ms to generate the proxy, hug! is Javassist Faster?
    //TODO prebuild the javax.persistence and org.hibernate.annotations classes?
    Class<T> proxyClass = (Class<T>) Proxy.getProxyClass( classLoader, descriptor.type() );
    InvocationHandler handler = new AnnotationProxy( descriptor );
    try {
      return getProxyInstance( proxyClass, handler );
    }
    catch (RuntimeException e) {
      throw e;
View Full Code Here

  @SuppressWarnings("unchecked")
  public static <T extends Annotation> T create(AnnotationDescriptor descriptor, ClassLoader classLoader) {
    //TODO round 34ms to generate the proxy, hug! is Javassist Faster?
    //TODO prebuild the javax.persistence and org.hibernate.annotations classes?
    Class<T> proxyClass = (Class<T>) Proxy.getProxyClass( classLoader, descriptor.type() );
    InvocationHandler handler = new AnnotationProxy( descriptor );
    try {
      return getProxyInstance( proxyClass, handler );
    }
    catch (RuntimeException e) {
      throw e;
View Full Code Here

  @SuppressWarnings("unchecked")
  public static <T extends Annotation> T create(AnnotationDescriptor descriptor, ClassLoader classLoader) {
        //TODO round 34ms to generate the proxy, hug! is Javassist Faster?
        //TODO prebuild the javax.persistence and org.hibernate.annotations classes?
        Class<T> proxyClass = (Class<T>) Proxy.getProxyClass( classLoader, descriptor.type() );
    InvocationHandler handler = new AnnotationProxy( descriptor );
    try {
      return getProxyInstance( proxyClass, handler );
    }
    catch (RuntimeException e) {
      throw e;
View Full Code Here

  @SuppressWarnings("unchecked")
  public static <T extends Annotation> T create(AnnotationDescriptor descriptor, ClassLoader classLoader) {
    //TODO round 34ms to generate the proxy, hug! is Javassist Faster?
    //TODO prebuild the javax.persistence and org.hibernate.annotations classes?
    Class<T> proxyClass = (Class<T>) Proxy.getProxyClass( classLoader, descriptor.type() );
    InvocationHandler handler = new AnnotationProxy( descriptor );
    try {
      return getProxyInstance( proxyClass, handler );
    }
    catch (RuntimeException e) {
      throw e;
View Full Code Here

TOP

Related Classes of org.hibernate.annotations.common.annotationfactory.AnnotationProxy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.