Class JavaClass

    • Field Detail

      • typeDeclaration

        private org.eclipse.jdt.core.dom.TypeDeclaration typeDeclaration
    • Constructor Detail

      • JavaClass

        public JavaClass​(org.eclipse.jdt.core.dom.TypeDeclaration typeDeclaration,
                         IJavaParent parent)
        Default Constructor.
        Parameters:
        typeDeclaration - the type declaration representing the class
        parent - the parent artifact
    • Method Detail

      • getName

        public java.lang.String getName()
                                 throws VilException
        Description copied from interface: IArtifact
        Returns the name of this artifact.
        Returns:
        the name of this artifact
        Throws:
        VilException - in case of serious problems so that this operation cannot continue
      • rename

        public void rename​(java.lang.String name)
                    throws VilException
        Description copied from interface: IArtifact
        Renames 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: IArtifact
        Returns 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: IArtifact
        Returns 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: IArtifact
        Visits 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
      • annotations

        public Set<JavaAnnotation> annotations()
        Returns the annotations of this class.
        Returns:
        the annotations
      • methods

        public Set<JavaMethod> methods()
        Returns the methods of this class.
        Returns:
        the methods
      • deleteStatement

        public void deleteStatement​(ExpressionEvaluator evaluator)
                             throws VilException
        Deletes a statement within a method. Right now only JavaCall can be deleted.
        Parameters:
        evaluator - A wrapper type to pass and evaluate
        Throws:
        VilException - in case something goes wrong
      • deleteMethodWithCalls

        public void deleteMethodWithCalls​(ExpressionEvaluator evaluator)
                                   throws VilException
        Deletes a method and all java calls assigned to this method.
        Parameters:
        evaluator - A wrapper type to pass and evaluate
        Throws:
        VilException - in case something goes wrong
      • deleteMethodWithCalls

        public void deleteMethodWithCalls​(ExpressionEvaluator evaluator,
                                          java.lang.Object replacement)
                                   throws VilException
        Deletes a method and all java calls assigned to this method.
        Parameters:
        evaluator - A wrapper type to pass and evaluate
        replacement - The replacement that should be inserted for when the method is called
        Throws:
        VilException - in case something goes wrong
      • classes

        public Set<JavaClass> classes()
        Returns the inner classes of this class.
        Returns:
        Set with inner classes
      • attributes

        public Set<JavaAttribute> attributes()
        Returns the attributes of this class.
        Returns:
        the attributes
      • getAttributeByName

        public JavaAttribute getAttributeByName​(java.lang.String name)
        Returns the specified Java attribute.
        Parameters:
        name - the name of the attribute
        Returns:
        the attribute or null if there is no such attribute
      • qualifiedNames

        public Set<JavaQualifiedName> qualifiedNames()
        Returns all qualified names of this class.
        Returns:
        the qualified names
      • getStringValue

        public java.lang.String getStringValue​(IStringValueProvider.StringComparator comparator)
        Description copied from interface: IStringValueProvider
        Returns 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