Home | History | Annotate | Download | only in reflectionmodel
      1 package com.github.javaparser.symbolsolver.reflectionmodel;
      2 
      3 import com.github.javaparser.resolution.declarations.ResolvedEnumConstantDeclaration;
      4 import com.github.javaparser.resolution.types.ResolvedType;
      5 import com.github.javaparser.symbolsolver.model.resolution.TypeSolver;
      6 
      7 import java.lang.reflect.Field;
      8 
      9 public class ReflectionEnumConstantDeclaration implements ResolvedEnumConstantDeclaration {
     10 
     11     private Field enumConstant;
     12     private TypeSolver typeSolver;
     13 
     14     public ReflectionEnumConstantDeclaration(Field enumConstant, TypeSolver typeSolver) {
     15         if (!enumConstant.isEnumConstant()) {
     16             throw new IllegalArgumentException("The given field does not represent an enum constant");
     17         }
     18         this.enumConstant = enumConstant;
     19         this.typeSolver = typeSolver;
     20     }
     21 
     22     @Override
     23     public String getName() {
     24         return enumConstant.getName();
     25     }
     26 
     27     @Override
     28     public ResolvedType getType() {
     29         throw new UnsupportedOperationException();
     30     }
     31 }
     32