Attribute.java revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* ident "%Z%%M% %I% %E% SMI"
*
* Copyright (c) 2000 by Sun Microsystems, Inc.
* All rights reserved.
*/
/*
* Copyright (C) 1996 Active Software, Inc.
* All rights reserved.
*
* @(#) Attribute.java 1.25 - last change made 07/30/96
*/
/**
* Storage for a single attribute.
*
* @version 1.25, 07/30/96
*/
/**
* Name of this attribute.
*/
/**
* The full class name of the type of the value of this attribute.
*/
/**
* The actual value of this attribute. It is of the type specified
* by the type field.
*/
/**
* The default value of this attribute. It is of the type specified
* by the type field.
*/
private Object defaultValue;
/**
* Contains description flags about the nature of this attribute.
*/
private int flags;
/**
* The constructor initializes the value for the attribute.
* The initial value of the attribute is set to be the same
* as the default value. If the default value is not a simple
* type, you
* may want to set the value again after cloning the default value,
* otherwise, directly setting internal members of the value will
* change
* the default value as well.
*/
int flags) {
// throwOnBadType is commented out for performance reasons.
// Shadow class construction is 15% faster with this
// commented out.
//
// throwOnBadType(defaultValue);
this.value = defaultValue;
this.defaultValue = defaultValue;
}
// allow null
return;
return; // FIX for 4059234
// type must pass "instance of" test (except for null)
try {
} catch (ClassNotFoundException e) {
"sunsoft.jws.visual.rt.base.Attribute.ClassNotFound", type));
}
return;
"sunsoft.jws.visual.rt.base.Attribute.IllegalAttribute",
}
return (name);
}
return (type);
}
public Object getDefaultValue() {
return (defaultValue);
}
}
public boolean isModified() {
return (defaultValue != null);
else
}
/**
* Resets the value to the default
*/
public void reset() {
}
return (value);
}
/**
* Sets the value of the attribute.
*/
// Commented out the "does new value equal old value"
// check, because:
// 1) Setting a value to "null" can cause a null pointer
// exception
// 2) Some attributes may not implement equals properly
}
public int getFlags() {
return (flags);
}
}
}
/**
* Shallow clone for this attribute. It's not a deep clone,
* only the
* references to the value and default value are cloned,
* not the actual
* values themselves.
*/
try {
}
catch (CloneNotSupportedException e) {
throw new Error(e.getMessage());
}
return (retval);
}
}