cz.mallat.uasparser
Class UASparser

java.lang.Object
  extended by cz.mallat.uasparser.UASparser
Direct Known Subclasses:
OnlineUpdateUASparser

public class UASparser
extends Object

User agent parser.

Author:
oli

Constructor Summary
protected UASparser()
          Constructor for inherented classes
  UASparser(InputStream inputStreamToDefinitionFile)
          Use the given inputstream to load the definition file from the local filesystem
  UASparser(String localDefinitionFilename)
          Use the given filename to load the definition file from the local filesystem
 
Method Summary
protected  void checkDataMaps()
          When a class inherents from this class, it probably has to override this method
protected  void createInternalDataStructre(List<Section> sectionList)
          Creates the internal data structes from the seciontList
protected  void loadDataFromFile(File definitionFile)
          loads the data file and creates all internal data structs
protected  void loadDataFromFile(InputStream is)
          loads the data file and creates all internal data structs
 UserAgentInfo parse(String useragent)
          Parse the given user agent string and returns a UserAgentInfo object with the related data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UASparser

public UASparser(String localDefinitionFilename)
          throws IOException
Use the given filename to load the definition file from the local filesystem

Parameters:
localDefinitionFilename -
Throws:
IOException

UASparser

public UASparser(InputStream inputStreamToDefinitionFile)
          throws IOException
Use the given inputstream to load the definition file from the local filesystem

Parameters:
inputStreamToDefinitionFile -
Throws:
IOException

UASparser

protected UASparser()
Constructor for inherented classes

Method Detail

checkDataMaps

protected void checkDataMaps()
                      throws IOException
When a class inherents from this class, it probably has to override this method

Throws:
IOException

parse

public UserAgentInfo parse(String useragent)
                    throws IOException
Parse the given user agent string and returns a UserAgentInfo object with the related data

Parameters:
useragent -
Returns:
Throws:
IOException - may happen when the retrieval of the data file fails

loadDataFromFile

protected void loadDataFromFile(File definitionFile)
                         throws IOException
loads the data file and creates all internal data structs

Parameters:
definitionFile -
Throws:
IOException

loadDataFromFile

protected void loadDataFromFile(InputStream is)
                         throws IOException
loads the data file and creates all internal data structs

Parameters:
is -
Throws:
IOException

createInternalDataStructre

protected void createInternalDataStructre(List<Section> sectionList)
Creates the internal data structes from the seciontList

Parameters:
sectionList -


Copyright © 2011. All Rights Reserved.