org.polliwog.fields
Class RefererHeaderField

java.lang.Object
  extended by org.polliwog.fields.AbstractField
      extended by org.polliwog.fields.AbstractURIField
          extended by org.polliwog.fields.RefererHeaderField

public class RefererHeaderField
extends AbstractURIField

A field that represents a website "referer". A referer is basically a fully-qualified URL. In certain circumstances a referer is a "-", this is generally used by search engines.

 Last Modified By: $Author: barrygently $
 Last Modified On: $Date: 2005/07/04 14:00:02 $
 Current Revision: $Revision: 1.3 $
 


Field Summary
static int FIELD_ID
          This is a unique constant for this field, it MUST NOT clash with any other field constant value otherwise incorrect casting may result.
 
Fields inherited from class org.polliwog.fields.AbstractURIField
uri
 
Constructor Summary
RefererHeaderField()
           
 
Method Summary
 void clear()
          Clear the data that the field holds.
 int getFieldId()
          Should return a unique id for this field, this is to help with classes (such as: Hit) that use this id to help in identification.
 java.lang.String getPath()
          Get the "path" of the URL, in general this is either the value (if it's not a valid URL) or the path of the URL returned from URI.getPath.
 java.lang.String getPathExtension()
          Get the "file extension" of the URL.
 java.net.URI getURI()
          Get the URI.
 void init(java.util.Map params, java.lang.String value)
          Init the field with the referer value.
 
Methods inherited from class org.polliwog.fields.AbstractURIField
getParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIELD_ID

public static final int FIELD_ID
This is a unique constant for this field, it MUST NOT clash with any other field constant value otherwise incorrect casting may result.

See Also:
Constant Field Values
Constructor Detail

RefererHeaderField

public RefererHeaderField()
Method Detail

clear

public void clear()
Description copied from class: AbstractField
Clear the data that the field holds.

Specified by:
clear in class AbstractField

getPath

public java.lang.String getPath()
Get the "path" of the URL, in general this is either the value (if it's not a valid URL) or the path of the URL returned from URI.getPath.

Overrides:
getPath in class AbstractURIField
Returns:
The path of the referer or the value if it's not a valid URL.

getURI

public java.net.URI getURI()
Get the URI.

Overrides:
getURI in class AbstractURIField
Returns:
The uri of the referer or null if the URL is invalid.

getPathExtension

public java.lang.String getPathExtension()
Get the "file extension" of the URL. If the uri is null (not valid) then just entire referer is returned, otherwise the last "." is searched for and everything returned after that. If there is no "." then null is returned.

Overrides:
getPathExtension in class AbstractURIField
Returns:
The file extension as described above.

init

public void init(java.util.Map params,
                 java.lang.String value)
Init the field with the referer value.

Specified by:
init in class AbstractField
Parameters:
params - Init parms, not used here.
value - The referer value.

getFieldId

public int getFieldId()
Description copied from class: AbstractField
Should return a unique id for this field, this is to help with classes (such as: Hit) that use this id to help in identification.

Specified by:
getFieldId in class AbstractField
Returns:
A unique id.


  Copyright © 2007 Gary Bentley. All Rights Reserved.