public class Dsmlv1Reader extends Object implements SearchResultReader
Reader
and returns a SearchResult
.Modifier and Type | Field and Description |
---|---|
private static DocumentBuilderFactory |
DOC_BUILDER_FACTORY
Document builder factory.
|
private Reader |
dsmlReader
Reader to read from.
|
private SortBehavior |
sortBehavior
Sort behavior.
|
Constructor and Description |
---|
Dsmlv1Reader(Reader reader)
Creates a new dsml reader.
|
Dsmlv1Reader(Reader reader,
SortBehavior sb)
Creates a new dsml reader.
|
Modifier and Type | Method and Description |
---|---|
protected LdapAttribute |
createLdapAttribute(String name,
NodeList nodes)
Returns an ldap attribute derived from the supplied node list.
|
protected LdapEntry |
createLdapEntry(Element entryElement)
Converts the supplied DSML entry element into an ldap entry object.
|
protected SearchResult |
createSearchResult(Document doc)
Creates a search result that corresponds to the supplied DSML document.
|
protected Object |
getAttrValue(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 DocumentBuilderFactory DOC_BUILDER_FACTORY
private final Reader dsmlReader
private final SortBehavior sortBehavior
public Dsmlv1Reader(Reader reader)
reader
- to read DSML frompublic Dsmlv1Reader(Reader reader, SortBehavior sb)
reader
- to read DSML fromsb
- sort behavior of the ldap resultpublic SearchResult read() throws IOException
read
in interface SearchResultReader
IOException
- if an error occurs using the readerprotected SearchResult createSearchResult(Document doc)
doc
- DSML to parseprotected LdapEntry createLdapEntry(Element entryElement)
entryElement
- to parseprotected LdapAttribute createLdapAttribute(String name, NodeList nodes)
name
- of the ldap attributenodes
- to parseprotected Object getAttrValue(Element valueElement, boolean base64)
valueElement
- to read value frombase64
- whether to base64 decode the valueCopyright © 2003-2019 Virginia Tech. All Rights Reserved.