Package org.jvnet.jaxb2_commons.locator
Class AbstractObjectLocator
- java.lang.Object
-
- org.jvnet.jaxb2_commons.locator.AbstractObjectLocator
-
- All Implemented Interfaces:
ValidationEventLocator,Reportable,ObjectLocator
- Direct Known Subclasses:
DefaultItemObjectLocator,DefaultPropertyObjectLocator,DefaultRootObjectLocator
public abstract class AbstractObjectLocator extends Object implements ObjectLocator
Abstract base class for event locators.- Author:
- Aleksei Valikov
-
-
Field Summary
Fields Modifier and Type Field Description protected ObjectobjectObject.protected ObjectLocatorparentLocatorParent locator.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractObjectLocator(ObjectLocator parentLocator, Object object)Constructs a new validation event locator.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intgetColumnNumber()protected abstract StringgetDefaultMessage()intgetLineNumber()StringgetMessage()Returns location message.StringgetMessage(ResourceBundle bundle)Formats the message using given resource bundle.StringgetMessageCode()Returns message code.NodegetNode()ObjectgetObject()intgetOffset()ObjectLocatorgetParentLocator()Returns parent locator.ObjectLocator[]getPath()StringgetPathAsString()protected abstract StringgetStepAsString()URLgetURL()ItemObjectLocatoritem(int index, Object value)Creates a locator for the item (like list or array item) relative to this locator.PropertyObjectLocatorproperty(String name, Object value)Creates a locator for the property, relative to this locator.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jvnet.jaxb2_commons.i18n.Reportable
getMessageParameters
-
-
-
-
Field Detail
-
parentLocator
protected final ObjectLocator parentLocator
Parent locator.
-
object
protected final Object object
Object.
-
-
Constructor Detail
-
AbstractObjectLocator
protected AbstractObjectLocator(ObjectLocator parentLocator, Object object)
Constructs a new validation event locator.- Parameters:
parentLocator- parent location (may benull).object- object.
-
-
Method Detail
-
getParentLocator
public ObjectLocator getParentLocator()
Returns parent locator.- Specified by:
getParentLocatorin interfaceObjectLocator- Returns:
- Parent locator.
-
getPath
public ObjectLocator[] getPath()
- Specified by:
getPathin interfaceObjectLocator- Returns:
- Path to this locator from the root.
-
getPathAsString
public String getPathAsString()
- Specified by:
getPathAsStringin interfaceObjectLocator- Returns:
- Path to this locator in string form;
-
getStepAsString
protected abstract String getStepAsString()
-
getObject
public Object getObject()
- Specified by:
getObjectin interfaceValidationEventLocator
-
getColumnNumber
public int getColumnNumber()
- Specified by:
getColumnNumberin interfaceValidationEventLocator
-
getLineNumber
public int getLineNumber()
- Specified by:
getLineNumberin interfaceValidationEventLocator
-
getOffset
public int getOffset()
- Specified by:
getOffsetin interfaceValidationEventLocator
-
getURL
public URL getURL()
- Specified by:
getURLin interfaceValidationEventLocator
-
getNode
public Node getNode()
- Specified by:
getNodein interfaceValidationEventLocator
-
getMessageCode
public String getMessageCode()
Returns message code.- Specified by:
getMessageCodein interfaceReportable- Returns:
- Message code.
-
getDefaultMessage
protected abstract String getDefaultMessage()
-
getMessage
public String getMessage(ResourceBundle bundle)
Description copied from interface:ReportableFormats the message using given resource bundle.- Specified by:
getMessagein interfaceReportable- Parameters:
bundle- bundle to use resources from.- Returns:
- Formatted message.
-
getMessage
public String getMessage()
Returns location message.- Specified by:
getMessagein interfaceReportable- Returns:
- Location message.
-
item
public ItemObjectLocator item(int index, Object value)
Description copied from interface:ObjectLocatorCreates a locator for the item (like list or array item) relative to this locator.- Specified by:
itemin interfaceObjectLocator- Parameters:
index- index of the item.value- value of the item.- Returns:
- Child item locator.
-
property
public PropertyObjectLocator property(String name, Object value)
Description copied from interface:ObjectLocatorCreates a locator for the property, relative to this locator.- Specified by:
propertyin interfaceObjectLocator- Parameters:
name- name of the property, must not benull.value- value of the property, may benull.- Returns:
- Child property locator.
-
-