Package org.apache.directory.api.dsmlv2
Class Dsmlv2ResponseParser
- java.lang.Object
-
- org.apache.directory.api.dsmlv2.Dsmlv2ResponseParser
-
public class Dsmlv2ResponseParser extends Object
This class represents the DSMLv2 Parser. It can be used to parse a DSMLv2 Response input.- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description Dsmlv2ResponseParser(LdapApiService codec)Creates a new instance of Dsmlv2ResponseParser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BatchResponseDsmlgetBatchResponse()Gets the Batch Response or null if the it has not been parsed yetDsmlDecorator<? extends Response>getNextResponse()Returns the next Request or null if there's no more requestvoidparse()Launches the parsing on the inputvoidparseAllResponses()Parses all the responsesvoidparseBatchResponse()Launches the parsing of the Batch Response onlyvoidsetInput(InputStream inputStream, String inputEncoding)Sets the input stream the parser is going to processvoidsetInput(String str)Sets the input string the parser is going to parsevoidsetInputFile(String fileName)Sets the input file the parser is going to parse.
-
-
-
Constructor Detail
-
Dsmlv2ResponseParser
public Dsmlv2ResponseParser(LdapApiService codec) throws XmlPullParserException
Creates a new instance of Dsmlv2ResponseParser.- Parameters:
codec- The Ldap Service to use- Throws:
XmlPullParserException- if an error occurs while the initialization of the parser
-
-
Method Detail
-
setInput
public void setInput(String str) throws XmlPullParserException
Sets the input string the parser is going to parse- Parameters:
str- the string the parser is going to parse- Throws:
XmlPullParserException- if an error occurs in the parser
-
setInputFile
public void setInputFile(String fileName) throws IOException, XmlPullParserException
Sets the input file the parser is going to parse. Default charset is used.- Parameters:
fileName- the name of the file- Throws:
IOException- if the file does not existXmlPullParserException- if an error occurs in the parser
-
setInput
public void setInput(InputStream inputStream, String inputEncoding) throws XmlPullParserException
Sets the input stream the parser is going to process- Parameters:
inputStream- contains a raw byte input stream of possibly unknown encoding (when inputEncoding is null)inputEncoding- if not null it MUST be used as encoding for inputStream- Throws:
XmlPullParserException- if an error occurs in the parser
-
parse
public void parse() throws XmlPullParserException, IOExceptionLaunches the parsing on the input- Throws:
XmlPullParserException- when an unrecoverable error occursIOException- when an IO exception occurs
-
parseBatchResponse
public void parseBatchResponse() throws XmlPullParserExceptionLaunches the parsing of the Batch Response only- Throws:
XmlPullParserException- if an error occurs in the parser
-
getBatchResponse
public BatchResponseDsml getBatchResponse()
Gets the Batch Response or null if the it has not been parsed yet- Returns:
- the Batch Response or null if the it has not been parsed yet
-
getNextResponse
public DsmlDecorator<? extends Response> getNextResponse() throws XmlPullParserException
Returns the next Request or null if there's no more request- Returns:
- the next Request or null if there's no more request
- Throws:
XmlPullParserException- when an error occurs during the parsing
-
parseAllResponses
public void parseAllResponses() throws XmlPullParserExceptionParses all the responses- Throws:
XmlPullParserException- when an error occurs during the parsing
-
-