dochelper
Class URLRecord

java.lang.Object
  extended by dochelper.URLRecord
All Implemented Interfaces:
Record

public class URLRecord
extends java.lang.Object
implements Record


Field Summary
protected  java.util.HashMap<java.lang.String,java.lang.String> _params
          The parameters associated to this URLRecord.
(package private) static org.apache.http.client.HttpClient httpClient
          A Default Http Client for all instance
protected  java.lang.String name
          Name of this record.
protected  java.net.URI url
          String that contains the URL represented by this record.
protected  java.lang.String value
          The HTML souce fetched from the URL.
 
Constructor Summary
URLRecord(java.lang.String url, java.lang.String name)
          Creates a new instance of URLRecord
 
Method Summary
 boolean equals(java.lang.Object record)
          Equals operation.
 ResultNode execute(java.util.ArrayList<DocPattern> patterns)
          Renders a record using the specified Pattern list.
 java.net.URI getURL()
           
 java.lang.String getValue()
          Return the string value of this record.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

url

protected java.net.URI url
String that contains the URL represented by this record.


value

protected java.lang.String value
The HTML souce fetched from the URL.


name

protected java.lang.String name
Name of this record.


_params

protected java.util.HashMap<java.lang.String,java.lang.String> _params
The parameters associated to this URLRecord.


httpClient

static final org.apache.http.client.HttpClient httpClient
A Default Http Client for all instance

Constructor Detail

URLRecord

public URLRecord(java.lang.String url,
                 java.lang.String name)
          throws InvalidValueException
Creates a new instance of URLRecord

Parameters:
fieldValues -
Throws:
InvalidValueException
Method Detail

execute

public ResultNode execute(java.util.ArrayList<DocPattern> patterns)
Renders a record using the specified Pattern list. This method will iterate through all patterns passed in if any, and execute the pattern passing the contents of the row this record represents.

Specified by:
execute in interface Record
Parameters:
patterns - The ArrayList of DocPatterns to search in this record.
Returns:
String containing the contents of the pattern rendering and the encapsulation.

getURL

public java.net.URI getURL()

getValue

public java.lang.String getValue()
Return the string value of this record. For URL Records this means fetching the source HTML or the page as returned by a request to the URL this Record represents.

Specified by:
getValue in interface Record
Returns:
String value of the entire record.

equals

public boolean equals(java.lang.Object record)
Equals operation. A record is deemed equal if the URL are equal.

Overrides:
equals in class java.lang.Object
Parameters:
record - The URL Record to compare to
Returns:
Whether the URLRecord may be considered equal