public class RepositoryJsonSerializerV2
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
RepositoryJsonSerializerV2.DOView
The DOView object loads all attributes and elements of a digital object into into a java object.
|
| Constructor and Description |
|---|
RepositoryJsonSerializerV2() |
| Modifier and Type | Method and Description |
|---|---|
static MemoryDigitalObject |
createDigitalObjectFromJson(java.lang.String json) |
static java.util.List<MemoryDigitalObject> |
createDigitalObjectsFromDOViews(java.util.List<RepositoryJsonSerializerV2.DOView> doViews) |
static java.util.List<MemoryDigitalObject> |
createDigitalObjectsFromJson(java.lang.String json) |
static java.util.List<RepositoryJsonSerializerV2.DOView> |
fromJSON(java.lang.String json) |
static java.util.List<RepositoryJsonSerializerV2.DOView> |
getDOViewsFromURL(java.lang.String url) |
static java.lang.String |
getJSONFromURL(java.lang.String url) |
static boolean |
loadDOViewIntoRepository(RepositoryJsonSerializerV2.DOView view,
Repository repository) |
static void |
loadDOViewsIntoRepository(java.util.List<RepositoryJsonSerializerV2.DOView> views,
Repository repository) |
static boolean |
loadJsonIntoDigitalObject(java.lang.String json,
DigitalObject dobj) |
static void |
loadRepositoryFromURL(Repository repository,
java.lang.String url)
Loads a Repository from a URL given that the URL returns a correctly formatted JSON string.
|
static java.util.List<RepositoryJsonSerializerV2.DOView> |
readJsonStream(java.io.InputStream in) |
static java.util.List<RepositoryJsonSerializerV2.DOView> |
toDOViews(java.util.List<DigitalObject> objects) |
static java.util.List<RepositoryJsonSerializerV2.DOView> |
toDOViews(java.util.List<DigitalObject> objects,
java.util.List<java.lang.String> elementsToInclude) |
static java.lang.String |
toJSON(DigitalObject dobj)
Given a single DigitalObject this method will return a JSON String that represents that object.
|
static java.lang.String |
toJSON(DigitalObject dobj,
java.util.List<java.lang.String> elementsToInclude)
Given a Repository this method will return a JSON String that the object in the Repository.
|
static java.lang.String |
toJSON(java.util.List<DigitalObject> objects)
Given a list of DigitalObjects this method will return a JSON String that represents those objects.
|
static java.lang.String |
toJSON(java.util.List<DigitalObject> objects,
java.util.List<java.lang.String> elementsToInclude)
Given a list of DigitalObjects this method will return a JSON String that represents those objects.
|
static java.lang.String |
toJSON(Repository repository)
Given a Repository this method will return a JSON String that represents all the object in the Repository.
|
static java.lang.String |
toJSON(Repository repository,
java.util.List<java.lang.String> elementsToInclude)
Given a Repository this method will return a JSON String that represents all the object in the Repository.
|
static void |
writeJSONStream(java.io.OutputStream out,
java.util.List<DigitalObject> objects) |
public static void loadRepositoryFromURL(Repository repository, java.lang.String url) throws java.io.IOException, RepositoryException, CreationException
repository - The Repositroy you want to load the objects into.url - The URL that will return the JSONjava.io.IOExceptionRepositoryExceptionCreationExceptionpublic static java.util.List<RepositoryJsonSerializerV2.DOView> getDOViewsFromURL(java.lang.String url) throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String getJSONFromURL(java.lang.String url)
throws java.io.IOException
java.io.IOExceptionpublic static void loadDOViewsIntoRepository(java.util.List<RepositoryJsonSerializerV2.DOView> views, Repository repository) throws RepositoryException, CreationException
RepositoryExceptionCreationExceptionpublic static MemoryDigitalObject createDigitalObjectFromJson(java.lang.String json) throws RepositoryException
RepositoryExceptionpublic static java.util.List<MemoryDigitalObject> createDigitalObjectsFromJson(java.lang.String json) throws RepositoryException
RepositoryExceptionpublic static java.util.List<MemoryDigitalObject> createDigitalObjectsFromDOViews(java.util.List<RepositoryJsonSerializerV2.DOView> doViews) throws RepositoryException
RepositoryExceptionpublic static boolean loadJsonIntoDigitalObject(java.lang.String json,
DigitalObject dobj)
throws RepositoryException
RepositoryExceptionpublic static boolean loadDOViewIntoRepository(RepositoryJsonSerializerV2.DOView view, Repository repository) throws RepositoryException, CreationException
RepositoryExceptionCreationExceptionpublic static java.lang.String toJSON(Repository repository)
repository - public static java.lang.String toJSON(Repository repository, java.util.List<java.lang.String> elementsToInclude)
repository - elementsToInclude - A list of Strings that are the names of the elements to be included in the JSONpublic static java.lang.String toJSON(DigitalObject dobj)
public static java.lang.String toJSON(DigitalObject dobj, java.util.List<java.lang.String> elementsToInclude)
elementsToInclude - A list of Strings that are the names of the elements to be included in the JSONpublic static void writeJSONStream(java.io.OutputStream out,
java.util.List<DigitalObject> objects)
throws java.io.IOException
java.io.IOExceptionpublic static java.util.List<RepositoryJsonSerializerV2.DOView> readJsonStream(java.io.InputStream in) throws java.io.IOException
java.io.IOExceptionpublic static java.util.List<RepositoryJsonSerializerV2.DOView> toDOViews(java.util.List<DigitalObject> objects)
public static java.util.List<RepositoryJsonSerializerV2.DOView> toDOViews(java.util.List<DigitalObject> objects, java.util.List<java.lang.String> elementsToInclude)
public static java.lang.String toJSON(java.util.List<DigitalObject> objects)
public static java.lang.String toJSON(java.util.List<DigitalObject> objects, java.util.List<java.lang.String> elementsToInclude)
elementsToInclude - A list of Strings that are the names of the elements to be included in the JSONpublic static java.util.List<RepositoryJsonSerializerV2.DOView> fromJSON(java.lang.String json)