RECODER 0.92

recoder.abstraction
Class Package

java.lang.Object
  extended by recoder.abstraction.Package
All Implemented Interfaces:
ClassTypeContainer, ProgramModelElement, AccessFlags, ModelElement, NamedModelElement

public class Package
extends java.lang.Object
implements ClassTypeContainer

A program model element representing packages.

Author:
AL, RN

Nested Class Summary
 
Nested classes/interfaces inherited from interface recoder.abstraction.ProgramModelElement
ProgramModelElement.LexicalOrder
 
Field Summary
 
Fields inherited from interface recoder.abstraction.ProgramModelElement
LEXICAL_ORDER
 
Fields inherited from interface recoder.bytecode.AccessFlags
ABSTRACT, ANNOTATION, BRIDGE, ENUM, FINAL, INTERFACE, NATIVE, PRIVATE, PROTECTED, PUBLIC, STATIC, STRICT, SUPER, SYNCHRONIZED, SYNTHETIC, TRANSIENT, VARARGS, VOLATILE
 
Constructor Summary
Package(java.lang.String name, ProgramModelInfo pmi)
          Creates a new package with the given name, organized by the given program model info.
 
Method Summary
 java.lang.String getBinaryName()
          Returns the binary name.
 ClassTypeContainer getContainer()
          Returns the enclosing package or class type, or method.
 java.lang.String getFullName()
          Returns the name of this package.
 java.lang.String getName()
          Returns the name of this package.
 Package getPackage()
          Returns the enclosing package.
 java.util.List<? extends AnnotationUse> getPackageAnnotations()
          Returns the list of RuntimeInvisibleAnnotations retrieved from package-info.class, or the list of AnnotationUseSpecification retrieved from package-info.java, respectively.
 ProgramModelInfo getProgramModelInfo()
          Returns the instance that can retrieve information about this program model element.
 java.util.List<? extends ClassType> getTypes()
          Returns the list of class types defined within this ontainer.
 void setProgramModelInfo(ProgramModelInfo service)
          Sets the instance that can retrieve information about this program model element.
 void validate()
          Check consistency and admissibility of a construct, e.g. cardinality of participants.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Package

public Package(java.lang.String name,
               ProgramModelInfo pmi)
Creates a new package with the given name, organized by the given program model info.

Parameters:
name - the name of the package.
pmi - the program model info responsible for this package.
Method Detail

getName

public java.lang.String getName()
Returns the name of this package.

Specified by:
getName in interface NamedModelElement
Returns:
the name of this package.

getFullName

public java.lang.String getFullName()
Returns the name of this package.

Specified by:
getFullName in interface ProgramModelElement
Returns:
the full name of this program model element.

getBinaryName

public java.lang.String getBinaryName()
Description copied from interface: ProgramModelElement
Returns the binary name. The binary name is the name this program model element would have in bytecode, i.e., how it either is read by the bytecode parser, or the name a compiler would give this element during the compilation process (if this program model element is represented in source code). See JLS, §13.1

Specified by:
getBinaryName in interface ProgramModelElement
Returns:
the bytecode name of this program model element

getProgramModelInfo

public ProgramModelInfo getProgramModelInfo()
Returns the instance that can retrieve information about this program model element.

Specified by:
getProgramModelInfo in interface ProgramModelElement
Returns:
the program model info of this element.

setProgramModelInfo

public void setProgramModelInfo(ProgramModelInfo service)
Sets the instance that can retrieve information about this program model element.

Specified by:
setProgramModelInfo in interface ProgramModelElement
Parameters:
service - the program model info for this element.

getTypes

public java.util.List<? extends ClassType> getTypes()
Returns the list of class types defined within this ontainer.

Specified by:
getTypes in interface ClassTypeContainer
Returns:
a list of contained class types.

getPackageAnnotations

public java.util.List<? extends AnnotationUse> getPackageAnnotations()
Returns the list of RuntimeInvisibleAnnotations retrieved from package-info.class, or the list of AnnotationUseSpecification retrieved from package-info.java, respectively. Returns null if neither file is present or no package annotations are specified.

Returns:
Since:
0.80

getContainer

public ClassTypeContainer getContainer()
Returns the enclosing package or class type, or method.

Specified by:
getContainer in interface ClassTypeContainer
Returns:
null.

getPackage

public Package getPackage()
Returns the enclosing package.

Specified by:
getPackage in interface ClassTypeContainer
Returns:
null.

validate

public void validate()
              throws ModelException
Description copied from interface: ModelElement
Check consistency and admissibility of a construct, e.g. cardinality of participants. Should only check syntactical correctness, not semantical correctness.
For checking, e.g., if an AST element of type recoder.java.statement.If has a boolean parameter as condition, recoder.service.SemanticsChecker

Specified by:
validate in interface ModelElement
Throws:
ModelException
See Also:
SemanticsChecker

RECODER 0.92