Annotation Type Child


  • @Retention(RUNTIME)
    @Target(METHOD)
    public @interface Child
    Mark a JSR-170 child node. This indicates that this item should be stored as a child node. This annotation can only be used for non-primitive data types, and automatically creates a constraint limiting the type of child nodes to that specified by the annotated method's return type. This annotation can not be used in combination with @property.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean allowsSameNameSiblings
      Specifies whether this child node can have same-name siblings.
      String defaultPrimaryType
      Specifies the default primary node type that will be assigned to the child node if it is created without an explicitly specified primary node type.
      boolean mandatory
      Specifies whether the child node is mandatory.
      String name
      Specifies the name of this child node for in the repository.
      String[] requiredPrimaryTypes
      Specifies the minimum set of primary node types that the child node must have.
    • Element Detail

      • name

        String name
        Specifies the name of this child node for in the repository. Defaults to the name of the method without the prefix "set" or "get" if present, and using the same namespace as the @nodetype annotation.
        Default:
        ""
      • mandatory

        boolean mandatory
        Specifies whether the child node is mandatory. Defaults to false. If using in conjunction with multiple beware a mandatory child node can have zero values.
        Default:
        false
      • allowsSameNameSiblings

        boolean allowsSameNameSiblings
        Specifies whether this child node can have same-name siblings. In other words, whether the parent node can have more than one child node of this name. Note that this property is only meaningfull if the return type of the getter method of this annotation is a non-array (i.e., of type Node). If this is not the case (the return type is Node[]), then allowSameNameSiblings of the under water nodetype definition is automatically set to true.
        Default:
        false
      • requiredPrimaryTypes

        String[] requiredPrimaryTypes
        Specifies the minimum set of primary node types that the child node must have.
        Default:
        {"{http://www.jcp.org/jcr/nt/1.0}base"}
      • defaultPrimaryType

        String defaultPrimaryType
        Specifies the default primary node type that will be assigned to the child node if it is created without an explicitly specified primary node type.
        Default:
        "{http://www.jcp.org/jcr/nt/1.0}unstructured"