config-prettyfaces/src/main/java/com/ocpsoft/pretty/faces/config/annotation/PrettyAnnotationHandler.java
private void processPrettyActionAnnotation(URLAction actionAnnotation, Method method, String[] classMappingIds)
   {

      // Create ActionSpec
      ActionSpec actionSpec = new ActionSpec();
      actionSpec.setMethod(method);
      actionSpec.setOnPostback(actionAnnotation.onPostback());
      actionSpec.setInheritable(actionAnnotation.inheritable());
      actionSpec.setPhaseId(actionAnnotation.phaseId());

      // check which mapping the action belongs to
      if (!isBlank(actionAnnotation.mappingId()))
      {
         // action belongs to the mapping mentioned with mappingId attribute
         actionSpec.setMappingIds(new String[] { actionAnnotation.mappingId().trim() });
      }
      else if (classMappingIds != null && classMappingIds.length > 0)
      {
         // use the mapping found on the class
         actionSpec.setMappingIds(classMappingIds);
      }
      else
      {
         // No mapping found... throw an exception..
         throw new IllegalArgumentException("Unable to find a suitable mapping "
                  + "for the action definied on method '" + method.getName() + "' in class '"
                  + method.getDeclaringClass().getName() + "'. Either place a @URLMapping annotation on the "
                  + "class or reference a foreign mapping using the 'mappingId' attribute.");
      }

      // add action to list of actions
      urlActions.add(actionSpec);

   }
private void processPrettyActionAnnotation(URLAction actionAnnotation, Method method, String[] classMappingIds)
   {

      // Create ActionSpec
      ActionSpec actionSpec = new ActionSpec();
      actionSpec.setMethod(method);
      actionSpec.setOnPostback(actionAnnotation.onPostback());
      actionSpec.setInheritable(actionAnnotation.inheritable());
      actionSpec.setPhaseId(actionAnnotation.phaseId());

      // check which mapping the action belongs to
      if (!isBlank(actionAnnotation.mappingId()))
      {
         // action belongs to the mapping mentioned with mappingId attribute
         actionSpec.setMappingIds(new String[] { actionAnnotation.mappingId().trim() });
      }
      else if (classMappingIds != null && classMappingIds.length > 0)
      {
         // use the mapping found on the class
         actionSpec.setMappingIds(classMappingIds);
      }
      else
      {
         // No mapping found... throw an exception..
         throw new IllegalArgumentException("Unable to find a suitable mapping "
                  + "for the action definied on method '" + method.getName() + "' in class '"
                  + method.getDeclaringClass().getName() + "'. Either place a @URLMapping annotation on the "
                  + "class or reference a foreign mapping using the 'mappingId' attribute.");
      }

      // add action to list of actions
      urlActions.add(actionSpec);

   }
private void processPrettyActionAnnotation ( URLAction actionAnnotation , Method method , String [ ] classMappingIds ) { // Create ActionSpec ActionSpec actionSpec = new ActionSpec ( ) ; actionSpec . setMethod ( method ) ; actionSpec . setOnPostback ( actionAnnotation . onPostback ( ) ) ; actionSpec . setInheritable ( actionAnnotation . inheritable ( ) ) ; actionSpec . setPhaseId ( actionAnnotation . phaseId ( ) ) ; // check which mapping the action belongs to if ( ! isBlank ( actionAnnotation . mappingId ( ) ) ) { // action belongs to the mapping mentioned with mappingId attribute actionSpec . setMappingIds ( new String [ ] { actionAnnotation . mappingId ( ) . trim ( ) } ) ; } else if ( classMappingIds != null && classMappingIds . length > 0 ) { // use the mapping found on the class actionSpec . setMappingIds ( classMappingIds ) ; } else { // No mapping found... throw an exception.. throw new IllegalArgumentException ( "Unable to find a suitable mapping " + "for the action definied on method '" + method . getName ( ) + "' in class '" + method . getDeclaringClass ( ) . getName ( ) + "'. Either place a @URLMapping annotation on the " + "class or reference a foreign mapping using the 'mappingId' attribute." ) ; } // add action to list of actions urlActions . add ( actionSpec ) ; }
Creates a {@link UrlAction} object from the supplied {@link URLAction} annotation

@param actionAnnotation The annotation
@param method The method that was annotated
@param classMappingIds the mapping IDs of the current class
Creates a { @link UrlAction } object from the supplied { @link URLAction } annotation