net.groboclown.util.jplugin.v2
Class ClassWrapper

java.lang.Object
  |
  +--net.groboclown.util.jplugin.v2.ClassWrapper

public class ClassWrapper
extends Object

Maintains all the information discovered about the given class. You must never directly add ClassAttributes to the inner ClassAttribute field - always go through the addAttributes( ClassAttributes ) method.

Version:
0.9.0 Alpha
Author:
Matt Albrecht

Field Summary
private  ClassAttributes attribs
           
private  IClassInspector classInspector
           
private  String className
           
private  Class clazz
           
static String DISPLAY_NAME
           
private  String displayName
           
private  Image icon
           
static String ICON_NAME
           
private  String iconName
           
 
Constructor Summary
ClassWrapper(String className)
           
 
Method Summary
 void addAttributes(ClassAttributes ca)
          Adds the given class attributes to the internal list of attributes.
(package private)  ClassAttributes getClassAttributes()
          Package-protected.
 IClassInspector getClassInspector()
           
 String getClassName()
           
 Class getClassObject()
           
 String getDisplayName()
           
 Image getIcon()
           
 boolean hasAttribute(String attrib)
          Check if this class has a matching attribute name defined.
 boolean hasAttribute(String attrib, String val)
          Check if this class has a matching attribute with a matching value, ignoring the case of the value.
 boolean hasAttribute(String attrib, String val, boolean isCaseSensitive)
          Check if this class has a matching attribute with a matching value.
 Object instantiate()
           
 boolean isOfClass(Class c)
           
protected  void parseAttributes(ClassAttributes ca)
           
 void setClassInspector(IClassInspector ci)
           
 void setDisplayName(String name)
           
 void setIcon(Image icon)
           
 void setIcon(String iconName)
           
protected  void setIconToName(String iconName)
           
protected  void setupClassInspector()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

DISPLAY_NAME

public static final String DISPLAY_NAME

ICON_NAME

public static final String ICON_NAME

attribs

private ClassAttributes attribs

className

private String className

classInspector

private IClassInspector classInspector

icon

private Image icon

iconName

private String iconName

displayName

private String displayName

clazz

private Class clazz
Constructor Detail

ClassWrapper

public ClassWrapper(String className)
Method Detail

getClassName

public String getClassName()

setIcon

public void setIcon(String iconName)

setIcon

public void setIcon(Image icon)

getIcon

public Image getIcon()

setDisplayName

public void setDisplayName(String name)

getDisplayName

public String getDisplayName()

setClassInspector

public void setClassInspector(IClassInspector ci)

getClassInspector

public IClassInspector getClassInspector()

instantiate

public Object instantiate()

getClassObject

public Class getClassObject()

isOfClass

public boolean isOfClass(Class c)

addAttributes

public void addAttributes(ClassAttributes ca)
Adds the given class attributes to the internal list of attributes. If the attributes update any known fields, they will be updated internally.

hasAttribute

public boolean hasAttribute(String attrib)
Check if this class has a matching attribute name defined.

hasAttribute

public boolean hasAttribute(String attrib,
                            String val)
Check if this class has a matching attribute with a matching value, ignoring the case of the value.

hasAttribute

public boolean hasAttribute(String attrib,
                            String val,
                            boolean isCaseSensitive)
Check if this class has a matching attribute with a matching value.
Parameters:
val - the value which the attribute must contain, or null if you want to check if the attribute is not defined.
isCaseSensitive - true if the values must match their cases exactly.

getClassAttributes

ClassAttributes getClassAttributes()
Package-protected. Never add attributes directly to this object.

parseAttributes

protected void parseAttributes(ClassAttributes ca)

setupClassInspector

protected void setupClassInspector()

setIconToName

protected void setIconToName(String iconName)
Parameters:
iconName - a non-null string indicating the location of the icon, a resource name.


Written under the LGPL