public class PropertyClass extends Collection implements Comparable<PropertyClass>
XProperty definition API.
A property definition is the instantiation of a PropertyMetaClass
for a particular Object definition (XClass
), that customizes a property type to suit
the needs of the class. For example, it can set the number type for a
NumberClass
, the list of possible values for a
StaticListClass
, etc.
Constructor and Description |
---|
PropertyClass(PropertyClass property,
XWikiContext context)
Default API constructor that creates a wrapper for a
PropertyClass , given a
context . |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(PropertyClass other)
Compares two property definitions based on their index number.
|
protected PropertyClass |
getBasePropertyClass()
Internal access to the wrapped
PropertyClass . |
String |
getClassName()
Get the name of the
XClass (Object Definition) this property definition belongs
to. |
String |
getClassType()
Each type of XClass property is identified by a string that specifies the data type of the property value (e.g.
|
String |
getHint()
Get the translated hint string that should be displayed for input fields for instances of this property
definition.
|
List<String> |
getListValues()
If the property is a
ListClass , returns the possible values. |
Map<String,ListItem> |
getMapValues()
If the property is a
ListClass , returns the possible values as a map internal key <-> displayed
value . |
String |
getPrettyName()
Get the untranslated user-friendly name of this property.
|
PropertyClass |
getPropertyClass()
Provides access to the wrapped
PropertyClass if Programming Rights are
present. |
ClassPropertyReference |
getReference() |
String |
getTooltip()
Get a tooltip string that should be displayed for input fields for instances of this property definition.
|
String |
getTranslatedPrettyName()
Get the translated user-friendly name of this property.
|
String |
getType()
Get the actual type of the wrapped
PropertyClass . |
String |
getValidationMessage()
Get the message that should be displayed when a value for an instance of this property definition fails the
validation.
|
String |
getValidationRegExp()
Get the regular expression used for validating a value for an instance of this property definition.
|
boolean |
isDisabled()
See if this property is disabled or not.
|
getCollection, getName, getNumber, getProperties, getProperty, getPropertyNames, getValue, getxWikiClass
getBaseElement, getDocumentReference
convert, convert, convert, convertAttachments, getAuthorizationManager, getContextualAuthorizationManager, getXWikiContext, hasAccess, hasAccessLevel, hasAdminRights, hasProgrammingRights, hasWikiAdminRights
public PropertyClass(PropertyClass property, XWikiContext context)
PropertyClass
, given a
context
.property
- the property definition to wrapcontext
- the current request contextprotected PropertyClass getBasePropertyClass()
PropertyClass
.public ClassPropertyReference getReference()
getReference
in class Element
public String getClassType()
classType
should not.
The classType
can be used as a hint to lookup various components related to this specific XClass property
type or it can be used as a property name to retrieve the meta class of this property from
XWiki.getMetaclass()
.
public String getType()
PropertyClass
. The returned value is
extracted from the class name of the runtime object representing this property definition, and denotes a
user-friendly data type name, for example StringClass
, NumberClass
or StaticListClass
.{@code getClassType()} if you need the implementation hint of this property
public String getClassName()
XClass
(Object Definition) this property definition belongs
to. For example, XWiki.XWikiUsers
or Blog.BlogPostClass
.@Programming public PropertyClass getPropertyClass()
PropertyClass
if Programming Rights are
present.public String getPrettyName()
User type
instead of the internal
usertype
.getPrettyName
in class Collection
{@code getName()} returns the actual property name
public String getTranslatedPrettyName()
{@code getName()} returns the actual property name
public String getHint()
public String getValidationMessage()
Please enter a valid IP address
.{@code getValidationRegExp()} returns the regular expression used for validating the
property value
public String getValidationRegExp()
{@code getValidationMessage()} returns the message that should be displayed in case
the validation failed
public String getTooltip()
title
attribute.public boolean isDisabled()
true
if this property is disabled and should not be used, false
otherwisepublic List<String> getListValues()
ListClass
, returns the possible values. These are the internal values (keys), and
not the user-friendly or translated values that would be displayed to the user.String
) values{@code getMapValues()} returns both the keys and their user-friendly displayed values
public Map<String,ListItem> getMapValues()
ListClass
, returns the possible values as a map internal key <-> displayed
value
.String
) values and their associated (ListItem
) displayed values{@code getListValues()} returns only the list of possible internal keys
public int compareTo(PropertyClass other)
compareTo
in interface Comparable<PropertyClass>
other
- the other property definition to be compared withCollection.getNumber()
Copyright © 2004–2021 XWiki. All rights reserved.