Enum ObjectPolicyType

  • All Implemented Interfaces:
    Serializable, Comparable<ObjectPolicyType>

    public enum ObjectPolicyType
    extends Enum<ObjectPolicyType>
    Enumeration of supported object policy types. A object policy type is an implementation on how to manage parameters in the query string that wants to modify objects in page. They are usually on the form of 'Space.PageClass_0_prop. In the default implementation of XWiki, these parameters will initialize values of properties of existing object (see 'UPDATE'). The second implementation, called 'UDPATE_OR_CREATE' will also create objects if they don't exist. For example, let's take a page that contains one object Space.PageClass. Given the following parameters:
    • Space.PageClass_0_prop=abc
    • Space.PageClass_1_prop=def
    • Space.PageClass_2_prop=ghi
    • Space.PageClass_6_prop=jkl
    The object number 0 will have it's property initialized with 'abc'. The objects number 1 and 2 will be created and respectively initialized with 'def' and 'ghi'. The final parameter will be ignored since the number doesn't refer to a following number.
    $Id: 6f304bb83bcf96f2e817254670ca9bd237e12a2a $
    • Enum Constant Detail


        public static final ObjectPolicyType UPDATE_OR_CREATE
        Update and/or create objects.
    • Method Detail

      • values

        public static ObjectPolicyType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ObjectPolicyType c : ObjectPolicyType.values())
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ObjectPolicyType valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        name - the name of the enum constant to be returned.
        the enum constant with the specified name
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getName

        public String getName()
        The string name corresponding to the object policy type.
      • forName

        public static ObjectPolicyType forName​(String name)
        name - The string name corresponding to the object policy type.
        The ObjectPolicyType corresponding to the parameter 'name'.