| java.lang.Object sun.tools.java.MemberDefinition
All known Subclasses: sun.tools.javac.SourceMember, sun.tools.java.BinaryMember, sun.tools.tree.LocalMember,
MemberDefinition | public class MemberDefinition implements Constants(Code) | | This class defines a member of a Java class:
a variable, a method, or an inner class.
WARNING: The contents of this source file are not part of any
supported API. Code that depends on them does so at its own risk:
they are subject to change or removal without notice.
|
Method Summary | |
final public void | addModifiers(int mod) | final public boolean | canReach(Environment env, MemberDefinition f) Check if a field can reach another field (only considers
forward references, not the access modifiers). | public void | check(Environment env) Request a check of the field definition. | public Vset | check(Environment env, Context ctx, Vset vset) Really check the field definition. | public boolean | checkMeet(Environment env, MemberDefinition method, ClassDeclaration clazz) Check to see if two method definitions are compatible, that is
do they have a `meet'. | public boolean | checkOverride(Environment env, MemberDefinition method) Check to see if `this' can override/hide `method'. | public void | cleanup(Environment env) | public void | code(Environment env, Assembler asm) | public void | codeInit(Environment env, Context ctx, Assembler asm) | public boolean | couldOverride(Environment env, MemberDefinition method) This method is meant to be used to determine if one of two inherited
methods could override the other. | public MemberDefinition | getAccessMethodTarget() | public MemberDefinition | getAccessUpdateMember() If this method is a getter for a private field, return the setter. | public Vector | getArguments() | final public ClassDeclaration | getClassDeclaration() | final public ClassDefinition | getClassDefinition() | public ClassDeclaration | getDefiningClassDeclaration() | public String | getDocumentation() | final public IdentifierToken[] | getExceptionIds() | public ClassDeclaration[] | getExceptions(Environment env) Get the exceptions that are thrown by this method. | public Object | getInitialValue() | public ClassDefinition | getInnerClass() Get an inner class. | final public int | getModifiers() | final public Identifier | getName() | final public MemberDefinition | getNextMatch() | final public MemberDefinition | getNextMember() | final public ClassDefinition | getTopClass() | final public Type | getType() | public Node | getValue(Environment env) | final public Node | getValue() | final public long | getWhere() | final public boolean | isAbstract() | public boolean | isAccessMethod() | final public boolean | isBlankFinal() Tell if this is a final variable without an initializer. | public boolean | isConstant() | final public boolean | isConstructor() | final public boolean | isDeprecated() | final public boolean | isFinal() | final public boolean | isInitializer() | public boolean | isInlineable(Environment env, boolean fromFinal) | final public boolean | isInnerClass() | public boolean | isLocal() | final public boolean | isMethod() | final public boolean | isNative() | public boolean | isNeverNull() | final public boolean | isPackagePrivate() | final public boolean | isPrivate() | final public boolean | isProtected() | final public boolean | isPublic() | final public boolean | isStatic() | final public boolean | isStrict() | final public boolean | isSuperAccessMethod() | final public boolean | isSynchronized() | final public boolean | isSynthetic() | final public boolean | isTransient() | public boolean | isUplevelValue() | final public boolean | isVariable() | final public boolean | isVolatile() | public static MemberDefinition | makeProxyMember(MemberDefinition field, ClassDefinition classDef, Environment env) Create a member which is externally the same as `field' but
is defined in class `classDef'. | public void | print(PrintStream out) | public boolean | reportDeprecated(Environment env) Tells whether to report a deprecation error for this field. | public void | resolveTypeStructure(Environment env) A stub. | public boolean | sameReturnType(MemberDefinition method) | public void | setAccessMethodTarget(MemberDefinition target) | public void | setAccessUpdateMember(MemberDefinition updater) | final public void | setIsSuperAccessMethod(boolean b) Mark this member as an access method for a field selection
or method call via the 'super' keyword. | final public void | setValue(Node value) | final public void | subModifiers(int mod) | public String | toString() |
PACKAGE_ACCESS | final static int PACKAGE_ACCESS(Code) | | |
PRIVATE_ACCESS | final static int PRIVATE_ACCESS(Code) | | |
PROTECTED_ACCESS | final static int PROTECTED_ACCESS(Code) | | |
PUBLIC_ACCESS | final static int PUBLIC_ACCESS(Code) | | Constants used by getAccessLevel() to represent the access
modifiers as numbers.
|
modifiers | protected int modifiers(Code) | | |
superAccessMethod | protected boolean superAccessMethod(Code) | | |
where | protected long where(Code) | | |
MemberDefinition | public MemberDefinition(ClassDefinition innerClass)(Code) | | Constructor for an inner class.
Inner classes are represented as fields right along with
variables and methods for simplicity of data structure,
and to reflect properly the textual declaration order.
This constructor calls the generic constructor for this
class, extracting all necessary values from the innerClass.
|
addModifiers | final public void addModifiers(int mod)(Code) | | |
canReach | final public boolean canReach(Environment env, MemberDefinition f)(Code) | | Check if a field can reach another field (only considers
forward references, not the access modifiers).
|
checkMeet | public boolean checkMeet(Environment env, MemberDefinition method, ClassDeclaration clazz)(Code) | | Check to see if two method definitions are compatible, that is
do they have a `meet'. The meet of two methods is essentially
and `intersection' of
two methods. This method is called when some class C inherits
declarations for some method foo from two parents (superclass,
interfaces) but it does not, itself, have a declaration of foo.
Caller is responsible for making sure that both methods are
indeed visible in clazz.
A - void foo() throws e1
\
\ B void foo() throws e2
\ /
\ /
C
|
checkOverride | public boolean checkOverride(Environment env, MemberDefinition method)(Code) | | Check to see if `this' can override/hide `method'. Caller is
responsible for verifying that `method' has the same signature
as `this'. Caller is also responsible for verifying that
`method' is visible to the class where this override is occurring.
This method is called for the case when class B extends A and both
A and B define some method.
A - void foo() throws e1
|
|
B - void foo() throws e2
|
couldOverride | public boolean couldOverride(Environment env, MemberDefinition method)(Code) | | This method is meant to be used to determine if one of two inherited
methods could override the other. Unlike checkOverride(), failure
is not an error. This method is only meant to be called after
checkMeet() has succeeded on the two methods.
If you call couldOverride() without doing a checkMeet() first, then
you are on your own.
|
getAccessMethodTarget | public MemberDefinition getAccessMethodTarget()(Code) | | Is this a synthetic method which provides access to a
visible private member?
|
getAccessUpdateMember | public MemberDefinition getAccessUpdateMember()(Code) | | If this method is a getter for a private field, return the setter.
|
getArguments | public Vector getArguments()(Code) | | Get arguments (a vector of LocalMember)
|
getDefiningClassDeclaration | public ClassDeclaration getDefiningClassDeclaration()(Code) | | Get the class declaration in which the field is actually defined
|
getDocumentation | public String getDocumentation()(Code) | | Get the field's documentation
|
getModifiers | final public int getModifiers()(Code) | | Get the field's modifiers
|
getType | final public Type getType()(Code) | | Get the field's type
|
getWhere | final public long getWhere()(Code) | | Get the position in the input
|
isAbstract | final public boolean isAbstract()(Code) | | |
isAccessMethod | public boolean isAccessMethod()(Code) | | |
isBlankFinal | final public boolean isBlankFinal()(Code) | | Tell if this is a final variable without an initializer.
Such variables are subject to definite single assignment.
|
isConstant | public boolean isConstant()(Code) | | Check if constant: Will it inline away to a constant?
|
isConstructor | final public boolean isConstructor()(Code) | | |
isDeprecated | final public boolean isDeprecated()(Code) | | |
isFinal | final public boolean isFinal()(Code) | | |
isInitializer | final public boolean isInitializer()(Code) | | |
isInnerClass | final public boolean isInnerClass()(Code) | | |
isLocal | public boolean isLocal()(Code) | | |
isMethod | final public boolean isMethod()(Code) | | |
isNative | final public boolean isNative()(Code) | | |
isNeverNull | public boolean isNeverNull()(Code) | | |
isPackagePrivate | final public boolean isPackagePrivate()(Code) | | |
isPrivate | final public boolean isPrivate()(Code) | | |
isProtected | final public boolean isProtected()(Code) | | |
isPublic | final public boolean isPublic()(Code) | | Checks
|
isStatic | final public boolean isStatic()(Code) | | |
isStrict | final public boolean isStrict()(Code) | | |
isSuperAccessMethod | final public boolean isSuperAccessMethod()(Code) | | Is this an access method for a field selection or method call
of the form '...super.foo' or '...super.foo()'?
|
isSynchronized | final public boolean isSynchronized()(Code) | | |
isSynthetic | final public boolean isSynthetic()(Code) | | |
isTransient | final public boolean isTransient()(Code) | | |
isUplevelValue | public boolean isUplevelValue()(Code) | | Is this a synthetic field which holds a copy of,
or reference to, a local variable or enclosing instance?
|
isVariable | final public boolean isVariable()(Code) | | |
isVolatile | final public boolean isVolatile()(Code) | | |
makeProxyMember | public static MemberDefinition makeProxyMember(MemberDefinition field, ClassDefinition classDef, Environment env)(Code) | | Create a member which is externally the same as `field' but
is defined in class `classDef'. This is used by code
in sun.tools.tree.(MethodExpression,FieldExpression) as
part of the fix for bug 4135692.
Proxy members should not be added, ala addMember(), to classes.
They are merely "stand-ins" to produce modified MethodRef
constant pool entries during code generation.
We keep a cache of previously created proxy members not to
save time or space, but to ensure uniqueness of the proxy
member for any (field,classDef) pair. If these are not made
unique then we can end up generating duplicate MethodRef
constant pool entries during code generation.
|
reportDeprecated | public boolean reportDeprecated(Environment env)(Code) | | Tells whether to report a deprecation error for this field.
|
resolveTypeStructure | public void resolveTypeStructure(Environment env)(Code) | | A stub. Subclasses can do more checking.
|
sameReturnType | public boolean sameReturnType(MemberDefinition method)(Code) | | Convenience method to see if two methods return the same type
|
setIsSuperAccessMethod | final public void setIsSuperAccessMethod(boolean b)(Code) | | Mark this member as an access method for a field selection
or method call via the 'super' keyword.
|
setValue | final public void setValue(Node value)(Code) | | |
subModifiers | final public void subModifiers(int mod)(Code) | | |
|
|