public abstract class FedoraTypesUtils extends Object implements FedoraJcrTypes
Modifier and Type | Field and Description |
---|---|
static Predicate<javax.jcr.Node> |
isContainer
Predicate for determining whether this
Node is a Container . |
static Predicate<javax.jcr.Node> |
isExternalNode
Check if a node is externally managed.
|
static Predicate<javax.jcr.Node> |
isFedoraBinary
Predicate for determining whether this
Node is a Fedora
binary. |
static Predicate<FedoraResource> |
isFrozenNode
Predicate for determining whether this
FedoraResource has a frozen node |
static Predicate<javax.jcr.Node> |
isInternalNode
Check if a node is "internal" and should not be exposed e.g.
|
static Predicate<javax.jcr.Property> |
isInternalProperty
Check whether a property is an internal property that should be suppressed
from external output.
|
static Predicate<javax.jcr.Property> |
isInternalReferenceProperty
Check if a property is a reference property.
|
static Predicate<javax.jcr.Node> |
isNonRdfSourceDescription
Predicate for determining whether this
Node is a
NonRdfSourceDescription . |
static Predicate<javax.jcr.Property> |
isProtectedAndShouldBeHidden
Check whether a property is protected (ie, cannot be modified directly) but
is not one we've explicitly chosen to include.
|
static Predicate<javax.jcr.Node> |
isSkolemNode
Predicate for determining whether this
Node is a Fedora Skolem node. |
static String |
REFERENCE_PROPERTY_SUFFIX |
CONTENT_DIGEST, CONTENT_SIZE, EXPOSED_PROTECTED_JCR_TYPES, FCR_METADATA, FCR_VERSIONS, FEDORA_BINARY, FEDORA_CONTAINER, FEDORA_NON_RDF_SOURCE_DESCRIPTION, FEDORA_PAIRTREE, FEDORA_RESOURCE, FEDORA_SKOLEM, FEDORA_TOMBSTONE, FILENAME, FROZEN_MIXIN_TYPES, FROZEN_NODE, HAS_MIME_TYPE, JCR_CONTENT, JCR_CREATED, JCR_CREATEDBY, JCR_FROZEN_NODE, JCR_LASTMODIFIED, JCR_MIXIN_TYPES, JCR_PRIMARY_TYPE, LDP_BASIC_CONTAINER, LDP_DIRECT_CONTAINER, LDP_HAS_MEMBER_RELATION, LDP_INDIRECT_CONTAINER, LDP_INSERTED_CONTENT_RELATION, LDP_IS_MEMBER_OF_RELATION, LDP_MEMBER_RESOURCE, ROOT, VERSIONABLE
Constructor and Description |
---|
FedoraTypesUtils() |
Modifier and Type | Method and Description |
---|---|
static javax.jcr.Node |
getClosestExistingAncestor(javax.jcr.Session session,
String path)
Get the closest ancestor that current exists
|
static Optional<javax.jcr.nodetype.PropertyDefinition> |
getDefinitionForPropertyName(javax.jcr.Node node,
String propertyName)
Get the property definition information (containing type and multi-value
information)
|
static Optional<Integer> |
getPropertyType(javax.jcr.Node node,
String propertyName)
Get the JCR property type ID for a given property name.
|
static String |
getReferencePropertyName(String propertyName)
When we add certain URI properties, we also want to leave a reference node
|
static String |
getReferencePropertyOriginalName(String refPropertyName)
Given an internal reference node property, get the original name
|
static boolean |
isMultivaluedProperty(javax.jcr.Node node,
String propertyName)
Determine if a given JCR property name is single- or multi- valued.
|
static boolean |
isReferenceProperty(javax.jcr.Node node,
String propertyName)
Check if a property definition is a reference property
|
public static final String REFERENCE_PROPERTY_SUFFIX
public static Predicate<javax.jcr.Node> isContainer
Node
is a Container
.public static Predicate<javax.jcr.Node> isNonRdfSourceDescription
Node
is a
NonRdfSourceDescription
.public static Predicate<javax.jcr.Node> isFedoraBinary
Node
is a Fedora
binary.public static Predicate<FedoraResource> isFrozenNode
FedoraResource
has a frozen nodepublic static Predicate<javax.jcr.Node> isSkolemNode
Node
is a Fedora Skolem node.public static Predicate<javax.jcr.Property> isInternalReferenceProperty
public static Predicate<javax.jcr.Property> isProtectedAndShouldBeHidden
public static Predicate<javax.jcr.Property> isInternalProperty
public static Predicate<javax.jcr.Node> isInternalNode
public static Predicate<javax.jcr.Node> isExternalNode
public FedoraTypesUtils()
public static Optional<Integer> getPropertyType(javax.jcr.Node node, String propertyName) throws javax.jcr.RepositoryException
node
- the JCR node to add the property onpropertyName
- the property namejavax.jcr.RepositoryException
- if repository exception occurredpublic static boolean isMultivaluedProperty(javax.jcr.Node node, String propertyName) throws javax.jcr.RepositoryException
node
- the JCR node to checkpropertyName
- the property name (which may or may not already exist)javax.jcr.RepositoryException
- if repository exception occurredpublic static Optional<javax.jcr.nodetype.PropertyDefinition> getDefinitionForPropertyName(javax.jcr.Node node, String propertyName) throws javax.jcr.RepositoryException
node
- the node to use for inferring the property definitionpropertyName
- the property name to retrieve a definition forjavax.jcr.RepositoryException
- if repository exception occurredpublic static String getReferencePropertyName(String propertyName)
propertyName
- the property namepublic static String getReferencePropertyOriginalName(String refPropertyName)
refPropertyName
- the reference node property namepublic static boolean isReferenceProperty(javax.jcr.Node node, String propertyName) throws javax.jcr.RepositoryException
node
- the given nodepropertyName
- the property namejavax.jcr.RepositoryException
- if repository exception occurredpublic static javax.jcr.Node getClosestExistingAncestor(javax.jcr.Session session, String path) throws javax.jcr.RepositoryException
session
- the given sessionpath
- the given pathjavax.jcr.RepositoryException
- if repository exception occurredCopyright © 2013–2015 DuraSpace, Inc.. All rights reserved.