|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.Utils
org.multijava.mjc.MemberAccess
org.jmlspecs.checker.JmlMemberAccess
This class represents and contains the information needed to determine
whether a member of a class or compilation unit can be accessed
from some other member.
It has the interface checking code for ensuring that modifiers
are valid for the member containing it,
e.g., class, field, and method signature classes.
The modifier checking code was factored out of
JmlTypeDeclaration, JmlFieldDeclaration, and
JmlMethodDeclaration rather than using callbacks so
the modifier checking could all be done in one class.
CMember| Field Summary | |
protected static long |
invalidJmlClassModifiers
The invalid JML class modifiers are ghost, instance, monitored, uninitialized, non_null, and helper. |
protected static long |
invalidJmlFieldModifiers
The invalid JML field modifiers. |
protected static long |
invalidJmlMethodModifiers
The invalid JML method modifiers are ghost, instance, monitored, and uninitialized. |
| Fields inherited from class org.multijava.mjc.MemberAccess |
host, hostCompilationUnit, interfaceFieldModifiers, interfaceMethodModifiers, invalidAbstractMethodModifiers, invalidClassModifiers, invalidFieldModifiers, invalidMethodModifiers, modifiers, owner |
| Fields inherited from class org.multijava.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
| Constructor Summary | |
JmlMemberAccess(CClass owner,
long modifiers)
Constructs a member export |
|
JmlMemberAccess(CClass owner,
CMemberHost host,
long modifiers)
Constructs a top-level member export |
|
| Method Summary | |
void |
checkAccessModifiers(CContextType context,
JMemberDeclaration member)
Check illegal combinations of modifiers common to classes, interfaces, fields, and methods. |
void |
checkClassModifiers(CContextType context,
JTypeDeclaration member)
Check for illegal combinations of modifiers specific to classes and interfaces. |
void |
checkFieldModifiers(CContextType context,
JFieldDeclaration member)
Check for illegal combinations of modifiers specific to field declarations. |
long |
checkInterfaceFieldModifiers(CContextType context,
JFieldDeclaration member)
Check for illegal combinations of modifiers disallowed in interface field declarations. |
long |
checkInterfaceMethodModifiers(CContextType context,
JMethodDeclaration member)
Check for illegal combinations of modifiers disallowed in interface method declarations. |
void |
checkMethodModifiers(CContextType context,
JMethodDeclaration member)
Check for illegal combinations of modifiers specific to method declarations. |
JMLMathMode |
codeArithmeticMode()
Returns the arithmetic mode of the code (or -1 if not specified) |
boolean |
inJavaFile()
Returns true if this member is declared in a '.java' file. |
boolean |
isExplicitlyPrivate()
Returns true if this member has a private modifier. |
boolean |
isExplicitlyProtected()
Returns true iff this member has a protected modifier. |
boolean |
isExplicitlyPublic()
Returns true iff this member has a public modifier. |
boolean |
isGhost()
Returns true if this member is a ghost variable. |
boolean |
isHelper()
Returns true if this member is a helper method. |
boolean |
isInstance()
Returns true if this member is a instance variable. |
boolean |
isMemberVisibleInX(CMember member,
CMemberHost from)
Indicates whether this is accessible from the given host. |
boolean |
isModel()
Returns true if this member is a model. |
boolean |
isMonitored()
Returns true if this member is a monitored field. |
boolean |
isPrivate()
Returns true if this member is private. |
boolean |
isProtected()
Returns true if this member is protected, including spec_portected in a JML specification scope. |
boolean |
isPublic()
Returns true if this member is public, including spec_public in a JML specification scope. |
boolean |
isPure()
Returns true if this member is pure. |
boolean |
isQuery()
Returns true if this member is query. |
boolean |
isSecret()
Returns true if this member is secret. |
boolean |
isSpecProtected()
Returns true if this member is spec_protected. |
boolean |
isSpecPublic()
Returns true if this member is spec_public. |
boolean |
isUninitialized()
Returns true if this member is an uninitialized field. |
protected long |
privacy()
Returns the privacy of this declaration. |
JMLMathMode |
specArithmeticMode()
Returns the arithmetic mode of the spec (or -1 if not specified) |
| Methods inherited from class org.multijava.mjc.MemberAccess |
addModifiers, checkExternalMethodModifiers, getCCompilationUnit, getOwnerName, hasDefaultAccess, host, isAbstract, isExternalMethod, isFinal, isInterface, isMemberVisibleIn, isNative, isStatic, isStrictFP, isSynchronized, isTransient, isVolatile, modifiers, owner, removeAbstractModifier, removeFinalModifier, removePrivateModifier, removeStaticModifier, setModifiers, setOwner |
| Methods inherited from class org.multijava.util.Utils |
assertTrue, assertTrue, combineArrays, escapeString, escapeString, fail, fail, getFilePath, hasFlag, hasOtherFlags, parsePathParts, relativePathTo, splitQualifiedName, splitQualifiedName, stripJavaModifiers, stripNonJavaModifiers, stripPrivateModifier, unescapeString, vectorToArray, vectorToIntArray |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final long invalidJmlClassModifiers
protected static final long invalidJmlFieldModifiers
protected static final long invalidJmlMethodModifiers
| Constructor Detail |
public JmlMemberAccess(CClass owner,
long modifiers)
owner - the owner of this fieldmodifiers - the modifiers on this field
public JmlMemberAccess(CClass owner,
CMemberHost host,
long modifiers)
owner - the owner of this memberhost - the host of this member's declarationmodifiers - the modifiers on this member| Method Detail |
public boolean isMemberVisibleInX(CMember member,
CMemberHost from)
member - the member that needs to be accessedfrom - the host that wants to access member
public boolean inJavaFile()
public boolean isPublic()
isPublic in class MemberAccesspublic boolean isProtected()
isProtected in class MemberAccesspublic boolean isPrivate()
isPrivate in class MemberAccesspublic boolean isExplicitlyPublic()
public boolean isExplicitlyProtected()
public boolean isExplicitlyPrivate()
public boolean isSpecPublic()
public boolean isSpecProtected()
public boolean isPure()
pure modifier.
isPure in class MemberAccesspublic boolean isQuery()
query modifier.
public boolean isSecret()
secret modifier.
public boolean isModel()
model modifier.
public boolean isGhost()
ghost modifier.
public boolean isInstance()
instance modifier.
public boolean isHelper()
helper modifier.
public boolean isMonitored()
monitored
modifier.
public boolean isUninitialized()
uninitialized
modifier.
protected long privacy()
public JMLMathMode codeArithmeticMode()
public JMLMathMode specArithmeticMode()
public void checkAccessModifiers(CContextType context,
JMemberDeclaration member)
throws PositionedError
checkAccessModifiers in class MemberAccessPositionedError
public void checkClassModifiers(CContextType context,
JTypeDeclaration member)
throws PositionedError
checkClassModifiers in class MemberAccessPositionedError
public void checkFieldModifiers(CContextType context,
JFieldDeclaration member)
throws PositionedError
checkFieldModifiers in class MemberAccessPositionedError
public long checkInterfaceFieldModifiers(CContextType context,
JFieldDeclaration member)
throws PositionedError
checkInterfaceFieldModifiers in class MemberAccessPositionedError
public void checkMethodModifiers(CContextType context,
JMethodDeclaration member)
throws PositionedError
checkMethodModifiers in class MemberAccessPositionedError
public long checkInterfaceMethodModifiers(CContextType context,
JMethodDeclaration member)
throws PositionedError
checkInterfaceMethodModifiers in class MemberAccessPositionedError
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||