|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.sswap.http.representation.json.JsonPropertyFactory
public class JsonPropertyFactory
Builds a Property object (and its associated Value, if applicable) for an entity.
Constructor Summary | |
---|---|
JsonPropertyFactory()
|
Method Summary | |
---|---|
private static ArrayValue |
buildArrayValue(org.json.JSONArray array,
Prefixes prefixes)
|
private static LiteralValue |
buildLiteralValueFromJSONObject(org.json.JSONObject valueObject,
Property property,
Prefixes prefixes)
Builds a property value object/reads information about the property (for complex property representations like "prefix:property" : { "value" : "42" } -- since only the complex representations can set datatype and cardinality restrictions). |
static Property |
buildProperty(org.json.JSONObject enclosingObject,
java.lang.String key,
Prefixes prefixes)
Builds a Property object (and its associated Value, if applicable). |
private static Value |
buildValueFromComplexRepresentation(org.json.JSONObject valueObject,
Property property,
Prefixes prefixes)
Builds a value based on the complex form of value representation (e.g., { "value" : 42, "cardinality" : [ 0, 1 ] } or a nested entity). |
private static boolean |
containsOnlyValueDefKeywords(org.json.JSONObject valueObject)
Checks whether a JSON object contains only the keywords that are used to define a value (e.g,. |
private static LiteralValue |
createLiteralValue(java.lang.String explicitDatatype,
java.lang.String value,
Prefixes prefixes)
|
private static java.lang.String |
extractLiteralTypeFromValue(java.lang.String value,
Prefixes prefixes)
|
private static java.lang.String |
extractLiteralValueWithoutType(java.lang.String value)
|
private static void |
processCardinality(org.json.JSONObject valueObject,
Property property)
Processes cardinality restriction definition. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JsonPropertyFactory()
Method Detail |
---|
public static Property buildProperty(org.json.JSONObject enclosingObject, java.lang.String key, Prefixes prefixes) throws org.json.JSONException
enclosingObject
- the JSON object enclosing the property (i.e., the object where the key name is the URI/QName of the
property).key
- the key in the enclosingObjectprefixes
- the read namespace prefix definition (for QName expansion)
org.json.JSONException
- if a syntax error should occurprivate static ArrayValue buildArrayValue(org.json.JSONArray array, Prefixes prefixes) throws org.json.JSONException
org.json.JSONException
private static Value buildValueFromComplexRepresentation(org.json.JSONObject valueObject, Property property, Prefixes prefixes) throws org.json.JSONException
valueObject
- the JSON object containing the complex value representationproperty
- the property pointing to this valueObject (may be null, if this value is within an array).prefixes
- the prefix definition
org.json.JSONException
- if a syntax error should occurprivate static LiteralValue buildLiteralValueFromJSONObject(org.json.JSONObject valueObject, Property property, Prefixes prefixes) throws org.json.JSONException
valueObject
- the JSON object that corresponds to the complex property representation (e.g., { "value" : "42" }property
- the Property being createdprefixes
- the read namespace prefix definition (for QName expansion)
org.json.JSONException
- if a syntax error should occurprivate static void processCardinality(org.json.JSONObject valueObject, Property property) throws org.json.JSONException
valueObject
- the object containing the cardinality keywords (if any)property
- the property for which the cardinality restriction should apply
org.json.JSONException
- if a syntax error should occurprivate static boolean containsOnlyValueDefKeywords(org.json.JSONObject valueObject)
valueObject
- the object to be checked
private static LiteralValue createLiteralValue(java.lang.String explicitDatatype, java.lang.String value, Prefixes prefixes)
private static java.lang.String extractLiteralTypeFromValue(java.lang.String value, Prefixes prefixes)
private static java.lang.String extractLiteralValueWithoutType(java.lang.String value)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |