|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openanzo.serialization.SerializationUtils
public class SerializationUtils
Utility methods used to serialize and deserialize data
| Field Summary | |
|---|---|
static int |
ANY
Constant for the WILDCARD Any type |
static boolean |
BASE64_ENABLED
Should the contents of elements be encoded as Base64 |
static int |
BNODE
Constant for BLANKNode object type |
static boolean |
GZIP_ENABLED
Should contents of elements be gziped |
static int |
LIT
Constant for Literal object type |
static int |
TRANSPORT_N3
Constant for N3 serialization type |
static int |
TRANSPORT_NTRIPLE
Constant for NTriple serialization type |
static int |
TRANSPORT_RDFXML
Constant for RDFXML serialization type |
static int |
TRANSPORT_TRIX
Constant for NTriple serialization type |
static int |
TRANSPORT_TYPE
Default serialization type for system |
static int |
URI
Constant for URI object type |
| Constructor Summary | |
|---|---|
SerializationUtils()
|
|
| Method Summary | |
|---|---|
static org.openrdf.model.Value |
convertAnyToUri(org.openrdf.model.Value node)
Convert a NULL value to the ANY uri |
static org.openrdf.model.Value |
convertUriToAny(org.openrdf.model.Value node)
Convert Constants.ANY_URI to a null |
static org.openrdf.model.Value |
createValueFromData(int type,
java.lang.String nodeString,
java.lang.String dataType,
java.lang.String lang)
Create a Value object from decoded data |
static java.lang.String |
decode(java.lang.String encodedString)
Decode encoded string to decoded string |
static java.lang.String |
deserialize(javax.xml.soap.SOAPElement sourceElement)
Deserialize SOAP element to a string |
static void |
deserializeToHandler(javax.xml.soap.SOAPElement sourceElement,
IRepositoryHandler handler)
Deserialize SOAP element to an XML stream, and parse stream to IRepositoryHandler |
static java.util.Map<org.openrdf.model.URI,java.util.ArrayList<org.openrdf.model.Statement>>[] |
deserializeToIterator(javax.xml.soap.SOAPElement serializedStatements)
Deserialize SOAP element to an map of URIs and statements for those URIs |
static org.openrdf.query.TupleQueryResult |
deserializeToResultSet(javax.xml.soap.SOAPElement sourceElement)
Deserialize SOAP element to query results |
static org.openrdf.query.TupleQueryResult |
deserializeToResultSet(java.lang.String encodedData)
Deserialize encoded queryresults to a TupleQueryResult using system default encoding and system default serialization format |
static java.util.Collection<org.openrdf.model.Statement> |
deserializeToStatements(javax.xml.soap.SOAPElement statementsElement)
Deserialize SOAP element to a graph |
static java.util.Collection<org.openrdf.model.Statement> |
deserializeToStatements(java.lang.String encodedData)
Deserialize an encoded string to a graph using system default encoding and system default serialization format |
static java.io.InputStream |
deserializeToStream(javax.xml.soap.SOAPElement addElement)
Deserialize SOAP element to an input stream that can be processed by other methods |
static org.openrdf.model.Value |
deserializeToValue(org.apache.axis.message.MessageElement encodedValue)
Deserialize SOAP element to a Value |
static java.lang.String |
formatNode(org.openrdf.model.Value value)
Get the formated string version of Value |
static java.lang.String |
getDefaultFormat()
Get the default RDF format type |
static org.openrdf.rio.RDFFormat |
getDefaultFormatter()
Get the default RDF formatter |
static java.util.Set<IPrecondition> |
parsePreconditionStatements(java.util.Collection<org.openrdf.model.Statement> statements)
Parse a set of statements into the Preconditions that are encoded within |
static org.openrdf.query.TupleQueryResult |
readQueryResults(java.io.InputStream inputStream)
Read data from inputStream into a new TupleQueryResult |
static void |
readStatements(java.util.Collection<org.openrdf.model.Statement> statements,
java.io.InputStream inputStream)
Read data from reader into a set of statements |
static void |
serialize(java.util.Collection<org.openrdf.model.Statement> statements,
javax.xml.soap.SOAPElement childElement,
boolean useElementTextNode)
Serialize the contents of a graph to a SOAP element using system default encoding style |
static void |
serialize(java.io.OutputStream outputStream,
java.io.ByteArrayOutputStream sourceStream,
javax.xml.soap.SOAPElement element)
Serialize a stream to a SOAP element using system default encoding |
static java.lang.String |
serialize(java.lang.String string)
Serialize a string based on system default encoding style |
static void |
serialize(java.lang.String string,
javax.xml.soap.SOAPElement childElement,
boolean useElementTextNode)
Serialize a string to a SOAP element using system default encoding style |
static info.aduna.collections.iterators.CloseableIterator<org.openrdf.model.Statement> |
serializePreconditions(java.util.Set<IPrecondition> preconditions)
Serialize a set of IPreconditions to a set of statements |
static void |
serializeStatementsToElement(boolean additions,
org.openrdf.model.URI namedGraphUri,
java.util.Collection<org.openrdf.model.Statement> statements,
javax.xml.soap.SOAPElement childElement,
boolean useElementTextNode)
Serialize the contents of graph containing Anzo additions or deletions into a SOAP element |
static void |
serializeTransactions(ITransaction[] transactions,
javax.xml.soap.SOAPElement destinationElement)
Serialize an array of ITransactions to SOAP element |
static boolean |
serializeTransactionsStream(ITransaction[] transactions,
java.io.OutputStream stream)
Serialize an array of ITransactions to an output stream |
static void |
serializeValue(org.openrdf.model.Value[] values,
javax.xml.soap.SOAPElement encodedElement)
Serialize Value array to SOAPElement |
static void |
serializeValue(org.openrdf.model.Value value,
javax.xml.soap.SOAPElement encodedElement)
Serialize Value to SOAPElement |
static void |
setEncoding(javax.xml.soap.SOAPElement childElement)
Set the encoding style of a SOAP element to the system default encoding style |
static java.lang.String |
statementsToString(java.util.Collection<org.openrdf.model.Statement> statements)
Serialize statements to a string using system default serialization format |
static java.io.OutputStream |
wrapSerializerStream(java.io.ByteArrayOutputStream outputStream)
Wrap outputStream with GZIP stream if gzip enabled |
static void |
writeStatements(java.util.Iterator<org.openrdf.model.Statement> statements,
java.io.OutputStream outputStream)
Write contents of statements into outputStream using system default serialization |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean GZIP_ENABLED
public static final boolean BASE64_ENABLED
public static final int TRANSPORT_RDFXML
public static final int TRANSPORT_N3
public static final int TRANSPORT_NTRIPLE
public static final int TRANSPORT_TRIX
public static int TRANSPORT_TYPE
public static final int URI
public static final int BNODE
public static final int LIT
public static final int ANY
| Constructor Detail |
|---|
public SerializationUtils()
| Method Detail |
|---|
public static java.lang.String getDefaultFormat()
public static org.openrdf.rio.RDFFormat getDefaultFormatter()
public static void setEncoding(javax.xml.soap.SOAPElement childElement)
throws AnzoException
childElement -
AnzoException
public static java.lang.String serialize(java.lang.String string)
throws AnzoException
string - to serialize
AnzoException
public static void serialize(java.lang.String string,
javax.xml.soap.SOAPElement childElement,
boolean useElementTextNode)
throws AnzoException
string - String to encodechildElement - Element to which data is addeduseElementTextNode - Use a text node for element, or simply set element value
AnzoException
public static void serialize(java.util.Collection<org.openrdf.model.Statement> statements,
javax.xml.soap.SOAPElement childElement,
boolean useElementTextNode)
throws AnzoException
statements - Set of statements to serializechildElement - SOAP element to which data is addeduseElementTextNode - Use a text node for element, or simply set element value
AnzoException
public static void serializeStatementsToElement(boolean additions,
org.openrdf.model.URI namedGraphUri,
java.util.Collection<org.openrdf.model.Statement> statements,
javax.xml.soap.SOAPElement childElement,
boolean useElementTextNode)
throws AnzoException
additions - Are changes additions or deletionsnamedGraphUri - URI of NamedGraph that changes affectstatements - Set of statements to serializechildElement - SOAP element to which data is addeduseElementTextNode - Use a text node for element, or simply set element value
AnzoException
public static java.io.OutputStream wrapSerializerStream(java.io.ByteArrayOutputStream outputStream)
throws AnzoException
outputStream - to wrap
AnzoException - if there was an IO error wrapping outputStream
public static void serialize(java.io.OutputStream outputStream,
java.io.ByteArrayOutputStream sourceStream,
javax.xml.soap.SOAPElement element)
throws AnzoException
outputStream - stream to which data is writtensourceStream - source of data to writeelement - soapElement to which encoded data is added
AnzoException
public static java.util.Collection<org.openrdf.model.Statement> deserializeToStatements(java.lang.String encodedData)
throws AnzoException
encodedData - data to decode
AnzoException - if there was an encoding or IO error deserializing data
public static org.openrdf.query.TupleQueryResult deserializeToResultSet(java.lang.String encodedData)
throws AnzoException
encodedData - data to decode
AnzoException - if there was an encoding or IO error deserializing data
public static java.io.InputStream deserializeToStream(javax.xml.soap.SOAPElement addElement)
throws AnzoException
addElement - SOAP element containing data
AnzoException
public static org.openrdf.model.Value deserializeToValue(org.apache.axis.message.MessageElement encodedValue)
throws AnzoException
encodedValue - SOAP encoded Value
AnzoException
public static void serializeValue(org.openrdf.model.Value value,
javax.xml.soap.SOAPElement encodedElement)
throws AnzoException
value - Value to encodeencodedElement - element to which encoded data is added
AnzoException - if there was a SOAPException encoding value
public static void serializeValue(org.openrdf.model.Value[] values,
javax.xml.soap.SOAPElement encodedElement)
throws AnzoException
values - Value array to encodeencodedElement - element to which encoded data is added
AnzoException - if there was a SOAPException encoding value
public static java.lang.String decode(java.lang.String encodedString)
throws AnzoException
encodedString -
AnzoException - if there was an Encoding error decoding string
public static java.lang.String deserialize(javax.xml.soap.SOAPElement sourceElement)
throws AnzoException
sourceElement -
AnzoException - if there was an Encoding error decoding string
public static java.util.Collection<org.openrdf.model.Statement> deserializeToStatements(javax.xml.soap.SOAPElement statementsElement)
throws AnzoException
statementsElement - serialized statements to deserialize
AnzoException - if there was an error deserializing data
public static org.openrdf.query.TupleQueryResult deserializeToResultSet(javax.xml.soap.SOAPElement sourceElement)
throws AnzoException
sourceElement - source of serialized data
AnzoException - if there was an error deserializing data
public static java.util.Map<org.openrdf.model.URI,java.util.ArrayList<org.openrdf.model.Statement>>[] deserializeToIterator(javax.xml.soap.SOAPElement serializedStatements)
throws AnzoException
serializedStatements - source element containing serialized statements
AnzoException - if there was an error deserializing data
public static void deserializeToHandler(javax.xml.soap.SOAPElement sourceElement,
IRepositoryHandler handler)
throws AnzoException
sourceElement - source element containing serialized XML update datahandler - used to handle parsed data
AnzoException - if there was an error deserializing or handling data
public static void serializeTransactions(ITransaction[] transactions,
javax.xml.soap.SOAPElement destinationElement)
throws AnzoException
transactions - array of transaction to serializedestinationElement - element to which serialized data is written
AnzoException - if there was an error serializing datapublic static info.aduna.collections.iterators.CloseableIterator<org.openrdf.model.Statement> serializePreconditions(java.util.Set<IPrecondition> preconditions)
preconditions - to serialize
public static java.util.Set<IPrecondition> parsePreconditionStatements(java.util.Collection<org.openrdf.model.Statement> statements)
statements - containing data for preconditions
public static boolean serializeTransactionsStream(ITransaction[] transactions,
java.io.OutputStream stream)
throws AnzoException
transactions - transaction to serializestream - to which serialize data is written
AnzoException - if there was an error serializing transactions
public static void readStatements(java.util.Collection<org.openrdf.model.Statement> statements,
java.io.InputStream inputStream)
throws AnzoException
statements - read from input streaminputStream - source of statements data
AnzoException - if there was an error reading statements from the inputstream
public static org.openrdf.query.TupleQueryResult readQueryResults(java.io.InputStream inputStream)
throws AnzoException
inputStream - containing queryResults
AnzoException - if there was an error reading query results from the inputStream
public static void writeStatements(java.util.Iterator<org.openrdf.model.Statement> statements,
java.io.OutputStream outputStream)
throws AnzoException
statements - set of statements to writeoutputStream - to which data is written
AnzoException - if there was an error writing statements to the outputStream
public static java.lang.String statementsToString(java.util.Collection<org.openrdf.model.Statement> statements)
throws AnzoException
statements - set containing statements to serialize
AnzoException - if there was an error writing statements to the stringpublic static java.lang.String formatNode(org.openrdf.model.Value value)
value - to format
public static org.openrdf.model.Value createValueFromData(int type,
java.lang.String nodeString,
java.lang.String dataType,
java.lang.String lang)
type - Type of ValuenodeString - Value string for ValuedataType - Datatype if Literallang - Lang if Literal
public static org.openrdf.model.Value convertAnyToUri(org.openrdf.model.Value node)
node - Value to convert to Constants.ANY_URI if node is NULL
public static org.openrdf.model.Value convertUriToAny(org.openrdf.model.Value node)
Constants.ANY_URI to a null
node - Value to convert to null if Constants.ANY_URI
Constants.ANY_URI
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||