|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Property
implements the
interface and defines behavior for a property of a Java class.
These properties have modifiers, types, and names, as well
as a value.
Binding
Field Summary | |
static int |
ACCESS_PRIVATE
Access Modifier: private |
static int |
ACCESS_PROTECTED
Access Modifier: private |
static int |
ACCESS_PUBLIC
Access Modifier: public |
Method Summary | |
int |
getAccessModifier()
This will return the access level modifier for a property. |
java.lang.String |
getAccessModifierString()
This will return the Java String representation
of this Property 's access modifier. |
java.lang.Object |
getDefaultValue()
This will retrieve the default value associated with this property, or null if there is not one. |
void |
setAccessModifier(int accessModifier)
This will set the access level modifier for a property. |
void |
setDefaultValue(java.lang.Object defaultValue)
This will set the default value of the property. |
Methods inherited from interface org.enhydra.zeus.Binding |
getJavaType, getName, setJavaType, setName |
Field Detail |
public static final int ACCESS_PRIVATE
private
public static final int ACCESS_PROTECTED
private
public static final int ACCESS_PUBLIC
public
Method Detail |
public void setAccessModifier(int accessModifier)
This will set the access level modifier for a property. The
value submitted must be in the form of an int
,
which should correspond to one of the constants defined
(
,
ACCESS_PRIVATE
,
or ACCESS_PROTECTED
. By default,
all properties will be ACCESS_PUBLIC
private
(ACCESS_PRIVATE
).
modifier
- int
constant for access level.ACCESS_PRIVATE
,
ACCESS_PROTECTED
,
ACCESS_PUBLIC
public int getAccessModifier()
This will return the access level modifier for a property. The
value returned will be in the form of an int
,
which will correspond to one of the constants defined
(
,
ACCESS_PRIVATE
,
or ACCESS_PROTECTED
.
ACCESS_PUBLIC
int
- constant for access level modifier.ACCESS_PRIVATE
,
ACCESS_PROTECTED
,
ACCESS_PUBLIC
public java.lang.String getAccessModifierString()
This will return the Java String
representation
of this Property
's access modifier. For
example,
would be
converted to "private".
ACCESS_PRIVATE
String
- Java representationACCESS_PRIVATE
,
ACCESS_PROTECTED
,
ACCESS_PUBLIC
public void setDefaultValue(java.lang.Object defaultValue)
This will set the default value of the property. Since no typing
is available at this point, a simple Java Object
is allowed as the type supplied. As a result, any errors in
mismatches between object type and allowed paramater type will
occur at runtime, when class generation takes place. Supplying
a value here essentially results in:
public class Foo {
private String myString = "some default value";
public String getMyString() {
return myString;
}
public void setMyString(String myString) {
this.myString = myString;
}
// Other methods and properties
}
Also, note that data binding users who supply their own class implementations will LOSE THIS DEFAULT VALUE, as the interface alone cannot specify a default value. So use this carefully!
defaultValue
- Object
to be used as default value.public java.lang.Object getDefaultValue()
This will retrieve the default value associated with this property,
or null
if there is not one. For more information on
default property values, see
.
setDefaultValue(Object)
Object
- default value of the property.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |