com.simonstl.fragment
Class FragmentRules
java.lang.Object
|
+--com.simonstl.fragment.FragmentRules
- public class FragmentRules
- extends java.lang.Object
This class stores a set of rules in a HashMap. The namespaceURI and localName
are combined to provide a key value. This may eventually be extended to support
attribute possibilities.
Version 0.06 cleans up methods that required an Element
when
the current approach prefers DocComponent
. This will lead
to rules for processing attribute values as well as element content.
Version 0.05 adds support for print() and toString().
Version 0.04 now returns DocComponent
objects more effectively, uses the cleanDuplicate()
method to ensure that object reuse doesn't mar results. It also checks to see that their results (content results, anyway, not yet attributes) are processed, permitting recursive processing.
Version 0.03 is moving toward a fully encapsulated version where it is possible to determine
if a rule exists and where DocComponents come in and leave.
Version 0.02 moved some of the logic for key generation to the Element class.
Making that logic work more smoothly will require changes to isRule() and getRule(),
as well as the FragmentFilter
class.
- Version:
- 0.06 5 July 2001
- Author:
- Simon St.Laurent
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
FragmentRules
public FragmentRules()
addRule
public void addRule(DocComponent newComponent,
FragmentRule rule)
isRule
public boolean isRule(java.lang.String nsURI,
java.lang.String localName,
org.xml.sax.Attributes atts)
isRule
public boolean isRule(java.lang.String nsURI,
java.lang.String localName)
isRule
public boolean isRule(DocComponent component)
removeRule
public void removeRule(DocComponent newComponent)
getRule
public FragmentRule getRule(java.lang.String nsURI,
java.lang.String localName)
setMatchAttributes
public void setMatchAttributes(boolean _matchAttributes)
getMatchAttributes
public boolean getMatchAttributes()
processComponent
public void processComponent(DocComponent targetComponent)
setMatchLevel
public void setMatchLevel(int level)
print
public void print()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object