Package ua_parser
Class Parser
- java.lang.Object
-
- ua_parser.Parser
-
- Direct Known Subclasses:
CachingParser
public class Parser extends Object
Java implementation of UA Parser- Author:
- Steve Jiang (@sjiang) <gh at iamsteve com>
-
-
Field Summary
Fields Modifier and Type Field Description static intCODE_POINT_LIMIT
-
Constructor Summary
Constructors Constructor Description Parser()Creates a parser using the regular expression yaml file bundled in the jar.Parser(InputStream regexYaml)Creates a parser using the supplied regular expression yaml file.Parser(InputStream regexYaml, org.yaml.snakeyaml.LoaderOptions loaderOptions)Creates a parser using the supplied regular expression yaml file.Parser(org.yaml.snakeyaml.LoaderOptions loaderOptions)Creates a parser using the regular expression yaml file bundled in the jar.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.yaml.snakeyaml.LoaderOptionsgetDefaultLoaderOptions()Clientparse(String agentString)DeviceparseDevice(String agentString)OSparseOS(String agentString)UserAgentparseUserAgent(String agentString)
-
-
-
Field Detail
-
CODE_POINT_LIMIT
public static final int CODE_POINT_LIMIT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Parser
public Parser()
Creates a parser using the regular expression yaml file bundled in the jar.- Throws:
RuntimeException- if there's a problem reading the file from the classpath
-
Parser
public Parser(org.yaml.snakeyaml.LoaderOptions loaderOptions)
Creates a parser using the regular expression yaml file bundled in the jar.- Parameters:
loaderOptions- configuration for loading parser safe limits.- Throws:
RuntimeException- if there's a problem reading the file from the classpath.
-
Parser
public Parser(InputStream regexYaml)
Creates a parser using the supplied regular expression yaml file. It is the responsibility of the caller to close the InputStream after construction.- Parameters:
regexYaml- the yaml file containing the regular expressions
-
Parser
public Parser(InputStream regexYaml, org.yaml.snakeyaml.LoaderOptions loaderOptions)
Creates a parser using the supplied regular expression yaml file. It is the responsibility of the caller to close the InputStream after construction.- Parameters:
regexYaml- the yaml file containing the regular expressionsloaderOptions- configuration for loading parser safe limits.
-
-