Class JavaAnnotation
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.artifactModel.FragmentArtifact
-
- net.ssehub.easy.instantiation.java.artifacts.JavaFragmentArtifact
-
- net.ssehub.easy.instantiation.java.artifacts.JavaAnnotation
-
- All Implemented Interfaces:
IArtifact,IStringValueProvider,IVilType
public class JavaAnnotation extends JavaFragmentArtifact
Represents a Java annotation.- Author:
- Holger Eichelberger, Sass
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.ssehub.easy.instantiation.core.model.vilTypes.IStringValueProvider
IStringValueProvider.StringComparator
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.StringDEFAULT_FIELDprivate java.util.Map<java.lang.String,java.lang.String>fieldsprivate java.lang.StringqualifiedNameprivate java.lang.StringsimpleName
-
Constructor Summary
Constructors Constructor Description JavaAnnotation(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> fields, IJavaParent parent)Default Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(IArtifactVisitor visitor)Visits this artifact (and dependent on the visitor also contained artifacts and fragments) using the given visitor.voiddelete()Deletes this artifact.Set<java.lang.String>fields()Returns the fields of this annotation.java.lang.StringgetAnnotationValue(java.lang.String field)Returns the annotation value as a string.BinarygetBinary()Returns the binary representation of the contents of this artifact for manipulation.java.lang.StringgetName()Returns the name of this artifact.java.lang.StringgetQualifiedName()Returns the qualified name of the annotation.java.lang.StringgetStringValue(IStringValueProvider.StringComparator comparator)Returns the string value of this object.TextgetText()Returns the textual representation of the contents of this artifact for manipulation.voidrename(java.lang.String name)Renames this artifact.(package private) static java.lang.StringtoSimpleName(java.lang.String name)Returns the simple name of a possible qualified name.-
Methods inherited from class net.ssehub.easy.instantiation.java.artifacts.JavaFragmentArtifact
getNameSafe, getParent, notifyChanged, store, update
-
Methods inherited from class net.ssehub.easy.instantiation.core.model.artifactModel.FragmentArtifact
exists, lastModification
-
-
-
-
Field Detail
-
DEFAULT_FIELD
static final java.lang.String DEFAULT_FIELD
- See Also:
- Constant Field Values
-
qualifiedName
private java.lang.String qualifiedName
-
simpleName
private java.lang.String simpleName
-
fields
private java.util.Map<java.lang.String,java.lang.String> fields
-
-
Constructor Detail
-
JavaAnnotation
public JavaAnnotation(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> fields, IJavaParent parent)Default Constructor.- Parameters:
name- The annotation namefields- the annotation fields (name-value mapping)parent- the parent artifact or fragment
-
-
Method Detail
-
toSimpleName
static java.lang.String toSimpleName(java.lang.String name)
Returns the simple name of a possible qualified name.- Parameters:
name- the name- Returns:
- the simple name
-
delete
public void delete() throws VilExceptionDescription copied from interface:IArtifactDeletes this artifact.- Specified by:
deletein interfaceIArtifact- Overrides:
deletein classJavaFragmentArtifact- Throws:
VilException- in case of serious problems so that this operation cannot continue
-
getName
public java.lang.String getName() throws VilExceptionDescription copied from interface:IArtifactReturns the name of this artifact.- Returns:
- the name of this artifact
- Throws:
VilException- in case of serious problems so that this operation cannot continue
-
getQualifiedName
public java.lang.String getQualifiedName()
Returns the qualified name of the annotation.- Returns:
- the qualified name
-
rename
public void rename(java.lang.String name) throws VilExceptionDescription copied from interface:IArtifactRenames this artifact.- Parameters:
name- the new name of this artifact- Throws:
VilException- in case of serious problems so that this operation cannot continue
-
getText
public Text getText() throws VilException
Description copied from interface:IArtifactReturns the textual representation of the contents of this artifact for manipulation. In case of binary artifacts, the returned object may be empty.- Returns:
- the textual representation of the contents
- Throws:
VilException- in case of obtaining the representation causes serious problems
-
getBinary
public Binary getBinary() throws VilException
Description copied from interface:IArtifactReturns the binary representation of the contents of this artifact for manipulation.- Returns:
- the binary representation of the contents
- Throws:
VilException- in case of obtaining the representation causes serious problems
-
accept
public void accept(IArtifactVisitor visitor)
Description copied from interface:IArtifactVisits this artifact (and dependent on the visitor also contained artifacts and fragments) using the given visitor.- Parameters:
visitor- the visitor used for visiting this artifact
-
fields
public Set<java.lang.String> fields()
Returns the fields of this annotation.- Returns:
- the fields
-
getAnnotationValue
public java.lang.String getAnnotationValue(java.lang.String field)
Returns the annotation value as a string.- Parameters:
field- the name of the field to return- Returns:
- The annotation value represented as a string, may be null of not found.
-
getStringValue
public java.lang.String getStringValue(IStringValueProvider.StringComparator comparator)
Description copied from interface:IStringValueProviderReturns the string value of this object.- Parameters:
comparator- if the sequence of elements, e.g., in case of collections, shall be ordered according to the comparator, null if the original sequence shall be returned- Returns:
- the string value
-
-