public class RepositoryJSONSerializer
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
RepositoryJSONSerializer.DOView
The DOView object loads all attributes and elements of a digital object into into a java object.
|
Constructor and Description |
---|
RepositoryJSONSerializer() |
Modifier and Type | Method and Description |
---|---|
static MemoryDigitalObject |
createDigitalObjectFromJson(java.lang.String json) |
static java.util.List<MemoryDigitalObject> |
createDigitalObjectsFromDOViews(java.util.List<RepositoryJSONSerializer.DOView> doViews) |
static java.util.List<MemoryDigitalObject> |
createDigitalObjectsFromJson(java.lang.String json) |
static java.util.List<RepositoryJSONSerializer.DOView> |
fromJSON(java.lang.String json) |
static java.util.List<RepositoryJSONSerializer.DOView> |
getDOViewsFromURL(java.lang.String url) |
static java.lang.String |
getJSONFromURL(java.lang.String url) |
static boolean |
loadDOViewIntoRepository(RepositoryJSONSerializer.DOView view,
Repository repository) |
static void |
loadDOViewsIntoRepository(java.util.List<RepositoryJSONSerializer.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<RepositoryJSONSerializer.DOView> |
readJsonStream(java.io.InputStream in) |
static java.util.List<RepositoryJSONSerializer.DOView> |
toDOViews(java.util.List<DigitalObject> objects) |
static java.util.List<RepositoryJSONSerializer.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 JSONClientProtocolException
java.io.IOException
RepositoryException
CreationException
public static java.util.List<RepositoryJSONSerializer.DOView> getDOViewsFromURL(java.lang.String url) throws java.io.IOException
java.io.IOException
public static java.lang.String getJSONFromURL(java.lang.String url) throws java.io.IOException
java.io.IOException
public static void loadDOViewsIntoRepository(java.util.List<RepositoryJSONSerializer.DOView> views, Repository repository) throws RepositoryException, CreationException
RepositoryException
CreationException
public static MemoryDigitalObject createDigitalObjectFromJson(java.lang.String json) throws RepositoryException
RepositoryException
public static java.util.List<MemoryDigitalObject> createDigitalObjectsFromJson(java.lang.String json) throws RepositoryException
RepositoryException
public static java.util.List<MemoryDigitalObject> createDigitalObjectsFromDOViews(java.util.List<RepositoryJSONSerializer.DOView> doViews) throws RepositoryException
RepositoryException
public static boolean loadJsonIntoDigitalObject(java.lang.String json, DigitalObject dobj) throws RepositoryException
RepositoryException
public static boolean loadDOViewIntoRepository(RepositoryJSONSerializer.DOView view, Repository repository) throws RepositoryException, CreationException
RepositoryException
CreationException
public 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.IOException
public static java.util.List<RepositoryJSONSerializer.DOView> readJsonStream(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static java.util.List<RepositoryJSONSerializer.DOView> toDOViews(java.util.List<DigitalObject> objects)
public static java.util.List<RepositoryJSONSerializer.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<RepositoryJSONSerializer.DOView> fromJSON(java.lang.String json)