public class BundleJSON
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
BUNDLE_EXTENSION |
static java.lang.String |
JSON_PROPERTY_FORMAT |
static java.lang.String |
JSON_PROPERTY_PATH |
static java.lang.String |
JSON_PROPERTY_PRIMARY |
static java.lang.String |
JSON_PROPERTY_SCHEMA_NAME |
static java.lang.String |
JSON_PROPERTY_SCHEMA_VERSION |
static java.lang.String |
JSON_SCHEMA_NAME |
static java.lang.String |
JSON_SCHEMA_VERSION |
| Constructor and Description |
|---|
BundleJSON() |
| Modifier and Type | Method and Description |
|---|---|
static Bundle |
toBundle(java.lang.String jsonString)
Create a Bundle from jsonString.
|
static <T extends IOPath> |
toBundle(java.lang.String jsonString,
java.util.function.Function<java.lang.String,T> ioPathConstructor)
Create a Bundle from jsonString using a custom class that implements
IOPath for all resources. |
static java.lang.String |
toJSON(Bundle bundle)
Serialize this bundle to a JSON string representation.
|
public static final java.lang.String BUNDLE_EXTENSION
public static final java.lang.String JSON_PROPERTY_SCHEMA_NAME
public static final java.lang.String JSON_PROPERTY_SCHEMA_VERSION
public static final java.lang.String JSON_PROPERTY_PRIMARY
public static final java.lang.String JSON_PROPERTY_PATH
public static final java.lang.String JSON_PROPERTY_FORMAT
public static final java.lang.String JSON_SCHEMA_NAME
public static final java.lang.String JSON_SCHEMA_VERSION
public static java.lang.String toJSON(Bundle bundle)
IOPathResources for serialization to succeed. Stream resources cannot be serialized.bundle - the Bundle to serialize to JSONjava.lang.IllegalArgumentException - if any resource in bundle is not an IOPathResources.public static Bundle toBundle(java.lang.String jsonString)
jsonString - a valid JSON string conforming to the bundle schemaBundle created from jsonStringpublic static <T extends IOPath> Bundle toBundle(java.lang.String jsonString, java.util.function.Function<java.lang.String,T> ioPathConstructor)
IOPath for all resources.T - the IOPath-derived type to use for IOPathResourcesjsonString - a valid JSON string conforming to the bundle schemaioPathConstructor - a function that takes a string and returns an IOPath-derived class of type Bundle