Index: core/src/main/java/org/castor/core/annotationprocessing/TargetAwareAnnotationProcessingService.java
===================================================================
--- core/src/main/java/org/castor/core/annotationprocessing/TargetAwareAnnotationProcessingService.java	(revision 0)
+++ core/src/main/java/org/castor/core/annotationprocessing/TargetAwareAnnotationProcessingService.java	(revision 0)
@@ -0,0 +1,80 @@
+package org.castor.core.annotationprocessing;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+import java.util.Set;
+
+import org.castor.core.nature.BaseNature;
+import org.castor.core.nature.PropertyHolder;
+
+public interface TargetAwareAnnotationProcessingService extends
+        AnnotationProcessingService {
+
+    /**
+     * Calls {@link #processAnnotation(BaseNature, Annotation)} for each given
+     * Annotation.
+     * 
+     * @param info
+     *            the {@link BaseNature} (and so its {@link PropertyHolder})
+     *            that should be filled with the information read
+     * @param annotations
+     *            the annotations to process
+     * @param target
+     *            the target ({@link AnnotatedElement}) of the given annotation
+     * @return Annotation[] filled with unprocessed annotations
+     * @see #processAnnotation(BaseNature, Annotation)
+     */
+    public abstract <I extends BaseNature> Annotation[] processAnnotations(
+            I info, final Annotation[] annotations,
+            final AnnotatedElement target);
+
+    /**
+     * The processing action of this service. If an annotation is given which is
+     * not supported by this processor false is returned. Otherwise the
+     * Annotations specific processor will (try to) process the Annotation and
+     * the result of
+     * {@link TargetAwareAnnotationProcessor#processAnnotation(BaseNature, Annotation, AnnotatedElement)}
+     * is returned.
+     * 
+     * @param info
+     *            the {@link BaseNature} (and so its {@link PropertyHolder})
+     *            that should be filled with the information read
+     * @param annotation
+     *            the annotation to process
+     * @param target
+     *            the target ({@link AnnotatedElement}) of the given annotation
+     * @return true, if the annotation was processed, false if not
+     * @see TargetAwareAnnotationProcessor
+     */
+    public <I extends BaseNature, A extends Annotation> boolean processAnnotation(
+            I info, final A annotation, final AnnotatedElement target);
+
+    /**
+     * Add an {@link TargetAwareAnnotationProcessor} to the service.
+     * 
+     * @param annotationProcessor
+     *            the {@link TargetAwareAnnotationProcessor} to add to this
+     *            service.
+     */
+    public void addAnnotationProcessor(
+            final TargetAwareAnnotationProcessor annotationProcessor);
+
+    /**
+     * Returns the set of {@link TargetAwareAnnotationProcessor}s registered
+     * with this service.
+     * 
+     * @return A set of {@link TargetAwareAnnotationProcessor}s registered with
+     *         this service.
+     */
+    public Set<TargetAwareAnnotationProcessor> getTargetAwareAnnotationProcessors();
+
+    /**
+     * Returns the set of {@link AnnotationProcessor}s and
+     * {@link TargetAwareAnnotationProcessor}s registered with this service.
+     * 
+     * @return A set of {@link AnnotationProcessor}s registered with this
+     *         service.
+     */
+    public Set<AnnotationProcessor> getAllAnnotationProcessors();
+
+}
Index: core/src/main/java/org/castor/core/annotationprocessing/BaseTargetAwareAnnotationProcessingService.java
===================================================================
--- core/src/main/java/org/castor/core/annotationprocessing/BaseTargetAwareAnnotationProcessingService.java	(revision 0)
+++ core/src/main/java/org/castor/core/annotationprocessing/BaseTargetAwareAnnotationProcessingService.java	(revision 0)
@@ -0,0 +1,177 @@
+/*
+ * Copyright 2007 Joachim Grueneis
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.castor.core.annotationprocessing;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.castor.core.nature.BaseNature;
+
+/**
+ * An AnnotationProcessingService handles multiple {@link AnnotationProcessor}s
+ * and uses them to process one or more {@link Annotation}s. This is a standard
+ * implementation that should be sufficient for most purposes.
+ * 
+ * @see AnnotationProcessingService
+ * @author Alexander Eibner, Peter Schmidt
+ * @since 1.3
+ */
+
+public class BaseTargetAwareAnnotationProcessingService extends
+        BaseAnnotationProcessingService implements
+        TargetAwareAnnotationProcessingService {
+
+    /**
+     * List of target aware annotation processors.
+     */
+    private Map<Class<? extends Annotation>, TargetAwareAnnotationProcessor> _taAnnotationProcessorMap = new HashMap<Class<? extends Annotation>, TargetAwareAnnotationProcessor>();
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.castor.annotationprocessing.AnnotationProcessingService#
+     *      addAnnotationProcessor(AnnotationProcessor)
+     */
+    public void addAnnotationProcessor(
+            final TargetAwareAnnotationProcessor taAnnotationProcessor) {
+        if (taAnnotationProcessor != null) {
+            _taAnnotationProcessorMap.put(taAnnotationProcessor
+                    .forAnnotationClass(), taAnnotationProcessor);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.castor.core.annotationprocessing.TargetAwareAnnotationProcessingService#getAllAnnotationProcessors()
+     */
+    public Set<AnnotationProcessor> getAllAnnotationProcessors() {
+        Set<AnnotationProcessor> result = new HashSet<AnnotationProcessor>(
+                super.getAnnotationProcessors());
+        result.addAll(this._taAnnotationProcessorMap.values());
+        return result;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.castor.core.annotationprocessing.TargetAwareAnnotationProcessingService#getTargetAwareAnnotationProcessors()
+     */
+    public Set<TargetAwareAnnotationProcessor> getTargetAwareAnnotationProcessors() {
+        Set<TargetAwareAnnotationProcessor> result = new HashSet<TargetAwareAnnotationProcessor>(
+                this._taAnnotationProcessorMap.values());
+        return result;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.castor.core.annotationprocessing.TargetAwareAnnotationProcessingService#processAnnotation(org.castor.core.nature.BaseNature,
+     *      java.lang.annotation.Annotation, java.lang.reflect.AnnotatedElement)
+     */
+    public <I extends BaseNature, A extends Annotation> boolean processAnnotation(
+            I info, A annotation, AnnotatedElement target) {
+        boolean processed = false;
+        TargetAwareAnnotationProcessor annotationProcessor = _taAnnotationProcessorMap
+                .get(annotation.annotationType());
+        if (annotationProcessor != null) {
+            processed = annotationProcessor.processAnnotation(info, annotation,
+                    target);
+        }
+        return processed;
+
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * @see org.castor.core.annotationprocessing.TargetAwareAnnotationProcessingService#processAnnotations(org.castor.core.nature.BaseNature,
+     *      java.lang.annotation.Annotation[],
+     *      java.lang.reflect.AnnotatedElement)
+     */
+    public <I extends BaseNature> Annotation[] processAnnotations(I info,
+            Annotation[] annotations, AnnotatedElement target) {
+        ArrayList<Annotation> unprocessed = new ArrayList<Annotation>();
+
+        for (int i = 0; i < annotations.length; i++) {
+            if (processAnnotation(info, annotations[i], target) == false) {
+                unprocessed.add(annotations[i]);
+            }
+        }
+
+        Annotation[] arrReturn = new Annotation[unprocessed.size()];
+
+        return unprocessed.toArray(arrReturn);
+    }
+
+    /**
+     * This method acts like it's super method, but also tries to process the
+     * annotation with the {@link TargetAwareAnnotationProcessor}s.
+     * {@inheritDoc}
+     * 
+     * @see org.castor.core.annotationprocessing.BaseAnnotationProcessingService#processAnnotation(org.castor.core.nature.BaseNature,
+     *      java.lang.annotation.Annotation)
+     */
+    @Override
+    public <I extends BaseNature, A extends Annotation> boolean processAnnotation(
+            I info, A annotation) {
+        boolean superReturn = super.processAnnotation(info, annotation);
+        if (!superReturn) {
+            boolean processed = false;
+            AnnotationProcessor annotationProcessor = _taAnnotationProcessorMap
+                    .get(annotation.annotationType());
+            if (annotationProcessor != null) {
+                processed = annotationProcessor.processAnnotation(info,
+                        annotation);
+            }
+            return processed;
+        }
+        return superReturn;
+    }
+
+    /**
+     * This method acts like it's super method, but also tries to process the
+     * annotations with the {@link TargetAwareAnnotationProcessor}s.
+     * {@inheritDoc}
+     * 
+     * @see org.castor.core.annotationprocessing.BaseAnnotationProcessingService#processAnnotations(org.castor.core.nature.BaseNature,
+     *      java.lang.annotation.Annotation)
+     */
+    @Override
+    public <I extends BaseNature> Annotation[] processAnnotations(I info,
+            Annotation[] annotations) {
+        Annotation[] superUnprocessed = super.processAnnotations(info,
+                annotations);
+
+        ArrayList<Annotation> unprocessed = new ArrayList<Annotation>();
+
+        for (int i = 0; i < superUnprocessed.length; i++) {
+            if (processAnnotation(info, annotations[i]) == false) {
+                unprocessed.add(annotations[i]);
+            }
+        }
+
+        Annotation[] arrReturn = new Annotation[unprocessed.size()];
+
+        return unprocessed.toArray(arrReturn);
+    }
+
+}
Index: core/src/main/java/org/castor/core/annotationprocessing/TargetAwareAnnotationProcessor.java
===================================================================
--- core/src/main/java/org/castor/core/annotationprocessing/TargetAwareAnnotationProcessor.java	(revision 0)
+++ core/src/main/java/org/castor/core/annotationprocessing/TargetAwareAnnotationProcessor.java	(revision 0)
@@ -0,0 +1,29 @@
+package org.castor.core.annotationprocessing;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Field;
+
+import org.castor.core.nature.BaseNature;
+
+public interface TargetAwareAnnotationProcessor extends AnnotationProcessor {
+
+    /**
+     * The processing action of this processor. If an annotation is given which
+     * is not supported false is returned.
+     * 
+     * @param info
+     *            the Info class that should be filled with the information read
+     * @param annotation
+     *            the annotation to process
+     * @param target
+     *            the target ({@link Field}, {@link Class}, etc.) of the given
+     *            annotation
+     * @return true, if the annotation was processed successfully, false if not
+     * 
+     * @see AnnotatedElement
+     */
+    <I extends BaseNature, A extends Annotation> boolean processAnnotation(
+            I info, final A annotation, final AnnotatedElement target);
+
+}
Index: core/src/main/java/org/castor/core/annotationprocessing/BaseAnnotationProcessingService.java
===================================================================
--- core/src/main/java/org/castor/core/annotationprocessing/BaseAnnotationProcessingService.java	(revision 8034)
+++ core/src/main/java/org/castor/core/annotationprocessing/BaseAnnotationProcessingService.java	(working copy)
@@ -48,7 +48,7 @@
      * @see org.castor.annotationprocessing.AnnotationProcessingService#
      *      addAnnotationProcessor(AnnotationProcessor)
      */
-    public final void addAnnotationProcessor(
+    public void addAnnotationProcessor(
             final AnnotationProcessor annotationProcessor) {
         if (annotationProcessor != null) {
             _annotationProcessorMap.put(annotationProcessor
@@ -73,7 +73,7 @@
      * @see org.castor.annotationprocessing.AnnotationProcessingService#
      *      processAnnotations(BaseNature, Annotation[])
      */
-    public final <I extends BaseNature> Annotation[] processAnnotations(I info,
+    public <I extends BaseNature> Annotation[] processAnnotations(I info,
             final Annotation[] annotations) {
         ArrayList<Annotation> unprocessed = new ArrayList<Annotation>();
 
@@ -94,7 +94,7 @@
      * @see org.castor.annotationprocessing.AnnotationProcessingService#processAnnotation
      *      (BaseNature, Annotation)
      */
-    public final <I extends BaseNature, A extends Annotation> boolean processAnnotation(
+    public <I extends BaseNature, A extends Annotation> boolean processAnnotation(
             I info, final A annotation) {
         boolean processed = false;
         AnnotationProcessor annotationProcessor = _annotationProcessorMap
Index: core/src/test/java/org/castor/core/annotationprocessing/BaseTargetAwareAnnotationProcessingServiceTest.java
===================================================================
--- core/src/test/java/org/castor/core/annotationprocessing/BaseTargetAwareAnnotationProcessingServiceTest.java	(revision 8034)
+++ core/src/test/java/org/castor/core/annotationprocessing/BaseTargetAwareAnnotationProcessingServiceTest.java	(working copy)
@@ -16,15 +16,16 @@
 package org.castor.core.annotationprocessing;
 
 import java.lang.annotation.*;
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Method;
 
 import junit.framework.TestCase;
 
 import org.castor.core.nature.BaseNature;
 import org.castor.core.nature.PropertyHolder;
 import org.castor.core.annotationprocessing.AnnotationProcessor;
-import org.castor.core.annotationprocessing.BaseAnnotationProcessingService;
 
-public class BaseAnnotationProcessingServiceTest extends TestCase {
+public class BaseTargetAwareAnnotationProcessingServiceTest extends TestCase {
 
     @Retention(RetentionPolicy.RUNTIME)
     public @interface SupportedAnnotation {
@@ -39,7 +40,37 @@
      * telling that it processed the given Annotation if it was of Type
      * {@link SupportedAnnotation}. It's just a dummy.
      */
-    class SupportedAnnotationProcessor implements AnnotationProcessor {
+    class SupportedClassAnnotationProcessor implements TargetAwareAnnotationProcessor {
+
+        public Class<? extends Annotation> forAnnotationClass() {
+            return SupportedAnnotation.class;
+        }
+
+        public <I extends BaseNature, A extends Annotation> boolean processAnnotation(
+                I info, A annotation) {
+            if (annotation instanceof SupportedAnnotation) {
+                // do
+                return true;
+            }
+            return false;
+        }
+
+        public <I extends BaseNature, A extends Annotation> boolean processAnnotation(
+                I info, A annotation, AnnotatedElement target) {
+            if ((annotation instanceof SupportedAnnotation)&&(target instanceof Class)) {
+                // do
+                return true;
+            }
+            return false;
+        }
+    }
+
+    /**
+     * This is a {@link AnnotationProcessor} that actually does nothing, except
+     * telling that it processed the given Annotation if it was of Type
+     * {@link SupportedAnnotation}. It's just a dummy.
+     */
+    class SupportedMethodAnnotationProcessor implements TargetAwareAnnotationProcessor {
 
         public Class<? extends Annotation> forAnnotationClass() {
             return SupportedAnnotation.class;
@@ -53,6 +84,15 @@
             }
             return false;
         }
+
+        public <I extends BaseNature, A extends Annotation> boolean processAnnotation(
+                I info, A annotation, AnnotatedElement target) {
+            if ((annotation instanceof SupportedAnnotation) && (target instanceof Method)) {
+                // do
+                return true;
+            }
+            return false;
+        }
     }
 
     /**
@@ -65,6 +105,12 @@
     @UnsupportedAnnotation
     class AnnotationHolder {
 
+        @SupportedAnnotation
+        @UnsupportedAnnotation
+        public void annotatedMethod(){
+            int i = 0;
+            i++;
+        }
     }
 
     /**
@@ -96,12 +142,15 @@
                 .isAnnotationPresent(SupportedAnnotation.class));
         assertTrue(AnnotationHolder.class
                 .isAnnotationPresent(UnsupportedAnnotation.class));
-
+        assertTrue(AnnotationHolder.class.getMethod("annotatedMethod",
+                new Class<?>[0]).isAnnotationPresent(SupportedAnnotation.class));
+        assertTrue(AnnotationHolder.class.getMethod("annotatedMethod",
+                new Class<?>[0]).isAnnotationPresent(UnsupportedAnnotation.class));
     }
 
     public void testAddGetAnnotationProcessor() {
-        BaseAnnotationProcessingService baps = new BaseAnnotationProcessingService();
-        SupportedAnnotationProcessor annotationProcessor = new SupportedAnnotationProcessor();
+        BaseTargetAwareAnnotationProcessingService baps = new BaseTargetAwareAnnotationProcessingService();
+        SupportedClassAnnotationProcessor annotationProcessor = new SupportedClassAnnotationProcessor();
 
         assertNotNull(baps.getAnnotationProcessors());
         assertFalse(baps.getAnnotationProcessors()
@@ -110,13 +159,14 @@
         baps.addAnnotationProcessor(annotationProcessor);
 
         assertNotNull(baps.getAnnotationProcessors());
-        assertTrue(baps.getAnnotationProcessors().contains(annotationProcessor));
-
+        assertFalse(baps.getAnnotationProcessors().contains(annotationProcessor));
+        assertTrue(baps.getAllAnnotationProcessors().contains(annotationProcessor));
+        assertTrue(baps.getTargetAwareAnnotationProcessors().contains(annotationProcessor));
     }
 
     public void testProcessAnnotations() {
-        BaseAnnotationProcessingService baps = new BaseAnnotationProcessingService();
-        SupportedAnnotationProcessor annotationProcessor = new SupportedAnnotationProcessor();
+        BaseTargetAwareAnnotationProcessingService baps = new BaseTargetAwareAnnotationProcessingService();
+        TargetAwareAnnotationProcessor annotationProcessor = new SupportedClassAnnotationProcessor();
         baps.addAnnotationProcessor(annotationProcessor);
         Annotation[] annotations = AnnotationHolder.class.getAnnotations();
         assertEquals(2, annotations.length);
@@ -150,9 +200,70 @@
                 .annotationType());
     }
 
+    public void testProcessAnnotationsTargetAware() throws SecurityException, NoSuchMethodException {
+        BaseTargetAwareAnnotationProcessingService baps = new BaseTargetAwareAnnotationProcessingService();
+        TargetAwareAnnotationProcessor annotationProcessor = new SupportedMethodAnnotationProcessor();
+        baps.addAnnotationProcessor(annotationProcessor);
+        Annotation[] annotations = AnnotationHolder.class.getAnnotations();
+        assertEquals(2, annotations.length);
+        /*
+         * now annotations[] contains @SupportedAnnotation and
+         * @UnsupportedAnnotation
+         */
+
+        MyPropertyHolder holder = new MyPropertyHolder();
+        holder.addNature(BaseNature.class.getName());
+
+        BaseNature info = new BaseNature(holder) {
+            public String getId() {
+                return BaseNature.class.getName();
+            }
+        };
+
+        /*
+         * try to process all annotations (the Method-processor added can't process them)
+         */
+        Annotation[] unprocessed = baps.processAnnotations(info, annotations, AnnotationHolder.class);
+
+        assertNotNull(unprocessed);
+        assertEquals(2, unprocessed.length);
+        assertEquals(UnsupportedAnnotation.class, unprocessed[0].annotationType());
+        assertEquals(SupportedAnnotation.class, unprocessed[1].annotationType());
+        
+        /*
+         * instead we try to process the methods annotations - they should work with our setup.
+         */
+        Method method = AnnotationHolder.class.getMethod("annotatedMethod", new Class<?>[0]);
+        Annotation[] methodAnnotations = method.getAnnotations();
+        unprocessed = baps.processAnnotations(info, methodAnnotations, method);
+
+        assertNotNull(unprocessed);
+        assertEquals(1, unprocessed.length);
+        assertEquals(UnsupportedAnnotation.class, unprocessed[0].annotationType());
+        
+        /*
+         * add the processor for Class annotations and try again
+         */
+        
+        annotationProcessor = new SupportedClassAnnotationProcessor();
+        baps.addAnnotationProcessor(annotationProcessor);
+        unprocessed = baps.processAnnotations(info, annotations, AnnotationHolder.class);
+        
+        /*
+         * we know, that we don't have processor for @UnsupportedAnnotation, so
+         * 
+         * @UnsupportedAnnotation is put into unprocessed[]
+         */
+        assertNotNull(unprocessed);
+        assertEquals(1, unprocessed.length);
+        assertEquals(UnsupportedAnnotation.class, unprocessed[0]
+                .annotationType());
+    }
+
+    
     public void testProcessAnnotation() {
         BaseAnnotationProcessingService baps = new BaseAnnotationProcessingService();
-        baps.addAnnotationProcessor(new SupportedAnnotationProcessor());
+        baps.addAnnotationProcessor(new SupportedClassAnnotationProcessor());
 
         MyPropertyHolder holder = new MyPropertyHolder();
         holder.addNature(BaseNature.class.getName());
