public class Property extends BaseEntity implements Comparable<Property>
Some properties are not mandatory and may not always contain values. For example; information concerning features of a television may not be applicable to a mobile phone. The IsMandatory property should be checked before assuming a value will be returned.
Properties can return none, one or many values. The IsList property should be referred to to determine the number of values to expect. Properties where IsList is false will only return up to one value.
The property also provides other information about the intended use of the property. The Description can be used by UI developers to provide more information about the intended use of the property and it's values. The Category property can be used to group together related properties in configuration UIs.
Values are returned in the type Values which includes utility methods to easily extract strongly typed values.
For more information see http://51degrees.mobi/Support/Documentation/Java
| Modifier and Type | Class and Description |
|---|---|
static class |
Property.PropertyValueType
Enumeration of strongly typed property values which could be returned.
|
| Modifier and Type | Field and Description |
|---|---|
private String |
category |
private int |
categoryOffset |
private Component |
component |
private int |
componentIndex |
private Value |
defaultValue |
private int |
defaultValueIndex |
private String |
description |
private int |
descriptionOffset |
byte |
displayOrder
The order in which the property should appear in relation to others with
a position value set when used to create a display string for the profile
it is contained within.
|
int |
FirstMapIndex |
(package private) int |
firstValueIndex
The index of the first value related to the property.
|
boolean |
isList
True if the property might have more than one value.
|
boolean |
isMandatory
True if the property must contain values.
|
boolean |
isObsolete
True if the property is marked as obsolete and will be removed from a
future version of the data set.
|
private int |
lastValueIndex |
int |
MapCount |
private String |
name |
private int |
nameOffset |
boolean |
show
True if the property is relevant to be shown in a configuration user
interface where the property may appear in a list of options.
|
boolean |
showValues
True if the values the property returns are relevant to configuration
user interfaces and are suitable to be selected from a list of table of
options.
|
private URL |
url |
private int |
urlOffset |
private Values |
values |
Property.PropertyValueType |
valueType
The strongly type data type the property returns.
|
| Constructor and Description |
|---|
Property(Dataset dataSet,
int index,
BinaryReader reader)
Constructs a new instance of Property
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Property other)
Compares this property to another using the index field if they're in the
same list, otherwise the name field.
|
private Values |
doGetValues()
Returns the values which reference the property by starting at the first
value index and moving forward until a new property is found.
|
String |
getCategory()
The category the property relates to within the data set.
|
Component |
getComponent()
The component the property relates to.
|
Value |
getDefaultValue()
The value the property returns if a strongly type value is not available.
|
String |
getDescription()
A description of the property suitable to be displayed to end users via a
user interface.
|
String |
getName()
The name of the property.
|
URL |
getUrl()
A URL to more information about the property.
|
Values |
getValues()
An array of values the property has available.
|
void |
init()
Initialises the often used lists and references if storing of object
references is enabled.
|
String |
toString()
A string representation of the property.
|
binarySearch, getDataSet, getIndex, readIntegerArraypublic final boolean isList
public final boolean isMandatory
public final boolean showValues
public final boolean show
public final boolean isObsolete
public final byte displayOrder
final int firstValueIndex
private String name
private final int nameOffset
public final Property.PropertyValueType valueType
private Value defaultValue
private final int defaultValueIndex
private Component component
private final int componentIndex
private Values values
private String description
private final int descriptionOffset
private String category
private final int categoryOffset
private URL url
private final int urlOffset
private int lastValueIndex
public final int MapCount
public final int FirstMapIndex
public Property(Dataset dataSet, int index, BinaryReader reader) throws IOException
dataSet - index - reader - IOExceptionpublic String getName() throws IOException
IOExceptionpublic Value getDefaultValue() throws IOException
IOExceptionpublic Component getComponent() throws IOException
IOExceptionpublic Values getValues() throws IOException
IOExceptionpublic String getDescription() throws IOException
IOExceptionpublic String getCategory() throws IOException
IOExceptionpublic URL getUrl() throws IOException
IOExceptionpublic void init()
throws IOException
IOExceptionprivate Values doGetValues() throws IOException
IOExceptionpublic int compareTo(Property other)
compareTo in interface Comparable<Property>other - The property to be compared against