Save This Page
Home » openjdk-7 » com.sun.org.apache.xml.internal » utils » [javadoc | source]
com.sun.org.apache.xml.internal.utils
public class: SerializableLocatorImpl [javadoc | source]
java.lang.Object
   com.sun.org.apache.xml.internal.utils.SerializableLocatorImpl

All Implemented Interfaces:
    Locator, Serializable

The standard SAX implementation of LocatorImpl is not serializable, limiting its utility as "a persistent snapshot of a locator". This is a quick hack to make it so. Note that it makes more sense in many cases to set up fields to hold this data rather than pointing at another object... but that decision should be made on architectural grounds rather than serializability.

It isn't clear whether subclassing LocatorImpl and adding serialization methods makes more sense than copying it and just adding Serializable to its interface. Since it's so simple, I've taken the latter approach for now.

Field Summary
static final  long serialVersionUID     
Constructor:
 public SerializableLocatorImpl() 
 public SerializableLocatorImpl(Locator locator) 
    Copy constructor.

    Create a persistent copy of the current state of a locator. When the original locator changes, this copy will still keep the original values (and it can be used outside the scope of DocumentHandler methods).

    Parameters:
    locator - The locator to copy.
Method from com.sun.org.apache.xml.internal.utils.SerializableLocatorImpl Summary:
getColumnNumber,   getLineNumber,   getPublicId,   getSystemId,   setColumnNumber,   setLineNumber,   setPublicId,   setSystemId
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sun.org.apache.xml.internal.utils.SerializableLocatorImpl Detail:
 public int getColumnNumber() 
    Return the saved column number (1-based).
 public int getLineNumber() 
    Return the saved line number (1-based).
 public String getPublicId() 
    Return the saved public identifier.
 public String getSystemId() 
    Return the saved system identifier.
 public  void setColumnNumber(int columnNumber) 
    Set the column number for this locator (1-based).
 public  void setLineNumber(int lineNumber) 
    Set the line number for this locator (1-based).
 public  void setPublicId(String publicId) 
    Set the public identifier for this locator.
 public  void setSystemId(String systemId) 
    Set the system identifier for this locator.