|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.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 FormInner classes inherited from class java.util.Map |
Map.Entry |
Field Summary | |
static String |
defaultEncoding
Default char encoding. |
static String |
INVALIDSOIF
Error message for invalid SOIF. |
Constructor Summary | |
SOIF()
Constructor. |
|
SOIF(byte[] data)
Constructor. |
|
SOIF(byte[] data,
Set allowed)
Constructor. |
|
SOIF(byte[] data,
String encoding)
Constructor. |
|
SOIF(byte[] data,
String encoding,
Set allowed)
Constructor. |
|
SOIF(String schemaName,
String URL)
Constructor. |
Method Summary | |
void |
absorb(SOIF s)
Copies all data from another SOIF without replacement. |
void |
absorb(SOIF s,
String[] filter)
Copies selected data from another SOIF without replacement Ignores case of all attribute names. |
boolean |
contains(String a)
Tests for attribute existence. |
boolean |
containsKey(Object key)
Case insensistive collection function. |
int |
contentSize()
|
Object |
get(Object key)
Case insensistive collection function. |
int |
getAttributeCount()
|
Set |
getAttributes()
|
String[] |
getAttributesArray()
|
AVPair |
getAVPair(String a)
Gets an AVPair by attribute. |
byte[] |
getBytes(String a)
Gets a byte array value by attribute. |
byte[] |
getBytes(String a,
int n)
Gets a byte array value by multivalue attribute and index. |
String |
getSchemaName()
|
String |
getURL()
|
String |
getValue(String a)
Gets a String value by attribute. |
String |
getValue(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(String a,
byte[] b)
Inserts a byte array valued attribute. |
boolean |
insert(String a,
byte[] b,
int n)
Inserts a String valued attribute with index. |
boolean |
insert(String a,
String v)
Inserts a String valued attribute. |
boolean |
insert(String a,
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,
String[] filter)
Copies selected data from another SOIF with replacement. |
Object |
put(Object key,
Object value)
Case insensistive collection function. |
Object |
remove(Object key)
Case insensistive collection function. |
boolean |
remove(String a)
Removes an attribute. |
boolean |
remove(String a,
int n)
Removes an attribute by index. |
boolean |
rename(String a,
String b)
Renames attribute a to b. |
void |
replace(AVPair avp)
Replaces an attribute-value pair by name. |
void |
replace(String a,
String v)
Replaces a single-valued attribute. |
void |
replace(String a,
String v,
int n)
Replaces a multivalued attribute by index. |
void |
setSchemaName(String s)
Sets the SOIF schema name. |
void |
setURL(String u)
Sets the SOIF URL. |
void |
squeezeMV()
Squeezes multivalued attributes. |
byte[] |
toByteArray()
Creates a byte array representation of this SOIF. |
byte[] |
toByteArray(Set allowed)
Creates a byte array representation of this SOIF. |
byte[] |
toByteArray(String enc)
Creates a byte array representation of this SOIF. |
byte[] |
toByteArray(String enc,
Set allowed)
Creates a byte array representation of this SOIF. |
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 |
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
Field Detail |
public static String defaultEncoding
public static String INVALIDSOIF
Constructor Detail |
public SOIF()
public SOIF(String schemaName, String URL)
schemaName
- the SOIF schema nameURL
- the SOIF URLpublic SOIF(byte[] data, String encoding, Set allowed) throws 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 errorIOException
- if byte array is emptypublic SOIF(byte[] data, String encoding) throws IOException
data
- a byte array SOIF representationencoding
- character encoding for byte/String conversionSOIFException
- on parsing errorIOException
- if byte array is emptypublic SOIF(byte[] data, Set allowed) throws IOException
data
- a byte array SOIF representationallowed
- a restricted attribute set for the conversion (use lower case)SOIFException
- if parsing errorIOException
- if byte array is emptypublic SOIF(byte[] data) throws IOException
data
- a byte array SOIF representationSOIFException
- if parsing errorIOException
- if byte array is emptyMethod Detail |
public String getSchemaName()
public void setSchemaName(String s)
public String getURL()
public void setURL(String u)
public String getValue(String a)
a
- the attribute namepublic byte[] getBytes(String a)
a
- the attribute namepublic String getValue(String a, int n)
a
- the attribute namen
- the indexpublic byte[] getBytes(String a, int n)
a
- the attribute namen
- the indexpublic AVPair getAVPair(String a)
a
- the attribute namepublic boolean contains(String a)
a
- the attribute namepublic boolean insert(String a, String v)
a
- the attribute namev
- the String value to insertpublic boolean insert(String a, byte[] b)
a
- the attribute nameb
- the byte array value to insertpublic boolean insert(String a, String v, int n)
a
- the attribute namev
- the String value to insertn
- the multivalue index position for this valuepublic boolean insert(String a, byte[] b, int n)
a
- the attribute nameb
- the byte array value to insertn
- the multivalue index position for this valuepublic boolean insert(AVPair a)
a
- the AVPair to insertpublic void replace(String a, String v)
a
- the attibute namev
- the attribute values
- the attributepublic void replace(String a, 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(String a)
a
- the attibute namepublic boolean remove(String a, int n)
public boolean rename(String a, String b)
public void merge(SOIF s)
public void merge(SOIF s, String[] filter)
public void absorb(SOIF s)
public void absorb(SOIF s, String[] filter)
public void squeezeMV()
public Set getAttributes()
public String[] getAttributesArray()
public int getAttributeCount()
public int contentSize()
public Object put(Object key, Object value)
put
in class HashMap
public Object get(Object key)
get
in class HashMap
public Object remove(Object key)
remove
in class HashMap
public boolean containsKey(Object key)
containsKey
in class HashMap
public byte[] toByteArray() throws IOException
UnsupportedEncodingException
- IOException
- public byte[] toByteArray(Set allowed) throws IOException
allowed
- a restricted attribute set for the conversion (use lower case)UnsupportedEncodingException
- IOException
- public byte[] toByteArray(String enc) throws IOException
enc
- character encoding for String/byte conversionUnsupportedEncodingException
- IOException
- SOIFInputStream.readSOIF()
,
SOIFOutputStream.write(SOIF s)
public byte[] toByteArray(String enc, Set allowed) throws IOException
enc
- character encoding for String/byte conversionallowed
- a restricted attribute set for the conversion (use lower case)IOException
- SOIFInputStream.readSOIF()
,
SOIFOutputStream.write(SOIF s)
public String toString()
toString
in class AbstractMap
toByteArray()
,
SOIFInputStream.readSOIF()
,
SOIFOutputStream.write(SOIF s)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |