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>
-
-
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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Client
parse(String agentString)
Device
parseDevice(String agentString)
OS
parseOS(String agentString)
UserAgent
parseUserAgent(String agentString)
-
-
-
Constructor Detail
-
Parser
public Parser() throws IOException
Creates a parser using the regular expression yaml file bundled in the jar.- Throws:
IOException
- 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
-
-