public class TypeFactory extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.log4j.Logger |
logger |
| Constructor and Description |
|---|
TypeFactory() |
| Modifier and Type | Method and Description |
|---|---|
static AccessRule |
buildAccessRule(String subjectString,
Permission permission) |
static AccessRule |
buildAccessRule(String subjectString,
Permission[] permissions) |
static ObjectFormatIdentifier |
buildFormatIdentifier(String value)
Factory method for creating an ObjectFormatIdentifier.
|
static Identifier |
buildIdentifier(String value)
Factory method for creating an Identifier.
|
static SystemMetadata |
buildMinimalSystemMetadata(Identifier id,
InputStream data,
String checksumAlgorithm,
ObjectFormatIdentifier formatId,
Subject submitterRightsHolder)
Builds a minimal and 'typical' SystemMetadata object containing all of the required fields needed
for submission to DataONE at time of create.
|
static NodeReference |
buildNodeReference(String value)
Factory method for creating a NodeReference.
|
static Subject |
buildSubject(String value)
Factory method for creating a Subject.
|
static <T> T |
clone(Object original)
Clone via marshalling and unmarshalling using the TypeMarshaller to ensure
a DEEP copy and no shared object references.
|
static ObjectFormatIdentifier |
cloneFormatIdentifier(ObjectFormatIdentifier orig)
Factory method for cloning an ObjectFormatIdentifier from another, such that they
do not share any references for mutable properties.
|
static Identifier |
cloneIdentifier(Identifier orig)
Factory method for cloning an Identifier from another, such that they
do not share any references for mutable properties.
|
static NodeReference |
cloneNodeReference(NodeReference orig)
Factory method for cloning a NodeReference from another, such that they
do not share any references for mutable properties.
|
static Subject |
cloneSubject(Subject orig)
Factory method for cloning a Subject from another, such that they
do not share any references for mutable properties.
|
public static ObjectFormatIdentifier buildFormatIdentifier(String value)
value - - a String containing at least one non-whitespace characterpublic static Identifier buildIdentifier(String value)
value - - a String containing at least one non-whitespace characterpublic static NodeReference buildNodeReference(String value)
value - - a String containing at least one non-whitespace characterpublic static Subject buildSubject(String value)
value - - a String containing at least one non-whitespace characterpublic static ObjectFormatIdentifier cloneFormatIdentifier(ObjectFormatIdentifier orig)
orig - public static Identifier cloneIdentifier(Identifier orig)
orig - public static NodeReference cloneNodeReference(NodeReference orig)
orig - public static Subject cloneSubject(Subject orig)
orig - ValidationExceptionpublic static <T> T clone(Object original) throws MarshallingException, IOException, InstantiationException, IllegalAccessException
Called using: TypeFactory.
original - MarshallingExceptionIOExceptionInstantiationExceptionIllegalAccessExceptionpublic static AccessRule buildAccessRule(String subjectString, Permission permission)
public static AccessRule buildAccessRule(String subjectString, Permission[] permissions)
public static SystemMetadata buildMinimalSystemMetadata(Identifier id, InputStream data, String checksumAlgorithm, ObjectFormatIdentifier formatId, Subject submitterRightsHolder) throws NoSuchAlgorithmException, IOException, NotFound, ServiceFailure
id - data - checksumAlgorithm - - if null, defaults to "MD5"formatId - - this method does not validate whether the formatId is supportedsubmitterRightsHolder - - uses this Subject as values for both of the propertiesNoSuchAlgorithmExceptionIOExceptionNotFoundServiceFailureCopyright © 2018. All Rights Reserved.