Class JavaAttribute

  • All Implemented Interfaces:
    net.ssehub.easy.instantiation.core.model.artifactModel.IArtifact, net.ssehub.easy.instantiation.core.model.vilTypes.IStringValueProvider, net.ssehub.easy.instantiation.core.model.vilTypes.IVilType, IJavaParent

    public class JavaAttribute
    extends JavaParentFragmentArtifact
    Represents a Java attribute.
    Author:
    Holger Eichelberger, Sass
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface net.ssehub.easy.instantiation.core.model.vilTypes.IStringValueProvider

        net.ssehub.easy.instantiation.core.model.vilTypes.IStringValueProvider.StringComparator
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String attributeName  
      private org.eclipse.jdt.core.dom.FieldDeclaration fieldDeclaration  
      private static net.ssehub.easy.basics.logger.EASyLoggerFactory.EASyLogger logger  
    • Constructor Summary

      Constructors 
      Constructor Description
      JavaAttribute​(org.eclipse.jdt.core.dom.FieldDeclaration node, java.lang.String name, IJavaParent parent)
      Default Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accept​(net.ssehub.easy.instantiation.core.model.artifactModel.IArtifactVisitor visitor)  
      net.ssehub.easy.instantiation.core.model.vilTypes.Set<JavaAnnotation> annotations()
      Returns the annotations of this attribute.
      void delete()  
      net.ssehub.easy.instantiation.core.model.artifactModel.ArtifactModel getArtifactModel()
      Returns the ArtifactModel.
      net.ssehub.easy.instantiation.core.model.artifactModel.representation.Binary getBinary()  
      (package private) org.eclipse.jdt.core.dom.FieldDeclaration getFieldDeclaration()
      Getter for the FieldDeclaration of the Attribute.
      java.lang.String getName()  
      java.lang.String getStringValue​(net.ssehub.easy.instantiation.core.model.vilTypes.IStringValueProvider.StringComparator comparator)  
      net.ssehub.easy.instantiation.core.model.artifactModel.representation.Text getText()  
      void makeConstant()
      Makes an attribute constant.
      void makeVariable()
      Makes a constant attribute variable.
      void rename​(java.lang.String name)  
      void setValue​(java.lang.Object value)
      Defines the (initial) value of this attribute.
      private boolean testIfModifierExists​(org.eclipse.jdt.core.dom.Modifier.ModifierKeyword keyword, java.util.List<org.eclipse.jdt.core.dom.IExtendedModifier> modifierList)
      Test if a modifier keyword is already present.
      • Methods inherited from class net.ssehub.easy.instantiation.core.model.artifactModel.FragmentArtifact

        exists, lastModification
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface net.ssehub.easy.instantiation.java.artifacts.IJavaParent

        store
    • Field Detail

      • logger

        private static net.ssehub.easy.basics.logger.EASyLoggerFactory.EASyLogger logger
      • fieldDeclaration

        private org.eclipse.jdt.core.dom.FieldDeclaration fieldDeclaration
      • attributeName

        private java.lang.String attributeName
    • Constructor Detail

      • JavaAttribute

        public JavaAttribute​(org.eclipse.jdt.core.dom.FieldDeclaration node,
                             java.lang.String name,
                             IJavaParent parent)
        Default Constructor.
        Parameters:
        node - The FieldDeclaration node
        name - The name of the attribute.
        parent - the parent artifact or fragment
    • Method Detail

      • delete

        public void delete()
                    throws net.ssehub.easy.instantiation.core.model.common.VilException
        Specified by:
        delete in interface net.ssehub.easy.instantiation.core.model.artifactModel.IArtifact
        Overrides:
        delete in class JavaFragmentArtifact
        Throws:
        net.ssehub.easy.instantiation.core.model.common.VilException
      • getName

        public java.lang.String getName()
                                 throws net.ssehub.easy.instantiation.core.model.common.VilException
        Throws:
        net.ssehub.easy.instantiation.core.model.common.VilException
      • rename

        public void rename​(java.lang.String name)
                    throws net.ssehub.easy.instantiation.core.model.common.VilException
        Throws:
        net.ssehub.easy.instantiation.core.model.common.VilException
      • getText

        public net.ssehub.easy.instantiation.core.model.artifactModel.representation.Text getText()
                                                                                           throws net.ssehub.easy.instantiation.core.model.common.VilException
        Throws:
        net.ssehub.easy.instantiation.core.model.common.VilException
      • getBinary

        public net.ssehub.easy.instantiation.core.model.artifactModel.representation.Binary getBinary()
                                                                                               throws net.ssehub.easy.instantiation.core.model.common.VilException
        Throws:
        net.ssehub.easy.instantiation.core.model.common.VilException
      • accept

        public void accept​(net.ssehub.easy.instantiation.core.model.artifactModel.IArtifactVisitor visitor)
      • annotations

        public net.ssehub.easy.instantiation.core.model.vilTypes.Set<JavaAnnotation> annotations()
        Returns the annotations of this attribute.
        Returns:
        An ArraySet with all annotations
      • setValue

        public void setValue​(java.lang.Object value)
        Defines the (initial) value of this attribute.
        Parameters:
        value - the value of this attribute
      • makeConstant

        public void makeConstant()
        Makes an attribute constant.
      • testIfModifierExists

        private boolean testIfModifierExists​(org.eclipse.jdt.core.dom.Modifier.ModifierKeyword keyword,
                                             java.util.List<org.eclipse.jdt.core.dom.IExtendedModifier> modifierList)
        Test if a modifier keyword is already present.
        Parameters:
        keyword - The modifier keyword
        modifierList - Live ordered list with modifiers.
        Returns:
        true if keyword is present
      • makeVariable

        public void makeVariable()
        Makes a constant attribute variable.
      • getFieldDeclaration

        org.eclipse.jdt.core.dom.FieldDeclaration getFieldDeclaration()
        Getter for the FieldDeclaration of the Attribute.
        Returns:
        Returns the FieldDeclaration of the Attribute.
      • getStringValue

        public java.lang.String getStringValue​(net.ssehub.easy.instantiation.core.model.vilTypes.IStringValueProvider.StringComparator comparator)
      • getArtifactModel

        public net.ssehub.easy.instantiation.core.model.artifactModel.ArtifactModel getArtifactModel()
        Description copied from interface: IJavaParent
        Returns the ArtifactModel.
        Returns:
        artifactmodel