Class Advice
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.common.Advice
-
public class Advice extends java.lang.ObjectEstablishes a link to a variability model for resolving names in tools. However, variability model identifiers are actually resolved at runtime from the actual configuration instance passed in.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringnameprivate Projectresolvedprivate IVersionRestrictionrestrictions
-
Constructor Summary
Constructors Constructor Description Advice(java.lang.String name, IVersionRestriction restrictions, Project resolved)Creates an advice annotation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectaccept(IVisitor visitor)Accepts the visitor for visiting.static Advicecreate(java.lang.String name, java.net.URI modelURI, IVersionRestriction restrictions, java.lang.StringBuilder warning)Creates an advice by resolvingnameto a variability model.java.lang.ObjectgetIvmlElement(java.lang.String name)Returns whethernamecan be resolved to an IVML element.static java.lang.ObjectgetIvmlElement(IResolutionScope scope, java.lang.String name)Returns whethernamecan be resolved to an IVML element inscope.java.lang.StringgetName()Returns the name of the variability model.ProjectgetResolved()Returns the resolved project.IVersionRestrictiongetVersionRestriction()Returns the version restrictions.
-
-
-
Field Detail
-
name
private java.lang.String name
-
restrictions
private IVersionRestriction restrictions
-
resolved
private Project resolved
-
-
Constructor Detail
-
Advice
public Advice(java.lang.String name, IVersionRestriction restrictions, Project resolved)Creates an advice annotation.- Parameters:
name- The name of the project to be imported.restrictions- the optional version restrictions that apply (may be null if absent)resolved- the resolved project, may be null if no resolution is possible
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of the variability model.- Returns:
- the name of the variability model
-
getVersionRestriction
public IVersionRestriction getVersionRestriction()
Returns the version restrictions.- Returns:
- the version restrictions (may be null if absent)
-
getResolved
public Project getResolved()
Returns the resolved project.- Returns:
- the resolved project, may be null if no resolution is possible
-
accept
public java.lang.Object accept(IVisitor visitor) throws VilException
Accepts the visitor for visiting.- Parameters:
visitor- the visitor to be used- Returns:
- the result of visiting this instance (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
getIvmlElement
public java.lang.Object getIvmlElement(java.lang.String name)
Returns whethernamecan be resolved to an IVML element.- Parameters:
name- the name to be resolved- Returns:
- the IVML element (value, containable model element), null else
-
getIvmlElement
public static java.lang.Object getIvmlElement(IResolutionScope scope, java.lang.String name)
Returns whethernamecan be resolved to an IVML element inscope.- Parameters:
scope- the resolution scopename- the name to be resolved- Returns:
- the IVML element (value, containable model element), null else
-
create
public static Advice create(java.lang.String name, java.net.URI modelURI, IVersionRestriction restrictions, java.lang.StringBuilder warning)
Creates an advice by resolvingnameto a variability model.- Parameters:
name- the name to be resolvedmodelURI- the URI of the modelrestrictions- the version restrictionswarning- a string builder to append warnings to- Returns:
- the created advice instance
-
-