SMILA 1.0 API documentation

org.eclipse.smila.connectivity.framework.crawler.web.metadata
Class Metadata

java.lang.Object
  extended by org.eclipse.smila.connectivity.framework.crawler.web.metadata.Metadata
All Implemented Interfaces:
Crawler, HttpHeaders

public class Metadata
extends java.lang.Object
implements HttpHeaders, Crawler

A syntax tolerant and multi-valued meta data container. All the static String fields declared by this class are used as reference names for syntax correction on metadata naming.

Author:
Chris Mattmann, Jérôme Charron, Dmitry Hazin (brox IT Solutions GmbH) - updates, Sebastian Voigt (brox IT Solutions GmbH) - updates

Field Summary
static java.text.SimpleDateFormat DATE_FORMAT
          Used to format DC dates for the DATE meta data field.
static int THRESHOLD_FACTOR
          The Constant THRESHOLD_FACTOR.
 
Fields inherited from interface org.eclipse.smila.connectivity.framework.crawler.web.metadata.HttpHeaders
CONTENT_DISPOSITION, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_MD5, CONTENT_TYPE, LAST_MODIFIED, LOCATION
 
Fields inherited from interface org.eclipse.smila.connectivity.framework.crawler.web.metadata.Crawler
CHAR_ENCODING_FOR_CONVERSION, ORIGINAL_CHAR_ENCODING
 
Constructor Summary
Metadata()
          Constructs a new, empty meta data.
 
Method Summary
 void add(java.lang.String name, java.lang.String value)
          Add a meta data name/value mapping.
 boolean equals(java.lang.Object o)
          
 java.lang.String get(java.lang.String name)
          Get the value associated to a _metadata name.
static java.lang.String getNormalizedName(java.lang.String name)
          Get the normalized name of meta data attribute name.
 java.lang.String[] getValues(java.lang.String name)
          Get the values associated to a meta data name.
 int hashCode()
          
 boolean isMultiValued(java.lang.String name)
           
 java.lang.String[] names()
          Returns an array of the names contained in the meta data.
 void remove(java.lang.String name)
          Remove a meta data and all its associated values.
 void set(java.lang.String name, java.lang.String value)
          Set _metadata name/value.
 void setAll(java.util.Properties properties)
          Assigns a meta data names/values mapping from the given properties.
 int size()
          Returns the number of meta data names in this meta data.
 java.util.List<java.lang.String> toArrayList()
          Returns ArrayList representation of the meta data for further indexing.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DATE_FORMAT

public static final java.text.SimpleDateFormat DATE_FORMAT
Used to format DC dates for the DATE meta data field.


THRESHOLD_FACTOR

public static final int THRESHOLD_FACTOR
The Constant THRESHOLD_FACTOR.

See Also:
Constant Field Values
Constructor Detail

Metadata

public Metadata()
Constructs a new, empty meta data.

Method Detail

isMultiValued

public boolean isMultiValued(java.lang.String name)
Parameters:
name - Name of the meta
Returns:
boolean

names

public java.lang.String[] names()
Returns an array of the names contained in the meta data.

Returns:
String[]

get

public java.lang.String get(java.lang.String name)
Get the value associated to a _metadata name. If many values are associated to the specified name, then the first one is returned.

Parameters:
name - of the meta data.
Returns:
the value associated to the specified meta data name.

getValues

public java.lang.String[] getValues(java.lang.String name)
Get the values associated to a meta data name.

Parameters:
name - of the meta data.
Returns:
the values associated to a meta data name.

add

public void add(java.lang.String name,
                java.lang.String value)
Add a meta data name/value mapping. Add the specified value to the list of values associated to the specified meta data name.

Parameters:
name - the meta data name.
value - the meta data value.

setAll

public void setAll(java.util.Properties properties)
Assigns a meta data names/values mapping from the given properties.

Parameters:
properties - set of properties representing name/value mapping.

set

public void set(java.lang.String name,
                java.lang.String value)
Set _metadata name/value. Associate the specified value to the specified _metadata name. If some previous values were associated to this name, they are removed.

Parameters:
name - the _metadata name.
value - the _metadata value.

remove

public void remove(java.lang.String name)
Remove a meta data and all its associated values.

Parameters:
name - Name of the meta data element.

size

public int size()
Returns the number of meta data names in this meta data.

Returns:
size

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

toArrayList

public java.util.List<java.lang.String> toArrayList()
Returns ArrayList representation of the meta data for further indexing.

Returns:
ArrayList

getNormalizedName

public static java.lang.String getNormalizedName(java.lang.String name)
Get the normalized name of meta data attribute name. This method tries to find a well-known meta data name (one of the meta data names defined in this class) that matches the specified name. The matching is error tolerent. For instance, If no matching with a well-known meta data name is found, then the original name is returned.

Parameters:
name - Meta data attribute name.
Returns:
String

SMILA 1.0 API documentation