public class CompileEnvironment extends Object
Modifier and Type | Class and Description |
---|---|
static class |
CompileEnvironment.Support
Represents kind of supported features in
CompileEnvironment . |
Constructor and Description |
---|
CompileEnvironment(ProcessingEnvironment processingEnvironment,
List<? extends OperatorDriver> operatorDrivers,
List<? extends DataModelMirrorRepository> dataModelMirrors)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
emit(CompilationUnit unit,
Element... originatingElements)
Emits the target compilation unit onto suitable location.
|
DataModelMirror |
findDataModel(ClassDescription typeName)
Returns data-model mirror.
|
DataModelMirror |
findDataModel(TypeMirror type)
Returns data-model mirror.
|
DeclaredType |
findDeclaredType(ClassDescription aClass)
Returns the type mirror witch has the specified qualified name.
|
OperatorDriver |
findDriver(TypeElement annotationType)
Returns a registered operator driver related to the annotation type.
|
TypeElement |
findTypeElement(ClassDescription aClass)
Returns the type element which has the specified qualified name.
|
TypeMirror |
getErasure(TypeMirror type)
Returns the type erasure.
|
String |
getMemberName(String token)
Returns the normalized member name.
|
List<OperatorDriver> |
getOperatorDrivers()
Returns registered operator drivers.
|
ProcessingEnvironment |
getProcessingEnvironment()
Returns the current processing environment.
|
WarningAction |
getWarningAction()
Returns the warning action type.
|
boolean |
isEnumConstantParameter()
Returns whether or not the operators can accept enum constants as value parameter.
|
boolean |
isFlowpartExternalIo()
Returns whether external I/O declaration is available in flow-parts or not.
|
boolean |
isForceGenerateImplementation()
Returns whether always generates implementation classes or not.
|
boolean |
isForceNormalizeMemberName()
Returns whether or not the member names must be normalized.
|
boolean |
isForceRegenerateResources()
Returns whether always re-generates resources or not.
|
boolean |
isResourceGenerated(ClassDescription key)
Returns whether the target resources is generated or not.
|
boolean |
isStrictOperatorParameterOrder()
Returns whether the operator method parameter must be strict ordered or not.
|
boolean |
isStrictOptionalOutputConnectivity()
Returns whether or not the operator outputs must not be opened even if they are optional.
|
boolean |
isUnboundProjection()
Returns whether or not the operators can accept unbound projective models.
|
static CompileEnvironment |
newInstance(ProcessingEnvironment processingEnvironment,
ClassLoader serviceLoader,
CompileEnvironment.Support... features)
Creates a new instance.
|
static CompileEnvironment |
newInstance(ProcessingEnvironment processingEnvironment,
CompileEnvironment.Support... features)
Creates a new instance.
|
void |
setResourceGenerated(ClassDescription key)
Sets the target resources is generated.
|
CompileEnvironment |
withEnumConstantParameter(boolean newValue)
Sets whether or not the operators can accept enum constants as value parameter.
|
CompileEnvironment |
withFlowpartExternalIo(boolean newValue)
Sets whether external I/O declarations are available in flow-parts or not.
|
CompileEnvironment |
withForceGenerateImplementation(boolean newValue)
Sets whether always generates implementation classes or not.
|
CompileEnvironment |
withForceNormalizeMemberName(boolean newValue)
Sets whether or not the member names must be normalized.
|
CompileEnvironment |
withForceRegenerateResources(boolean newValue)
Sets whether always re-generates resources.
|
CompileEnvironment |
withStrictOperatorParameterOrder(boolean newValue)
Sets whether the operator method parameter must be strict ordered or not.
|
CompileEnvironment |
withStrictOptionalOutputConnectivity(boolean newValue)
Sets whether or not the operator outputs must not be opened even if they are optional.
|
CompileEnvironment |
withUnboundProjection(boolean newValue)
Sets whether or not the operators can accept unbound projective models.
|
CompileEnvironment |
withWarningAction(WarningAction newValue)
Sets the warning action type.
|
public CompileEnvironment(ProcessingEnvironment processingEnvironment, List<? extends OperatorDriver> operatorDrivers, List<? extends DataModelMirrorRepository> dataModelMirrors)
processingEnvironment
- current annotation processing environmentoperatorDrivers
- supported operator driversdataModelMirrors
- supported data model mirror repositoriesIllegalArgumentException
- if some parameters were null
newInstance(ProcessingEnvironment, ClassLoader, Support...)
public static CompileEnvironment newInstance(ProcessingEnvironment processingEnvironment, CompileEnvironment.Support... features)
processingEnvironment
- current annotation processing environment.features
- list of supported featuresIllegalArgumentException
- if some parameters were null
public static CompileEnvironment newInstance(ProcessingEnvironment processingEnvironment, ClassLoader serviceLoader, CompileEnvironment.Support... features)
processingEnvironment
- current annotation processing environment.serviceLoader
- a class loader to be used for loading services listed in features
features
- list of supported featuresIllegalArgumentException
- if some parameters were null
public ProcessingEnvironment getProcessingEnvironment()
public void emit(CompilationUnit unit, Element... originatingElements) throws IOException
unit
- target compilation unitoriginatingElements
- the original elementsIOException
- if failed to emit by I/O errorIllegalArgumentException
- if some parameters were null
public DataModelMirror findDataModel(ClassDescription typeName)
typeName
- target type namenull
if not foundIllegalArgumentException
- if some parameters were null
public DataModelMirror findDataModel(TypeMirror type)
type
- target type mirrornull
if not foundIllegalArgumentException
- if some parameters were null
public List<OperatorDriver> getOperatorDrivers()
public OperatorDriver findDriver(TypeElement annotationType)
annotationType
- target annotation typenull
if it is not registeredIllegalArgumentException
- if some parameters were null
public TypeElement findTypeElement(ClassDescription aClass)
aClass
- fully qualified type namenull
if it is not foundIllegalArgumentException
- if some parameters were null
public DeclaredType findDeclaredType(ClassDescription aClass)
aClass
- fully qualified type namenull
if it is not foundIllegalArgumentException
- if some parameters were null
public TypeMirror getErasure(TypeMirror type)
type
- original typeIllegalArgumentException
- if some parameters were null
public String getMemberName(String token)
token
- the original tokenpublic void setResourceGenerated(ClassDescription key)
key
- the target resource keypublic boolean isResourceGenerated(ClassDescription key)
key
- the target resource keytrue
if it is already generated, otherwise false
public WarningAction getWarningAction()
public CompileEnvironment withWarningAction(WarningAction newValue)
newValue
- the value to setpublic boolean isFlowpartExternalIo()
true
if it is available, otherwise false
public CompileEnvironment withFlowpartExternalIo(boolean newValue)
newValue
- true
iff they are availablepublic boolean isForceGenerateImplementation()
true
if it is available, otherwise false
public CompileEnvironment withForceGenerateImplementation(boolean newValue)
newValue
- true
iff it is availablepublic boolean isForceRegenerateResources()
true
if it is available, otherwise false
public CompileEnvironment withForceRegenerateResources(boolean newValue)
newValue
- true
iff it is availablepublic boolean isStrictOperatorParameterOrder()
true
if it is strict, otherwise false
public CompileEnvironment withStrictOperatorParameterOrder(boolean newValue)
newValue
- true
if it must be strict, otherwise false
public boolean isStrictOptionalOutputConnectivity()
true
if it is strict, otherwise false
public CompileEnvironment withStrictOptionalOutputConnectivity(boolean newValue)
newValue
- true
if it must be strict, otherwise false
public boolean isForceNormalizeMemberName()
true
is normalized, otherwise false
public CompileEnvironment withForceNormalizeMemberName(boolean newValue)
newValue
- true
is normalized, otherwise false
public boolean isEnumConstantParameter()
true
if operators can accept enum constants, otherwise false
public CompileEnvironment withEnumConstantParameter(boolean newValue)
newValue
- true
to accept enum constants, otherwise false
public boolean isUnboundProjection()
true
if operators can accept unbound projective models, otherwise false
public CompileEnvironment withUnboundProjection(boolean newValue)
newValue
- true
to accept unbound projective models, otherwise false
Copyright © 2011–2019 Asakusa Framework Team. All rights reserved.