org.gcube.contentmanagement.gcubedocumentlibrary.projections
Class Projections

java.lang.Object
  extended by org.gcube.contentmanagement.gcubedocumentlibrary.projections.Projections

public class Projections
extends java.lang.Object

A set of facilities to construct and manipulate Projections.

Author:
Fabio Simeoni (University of Strathclyde)

Field Summary
static PropertyTypes.DocumentProperty ALTERNATIVE
           
static PropertyTypes.DocumentProperty ANNOTATION
           
static PropertyTypes.CommonProperty BYTESTREAM
           
static PropertyTypes.CommonProperty BYTESTREAM_URI
           
static PropertyTypes.CommonProperty CREATION_TIME
           
static PropertyTypes.CommonProperty LANGUAGE
           
static PropertyTypes.CommonProperty LAST_UPDATE
           
static PropertyTypes.CommonProperty LENGTH
           
static PropertyTypes.DocumentProperty METADATA
           
static PropertyTypes.CommonProperty MIME_TYPE
           
static PropertyTypes.CommonProperty NAME
           
static PropertyTypes.PartProperty ORDER
           
static PropertyTypes.DocumentProperty PART
           
static PropertyTypes.AnnotationProperty PREVIOUS
           
static PropertyTypes.CommonProperty PROPERTY
           
static PropertyTypes.ElementProperty PROPERTY_TYPE
           
static PropertyTypes.ElementProperty PROPERTY_VALUE
           
static PropertyTypes.CommonProperty SCHEMA_NAME
           
static PropertyTypes.CommonProperty SCHEMA_URI
           
static PropertyTypes.CommonProperty TYPE
           
 
Constructor Summary
Projections()
           
 
Method Summary
static AlternativeProjection alternative()
          Creates an AlternativeProjection.
static AnnotationProjection annotation()
          Creates an AnnotationProjection.
static DocumentProjection document()
          Creates a DocumentProjection.
static MetadataProjection metadata()
          Creates a MetadataProjection.
static
<P extends Property>
P
opt(P prop)
          Makes the default constraint on a Property optional.
static
<P extends Property>
P
opt(P prop, Predicate p)
          Returns a Property with a optional constraint.
static
<P extends Property>
P
opt(P prop, Projection<?,?> p)
          Returns a Property with a optional constraint.
static PartProjection part()
          Creates a PartProjection.
static PropertyProjection property()
          Creates a PropertyProjection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final PropertyTypes.CommonProperty NAME

TYPE

public static final PropertyTypes.CommonProperty TYPE

CREATION_TIME

public static final PropertyTypes.CommonProperty CREATION_TIME

BYTESTREAM

public static final PropertyTypes.CommonProperty BYTESTREAM

BYTESTREAM_URI

public static final PropertyTypes.CommonProperty BYTESTREAM_URI

LAST_UPDATE

public static final PropertyTypes.CommonProperty LAST_UPDATE

MIME_TYPE

public static final PropertyTypes.CommonProperty MIME_TYPE

LENGTH

public static final PropertyTypes.CommonProperty LENGTH

LANGUAGE

public static final PropertyTypes.CommonProperty LANGUAGE

PROPERTY

public static final PropertyTypes.CommonProperty PROPERTY

SCHEMA_URI

public static final PropertyTypes.CommonProperty SCHEMA_URI

SCHEMA_NAME

public static final PropertyTypes.CommonProperty SCHEMA_NAME

PROPERTY_TYPE

public static final PropertyTypes.ElementProperty PROPERTY_TYPE

PROPERTY_VALUE

public static final PropertyTypes.ElementProperty PROPERTY_VALUE

METADATA

public static final PropertyTypes.DocumentProperty METADATA

ANNOTATION

public static final PropertyTypes.DocumentProperty ANNOTATION

PART

public static final PropertyTypes.DocumentProperty PART

ALTERNATIVE

public static final PropertyTypes.DocumentProperty ALTERNATIVE

PREVIOUS

public static final PropertyTypes.AnnotationProperty PREVIOUS

ORDER

public static final PropertyTypes.PartProperty ORDER
Constructor Detail

Projections

public Projections()
Method Detail

document

public static DocumentProjection document()
Creates a DocumentProjection.

Returns:
the DocumentProjection.

metadata

public static MetadataProjection metadata()
Creates a MetadataProjection.

Returns:
the MetadataProjection.

annotation

public static AnnotationProjection annotation()
Creates an AnnotationProjection.

Returns:
the AnnotationProjection.

alternative

public static AlternativeProjection alternative()
Creates an AlternativeProjection.

Returns:
the AlternativeProjection.

part

public static PartProjection part()
Creates a PartProjection.

Returns:
the PartProjection.

property

public static PropertyProjection property()
Creates a PropertyProjection.

Returns:
the PropertyProjection.

opt

public static <P extends Property> P opt(P prop)
Makes the default constraint on a Property optional.

Type Parameters:
P - the type of the property.
Parameters:
prop - the property.
Returns:
a copy of the property with an optional constraint.

opt

public static <P extends Property> P opt(P prop,
                                         Projection<?,?> p)
Returns a Property with a optional constraint.

Type Parameters:
P - the type of the property.
Parameters:
prop - the property.
p - the constraint.
Returns:
a copy of the property with an optional constraint.

opt

public static <P extends Property> P opt(P prop,
                                         Predicate p)
Returns a Property with a optional constraint.

Type Parameters:
P - the type of the property.
Parameters:
prop - the property.
p - the constraint.
Returns:
a copy of the property with an optional constraint.