Class PropertyClass

    • Constructor Detail

      • PropertyClass

        public PropertyClass​(PropertyClass property,
                             XWikiContext context)
        Default API constructor that creates a wrapper for a PropertyClass, given a context.
        Parameters:
        property - the property definition to wrap
        context - the current request context
    • Method Detail

      • getBasePropertyClass

        protected PropertyClass getBasePropertyClass()
        Internal access to the wrapped PropertyClass.
        Returns:
        the wrapped property definition
      • getClassType

        public String getClassType()
        Each type of XClass property is identified by a string that specifies the data type of the property value (e.g. 'String', 'Number', 'Date') without disclosing implementation details. The internal implementation of an XClass property type can change over time but its 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().

        Returns:
        an identifier for the data type of the property value (e.g. 'String', 'Number', 'Date')
      • getType

        public String getType()
        Get the actual type of the wrapped 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.
        Returns:
        the type of this property definition
        See Also:
        if you need the implementation hint of this property
      • getClassName

        public String getClassName()
        Get the name of the XClass (Object Definition) this property definition belongs to. For example, XWiki.XWikiUsers or Blog.BlogPostClass.
        Returns:
        the name of the owner XClass
      • getPropertyClass

        @Programming
        public PropertyClass getPropertyClass()
        Provides access to the wrapped PropertyClass if Programming Rights are present.
        Returns:
        the wrapped property definition
      • getPrettyName

        public String getPrettyName()
        Get the untranslated user-friendly name of this property. For example, User type instead of the internal usertype.
        Overrides:
        getPrettyName in class Collection
        Returns:
        the configured pretty name of this property definition
        See Also:
        returns the actual property name
      • getTranslatedPrettyName

        public String getTranslatedPrettyName()
        Get the translated user-friendly name of this property.
        Returns:
        the configured pretty name of this property definition
        See Also:
        returns the actual property name
      • getHint

        public String getHint()
        Get the translated hint string that should be displayed for input fields for instances of this property definition.
        Returns:
        the hint string
        Since:
        9.11RC1
      • getTooltip

        public String getTooltip()
        Get a tooltip string that should be displayed for input fields for instances of this property definition.
        Returns:
        A raw tooltip string. The value does not escape special HTML characters, so the caller should manually escape quotes if the tooltip should be used as a value for the HTML title attribute.
      • isDisabled

        public boolean isDisabled()
        See if this property is disabled or not. A disabled property should not be editable, but existing object values are still kept in the database.
        Returns:
        true if this property is disabled and should not be used, false otherwise
        Since:
        2.4M2
      • compareTo

        public int compareTo​(PropertyClass other)
        Compares two property definitions based on their index number.
        Specified by:
        compareTo in interface Comparable<PropertyClass>
        Parameters:
        other - the other property definition to be compared with
        Returns:
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Since:
        2.4M2
        See Also:
        Collection.getNumber()