Package java.lang.reflect

Examples of java.lang.reflect.AnnotatedElement


     * @return HandlerProcessingResult
     */
    protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo,
            EjbContext[] ejbContexts) throws AnnotationProcessorException {

        AnnotatedElement ae = (AnnotatedElement)ainfo.getAnnotatedElement();
        if (ae.isAnnotationPresent(DenyAll.class) ||
                ae.isAnnotationPresent(RolesAllowed.class)) {
            log(Level.SEVERE, ainfo,
                localStrings.getLocalString(
                "enterprise.deployment.annotation.handlers.inconsistentsecannotation",
                "This annotation is not consistent with other annotations.  One cannot have more than one of @RolesAllowed, @PermitAll, @DenyAll in the same AnnotatedElement."));
            return getDefaultFailedResult();
View Full Code Here


     * @return a new EjbDescriptor
     */
    protected EjbDescriptor createEjbDescriptor(String elementName,
            AnnotationInfo ainfo) throws AnnotationProcessorException {

        AnnotatedElement ae = ainfo.getAnnotatedElement();
        Class ejbClass = (Class)ae;
        EjbSessionDescriptor newDescriptor = new EjbSessionDescriptor();
        newDescriptor.setName(elementName);
        newDescriptor.setEjbClassName(ejbClass.getName());
        newDescriptor.setSessionType(EjbSessionDescriptor.STATELESS);
View Full Code Here

    }   
       
    protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo,
            EjbContext[] ejbContexts) throws AnnotationProcessorException {

        AnnotatedElement ae = (AnnotatedElement)ainfo.getAnnotatedElement();

        if (ae.isAnnotationPresent(DenyAll.class) ||
                ae.isAnnotationPresent(PermitAll.class)) {
            log(Level.SEVERE, ainfo,
                localStrings.getLocalString(
                "enterprise.deployment.annotation.handlers.inconsistentsecannotation",
                "This annotation is not consistent with other annotations.  One cannot have more than one of @RolesAllowed, @PermitAll, @DenyAll in the same AnnotatedElement."));
            return getDefaultFailedResult();
View Full Code Here

     * @return HandlerProcessingResult
     */
    protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo,
            EjbContext[] ejbContexts) throws AnnotationProcessorException {

        AnnotatedElement ae = (AnnotatedElement)ainfo.getAnnotatedElement();
        Method annMethod = (Method) ainfo.getAnnotatedElement();
        if (ae.isAnnotationPresent(PermitAll.class) ||
                ae.isAnnotationPresent(RolesAllowed.class)) {
            log(Level.SEVERE, ainfo,
                localStrings.getLocalString(
                "enterprise.deployment.annotation.handlers.inconsistentsecannotation",
                "This annotation is not consistent with other annotations.  One cannot have more than one of @RolesAllowed, @PermitAll, @DenyAll in the same AnnotatedElement."));
            return getDefaultFailedResult();
View Full Code Here

                // may have defined a list of annotations that should be processed
                // (if present on the annotated element) before itself.
                // do this check and process those annotations first.
                Class<? extends Annotation>[] dependencies = handler.getTypeDependencies();
                if (dependencies!=null) {
                    AnnotatedElement ae = element.getAnnotatedElement();
                    for (Class<? extends Annotation> annotationType : dependencies) {
                        Annotation depAnnotation = ae.getAnnotation(annotationType);
                        if (depAnnotation!=null) {                       
                            ResultType resultType = result.processedAnnotations().get(annotationType);
                            if (resultType==null || resultType==ResultType.UNPROCESSED){
                                // annotation is present, process it.
                                AnnotationInfo info = new AnnotationInfo(ctx, ae, depAnnotation, getTopElementType());
View Full Code Here

      SipApplication sipApplication,
      AnnotationInfo ainfo,
      ResourceContainerContext[] rcContexts)
      throws AnnotationProcessorException
  {
        AnnotatedElement annotatedElement = ainfo.getAnnotatedElement();
       
        Annotation [] annotation = annotatedElement.getAnnotations();
        for (int i = 0; i < annotation.length; i++)
        {
          Class annotationClass = annotation[i].annotationType();
          if ( annotationClass == getAnnotationType() )
          {
View Full Code Here

  protected HandlerProcessingResult processAnnotation(
      SipApplication sipApplication, AnnotationInfo ainfo,
      ResourceContainerContext[] rcContexts)
      throws AnnotationProcessorException
  {
        AnnotatedElement annotatedElement = ainfo.getAnnotatedElement();
       
        Annotation [] annotation = annotatedElement.getAnnotations();
        for (int i = 0; i < annotation.length; i++) {
          Class annotationClass = annotation[i].annotationType();
          if ( annotationClass == getAnnotationType() ){
            String annotatedElementClassName = ((Class)annotatedElement).getName();
            javax.servlet.sip.annotation.SipListener listenerAnnotation = (javax.servlet.sip.annotation.SipListener) ainfo.getAnnotation();
View Full Code Here

      SipApplication sipApplication, AnnotationInfo ainfo,
      ResourceContainerContext[] rcContexts)
      throws AnnotationProcessorException
  {
        try {
            AnnotatedElement annotatedElement = ainfo.getAnnotatedElement();
           
            /*
             * 289 PR states that one application can be registered per sar achive.
             * An application is define in sip.xml or annotation package-info.java.
             *
             *  We assume that only one sip application annotation can exist and
             *  the first processed taken as the SipApplication.
             *
             *  If a sip application is defined in sip.xml, the  annotation is ignored.
             */
            Annotation [] annotation = annotatedElement.getAnnotations();
            for (int i = 0; i < annotation.length; i++)
            {
              Class annotationClass = annotation[i].annotationType();
              if ( annotationClass == getAnnotationType() )
              {
View Full Code Here

     * INTERNAL:
     *
   * Return true if this accessor represents a basic mapping.
     */
  public static boolean isBasic(MetadataAccessibleObject annotatedAccessor, MetadataDescriptor descriptor) {
        AnnotatedElement annotatedElement = annotatedAccessor.getAnnotatedElement();
        return isAnnotationPresent(Basic.class, annotatedElement, descriptor) ||
               isAnnotationPresent(Lob.class, annotatedElement, descriptor) ||
               isAnnotationPresent(Temporal.class, annotatedElement, descriptor) ||
               isAnnotationPresent(Enumerated.class, annotatedElement, descriptor);
    }
View Full Code Here

     * Return true if this accessor represents an aggregate mapping. True is
     * returned id and @Embedded is found or if an @Embeddable is found on the
     * raw/reference class.
     */
  public static boolean isEmbedded(MetadataAccessibleObject accessibleObject, MetadataDescriptor descriptor) {
        AnnotatedElement annotatedElement = accessibleObject.getAnnotatedElement();
       
        if (isAnnotationNotPresent(Embedded.class, annotatedElement, descriptor) && isAnnotationNotPresent(EmbeddedId.class, annotatedElement, descriptor)) {
            Class rawClass = accessibleObject.getRawClass();
            // Use the class loader from the descriptor's java class and not
            // that from the rawClass since it may be an int, String etc. which
View Full Code Here

TOP

Related Classes of java.lang.reflect.AnnotatedElement

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.