
org.teatrove.teatools.ContextClassEntryBeanInfo Maven / Gradle / Ivy
The newest version!
/*
* ContextClassEntryBeanInfo.java
*
* BeanDoc generated on Fri Mar 16 at 12:39:55 EDT 02012.
*
* See ContextClassEntry.java for copyright information.
*/
package org.teatrove.teatools;
import java.beans.*;
import java.lang.reflect.*;
import java.util.Vector;
/**
* The BeanInfo class describing ContextClassEntry.
*
* @author Mark Masse
*/
public class ContextClassEntryBeanInfo extends SimpleBeanInfo {
/** BeanDescriptor returned by the getBeanDescriptor
method */
private BeanDescriptor mBeanDescriptor;
/** BeanInfo array returned by the getAdditionalBeanInfo
method */
private BeanInfo[] mAdditionalBeanInfo;
/** MethodDescriptor array returned by the
getMethodDescriptors
method */
private MethodDescriptor[] mMethodDescriptors;
/** PropertyDescriptor array returned by the
getPropertyDescriptors
method */
private PropertyDescriptor[] mPropertyDescriptors;
/** The index of the default property */
private int mDefaultPropertyIndex;
/**
* Creates a new ContextClassEntryBeanInfo.
*/
public ContextClassEntryBeanInfo() {
mDefaultPropertyIndex = -1;
}
/**
* Returns a BeanDescriptor that describes ContextClassEntry.
*/
public BeanDescriptor getBeanDescriptor() {
if (mBeanDescriptor == null) {
mBeanDescriptor = createBeanDescriptor();
}
return mBeanDescriptor;
}
/**
* Returns a BeanInfo array containing BeanInfo object's for:
* java.lang.Object
*/
public BeanInfo[] getAdditionalBeanInfo() {
if (mAdditionalBeanInfo == null) {
mAdditionalBeanInfo = createAdditionalBeanInfo();
}
return mAdditionalBeanInfo;
}
/**
* Returns MethodDescriptors that describe the methods of
* ContextClassEntry. Call the
* getAdditionalBeanInfo
method to get the
* method descriptors of the superclass and interfaces.
*/
public MethodDescriptor[] getMethodDescriptors() {
if (mMethodDescriptors == null) {
mMethodDescriptors = createMethodDescriptors();
}
return mMethodDescriptors;
}
/**
* Returns a PropertyDescriptor array that describes the properties of
* ContextClassEntry.
*/
public PropertyDescriptor[] getPropertyDescriptors() {
if (mPropertyDescriptors == null) {
mPropertyDescriptors = createPropertyDescriptors();
}
return mPropertyDescriptors;
}
/**
* Return the index of the default property.
*/
public int getDefaultPropertyIndex() {
return mDefaultPropertyIndex;
}
//
// Non-public interface
//
// Create the bean descriptor for the bean.
private BeanDescriptor createBeanDescriptor() {
BeanDescriptor bd =
new BeanDescriptor(ContextClassEntry.class);
bd.setName("ContextClassEntry");
bd.setDisplayName("ContextClassEntry");
bd.setShortDescription("Data structure that contains a Context\'s class name and prefix name.\n This class can be used in conjuntion with the \n TeaToolsUtils.createContextClass
method.");
bd.setValue("BeanDoc", "4.1.2");
return bd;
}
// Create the additional bean info objects for the bean.
private BeanInfo[] createAdditionalBeanInfo() {
Vector bis = new Vector();
BeanInfo bi = null;
bi = null;
try {
// Get the BeanInfo for the superclass
bi = Introspector.getBeanInfo(java.lang.Object.class);
}
catch (Throwable t) {
t.printStackTrace();
}
if (bi != null) {
bis.addElement(bi);
}
BeanInfo[] additionalBeanInfo = null;
if (bis.size() > 0) {
additionalBeanInfo = new BeanInfo[bis.size()];
bis.copyInto(additionalBeanInfo);
}
return additionalBeanInfo;
}
// Create the method descriptor objects for the bean.
private MethodDescriptor[] createMethodDescriptors() {
Class[] paramTypes = null;
int paramIndex = 0;
ParameterDescriptor[] paramDescriptors = null;
ParameterDescriptor pd = null;
Vector mds = new Vector();
Method m = null;
MethodDescriptor md = null;
//
// getContextClassName
//
paramTypes = new Class[0];
paramDescriptors = new ParameterDescriptor[0];
paramIndex = 0;
m = null;
try {
m = ContextClassEntry.class.getMethod("getContextClassName", paramTypes);
}
catch (Throwable t) {
t.printStackTrace();
}
if (m != null) {
md = null;
if (paramDescriptors != null) {
md = new MethodDescriptor(m, paramDescriptors);
}
else {
md = new MethodDescriptor(m);
}
md.setName("getContextClassName");
md.setDisplayName("getContextClassName");
md.setShortDescription("Gets the class name of this ContextClassEntry");
mds.addElement(md);
}
//
// getPrefixName
//
paramTypes = new Class[0];
paramDescriptors = new ParameterDescriptor[0];
paramIndex = 0;
m = null;
try {
m = ContextClassEntry.class.getMethod("getPrefixName", paramTypes);
}
catch (Throwable t) {
t.printStackTrace();
}
if (m != null) {
md = null;
if (paramDescriptors != null) {
md = new MethodDescriptor(m, paramDescriptors);
}
else {
md = new MethodDescriptor(m);
}
md.setName("getPrefixName");
md.setDisplayName("getPrefixName");
md.setShortDescription("Gets the prefix name of this ContextClassEntry");
mds.addElement(md);
}
//
// setContextClassName
//
paramTypes = new Class[1];
paramDescriptors = new ParameterDescriptor[1];
paramIndex = 0;
paramTypes[paramIndex] = java.lang.String.class;
pd = new ParameterDescriptor();
pd.setName("contextClassName");
pd.setDisplayName("java.lang.String");
paramDescriptors[paramIndex] = pd;
paramIndex++;
m = null;
try {
m = ContextClassEntry.class.getMethod("setContextClassName", paramTypes);
}
catch (Throwable t) {
t.printStackTrace();
}
if (m != null) {
md = null;
if (paramDescriptors != null) {
md = new MethodDescriptor(m, paramDescriptors);
}
else {
md = new MethodDescriptor(m);
}
md.setName("setContextClassName");
md.setDisplayName("setContextClassName");
md.setShortDescription("Sets the class name of this ContextClassEntry");
mds.addElement(md);
}
//
// setPrefixName
//
paramTypes = new Class[1];
paramDescriptors = new ParameterDescriptor[1];
paramIndex = 0;
paramTypes[paramIndex] = java.lang.String.class;
pd = new ParameterDescriptor();
pd.setName("prefixName");
pd.setDisplayName("java.lang.String");
paramDescriptors[paramIndex] = pd;
paramIndex++;
m = null;
try {
m = ContextClassEntry.class.getMethod("setPrefixName", paramTypes);
}
catch (Throwable t) {
t.printStackTrace();
}
if (m != null) {
md = null;
if (paramDescriptors != null) {
md = new MethodDescriptor(m, paramDescriptors);
}
else {
md = new MethodDescriptor(m);
}
md.setName("setPrefixName");
md.setDisplayName("setPrefixName");
md.setShortDescription("Sets the prefix name of this ContextClassEntry");
mds.addElement(md);
}
//
// toString
//
paramTypes = new Class[0];
paramDescriptors = new ParameterDescriptor[0];
paramIndex = 0;
m = null;
try {
m = ContextClassEntry.class.getMethod("toString", paramTypes);
}
catch (Throwable t) {
t.printStackTrace();
}
if (m != null) {
md = null;
if (paramDescriptors != null) {
md = new MethodDescriptor(m, paramDescriptors);
}
else {
md = new MethodDescriptor(m);
}
md.setName("toString");
md.setDisplayName("toString");
md.setShortDescription("Returns the class name of this ContextClassEntry");
mds.addElement(md);
}
MethodDescriptor[] methodDescriptors =
new MethodDescriptor[mds.size()];
mds.copyInto(methodDescriptors);
return methodDescriptors;
}
// Create the property descriptor objects for the bean.
private PropertyDescriptor[] createPropertyDescriptors() {
PropertyDescriptor[] propertyDescriptors = new PropertyDescriptor[2];
PropertyDescriptor pd = null;
int propertyIndex = 0;
pd = null;
try {
pd = new PropertyDescriptor("contextClassName", ContextClassEntry.class, "getContextClassName", "setContextClassName");
}
catch (Throwable t) {
t.printStackTrace();
}
if (pd != null) {
pd.setDisplayName("contextClassName");
pd.setShortDescription("The class name of this ContextClassEntry");
propertyDescriptors[propertyIndex] = pd;
propertyIndex++;
}
pd = null;
try {
pd = new PropertyDescriptor("prefixName", ContextClassEntry.class, "getPrefixName", "setPrefixName");
}
catch (Throwable t) {
t.printStackTrace();
}
if (pd != null) {
pd.setDisplayName("prefixName");
pd.setShortDescription("The prefix name of this ContextClassEntry");
propertyDescriptors[propertyIndex] = pd;
propertyIndex++;
}
if (propertyDescriptors.length == 0) {
propertyDescriptors = null;
}
return propertyDescriptors;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy