Examples of AnnotationProxy


Examples of org.codehaus.jam.annotation.AnnotationProxy

    if (name == null) throw new IllegalArgumentException("null name");
    if (annComponentTypeName == null) throw new IllegalArgumentException("null typename");
    if (dimensions < 0) throw new IllegalArgumentException("dimensions = "+dimensions);
    MAnnotation[] out = new MAnnotation[dimensions];
    for(int i=0; i<out.length; i++) {
      AnnotationProxy p = getContext().createAnnotationProxy(annComponentTypeName);
      out[i] = new AnnotationImpl(getContext(),p,annComponentTypeName);
    }
    JClass type  = getContext().getClassLoader().loadClass("[L"+annComponentTypeName+";");
    mProxy.setValue(name,out,type);
    return out;
View Full Code Here

Examples of org.codehaus.jam.annotation.AnnotationProxy

  public MAnnotation findOrCreateAnnotation(String annotationName) {
    //ClassImpl.validateClassName(annotationName);
    MAnnotation ann = getMutableAnnotation(annotationName);
    if (ann != null) return ann;
    AnnotationProxy proxy = getContext().
      createAnnotationProxy(annotationName);
    ann = new AnnotationImpl(getContext(),proxy,annotationName);
    if (mName2Annotation == null) {
      mName2Annotation = new HashMap();
    }
View Full Code Here

Examples of org.codehaus.jam.annotation.AnnotationProxy

    if (annName == null) throw new IllegalArgumentException("null tagname");
    annName = annName.trim();
    // otherwise, we have to create an 'extra' one.  note this will only
    // happen when processing javadoc tags where more than one tag of a given
    // name appears in a given scope
    AnnotationProxy proxy = getContext().createAnnotationProxy(annName);
    MAnnotation ann = new AnnotationImpl(getContext(),proxy,annName);
    if (mAllAnnotations == null) mAllAnnotations = new ArrayList();
    mAllAnnotations.add(ann);

    // if one doesn't exist yet, then create the first one
View Full Code Here

Examples of org.hibernate.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

Examples of org.hibernate.annotationfactory.AnnotationProxy

  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

Examples of org.hibernate.annotationfactory.AnnotationProxy

  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

Examples of org.hibernate.annotationfactory.AnnotationProxy

  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

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

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

  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

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

  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
TOP
Copyright © 2018 www.massapi.com. 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.