Class Object

    • Method Detail

      • getBaseObject

        protected BaseObject getBaseObject()
      • getXWikiObject

        public BaseObject getXWikiObject()
      • getGuid

        public String getGuid()
      • setGuid

        public void setGuid​(String guid)
      • get

        public Object get​(String name)
        Display the passed field.

        This method's name is misleading since it doesn't return the Object's property value; it"s equivalent to display(String, String) (with type equals to the context action ("view" or "edit" usually). The right method to get the field value is Collection.getValue(String).

      • display

        public Object display​(String name,
                              String mode)
        Display the property with the passed name in the context of its own document.
        Parameters:
        name - the name of the property
        mode - the edit mode in which the property should be displayed ("view", "edit", etc.)
        Returns:
        the result of the display, generally HTML
      • display

        public Object display​(String name,
                              String mode,
                              boolean isolated)
        Display the property with the passed name in the context of the current document or its own document.
        Parameters:
        name - the name of the property
        mode - the edit mode in which the property should be displayed ("view", "edit", etc.)
        isolated - true if the property should be displayed in it's own document context
        Since:
        13.0
      • set

        public void set​(String fieldname,
                        Object value)
      • getPropertyReference

        public ObjectPropertyReference getPropertyReference​(String propertyName)
        Helper method used to obtain the reference of an object property even when the object might not have the property (e.g. because it's a computed property which doesn't have a stored value so it's not saved on the object). This is a safe alternative to getProperty(propertyName).getReference() when you're not sure whether the object has the specified property or not.
        Parameters:
        propertyName - the property name
        Returns:
        the object property reference
        Since:
        12.10.11, 13.4.6, 13.10RC1
        See Also:
        XWIKI-19031: Computed fields are stored as empty string properties in the database