M - the specific type of modelpublic class ModelImport<M extends IModel>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private boolean |
isConflict |
private java.lang.String |
name |
private M |
resolved |
private IVersionRestriction |
restriction |
| Constructor and Description |
|---|
ModelImport(java.lang.String name)
Creates an unrestricted script import.
|
ModelImport(java.lang.String name,
boolean isConflict,
IVersionRestriction restriction)
Creates a model import instance.
|
| Modifier and Type | Method and Description |
|---|---|
IVersionRestriction |
copyVersionRestriction(M model)
Copies the version restriction.
|
boolean |
evaluateRestrictions(IRestrictionEvaluationContext context,
Version version)
Evaluates the restrictions against
version. |
java.lang.String |
getName()
Returns the name of the model to be imported.
|
M |
getResolved()
Returns the resolved model instance.
|
IVersionRestriction |
getVersionRestriction()
Returns the version restriction.
|
boolean |
isConflict()
Does this object represent an import or a conflict.
|
boolean |
isResolved()
Returns whether the related model was already resolved.
|
void |
setResolved(M resolved)
Defines the resolved model instance.
|
void |
setRestrictions(IVersionRestriction restriction)
Setter for setting the version restrictions.
|
private java.lang.String name
private IVersionRestriction restriction
private boolean isConflict
public ModelImport(java.lang.String name)
name - The name of the project to be imported.public ModelImport(java.lang.String name,
boolean isConflict,
IVersionRestriction restriction)
name - the name of the model to be importisConflict - does this object represent a conflict or an importrestriction - the version restriction (or null if absent)public java.lang.String getName()
public boolean isConflict()
true in case of a conflict,
false in case of an importpublic void setRestrictions(IVersionRestriction restriction)
restriction - the version restriction to this import or null if absent.public M getResolved()
public boolean isResolved()
true if it was resolved, false elsepublic void setResolved(M resolved) throws ModelManagementException
resolved - the resolved instance or nullModelManagementException - in case of violated model access restrictionspublic boolean evaluateRestrictions(IRestrictionEvaluationContext context, Version version) throws RestrictionEvaluationException
version.context - the output context (interpreted by the respective implementation,
e.g., an output visitor in order to continue with the actual indentation, may
be null but then false will always be the result)version - the version to evaluate againsttrue if the restrictions are fulfilled (also if none restrictions
were given), false if the restrictions were not fulfilledRestrictionEvaluationException - in case of evaluation problemspublic IVersionRestriction getVersionRestriction()
public IVersionRestriction copyVersionRestriction(M model) throws RestrictionEvaluationException
model - the model to instantiate the copied version restriction forRestrictionEvaluationException - in case of type/structural problemsCopyright © 2009 - 2018 SSE. All Rights Reserved.