|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap
java.util.HashMap
com.sun.portal.search.soif.SOIF
SOIF (Summary Object Interchange Format) is a general purpose syntax and data structure for representing meta data. It is commonly used to create summaries, or Resource Descriptions, for storage, indexing, and transmission purposes.
A SOIF object has a standard serialized form, for example:
@DOCUMENT { http://www.siroe.com content-type{29}: text/html; charset=iso-8859-1 title{16}: Siroe Consulting author-1{14}: William Lawson author-2{16}: Gregory Blaxland author-3{17}: William Wentworth description{245}: Siroe Consulting - Business & Industry Solutions - Downloads - Documentation - Developers - Partners - Executives - Press Company Info - Investor Relations - News & Events - Feature Stories - Employment - Siroe Labs Copyright 1994-2002 Siroe Consulting }
Each SOIF object has a schema (eg, DOCUMENT) and URL.
SOIF attribute values can be plain text or binary.
Multivalued attributes are supported.
The standard SOIF serialized form uses UTF-8 encoding
for all character based data.
SOIF attribute names are case-insensitive.
More information on SOIF and the RDM search protocol can be found at http://www.w3.org/TR/NOTE-rdm.html
AVPair
,
Serialized FormField Summary | |
static java.lang.String |
defaultEncoding
Default char encoding. |
static java.lang.String |
INVALIDSOIF
Error message for invalid SOIF. |
Constructor Summary | |
SOIF()
Constructor. |
|
SOIF(byte[] data)
Constructor. |
|
SOIF(byte[] data,
java.util.Set allowed)
Constructor. |
|
SOIF(byte[] data,
java.lang.String encoding)
Constructor. |
|
SOIF(byte[] data,
java.lang.String encoding,
java.util.Set allowed)
Constructor. |
|
SOIF(java.lang.String schemaName,
java.lang.String URL)
Constructor. |
Method Summary | |
void |
absorb(SOIF s)
Copies all data from another SOIF without replacement. |
void |
absorb(SOIF s,
java.lang.String[] filter)
Copies selected data from another SOIF without replacement Ignores case of all attribute names. |
boolean |
contains(java.lang.String a)
Tests for attribute existence. |
boolean |
containsKey(java.lang.Object key)
Case insensistive collection function. |
int |
contentSize()
|
java.lang.Object |
get(java.lang.Object key)
Case insensistive collection function. |
int |
getAttributeCount()
|
java.util.Set |
getAttributes()
|
java.lang.String[] |
getAttributesArray()
|
AVPair |
getAVPair(java.lang.String a)
Gets an AVPair by attribute. |
byte[] |
getBytes(java.lang.String a)
Gets a byte array value by attribute. |
byte[] |
getBytes(java.lang.String a,
int n)
Gets a byte array value by multivalue attribute and index. |
java.lang.String |
getSchemaName()
|
java.lang.String |
getURL()
|
java.lang.String |
getValue(java.lang.String a)
Gets a String value by attribute. |
java.lang.String |
getValue(java.lang.String a,
int n)
Gets a String value by multivalue attribute and index. |
boolean |
insert(AVPair a)
Inserts an AVPair, which may be either single or multivalued. |
boolean |
insert(java.lang.String a,
byte[] b)
Inserts a byte array valued attribute. |
boolean |
insert(java.lang.String a,
byte[] b,
int n)
Inserts a String valued attribute with index. |
boolean |
insert(java.lang.String a,
java.lang.String v)
Inserts a String valued attribute. |
boolean |
insert(java.lang.String a,
java.lang.String v,
int n)
Inserts a String valued attribute with index. |
void |
merge(SOIF s)
Copies all data from another SOIF with replacement. |
void |
merge(SOIF s,
java.lang.String[] filter)
Copies selected data from another SOIF with replacement. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Case insensistive collection function. |
java.lang.Object |
remove(java.lang.Object key)
Case insensistive collection function. |
boolean |
remove(java.lang.String a)
Removes an attribute. |
boolean |
remove(java.lang.String a,
int n)
Removes an attribute by index. |
boolean |
rename(java.lang.String a,
java.lang.String b)
Renames attribute a to b. |
void |
replace(AVPair avp)
Replaces an attribute-value pair by name. |
void |
replace(java.lang.String a,
java.lang.String v)
Replaces a single-valued attribute. |
void |
replace(java.lang.String a,
java.lang.String v,
int n)
Replaces a multivalued attribute by index. |
void |
setSchemaName(java.lang.String s)
Sets the SOIF schema name. |
void |
setURL(java.lang.String u)
Sets the SOIF URL. |
void |
squeezeMV()
Squeezes multivalued attributes. |
byte[] |
toByteArray()
Creates a byte array representation of this SOIF. |
byte[] |
toByteArray(java.util.Set allowed)
Creates a byte array representation of this SOIF. |
byte[] |
toByteArray(java.lang.String enc)
Creates a byte array representation of this SOIF. |
byte[] |
toByteArray(java.lang.String enc,
java.util.Set allowed)
Creates a byte array representation of this SOIF. |
java.lang.String |
toString()
*WARNING*: This should be used for debugging only. |
Methods inherited from class java.util.HashMap |
clear, clone, containsValue, entrySet, isEmpty, keySet, putAll, size, values |
Methods inherited from class java.util.AbstractMap |
equals, hashCode |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
Field Detail |
public static java.lang.String defaultEncoding
public static java.lang.String INVALIDSOIF
Constructor Detail |
public SOIF()
public SOIF(java.lang.String schemaName, java.lang.String URL)
schemaName
- the SOIF schema nameURL
- the SOIF URLpublic SOIF(byte[] data, java.lang.String encoding, java.util.Set allowed) throws java.io.IOException
data
- a byte array SOIF representationencoding
- character encoding for byte/String conversionallowed
- a restricted attribute set for the conversion (use lower case)
SOIFException
- on parsing error
java.io.IOException
- if byte array is emptypublic SOIF(byte[] data, java.lang.String encoding) throws java.io.IOException
data
- a byte array SOIF representationencoding
- character encoding for byte/String conversion
SOIFException
- on parsing error
java.io.IOException
- if byte array is emptypublic SOIF(byte[] data, java.util.Set allowed) throws java.io.IOException
data
- a byte array SOIF representationallowed
- a restricted attribute set for the conversion (use lower case)
SOIFException
- if parsing error
java.io.IOException
- if byte array is emptypublic SOIF(byte[] data) throws java.io.IOException
data
- a byte array SOIF representation
SOIFException
- if parsing error
java.io.IOException
- if byte array is emptyMethod Detail |
public java.lang.String getSchemaName()
public void setSchemaName(java.lang.String s)
public java.lang.String getURL()
public void setURL(java.lang.String u)
public java.lang.String getValue(java.lang.String a)
a
- the attribute namepublic byte[] getBytes(java.lang.String a)
a
- the attribute namepublic java.lang.String getValue(java.lang.String a, int n)
a
- the attribute namen
- the indexpublic byte[] getBytes(java.lang.String a, int n)
a
- the attribute namen
- the indexpublic AVPair getAVPair(java.lang.String a)
a
- the attribute namepublic boolean contains(java.lang.String a)
a
- the attribute name
public boolean insert(java.lang.String a, java.lang.String v)
a
- the attribute namev
- the String value to insert
public boolean insert(java.lang.String a, byte[] b)
a
- the attribute nameb
- the byte array value to insert
public boolean insert(java.lang.String a, java.lang.String v, int n)
a
- the attribute namev
- the String value to insertn
- the multivalue index position for this value
public boolean insert(java.lang.String a, byte[] b, int n)
a
- the attribute nameb
- the byte array value to insertn
- the multivalue index position for this value
public boolean insert(AVPair a)
a
- the AVPair to insert
public void replace(java.lang.String a, java.lang.String v)
a
- the attibute namev
- the attribute valuepublic void replace(java.lang.String a, java.lang.String v, int n)
a
- the attibute namev
- the attribute valuen
- the multivalued index position to replacepublic void replace(AVPair avp)
avp
- the attibute-value pairpublic boolean remove(java.lang.String a)
a
- the attibute name
public boolean remove(java.lang.String a, int n)
public boolean rename(java.lang.String a, java.lang.String b)
public void merge(SOIF s)
public void merge(SOIF s, java.lang.String[] filter)
public void absorb(SOIF s)
public void absorb(SOIF s, java.lang.String[] filter)
public void squeezeMV()
public java.util.Set getAttributes()
public java.lang.String[] getAttributesArray()
public int getAttributeCount()
public int contentSize()
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
public java.lang.Object get(java.lang.Object key)
public java.lang.Object remove(java.lang.Object key)
public boolean containsKey(java.lang.Object key)
public byte[] toByteArray() throws java.io.IOException
java.io.UnsupportedEncodingException
java.io.IOException
public byte[] toByteArray(java.util.Set allowed) throws java.io.IOException
allowed
- a restricted attribute set for the conversion (use lower case)
java.io.UnsupportedEncodingException
java.io.IOException
public byte[] toByteArray(java.lang.String enc) throws java.io.IOException
enc
- character encoding for String/byte conversion
java.io.UnsupportedEncodingException
java.io.IOException
SOIFInputStream.readSOIF()
,
SOIFOutputStream.write(SOIF s)
public byte[] toByteArray(java.lang.String enc, java.util.Set allowed) throws java.io.IOException
enc
- character encoding for String/byte conversionallowed
- a restricted attribute set for the conversion (use lower case)
java.io.IOException
SOIFInputStream.readSOIF()
,
SOIFOutputStream.write(SOIF s)
public java.lang.String toString()
toByteArray()
,
SOIFInputStream.readSOIF()
,
SOIFOutputStream.write(SOIF s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |