Package org.fife.rsta.ac.java
Class MethodInfoData
- java.lang.Object
-
- org.fife.rsta.ac.java.MethodInfoData
-
- All Implemented Interfaces:
IconFactory.IconData,MemberCompletion.Data
class MethodInfoData extends java.lang.Object implements MemberCompletion.Data
Metadata about a method as read from a class file. This class is used by instances ofMethodCompletion.- Version:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description private MethodInfoinfoThe actual metadata.private java.util.List<java.lang.String>paramNamesCached method parameter names.private SourceCompletionProviderproviderThe parent completion provider.
-
Constructor Summary
Constructors Constructor Description MethodInfoData(MethodInfo info, SourceCompletionProvider provider)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetEnclosingClassName(boolean fullyQualified)Returns the name of the enclosing class.java.lang.StringgetIcon()Returns the main icon to use when rendering this member's completion.private MethodgetMethodFromSourceLoc(SourceLocation loc, ClassFile cf)Scours the source in a location (zip file, directory), looking for a particular class's source.java.lang.StringgetParameterName(int index)Returns the name of the specified parameter to this method, ornullif it cannot be determined.java.lang.StringgetSignature()Returns the signature of this member.java.lang.StringgetSummary()Returns the summary description (should be HTML) for this member.private java.lang.StringgetSummaryFromSourceLoc(SourceLocation loc, ClassFile cf)Scours the source in a location (zip file, directory), looking for a particular class's source.java.lang.StringgetType()Returns the type of this member (the return type for methods).booleanisAbstract()Returns whether this icon represents an abstract class/method/etc.booleanisConstructor()Returns whether this member is a constructor.booleanisDeprecated()Returns whether this icon represents a deprecated class/method/etc.booleanisFinal()Returns whether this icon represents a final class/method/etc.booleanisStatic()Returns whether this icon represents a static class/method/etc.
-
-
-
Field Detail
-
provider
private SourceCompletionProvider provider
The parent completion provider.
-
info
private MethodInfo info
The actual metadata.
-
paramNames
private java.util.List<java.lang.String> paramNames
Cached method parameter names.
-
-
Constructor Detail
-
MethodInfoData
MethodInfoData(MethodInfo info, SourceCompletionProvider provider)
Constructor.- Parameters:
info- The method info.provider- The parent completion provider.
-
-
Method Detail
-
getEnclosingClassName
public java.lang.String getEnclosingClassName(boolean fullyQualified)
Description copied from interface:MemberCompletion.DataReturns the name of the enclosing class.- Specified by:
getEnclosingClassNamein interfaceMemberCompletion.Data- Parameters:
fullyQualified- Whether the name returned should be fully qualified.- Returns:
- The class name.
-
getIcon
public java.lang.String getIcon()
Description copied from interface:IconFactory.IconDataReturns the main icon to use when rendering this member's completion. This icon will be decorated appropriately based on whether it is abstract, deprecated, final, static, or any of the above.- Specified by:
getIconin interfaceIconFactory.IconData- Returns:
- The icon to use.
-
getMethodFromSourceLoc
private Method getMethodFromSourceLoc(SourceLocation loc, ClassFile cf)
Scours the source in a location (zip file, directory), looking for a particular class's source. If it is found, it is parsed, and theMethodfor this method (if any) is returned.- Parameters:
loc- The zip file, jar file, or directory to look in.cf- TheClassFilerepresenting the class of this method.- Returns:
- The method, or
nullif it cannot be found, or an IO error occurred.
-
getParameterName
public java.lang.String getParameterName(int index)
Returns the name of the specified parameter to this method, ornullif it cannot be determined.- Parameters:
index- The index of the parameter.- Returns:
- The name of the parameter, or
null.
-
getSignature
public java.lang.String getSignature()
Description copied from interface:MemberCompletion.DataReturns the signature of this member.- Specified by:
getSignaturein interfaceMemberCompletion.Data- Returns:
- The signature.
- See Also:
MemberCompletion.getSignature()
-
getSummary
public java.lang.String getSummary()
Description copied from interface:MemberCompletion.DataReturns the summary description (should be HTML) for this member.- Specified by:
getSummaryin interfaceMemberCompletion.Data- Returns:
- The summary description, or
nullif there is none. - See Also:
Completion.getSummary()
-
getSummaryFromSourceLoc
private java.lang.String getSummaryFromSourceLoc(SourceLocation loc, ClassFile cf)
Scours the source in a location (zip file, directory), looking for a particular class's source. If it is found, it is parsed, and the Javadoc for this method (if any) is returned.- Parameters:
loc- The zip file, jar file, or directory to look in.cf- TheClassFilerepresenting the class of this method.- Returns:
- The summary, or
nullif the method has no javadoc, the class's source was not found, or an IO error occurred.
-
getType
public java.lang.String getType()
Description copied from interface:MemberCompletion.DataReturns the type of this member (the return type for methods).- Specified by:
getTypein interfaceMemberCompletion.Data- Returns:
- The type of this member.
- See Also:
MemberCompletion.getType()
-
isAbstract
public boolean isAbstract()
Description copied from interface:IconFactory.IconDataReturns whether this icon represents an abstract class/method/etc.- Specified by:
isAbstractin interfaceIconFactory.IconData- Returns:
- Whether it represents something abstract.
-
isConstructor
public boolean isConstructor()
Description copied from interface:MemberCompletion.DataReturns whether this member is a constructor.- Specified by:
isConstructorin interfaceMemberCompletion.Data- Returns:
- Whether this member is a constructor.
-
isDeprecated
public boolean isDeprecated()
Description copied from interface:IconFactory.IconDataReturns whether this icon represents a deprecated class/method/etc.- Specified by:
isDeprecatedin interfaceIconFactory.IconData- Returns:
- Whether it represents something deprecated.
-
isFinal
public boolean isFinal()
Description copied from interface:IconFactory.IconDataReturns whether this icon represents a final class/method/etc.- Specified by:
isFinalin interfaceIconFactory.IconData- Returns:
- Whether it represents something final.
-
isStatic
public boolean isStatic()
Description copied from interface:IconFactory.IconDataReturns whether this icon represents a static class/method/etc.- Specified by:
isStaticin interfaceIconFactory.IconData- Returns:
- Whether it represents something static.
-
-