Package eu.clarin.sru.client.fcs
Class ClarinFCSEndpointDescriptionParser
- java.lang.Object
-
- eu.clarin.sru.client.fcs.ClarinFCSEndpointDescriptionParser
-
- All Implemented Interfaces:
SRUExtraResponseDataParser
public class ClarinFCSEndpointDescriptionParser extends Object implements SRUExtraResponseDataParser
An extra response data parser for parsing CLARIN-FCS endpoint descriptions.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MAX_DEPTHconstant for default parsing resource enumeration parsing depthstatic booleanDEFAULT_PARSING_STREAMINGconstant for default parsing method (event based streaming, or in-memory XML DOM)static intINFINITE_MAX_DEPTHconstant for infinite resource enumeration parsing depth
-
Constructor Summary
Constructors Constructor Description ClarinFCSEndpointDescriptionParser()Constructor.ClarinFCSEndpointDescriptionParser(boolean streaming)Constructor.ClarinFCSEndpointDescriptionParser(int maxDepth)Constructor.ClarinFCSEndpointDescriptionParser(int maxDepth, boolean streaming)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetMaximumResourceParsingDepth()Get the maximum resource enumeration parsing depth.SRUExtraResponseDataparse(XMLStreamReader reader)booleansupports(QName name)
-
-
-
Field Detail
-
INFINITE_MAX_DEPTH
public static final int INFINITE_MAX_DEPTH
constant for infinite resource enumeration parsing depth- See Also:
- Constant Field Values
-
DEFAULT_MAX_DEPTH
public static final int DEFAULT_MAX_DEPTH
constant for default parsing resource enumeration parsing depth- See Also:
- Constant Field Values
-
DEFAULT_PARSING_STREAMING
public static final boolean DEFAULT_PARSING_STREAMING
constant for default parsing method (event based streaming, or in-memory XML DOM)- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ClarinFCSEndpointDescriptionParser
public ClarinFCSEndpointDescriptionParser()
Constructor. By default, the parser will parse the endpoint resource enumeration to an infinite depth. It will also parse the XML using an in-memory DOM with XPaths.
-
ClarinFCSEndpointDescriptionParser
public ClarinFCSEndpointDescriptionParser(int maxDepth)
Constructor. By default, the parser will use in-memory DOM with XPaths.- Parameters:
maxDepth- maximum depth for parsing the endpoint resource enumeration.- Throws:
IllegalArgumentException- if an argument is illegal
-
ClarinFCSEndpointDescriptionParser
public ClarinFCSEndpointDescriptionParser(boolean streaming)
Constructor. By default, the parser will parse the endpoint resource enumeration to an infinite depth.- Parameters:
streaming- parse SRU extra response data in streaming manner instead of in-memory DOM using XPaths.- Throws:
IllegalArgumentException- if an argument is illegal
-
ClarinFCSEndpointDescriptionParser
public ClarinFCSEndpointDescriptionParser(int maxDepth, boolean streaming)Constructor.- Parameters:
maxDepth- maximum depth for parsing the endpoint resource enumeration.streaming- parse SRU extra response data in streaming manner instead of in-memory DOM using XPaths.- Throws:
IllegalArgumentException- if an argument is illegal
-
-
Method Detail
-
supports
public boolean supports(QName name)
- Specified by:
supportsin interfaceSRUExtraResponseDataParser
-
parse
public SRUExtraResponseData parse(XMLStreamReader reader) throws XMLStreamException, SRUClientException
- Specified by:
parsein interfaceSRUExtraResponseDataParser- Throws:
XMLStreamExceptionSRUClientException
-
getMaximumResourceParsingDepth
public int getMaximumResourceParsingDepth()
Get the maximum resource enumeration parsing depth. The first level is indicate by the value0.- Returns:
- the default resource parsing depth or
-1for infinite.
-
-