
org.teatrove.teaservlet.HttpContext$ParameterValuesBeanInfo Maven / Gradle / Ivy
The newest version!
/*
* HttpContext$ParameterValuesBeanInfo.java
*
* BeanDoc generated on Fri Mar 16 at 12:39:55 EDT 02012.
*
* See HttpContext.ParameterValues.java for copyright information.
*/
package org.teatrove.teaservlet;
import java.beans.*;
import java.lang.reflect.*;
import java.util.Vector;
/**
* The BeanInfo class describing HttpContext.ParameterValues.
*
* @author Reece Wilton
*/
public class HttpContext$ParameterValuesBeanInfo 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 HttpContext$ParameterValuesBeanInfo.
*/
public HttpContext$ParameterValuesBeanInfo() {
mDefaultPropertyIndex = -1;
}
/**
* Returns a BeanDescriptor that describes HttpContext.ParameterValues.
*/
public BeanDescriptor getBeanDescriptor() {
if (mBeanDescriptor == null) {
mBeanDescriptor = createBeanDescriptor();
}
return mBeanDescriptor;
}
/**
* Returns a BeanInfo array containing BeanInfo object's for:
* java.util.List
*/
public BeanInfo[] getAdditionalBeanInfo() {
if (mAdditionalBeanInfo == null) {
mAdditionalBeanInfo = createAdditionalBeanInfo();
}
return mAdditionalBeanInfo;
}
/**
* Returns MethodDescriptors that describe the methods of
* HttpContext.ParameterValues. 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
* HttpContext.ParameterValues.
*/
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(HttpContext.ParameterValues.class);
bd.setName("HttpContext.ParameterValues");
bd.setDisplayName("HttpContext.ParameterValues");
bd.setShortDescription("The ParameterValues interface provides access to the request parameter \n values.");
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;
//
// Get the BeanInfo for each interface
//
bi = null;
try {
bi = Introspector.getBeanInfo(java.util.List.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;
//
// getAsInteger
//
paramTypes = new Class[0];
paramDescriptors = new ParameterDescriptor[0];
paramIndex = 0;
m = null;
try {
m = HttpContext.ParameterValues.class.getMethod("getAsInteger", 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("getAsInteger");
md.setDisplayName("getAsInteger");
md.setShortDescription("Returns the parameter value as an Integer.");
mds.addElement(md);
}
//
// getAsString
//
paramTypes = new Class[0];
paramDescriptors = new ParameterDescriptor[0];
paramIndex = 0;
m = null;
try {
m = HttpContext.ParameterValues.class.getMethod("getAsString", 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("getAsString");
md.setDisplayName("getAsString");
md.setShortDescription("Returns the parameter value as a String.");
mds.addElement(md);
}
//
// toString
//
paramTypes = new Class[0];
paramDescriptors = new ParameterDescriptor[0];
paramIndex = 0;
m = null;
try {
m = HttpContext.ParameterValues.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");
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("asInteger", HttpContext.ParameterValues.class, "getAsInteger", null);
}
catch (Throwable t) {
t.printStackTrace();
}
if (pd != null) {
pd.setDisplayName("asInteger");
pd.setShortDescription("The parameter value as an Integer.");
propertyDescriptors[propertyIndex] = pd;
propertyIndex++;
}
pd = null;
try {
pd = new PropertyDescriptor("asString", HttpContext.ParameterValues.class, "getAsString", null);
}
catch (Throwable t) {
t.printStackTrace();
}
if (pd != null) {
pd.setDisplayName("asString");
pd.setShortDescription("The parameter value as a String.");
propertyDescriptors[propertyIndex] = pd;
propertyIndex++;
}
if (propertyDescriptors.length == 0) {
propertyDescriptors = null;
}
return propertyDescriptors;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy