public class DSField
Contains accessors for all documented DataSource properties and a general getProperty() API for retrieving your own properties for custom DataSource implementations.
Modifier and Type | Method and Description |
---|---|
java.lang.String | getBeanPropertyName() Returns property name for this field: Returns valueXPath if specified. |
java.lang.String | getForeignKey() Returns the foreign key, if set. |
java.lang.String | getIncludeFrom() Returns value for "includeFrom" property of this field if set, null otherwise |
java.lang.Long | getLength() Returns the length of this field, if specified. |
java.lang.String | getName() Returns the name of this field. |
java.lang.String | getProperty(java.lang.String property) For an XML DataSource, returns the value of the specified attribute as a string. |
java.lang.String | getTitle() Returns the title of this field, if any. |
java.lang.String | getType() Returns the type of this field. |
java.util.List | getValidators() Returns the List of Validators defined on this DSField |
java.lang.String | getValueWriteXPath() For an XML DataSource, returns the XPath expression used as alternative way to set the field value. |
java.lang.String | getValueXPath() For an XML DataSource, returns the XPath expression used to retrieve the field value. |
boolean | isAutoGenerated() Returns true if this field value is auto-generated by data base or ORM provider, false otherwise. |
boolean | isInapplicable() Returns the value of this field's "inapplicable" property (default false) |
boolean | isPrimaryKey() Returns true if this field is a primary key, false otherwise. |
boolean | isRequired() Returns true if this field is required, false otherwise. |
boolean | shouldEncodeInResponse() Returns true if this is a field of binary type that also has "encodeInResponse" set |
public java.lang.String getName()
public boolean isRequired()
public java.lang.String getType()
Valid values include (please see the client-side documentation for details of what these types mean):
public java.lang.Long getLength()
public java.lang.String getTitle()
public boolean isPrimaryKey()
public boolean isAutoGenerated()
public java.lang.String getForeignKey()
If set, declares that this field holds values that can be matched to values from another DataSource field, to create a relationship between records from different DataSources or even records within the same DataSource.
The format of the foreign key is <dataSourceId>.<fieldName>
.
public java.lang.String getValueXPath()
public java.lang.String getValueWriteXPath()
public java.lang.String getProperty(java.lang.String property)
property
- the name of the attributepublic java.util.List getValidators()
public java.lang.String getIncludeFrom()
null
otherwisepublic java.lang.String getBeanPropertyName()
valueXPath
if specified. Supports only simple XPath definitions: "property/subProperty/subSubProperty". If XPath starts with slash ('/') - it is trimmed. Replaces slashes ('/') with periods ('.').fieldName
- String
Data source filed name.String
bean property name. Can be composed of subproperties (for example: "address.zipCode").public boolean shouldEncodeInResponse()
public boolean isInapplicable()