org.apache.batik.dom.svg
Class AbstractSVGItem

java.lang.Object
  extended by org.apache.batik.dom.svg.AbstractSVGItem
All Implemented Interfaces:
SVGItem
Direct Known Subclasses:
AbstractSVGPathSegList.SVGPathSegItem, AbstractSVGPointList.SVGPointItem

public abstract class AbstractSVGItem
extends Object
implements SVGItem

Adapter for the SVGItem interface.


Field Summary
protected  String itemStringValue
          String representation of the item.
protected  AbstractSVGList parent
          List the item belongs to.
 
Constructor Summary
protected AbstractSVGItem()
          Creates a new AbstractSVGList.
 
Method Summary
 AbstractSVGList getParent()
          Returns the parent list of this item.
protected abstract  String getStringValue()
          Return the string representation of the item.
 String getValueAsString()
          Returns the cached representation of the item if valid, otherwise recomputes the String representation of the item.
protected  void resetAttribute()
          Notifies the parent list that the item has changed.
 void setParent(AbstractSVGList list)
          Assigns a parent list to this item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected AbstractSVGList parent
List the item belongs to.


itemStringValue

protected String itemStringValue
String representation of the item. This is a cached representation of the item while it is not changed.

Constructor Detail

AbstractSVGItem

protected AbstractSVGItem()
Creates a new AbstractSVGList.

Method Detail

getStringValue

protected abstract String getStringValue()
Return the string representation of the item.


setParent

public void setParent(AbstractSVGList list)
Assigns a parent list to this item.

Specified by:
setParent in interface SVGItem
Parameters:
list - The list the item belongs.

getParent

public AbstractSVGList getParent()
Returns the parent list of this item.

Specified by:
getParent in interface SVGItem
Returns:
list the item belongs to. This could be if the item belongs to no list.

resetAttribute

protected void resetAttribute()
Notifies the parent list that the item has changed. This discards the cached representation of the item.


getValueAsString

public String getValueAsString()
Returns the cached representation of the item if valid, otherwise recomputes the String representation of the item.

Specified by:
getValueAsString in interface SVGItem
Returns:
textual representation of the item to be inserted in the attribute value representing the list.


Copyright © 2008 Apache Software Foundation. All Rights Reserved.