Changeset 70

Show
Ignore:
Timestamp:
10/15/07 12:27:34 (1 year ago)
Author:
dunja
Message:

throw exception if method is private

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/java/net/schst/XJConf/TagDefinition.java

    r64 r70  
    33import java.lang.reflect.InvocationTargetException; 
    44import java.lang.reflect.Method; 
     5import java.lang.reflect.Modifier; 
    56import java.util.ArrayList; 
    67import java.util.List; 
     
    1314 *  
    1415 * @author Stephan Schmidt <stephan.schmidt@schlund.de> 
     16 * @author Dunja Fehrenbach <dunja@schlund.de> 
    1517 */ 
    1618public class TagDefinition implements Definition, Cloneable { 
     
    382384                    } 
    383385                    if (childMethod == null) { 
    384                         throw new ValueConversionException("Could not add child " + child.getKey() + " to " + this.getType() + " using "+methodName+"()."); 
     386                        throw new ValueConversionException("Could not add child " + child.getKey() + " to " + this.getType() + " using "+methodName+"() because this method does not exist."); 
     387                    } else if (Modifier.toString(childMethod.getModifiers()).contains("private")) { 
     388                        throw new ValueConversionException("Could not add child " + child.getKey() + " to " + this.getType() + " using "+methodName+"() because this method is private."); 
    385389                    } 
    386390                    childMethod.invoke(instance, childParams);