Package ua_parser
Class Parser
java.lang.Object
ua_parser.Parser
- Direct Known Subclasses:
CachingParser
Java implementation of UA Parser
- Author:
- Steve Jiang (@sjiang) <gh at iamsteve com>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionParser()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
Modifier and TypeMethodDescriptionstatic org.yaml.snakeyaml.LoaderOptionsparseDevice(String agentString) parseUserAgent(String agentString)
-
Field Details
-
CODE_POINT_LIMIT
public static final int CODE_POINT_LIMIT- See Also:
-
-
Constructor Details
-
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
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
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.
-
-
Method Details
-
parse
-
parseUserAgent
-
parseDevice
-
parseOS
-
getDefaultLoaderOptions
public static org.yaml.snakeyaml.LoaderOptions getDefaultLoaderOptions()
-