org.jcrom.annotations
Annotation Type JcrFileNode


@Retention(value=RUNTIME)
@Target(value=FIELD)
public @interface JcrFileNode

This annotation is used to mark fields that are to be mapped as JCR file nodes. It can be applied to fields whos type is a JcrFile (or extension of that), or to a java.util.List that is parameterized with a JcrFile (or extension).

Note that JCROM creates a container node for all file nodes. The file node is then created with the name retrieved via calling JcrEntity.getName() on the child object.

Author:
Olafur Gauti Gudmundsson

Optional Element Summary
 boolean lazy
          Setting this to true will turn on lazy loading for this field.
 JcrFileNode.LoadType loadType
          Determines how to read the file when JCROM maps a JCR node to an object.
 java.lang.String name
          The name of the JCR container node for the file node(s).
 

name

public abstract java.lang.String name
The name of the JCR container node for the file node(s). Defaults to the name of the field being annotated.

Returns:
the name of the JCR node storing the child that the field represents
Default:
"fieldName"

loadType

public abstract JcrFileNode.LoadType loadType
Determines how to read the file when JCROM maps a JCR node to an object. Defaults to LoadType.STREAM, but can also be set to LoadType.BYTES (in which case the content will be read into a byte array).

Returns:
a value determining how to load the File from JCR
Default:
STREAM

lazy

public abstract boolean lazy
Setting this to true will turn on lazy loading for this field. The default is false.

Returns:
whether to apply lazy loading to this field
Default:
false


Copyright © 2009. All Rights Reserved.