FileDocCategorySizeDatePackage
CmpResource.javaAPI DocGlassfish v2 API38049Fri May 04 22:34:40 BST 2007com.sun.enterprise.tools.common.dd.ejb

CmpResource

public class CmpResource extends com.sun.enterprise.tools.common.dd.SunBaseBean
This generated bean class CmpResource matches the schema element cmp-resource Generated on Wed Aug 13 10:43:32 PDT 2003

Fields Summary
static Vector
comparators
public static final String
JNDI_NAME
public static final String
DEFAULT_RESOURCE_PRINCIPAL
public static final String
PROPERTY
public static final String
CREATE_TABLES_AT_DEPLOY
public static final String
DROP_TABLES_AT_UNDEPLOY
public static final String
DATABASE_VENDOR_NAME
public static final String
SCHEMA_GENERATOR_PROPERTIES
Constructors Summary
public CmpResource()

	// NOI18N

	  
		this(Common.USE_DEFAULT_VALUES);
	
public CmpResource(int options)

		super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
		// Properties (see root bean comments for the bean graph)
		this.createProperty("jndi-name", 	// NOI18N
			JNDI_NAME, 
			Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, 
			String.class);
		this.createProperty("default-resource-principal", 	// NOI18N
			DEFAULT_RESOURCE_PRINCIPAL, 
			Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 
			DefaultResourcePrincipal.class);
		this.createProperty("property", 	// NOI18N
			PROPERTY, 
			Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 
			PropertyElement.class);
		this.createProperty("create-tables-at-deploy", 	// NOI18N
			CREATE_TABLES_AT_DEPLOY, 
			Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 
			String.class);
		this.createProperty("drop-tables-at-undeploy", 	// NOI18N
			DROP_TABLES_AT_UNDEPLOY, 
			Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 
			String.class);
		this.createProperty("database-vendor-name", 	// NOI18N
			DATABASE_VENDOR_NAME, 
			Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 
			String.class);
		this.createProperty("schema-generator-properties", 	// NOI18N
			SCHEMA_GENERATOR_PROPERTIES, 
			Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 
			SchemaGeneratorProperties.class);
		this.initialize(options);
	
Methods Summary
public static voidaddComparator(org.netbeans.modules.schema2beans.BeanComparator c)

		comparators.add(c);
	
public intaddPropertyElement(com.sun.enterprise.tools.common.dd.ejb.PropertyElement value)

		return this.addValue(PROPERTY, value);
	
public voiddump(java.lang.StringBuffer str, java.lang.String indent)

		String s;
		Object o;
		org.netbeans.modules.schema2beans.BaseBean n;
		str.append(indent);
		str.append("JndiName");	// NOI18N
		str.append(indent+"\t");	// NOI18N
		str.append("<");	// NOI18N
		s = this.getJndiName();
		str.append((s==null?"null":s.trim()));	// NOI18N
		str.append(">\n");	// NOI18N
		this.dumpAttributes(JNDI_NAME, 0, str, indent);

		str.append(indent);
		str.append("DefaultResourcePrincipal");	// NOI18N
		n = (org.netbeans.modules.schema2beans.BaseBean) this.getDefaultResourcePrincipal();
		if (n != null)
			n.dump(str, indent + "\t");	// NOI18N
		else
			str.append(indent+"\tnull");	// NOI18N
		this.dumpAttributes(DEFAULT_RESOURCE_PRINCIPAL, 0, str, indent);

		str.append(indent);
		str.append("PropertyElement["+this.sizePropertyElement()+"]");	// NOI18N
		for(int i=0; i<this.sizePropertyElement(); i++)
		{
			str.append(indent+"\t");
			str.append("#"+i+":");
			n = (org.netbeans.modules.schema2beans.BaseBean) this.getPropertyElement(i);
			if (n != null)
				n.dump(str, indent + "\t");	// NOI18N
			else
				str.append(indent+"\tnull");	// NOI18N
			this.dumpAttributes(PROPERTY, i, str, indent);
		}

		str.append(indent);
		str.append("CreateTablesAtDeploy");	// NOI18N
		str.append(indent+"\t");	// NOI18N
		str.append("<");	// NOI18N
		s = this.getCreateTablesAtDeploy();
		str.append((s==null?"null":s.trim()));	// NOI18N
		str.append(">\n");	// NOI18N
		this.dumpAttributes(CREATE_TABLES_AT_DEPLOY, 0, str, indent);

		str.append(indent);
		str.append("DropTablesAtUndeploy");	// NOI18N
		str.append(indent+"\t");	// NOI18N
		str.append("<");	// NOI18N
		s = this.getDropTablesAtUndeploy();
		str.append((s==null?"null":s.trim()));	// NOI18N
		str.append(">\n");	// NOI18N
		this.dumpAttributes(DROP_TABLES_AT_UNDEPLOY, 0, str, indent);

		str.append(indent);
		str.append("DatabaseVendorName");	// NOI18N
		str.append(indent+"\t");	// NOI18N
		str.append("<");	// NOI18N
		s = this.getDatabaseVendorName();
		str.append((s==null?"null":s.trim()));	// NOI18N
		str.append(">\n");	// NOI18N
		this.dumpAttributes(DATABASE_VENDOR_NAME, 0, str, indent);

		str.append(indent);
		str.append("SchemaGeneratorProperties");	// NOI18N
		n = (org.netbeans.modules.schema2beans.BaseBean) this.getSchemaGeneratorProperties();
		if (n != null)
			n.dump(str, indent + "\t");	// NOI18N
		else
			str.append(indent+"\tnull");	// NOI18N
		this.dumpAttributes(SCHEMA_GENERATOR_PROPERTIES, 0, str, indent);

	
public java.lang.StringdumpBeanNode()

		StringBuffer str = new StringBuffer();
		str.append("CmpResource\n");	// NOI18N
		this.dump(str, "\n  ");	// NOI18N
		return str.toString();
	
public java.lang.StringgetCreateTablesAtDeploy()

		return (String)this.getValue(CREATE_TABLES_AT_DEPLOY);
	
public java.lang.StringgetDatabaseVendorName()

		return (String)this.getValue(DATABASE_VENDOR_NAME);
	
public com.sun.enterprise.tools.common.dd.DefaultResourcePrincipalgetDefaultResourcePrincipal()

		return (DefaultResourcePrincipal)this.getValue(DEFAULT_RESOURCE_PRINCIPAL);
	
public java.lang.StringgetDropTablesAtUndeploy()

		return (String)this.getValue(DROP_TABLES_AT_UNDEPLOY);
	
public java.lang.StringgetJndiName()

		return (String)this.getValue(JNDI_NAME);
	
public com.sun.enterprise.tools.common.dd.ejb.PropertyElement[]getPropertyElement()

		return (PropertyElement[])this.getValues(PROPERTY);
	
public com.sun.enterprise.tools.common.dd.ejb.PropertyElementgetPropertyElement(int index)

		return (PropertyElement)this.getValue(PROPERTY, index);
	
public SchemaGeneratorPropertiesgetSchemaGeneratorProperties()

		return (SchemaGeneratorProperties)this.getValue(SCHEMA_GENERATOR_PROPERTIES);
	
voidinitialize(int options)

				
	
public static voidremoveComparator(org.netbeans.modules.schema2beans.BeanComparator c)

		comparators.remove(c);
	
public intremovePropertyElement(com.sun.enterprise.tools.common.dd.ejb.PropertyElement value)

		return this.removeValue(PROPERTY, value);
	
public voidsetCreateTablesAtDeploy(java.lang.String value)

		this.setValue(CREATE_TABLES_AT_DEPLOY, value);
	
public voidsetDatabaseVendorName(java.lang.String value)

		this.setValue(DATABASE_VENDOR_NAME, value);
	
public voidsetDefaultResourcePrincipal(com.sun.enterprise.tools.common.dd.DefaultResourcePrincipal value)

		this.setValue(DEFAULT_RESOURCE_PRINCIPAL, value);
	
public voidsetDropTablesAtUndeploy(java.lang.String value)

		this.setValue(DROP_TABLES_AT_UNDEPLOY, value);
	
public voidsetJndiName(java.lang.String value)

		this.setValue(JNDI_NAME, value);
	
public voidsetPropertyElement(com.sun.enterprise.tools.common.dd.ejb.PropertyElement[] value)

		this.setValue(PROPERTY, value);
	
public voidsetPropertyElement(int index, com.sun.enterprise.tools.common.dd.ejb.PropertyElement value)

		this.setValue(PROPERTY, index, value);
	
public voidsetSchemaGeneratorProperties(SchemaGeneratorProperties value)

		this.setValue(SCHEMA_GENERATOR_PROPERTIES, value);
	
public intsizePropertyElement()

		return this.size(PROPERTY);
	
public voidvalidate()

		boolean restrictionFailure = false;
		// Validating property jndiName
		if (getJndiName() == null) {
			throw new org.netbeans.modules.schema2beans.ValidateException("getJndiName() == null", "jndiName", this);	// NOI18N
		}
		// Validating property defaultResourcePrincipal
		if (getDefaultResourcePrincipal() != null) {
			getDefaultResourcePrincipal().validate();
		}
		// Validating property propertyElement
		for (int _index = 0; _index < sizePropertyElement(); ++_index) {
			com.sun.enterprise.tools.common.dd.ejb.PropertyElement element = getPropertyElement(_index);
			if (element != null) {
				element.validate();
			}
		}
		// Validating property createTablesAtDeploy
		if (getCreateTablesAtDeploy() != null) {
		}
		// Validating property dropTablesAtUndeploy
		if (getDropTablesAtUndeploy() != null) {
		}
		// Validating property databaseVendorName
		if (getDatabaseVendorName() != null) {
		}
		// Validating property schemaGeneratorProperties
		if (getSchemaGeneratorProperties() != null) {
			getSchemaGeneratorProperties().validate();
		}