private TypeEnvironment createEnvironment(Type context) { return new TypeSwitch<TypeEnvironment>() { @Override public TypeEnvironment caseClass(Class classType) { return CompoundTypeEnvironment.create( createSuperTypeEnvironment( classType ), getEnvironment( classType.getSuperclass() ) ); } @Override public TypeEnvironment caseParameterizedType(ParameterizedType parameterizedType) { return createEnvironment( parameterizedType ); } @Override public TypeEnvironment defaultCase(Type t) { throw new IllegalArgumentException( "Invalid type for generating environment: " + t ); } }.doSwitch( context ); }
private TypeEnvironment createEnvironment(Type context) { return new TypeSwitch<TypeEnvironment>() { @Override public TypeEnvironment caseClass(Class classType) { return CompoundTypeEnvironment.create( createSuperTypeEnvironment( classType ), getEnvironment( classType.getSuperclass() ) ); } @Override public TypeEnvironment caseParameterizedType(ParameterizedType parameterizedType) { return createEnvironment( parameterizedType ); } @Override public TypeEnvironment defaultCase(Type t) { throw new IllegalArgumentException( "Invalid type for generating environment: " + t ); } }.doSwitch( context ); }
private TypeEnvironment createEnvironment(Type context) { return new TypeSwitch<TypeEnvironment>() { @Override public TypeEnvironment caseClass(Class classType) { return CompoundTypeEnvironment.create( createSuperTypeEnvironment( classType ), getEnvironment( classType.getSuperclass() ) ); } @Override public TypeEnvironment caseParameterizedType(ParameterizedType parameterizedType) { return createEnvironment( parameterizedType ); } @Override public TypeEnvironment defaultCase(Type t) { throw new IllegalArgumentException( "Invalid type for generating environment: " + t ); } }.doSwitch( context ); }
private TypeEnvironment createEnvironment(Type context) { return new TypeSwitch<TypeEnvironment>() { @Override public TypeEnvironment caseClass(Class classType) { return CompoundTypeEnvironment.create( createSuperTypeEnvironment( classType ), getEnvironment( classType.getSuperclass() ) ); } @Override public TypeEnvironment caseParameterizedType(ParameterizedType parameterizedType) { return createEnvironment( parameterizedType ); } @Override public TypeEnvironment defaultCase(Type t) { throw new IllegalArgumentException( "Invalid type for generating environment: " + t ); } }.doSwitch( context ); }
private TypeEnvironment createEnvironment(Type context) { return new TypeSwitch<TypeEnvironment>() { @Override public TypeEnvironment caseClass(Class classType) { return CompoundTypeEnvironment.create( createSuperTypeEnvironment( classType ), getEnvironment( classType.getSuperclass() ) ); } @Override public TypeEnvironment caseParameterizedType(ParameterizedType parameterizedType) { return createEnvironment( parameterizedType ); } @Override public TypeEnvironment defaultCase(Type t) { throw new IllegalArgumentException( "Invalid type for generating environment: " + t ); } }.doSwitch( context ); }