com.bluemarsh.jswat.breakpoint
Class PatternReferenceTypeSpec

java.lang.Object
  |
  +--com.bluemarsh.jswat.breakpoint.PatternReferenceTypeSpec
All Implemented Interfaces:
ReferenceTypeSpec, java.io.Serializable

public class PatternReferenceTypeSpec
extends java.lang.Object
implements ReferenceTypeSpec

Class PatternReferenceTypeSpec is used for specifying classes. It can accept class name patterns that are either prefixed or suffixed with an asterisk wildcard.

Version:
1.2 4/29/01
Author:
Nathan Fiedler
See Also:
Serialized Form

Field Summary
protected  java.lang.String className
          Name of the class specified, without wildcards.
protected  java.lang.String classPattern
          Name of the class specified, possibly with wild cards.
protected  boolean postWild
          True if class specification is suffixed with a wildcard.
protected  boolean preWild
          True if class specification is prefixed with a wildcard.
 
Fields inherited from interface com.bluemarsh.jswat.breakpoint.ReferenceTypeSpec
serialVersionUID
 
Constructor Summary
PatternReferenceTypeSpec(java.lang.String classId)
          Constructs a new PatternReferenceTypeSpec for the given class name pattern.
 
Method Summary
 com.sun.jdi.request.ClassPrepareRequest createPrepareRequest(com.sun.jdi.VirtualMachine vm)
          Create a class prepare request appropriate for this reference type specification.
 java.lang.String getIdentifier()
          Returns the class identifier this specification is specifying.
 boolean isExact()
          Returns true if this type specification is an exact name.
protected  boolean isJavaIdentifier(java.lang.String s)
          Determine if the given string is a valid Java identifier.
 boolean matches(com.sun.jdi.ReferenceType refType)
          Determines if the given ReferenceType matches this specification.
 boolean matches(java.lang.String classname)
          Determines if the given class name matches this specification.
 java.lang.String toString()
          Returns a String representation of this.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

className

protected java.lang.String className
Name of the class specified, without wildcards.

classPattern

protected java.lang.String classPattern
Name of the class specified, possibly with wild cards.

postWild

protected boolean postWild
True if class specification is suffixed with a wildcard.

preWild

protected boolean preWild
True if class specification is prefixed with a wildcard.
Constructor Detail

PatternReferenceTypeSpec

public PatternReferenceTypeSpec(java.lang.String classId)
                         throws java.lang.ClassNotFoundException
Constructs a new PatternReferenceTypeSpec for the given class name pattern.
Parameters:
classId - class identifier string.
Throws:
java.lang.ClassNotFoundException - Thrown if classId is not a valid identifier.
Method Detail

createPrepareRequest

public com.sun.jdi.request.ClassPrepareRequest createPrepareRequest(com.sun.jdi.VirtualMachine vm)
Create a class prepare request appropriate for this reference type specification.
Specified by:
createPrepareRequest in interface ReferenceTypeSpec
Parameters:
vm - VirtualMachine to use for creating request.
Returns:
ClassPrepareRequest.

getIdentifier

public java.lang.String getIdentifier()
Returns the class identifier this specification is specifying. This pattern includes any leading or trailing wildcards.
Specified by:
getIdentifier in interface ReferenceTypeSpec
Returns:
class identifier.

isExact

public boolean isExact()
Returns true if this type specification is an exact name.
Specified by:
isExact in interface ReferenceTypeSpec
Returns:
true if exact name, false if wildcard.

isJavaIdentifier

protected boolean isJavaIdentifier(java.lang.String s)
Determine if the given string is a valid Java identifier.
Parameters:
s - string to validate.
Returns:
true if string is a valid Java identifier.

matches

public boolean matches(java.lang.String classname)
Determines if the given class name matches this specification.
Specified by:
matches in interface ReferenceTypeSpec
Parameters:
classname - name of class to match against.
Returns:
true if name matches this specification.

matches

public boolean matches(com.sun.jdi.ReferenceType refType)
Determines if the given ReferenceType matches this specification.
Specified by:
matches in interface ReferenceTypeSpec
Parameters:
refType - ReferenceType to match against.
Returns:
true if type matches this specification.

toString

public java.lang.String toString()
Returns a String representation of this. This returns the class name pattern, including wildcards.
Overrides:
toString in class java.lang.Object
Returns:
String.