Package org.jvnet.basicjaxb.locator
Class AbstractObjectLocator
java.lang.Object
org.jvnet.basicjaxb.locator.AbstractObjectLocator
- All Implemented Interfaces:
jakarta.xml.bind.ValidationEventLocator,Reportable,ObjectLocator
- Direct Known Subclasses:
DefaultItemObjectLocator,DefaultPropertyObjectLocator,DefaultRootObjectLocator
Abstract base class for event locators.
- Author:
- Aleksei Valikov
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ObjectObject.protected final ObjectLocatorParent locator. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractObjectLocator(ObjectLocator parentLocator, Object object) Constructs a new validation event locator. -
Method Summary
Modifier and TypeMethodDescriptionintprotected abstract StringintReturns location message.getMessage(ResourceBundle bundle) Formats the message using given resource bundle.Returns message code.getNode()intReturns parent locator.getPath()protected abstract StringgetURL()Creates a locator for the item (like list or array item) relative to this locator.Creates a locator for the property, relative to this locator.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jvnet.basicjaxb.i18n.Reportable
getMessageParameters
-
Field Details
-
parentLocator
Parent locator. -
object
Object.
-
-
Constructor Details
-
AbstractObjectLocator
Constructs a new validation event locator.- Parameters:
parentLocator- parent location (may benull).object- object.
-
-
Method Details
-
getParentLocator
Returns parent locator.- Specified by:
getParentLocatorin interfaceObjectLocator- Returns:
- Parent locator.
-
getPath
- Specified by:
getPathin interfaceObjectLocator- Returns:
- Path to this locator from the root.
-
getPathAsString
- Specified by:
getPathAsStringin interfaceObjectLocator- Returns:
- Path to this locator in string form;
-
getStepAsString
-
getObject
- Specified by:
getObjectin interfacejakarta.xml.bind.ValidationEventLocator
-
getColumnNumber
public int getColumnNumber()- Specified by:
getColumnNumberin interfacejakarta.xml.bind.ValidationEventLocator
-
getLineNumber
public int getLineNumber()- Specified by:
getLineNumberin interfacejakarta.xml.bind.ValidationEventLocator
-
getOffset
public int getOffset()- Specified by:
getOffsetin interfacejakarta.xml.bind.ValidationEventLocator
-
getURL
- Specified by:
getURLin interfacejakarta.xml.bind.ValidationEventLocator
-
getNode
- Specified by:
getNodein interfacejakarta.xml.bind.ValidationEventLocator
-
toString
-
getMessageCode
Returns message code.- Specified by:
getMessageCodein interfaceReportable- Returns:
- Message code.
-
getDefaultMessage
-
getMessage
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
Returns location message.- Specified by:
getMessagein interfaceReportable- Returns:
- Location message.
-
item
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
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.
-