API
The types of scala-universe and what each one is for.
Entry
TypeResolver
The object every lookup starts from.
- resolve(aType: Type): ResolvedClass
- The cached model of a type.
- rawType(aType: Type): Class[?]
- The erased class of any Type; for an unbound type variable its declaring class.
- companionClass(clazz): Class[?]
- The Scala companion class, or null.
- companionInstance[E](clazz): E
- The companion object as E, or null.
Model
ResolvedClass
What resolve returns.
- name · fullName · raw · underlying
- Names, erased class and the Type it came from.
- typeArguments · hierarchy
- Resolved arguments and supertypes.
- fields · methods · constructors
- Through the hierarchy.
- declaredFields · declaredMethods · declaredConstructors
- The class's own.
- findField(name) · findMethod(name, args*) · findConstructor(args*)
- Lookup in the hierarchy; null if absent. Methods and constructors: public only.
- findDeclaredField · findDeclaredMethod · findDeclaredConstructor
- Lookup in the class itself, private members included.
- <:<(other): Boolean
- Subtype check on full types.
Members
Fields, methods, constructors, parameters
Each is Annotated and knows its owner.
- ResolvedField
- name, fieldType, get, set, hidden.
- ResolvedMethod
- name, returnType, parameters, invoke, overrides.
- ResolvedConstructor
- parameters, newInstance.
- ResolvedParameter
- name, parameterType.
- Annotated
- annotations, declaredAnnotations, findAnnotation, findDeclaredAnnotation.
Introspection
Property models and discovery
Turning members into properties, and finding classes.
- BeanIntrospector.create(aClass) · createWithType(aType): BeanModel
- Properties from getters and setters.
- AnnotationIntrospector.create(aClass, annotation) · createWithType(aType, annotation): AnnotationModel
- Properties from annotated members.
- properties · declaredProperties · findProperty(name)
- On both models; findProperty returns null if absent.
- AbstractProperty
- name, field, getter, setter, get, set, isWriteable, propertyType, annotations.
- ClassPathResolver.process(prefix, classLoader) · findAnnotation(classOf[A])
- Scan a package and look annotations up.
- ResolvedAnnotation(annotation, target)
- An indexed annotation and the element that carries it.