public class Dsmlv1Reader extends java.lang.Object implements SearchResultReader
Reader and returns a SearchResult.| Modifier and Type | Field and Description |
|---|---|
private static javax.xml.parsers.DocumentBuilderFactory |
DOC_BUILDER_FACTORY
Document builder factory.
|
private java.io.Reader |
dsmlReader
Reader to read from.
|
private SortBehavior |
sortBehavior
Sort behavior.
|
| Constructor and Description |
|---|
Dsmlv1Reader(java.io.Reader reader)
Creates a new dsml reader.
|
Dsmlv1Reader(java.io.Reader reader,
SortBehavior sb)
Creates a new dsml reader.
|
| Modifier and Type | Method and Description |
|---|---|
protected LdapAttribute |
createLdapAttribute(java.lang.String name,
org.w3c.dom.NodeList nodes)
Returns an ldap attribute derived from the supplied node list.
|
protected LdapEntry |
createLdapEntry(org.w3c.dom.Element entryElement)
Converts the supplied DSML entry element into an ldap entry object.
|
protected SearchResult |
createSearchResult(org.w3c.dom.Document doc)
Creates a search result that corresponds to the supplied DSML document.
|
protected java.lang.Object |
getAttrValue(org.w3c.dom.Element valueElement,
boolean base64)
Returns the value of the supplied element taking into account whether the value needs to be base64 decoded.
|
SearchResult |
read()
Reads DSML data from the reader and returns a search result.
|
private static final javax.xml.parsers.DocumentBuilderFactory DOC_BUILDER_FACTORY
private final java.io.Reader dsmlReader
private final SortBehavior sortBehavior
public Dsmlv1Reader(java.io.Reader reader)
reader - to read DSML frompublic Dsmlv1Reader(java.io.Reader reader,
SortBehavior sb)
reader - to read DSML fromsb - sort behavior of the ldap resultpublic SearchResult read() throws java.io.IOException
read in interface SearchResultReaderjava.io.IOException - if an error occurs using the readerprotected SearchResult createSearchResult(org.w3c.dom.Document doc)
doc - DSML to parseprotected LdapEntry createLdapEntry(org.w3c.dom.Element entryElement)
entryElement - to parseprotected LdapAttribute createLdapAttribute(java.lang.String name, org.w3c.dom.NodeList nodes)
name - of the ldap attributenodes - to parseprotected java.lang.Object getAttrValue(org.w3c.dom.Element valueElement,
boolean base64)
valueElement - to read value frombase64 - whether to base64 decode the value