public class TypeRegistry extends Object
Constructor and Description |
---|
TypeRegistry() |
Modifier and Type | Method and Description |
---|---|
protected String |
finalTypename(String name,
String context)
Get the final typename of the given identifier within the context.
|
<T extends PDeclaredDescriptor<T>> |
getDeclaredType(String name)
Get a declared type by its qualified type name.
|
<T extends PDeclaredDescriptor<T>> |
getDeclaredType(String name,
String context)
Get the declared type with the given name and package context.
|
PService |
getService(String name,
String context)
Get a service definition from the name and context.
|
<T> void |
putDeclaredType(PDeclaredDescriptor<T> declaredType)
Put a declared type into the registry.
|
void |
putService(PService service)
Services are not handled as "declared types", so they need to be registered
separately.
|
void |
putTypedef(String identifier,
String context,
String target)
Registers a typedef definition.
|
<T> void |
registerRecursively(PDeclaredDescriptor<T> declaredType)
Register a declared type recursively.
|
public <T extends PDeclaredDescriptor<T>> T getDeclaredType(String name, String context)
T
- The described type.name
- Name of type, without any spaces.context
- The package context of the type.public <T extends PDeclaredDescriptor<T>> T getDeclaredType(String name)
T
- The described type.name
- The name of the type.public <T> void putDeclaredType(PDeclaredDescriptor<T> declaredType)
T
- The descriptor object type.declaredType
- The type to register.public void putService(PService service)
service
- the service to register.@Nullable public PService getService(String name, String context)
name
- The service name.context
- The context to get the service for.public <T> void registerRecursively(PDeclaredDescriptor<T> declaredType)
T
- The declared java type.declaredType
- The descriptor for the type.public void putTypedef(String identifier, String context, String target)
identifier
- The typedef name (the alias) to put.context
- The package context of the typedef.target
- The qualified name that the name represents.Copyright © 2015–2017 morimekta.net. All rights reserved.