org.htmlparser.parserapplications.filterbuilder
public abstract class Filter extends JComponent implements NodeFilter
Field Summary | |
---|---|
protected static Hashtable | mWrappers
Map from cilter class to wrapper.
|
Constructor Summary | |
---|---|
Filter()
Create a filter.
|
Method Summary | |
---|---|
static String | deconstitute(Filter[] filters)
Returns a string serialization of the filters. |
static byte[] | deserialize(String string)
Convert a sequence of hexadecimal characters back into a byte array. |
abstract String | getDescription()
Get the name of the filter. |
protected static SubFilterList | getEnclosed(Component component)
Get the enclosed sub filter list if any.
|
Icon | getIcon()
Get the icon for the filter.
|
abstract String | getIconSpec()
Get the resource name for the icon. |
abstract NodeFilter | getNodeFilter()
Get the underlying node filter object. |
abstract NodeFilter[] | getSubNodeFilters()
Get the underlying node filter's subordinate filters. |
static Filter | instantiate(String class_name)
Create a new filter from the class name. |
static void | newline(StringBuffer out)
Append a newline to the buffer. |
static byte[] | pickle(Object object)
Serialize an object to a byte array. |
static Filter[] | reconstitute(String string, Parser context)
Returns the filters represented by the string. |
static String | serialize(byte[] data)
Serialize a byte array to a String.
|
void | setExpanded(boolean expanded)
Set the expanded state for the component.
|
abstract void | setNodeFilter(NodeFilter filter, Parser context)
Assign the underlying node filter for this wrapper. |
void | setSelected(boolean selected)
Set the 'selected look' for the component. |
abstract void | setSubNodeFilters(NodeFilter[] filters)
Assign the underlying node filter's subordinate filters. |
static void | spaces(StringBuffer out, int count)
Append count spaces to the buffer. |
abstract String | toJavaCode(StringBuffer out, int[] context)
Convert this filter into Java code.
|
String | toString()
Returns a string representation of this component and its values. |
static Object | unpickle(byte[] data)
Reconstitute a serialized object. |
static Filter | wrap(NodeFilter filter, Parser context)
Returns a wrapped filter. |
getDescription()
,
and an icon, returned by getIcon()
.Parameters: filters The list of filters to serialize.
Returns: A string representation of the filters.
Throws: IOException If serialization fails.
Parameters: string The string to convert (must be correct hex characters).
Returns: The bytes as an array.
Returns: A descriptive name for the filter.
Parameters: component The component that's supposedly enclosing the list.
Returns: The enclosed component or null
otherwise.
getIconSpec()
as an icon.Returns: The icon or null if it was not found.
Returns: The icon resource specification.
Returns: The node filter object suitable for serialization.
Returns: The node filter object's contained filters.
Parameters: class_name The class to instatiate.
Returns: The constructed filter object.
Parameters: out The buffer to append to.
Parameters: object The object to be pickled.
Returns: The serialized object.
Throws: IOException If the output stream complains (unlikely).
Parameters: string The string with serialized node filters. context The context from which to extract meaningful values for GUI choices (which aren't serialized).
Returns: The filters gleaned from the string.
See Also: Filter
Parameters: data The serialized object as a byte array.
Returns: The string representing the serialized object.
Parameters: expanded If true
, 'expand' this component,
otherwise 'collapse' it.
Parameters: filter The filter to wrap. context The parser to use for conditioning this filter. Some filters need contextual information to provide to the user, i.e. for tag names or attribute names or values, so the Parser context is provided.
Parameters: selected If true
, 'select' this component,
otherwise 'deselect' it.
Parameters: filters The filters to insert into the underlying node filter.
Parameters: out The buffer to append to. count The number of spaces to append.
Parameters: out The output buffer. context Three integers as follows:
Returns: The variable name to use when referencing this filter (usually "filter" + context[1]++)
Returns: A string representation of this component.
Parameters: data The pickled object.
Returns: The reconstituted object.
Throws: IOException If the input stream complains. ClassNotFoundException If the serialized object class cannot be located.
Parameters: filter A filter to be wrapped by GUI components. context The context within which to wrap the object. Some wrappers need context to set up useful choices for the user.
Returns: The filter to wrap.
HTML Parser is an open source library released under LGPL. | |