Top Description Fields Constructors Methods
org.springframework.beans.factory.parsing

public Class Location

extends Object
Class Inheritance
Imports
org.springframework.core.io.Resource, org.springframework.lang.Nullable, org.springframework.util.Assert

Class that models an arbitrary location in a resource.

Typically used to track the location of problematic or erroneous metadata in XML configuration files. For example, a source location might be 'The bean defined on line 76 of beans.properties has an invalid Class'; another source might be the actual DOM Element from a parsed XML org.w3c.dom.Document; or the source object might simply be null.

Author
Rob Harrop
Since
2.0

Field Summary

Modifier and TypeField and Description
private final Resource
private final Object

Constructor Summary

AccessConstructor and Description
public
Location(Resource
the resource with which this location is associated
resource
)

Create a new instance of the Location class.

public
Location(Resource
the resource with which this location is associated
resource
,
Object
the actual location within the associated resource (may be null)
source
)

Create a new instance of the Location class.

Method Summary

Modifier and TypeMethod and Description
public Resource
getResource()

Get the resource with which this location is associated.

public Object
getSource()

Get the actual location within the associated resource (may be null).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

resourceback to summary
private final Resource resource
sourceback to summary
private final Object source
Annotations
@Nullable

Constructor Detail

Locationback to summary
public Location(Resource resource)

Create a new instance of the Location class.

Parameters
resource:Resource

the resource with which this location is associated

Locationback to summary
public Location(Resource resource, Object source)

Create a new instance of the Location class.

Parameters
resource:Resource

the resource with which this location is associated

source:Object

the actual location within the associated resource (may be null)

Method Detail

getResourceback to summary
public Resource getResource()

Get the resource with which this location is associated.

getSourceback to summary
public Object getSource()

Get the actual location within the associated resource (may be null).

See the class level javadoc for this class for examples of what the actual type of the returned object may be.

Annotations
@Nullable