|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.planetalia.dynject.sources.StructuredContentSource
public class StructuredContentSource
Represents a property source that takes a String as a single source and a map of (name,regexp) pairs. The value of the property is considered to be the first group capture of the regular expression corresponding the property name. This source is mainly useful for screen scraping
| Constructor Summary | |
|---|---|
StructuredContentSource(java.lang.String content,
java.util.Map<java.lang.String,java.lang.String> regexps)
Creates a structured content source that uses the specified content and regexp map |
|
| Method Summary | |
|---|---|
ClassPreferences |
getPropertyClass(java.lang.String propertyName)
Returns the class preferences for a property |
java.util.Set<java.lang.String> |
getPropertyNames()
Returns the set of all existing properties at the time of invocation. |
java.lang.Object |
getValue(java.lang.String propertyName)
Provides the value of a specific property |
boolean |
propertyExists(java.lang.String propertyName)
Checks whether a specific property exists. |
void |
setValue(java.lang.String propertyName,
java.lang.String value)
Sets the value of a specific property. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StructuredContentSource(java.lang.String content,
java.util.Map<java.lang.String,java.lang.String> regexps)
content - Content from which the property values will be extractedregexps - Map associating the name of each property with a regular expression
whose first capture group captures the value of the property by using the underlying content.| Method Detail |
|---|
public java.lang.Object getValue(java.lang.String propertyName)
IValueSource
getValue in interface IValueSource<java.lang.String>propertyName - Name of the requested property. Assumed to exist.
public boolean propertyExists(java.lang.String propertyName)
IValueSource
propertyExists in interface IValueSource<java.lang.String>propertyName - Name of the requested property
public ClassPreferences getPropertyClass(java.lang.String propertyName)
IValueSource
getPropertyClass in interface IValueSource<java.lang.String>propertyName - Name of the property
public java.util.Set<java.lang.String> getPropertyNames()
IValueSource
getPropertyNames in interface IValueSource<java.lang.String>
public void setValue(java.lang.String propertyName,
java.lang.String value)
IValueSource
setValue in interface IValueSource<java.lang.String>propertyName - Name of the requested property.value - Property value.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||