Top Description Constructors Methods
org.jdom2.located

public Class LocatedJDOMFactory

extends DefaultJDOMFactory
Class Inheritance
Imports
java.util.Map, org.jdom2.CDATA, .Comment, .DefaultJDOMFactory, .DocType, .Element, .EntityRef, .Namespace, .ProcessingInstruction, .Text

All Content instances (Element, Comment, CDATA, DocType, Text, EntityRef, and ProcessingInstruction) will implement Located, and will have the values set appropriately.

You can set an instance of this LocatedJDOMFactory as the factory for a SAXBuilder, and the JDOM document produced will have the SAX Location data embedded. Note though, that SAX Location data indicates the position of the end of the SAX Event.

Author
Rolf Lear

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public CDATA
cdata(int
The line on which this content begins.
line
,
int
The column on the line at which this content begins.
col
,
String
String content of CDATA.
text
)

Overrides org.jdom2.DefaultJDOMFactory.cdata.

Implements org.jdom2.JDOMFactory.cdata.

This creates the CDATA with the supplied text.
public Comment
comment(int
The line on which this content begins.
line
,
int
The column on the line at which this content begins.
col
,
String
String content of comment.
text
)

Overrides org.jdom2.DefaultJDOMFactory.comment.

Implements org.jdom2.JDOMFactory.comment.

This creates the comment with the supplied text.
public DocType
docType(int
The line on which this content begins.
line
,
int
The column on the line at which this content begins.
col
,
String
String name of element being constrained.
elementName
,
String
String public ID of referenced DTD
publicID
,
String
String system ID of referenced DTD
systemID
)

Overrides org.jdom2.DefaultJDOMFactory.docType.

Implements org.jdom2.JDOMFactory.docType.

This will create the DocType with the specified element name and a reference to an external DTD.
public DocType
docType(int
The line on which this content begins.
line
,
int
The column on the line at which this content begins.
col
,
String
String name of element being constrained.
elementName
,
String
String system ID of referenced DTD
systemID
)

Overrides org.jdom2.DefaultJDOMFactory.docType.

Implements org.jdom2.JDOMFactory.docType.

This will create the DocType with the specified element name and reference to an external DTD.
public DocType
docType(int
The line on which this content begins.
line
,
int
The column on the line at which this content begins.
col
,
String
String name of element being constrained.
elementName
)

Overrides org.jdom2.DefaultJDOMFactory.docType.

Implements org.jdom2.JDOMFactory.docType.

This will create the DocType with the specified element name
public Element
element(int
The line on which this content begins.
line
,
int
The column on the line at which this content begins.
col
,
String
String name of element.
name
,
Namespace
Namespace to put element in.
namespace
)

Overrides org.jdom2.DefaultJDOMFactory.element.

Implements org.jdom2.JDOMFactory.element.

This will create a new Element with the supplied (local) name, and define the org.jdom2.Namespace to be used.
public Element
element(int
The line on which this content begins.
line
,
int
The column on the line at which this content begins.
col
,
String
String name of element.
name
)

Overrides org.jdom2.DefaultJDOMFactory.element.

Implements org.jdom2.JDOMFactory.element.

This will create an Element in no org.jdom2.Namespace.
public Element
element(int
The line on which this content begins.
line
,
int
The column on the line at which this content begins.
col
,
String
String name of element.
name
,
String
String URI for Namespace element should be in.
uri
)

Overrides org.jdom2.DefaultJDOMFactory.element.

Implements org.jdom2.JDOMFactory.element.

This will create a new Element with the supplied (local) name, and specifies the URI of the org.jdom2.Namespace the Element should be in, resulting it being unprefixed (in the default namespace).
public Element
element(int
The line on which this content begins.
line
,
int
The column on the line at which this content begins.
col
,
String
String name of element.
name
,
String
the NamespacePrefic to use for this Element
prefix
,
String
String URI for Namespace element should be in.
uri
)

Overrides org.jdom2.DefaultJDOMFactory.element.

Implements org.jdom2.JDOMFactory.element.

This will create a new Element with the supplied (local) name, and specifies the prefix and URI of the org.jdom2.Namespace the Element should be in.
public EntityRef
entityRef(int
The line on which this content begins.
line
,
int
The column on the line at which this content begins.
col
,
String
String name of element.
name
)

Overrides org.jdom2.DefaultJDOMFactory.entityRef.

Implements org.jdom2.JDOMFactory.entityRef.

This will create a new EntityRef with the supplied name.
public EntityRef
entityRef(int
The line on which this content begins.
line
,
int
The column on the line at which this content begins.
col
,
String
String name of element.
name
,
String
String public ID of element.
publicID
,
String
String system ID of element.
systemID
)

Overrides org.jdom2.DefaultJDOMFactory.entityRef.

Implements org.jdom2.JDOMFactory.entityRef.

This will create a new EntityRef with the supplied name, public ID, and system ID.
public EntityRef
entityRef(int
The line on which this content begins.
line
,
int
The column on the line at which this content begins.
col
,
String
String name of element.
name
,
String
String system ID of element.
systemID
)

Overrides org.jdom2.DefaultJDOMFactory.entityRef.

Implements org.jdom2.JDOMFactory.entityRef.

This will create a new EntityRef with the supplied name and system ID.
public ProcessingInstruction
processingInstruction(int
The line on which this content begins.
line
,
int
The column on the line at which this content begins.
col
,
String
String target of PI.
target
)

Overrides org.jdom2.DefaultJDOMFactory.processingInstruction.

Implements org.jdom2.JDOMFactory.processingInstruction.

This will create a new ProcessingInstruction with the specified target and no data.
public ProcessingInstruction
processingInstruction(int
The line on which this content begins.
line
,
int
The column on the line at which this content begins.
col
,
String
String target of PI.
target
,
Map<String, String>
Map data for PI, in name/value pairs
data
)

Overrides org.jdom2.DefaultJDOMFactory.processingInstruction.

Implements org.jdom2.JDOMFactory.processingInstruction.

This will create a new ProcessingInstruction with the specified target and data.
public ProcessingInstruction
processingInstruction(int
The line on which this content begins.
line
,
int
The column on the line at which this content begins.
col
,
String
String target of PI.
target
,
String
String data for PI.
data
)

Overrides org.jdom2.DefaultJDOMFactory.processingInstruction.

Implements org.jdom2.JDOMFactory.processingInstruction.

This will create a new ProcessingInstruction with the specified target and data.
public Text
text(int
The line on which this content begins.
line
,
int
The column on the line at which this content begins.
col
,
String
String content of Text.
text
)

Overrides org.jdom2.DefaultJDOMFactory.text.

Implements org.jdom2.JDOMFactory.text.

This creates the Text with the supplied text.
Inherited from org.jdom2.DefaultJDOMFactory:
addContentaddNamespaceDeclarationattributeattributeattributeattributeattributeattributecdatacommentdocTypedocTypedocTypedocumentdocumentdocumentelementelementelementelemententityRefentityRefentityRefprocessingInstructionprocessingInstructionprocessingInstructionsetAttributesetRoottext

Constructor Detail

LocatedJDOMFactoryback to summary
public LocatedJDOMFactory()

Method Detail

cdataback to summary
public CDATA cdata(int line, int col, String text)

Overrides org.jdom2.DefaultJDOMFactory.cdata.

Implements org.jdom2.JDOMFactory.cdata.

Doc from org.jdom2.JDOMFactory.cdata.

This creates the CDATA with the supplied text.

Parameters
line:int

The line on which this content begins.

col:int

The column on the line at which this content begins.

text:String

String content of CDATA.

Returns:CDATA

the created CDATA instance

Annotations
@Override
commentback to summary
public Comment comment(int line, int col, String text)

Overrides org.jdom2.DefaultJDOMFactory.comment.

Implements org.jdom2.JDOMFactory.comment.

Doc from org.jdom2.JDOMFactory.comment.

This creates the comment with the supplied text.

Parameters
line:int

The line on which this content begins.

col:int

The column on the line at which this content begins.

text:String

String content of comment.

Returns:Comment

the created Comment instance

Annotations
@Override
docTypeback to summary
public DocType docType(int line, int col, String elementName, String publicID, String systemID)

Overrides org.jdom2.DefaultJDOMFactory.docType.

Implements org.jdom2.JDOMFactory.docType.

Doc from org.jdom2.JDOMFactory.docType.

This will create the DocType with the specified element name and a reference to an external DTD.

Parameters
line:int

The line on which this content begins.

col:int

The column on the line at which this content begins.

elementName:String

String name of element being constrained.

publicID:String

String public ID of referenced DTD

systemID:String

String system ID of referenced DTD

Returns:DocType

the created DocType instance

Annotations
@Override
docTypeback to summary
public DocType docType(int line, int col, String elementName, String systemID)

Overrides org.jdom2.DefaultJDOMFactory.docType.

Implements org.jdom2.JDOMFactory.docType.

Doc from org.jdom2.JDOMFactory.docType.

This will create the DocType with the specified element name and reference to an external DTD.

Parameters
line:int

The line on which this content begins.

col:int

The column on the line at which this content begins.

elementName:String

String name of element being constrained.

systemID:String

String system ID of referenced DTD

Returns:DocType

the created DocType instance

Annotations
@Override
docTypeback to summary
public DocType docType(int line, int col, String elementName)

Overrides org.jdom2.DefaultJDOMFactory.docType.

Implements org.jdom2.JDOMFactory.docType.

Doc from org.jdom2.JDOMFactory.docType.

This will create the DocType with the specified element name

Parameters
line:int

The line on which this content begins.

col:int

The column on the line at which this content begins.

elementName:String

String name of element being constrained.

Returns:DocType

the created DocType instance

Annotations
@Override
elementback to summary
public Element element(int line, int col, String name, Namespace namespace)

Overrides org.jdom2.DefaultJDOMFactory.element.

Implements org.jdom2.JDOMFactory.element.

Doc from org.jdom2.JDOMFactory.element.

This will create a new Element with the supplied (local) name, and define the org.jdom2.Namespace to be used.

Parameters
line:int

The line on which this content begins.

col:int

The column on the line at which this content begins.

name:String

String name of element.

namespace:Namespace

Namespace to put element in.

Returns:Element

the created Element instance

Annotations
@Override
elementback to summary
public Element element(int line, int col, String name)

Overrides org.jdom2.DefaultJDOMFactory.element.

Implements org.jdom2.JDOMFactory.element.

Doc from org.jdom2.JDOMFactory.element.

This will create an Element in no org.jdom2.Namespace.

Parameters
line:int

The line on which this content begins.

col:int

The column on the line at which this content begins.

name:String

String name of element.

Returns:Element

the created Element instance

Annotations
@Override
elementback to summary
public Element element(int line, int col, String name, String uri)

Overrides org.jdom2.DefaultJDOMFactory.element.

Implements org.jdom2.JDOMFactory.element.

Doc from org.jdom2.JDOMFactory.element.

This will create a new Element with the supplied (local) name, and specifies the URI of the org.jdom2.Namespace the Element should be in, resulting it being unprefixed (in the default namespace).

Parameters
line:int

The line on which this content begins.

col:int

The column on the line at which this content begins.

name:String

String name of element.

uri:String

String URI for Namespace element should be in.

Returns:Element

the created Element instance

Annotations
@Override
elementback to summary
public Element element(int line, int col, String name, String prefix, String uri)

Overrides org.jdom2.DefaultJDOMFactory.element.

Implements org.jdom2.JDOMFactory.element.

Doc from org.jdom2.JDOMFactory.element.

This will create a new Element with the supplied (local) name, and specifies the prefix and URI of the org.jdom2.Namespace the Element should be in.

Parameters
line:int

The line on which this content begins.

col:int

The column on the line at which this content begins.

name:String

String name of element.

prefix:String

the NamespacePrefic to use for this Element

uri:String

String URI for Namespace element should be in.

Returns:Element

the created Element instance

Annotations
@Override
entityRefback to summary
public EntityRef entityRef(int line, int col, String name)

Overrides org.jdom2.DefaultJDOMFactory.entityRef.

Implements org.jdom2.JDOMFactory.entityRef.

Doc from org.jdom2.JDOMFactory.entityRef.

This will create a new EntityRef with the supplied name.

Parameters
line:int

The line on which this content begins.

col:int

The column on the line at which this content begins.

name:String

String name of element.

Returns:EntityRef

the created EntityRef instance

Annotations
@Override
entityRefback to summary
public EntityRef entityRef(int line, int col, String name, String publicID, String systemID)

Overrides org.jdom2.DefaultJDOMFactory.entityRef.

Implements org.jdom2.JDOMFactory.entityRef.

Doc from org.jdom2.JDOMFactory.entityRef.

This will create a new EntityRef with the supplied name, public ID, and system ID.

Parameters
line:int

The line on which this content begins.

col:int

The column on the line at which this content begins.

name:String

String name of element.

publicID:String

String public ID of element.

systemID:String

String system ID of element.

Returns:EntityRef

the created EntityRef instance

Annotations
@Override
entityRefback to summary
public EntityRef entityRef(int line, int col, String name, String systemID)

Overrides org.jdom2.DefaultJDOMFactory.entityRef.

Implements org.jdom2.JDOMFactory.entityRef.

Doc from org.jdom2.JDOMFactory.entityRef.

This will create a new EntityRef with the supplied name and system ID.

Parameters
line:int

The line on which this content begins.

col:int

The column on the line at which this content begins.

name:String

String name of element.

systemID:String

String system ID of element.

Returns:EntityRef

the created EntityRef instance

Annotations
@Override
processingInstructionback to summary
public ProcessingInstruction processingInstruction(int line, int col, String target)

Overrides org.jdom2.DefaultJDOMFactory.processingInstruction.

Implements org.jdom2.JDOMFactory.processingInstruction.

Doc from org.jdom2.JDOMFactory.processingInstruction.

This will create a new ProcessingInstruction with the specified target and no data.

Parameters
line:int

The line on which this content begins.

col:int

The column on the line at which this content begins.

target:String

String target of PI.

Returns:ProcessingInstruction

the created ProcessingInstruction instance

Annotations
@Override
processingInstructionback to summary
public ProcessingInstruction processingInstruction(int line, int col, String target, Map<String, String> data)

Overrides org.jdom2.DefaultJDOMFactory.processingInstruction.

Implements org.jdom2.JDOMFactory.processingInstruction.

Doc from org.jdom2.JDOMFactory.processingInstruction.

This will create a new ProcessingInstruction with the specified target and data.

Parameters
line:int

The line on which this content begins.

col:int

The column on the line at which this content begins.

target:String

String target of PI.

data:Map<String, String>

Map data for PI, in name/value pairs

Returns:ProcessingInstruction

the created ProcessingInstruction instance

Annotations
@Override
processingInstructionback to summary
public ProcessingInstruction processingInstruction(int line, int col, String target, String data)

Overrides org.jdom2.DefaultJDOMFactory.processingInstruction.

Implements org.jdom2.JDOMFactory.processingInstruction.

Doc from org.jdom2.JDOMFactory.processingInstruction.

This will create a new ProcessingInstruction with the specified target and data.

Parameters
line:int

The line on which this content begins.

col:int

The column on the line at which this content begins.

target:String

String target of PI.

data:String

String data for PI.

Returns:ProcessingInstruction

the created ProcessingInstruction instance

Annotations
@Override
textback to summary
public Text text(int line, int col, String text)

Overrides org.jdom2.DefaultJDOMFactory.text.

Implements org.jdom2.JDOMFactory.text.

Doc from org.jdom2.JDOMFactory.text.

This creates the Text with the supplied text.

Parameters
line:int

The line on which this content begins.

col:int

The column on the line at which this content begins.

text:String

String content of Text.

Returns:Text

the created Text instance

Annotations
@Override