Changeset 65

Show
Ignore:
Timestamp:
09/11/07 16:31:35 (1 year ago)
Author:
dunja
Message:

added tests on classes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/pom.xml

    r63 r65  
    66  <groupId>net.schst</groupId> 
    77  <artifactId>XJConf</artifactId> 
    8   <version>0.10.3</version> 
     8  <version>0.10.4</version> 
    99  <packaging>jar</packaging> 
    1010 
  • trunk/src/main/java/net/schst/XJConf/ObjectValueConverter.java

    r64 r65  
    22 
    33import java.lang.reflect.Constructor; 
     4import java.lang.reflect.Modifier; 
    45 
    56import net.schst.XJConf.exceptions.ValueConversionException; 
     
    4445            throw new ValueConversionException("Class " + this.className + " does not exist", e); 
    4546        } 
     47          
     48        if (instanceClass.isInterface()) { 
     49            throw new ValueConversionException("Class " + this.className + " is an interface."); 
     50        } 
     51        else if (Modifier.toString(instanceClass.getModifiers()).contains("abstract")) { 
     52            throw new ValueConversionException("Class " + this.className + " is abstract."); 
     53        } 
     54        else if (instanceClass.isAnnotation()) { 
     55            throw new ValueConversionException("Class " + this.className + " is an annotation."); 
     56        } 
     57        else if (instanceClass.isEnum()) { 
     58            throw new ValueConversionException("Class " + this.className + " is an enum."); 
     59        } 
     60         
    4661        // try to create a new instance 
    4762        try {