Package org.jdom2.located
Class LocatedJDOMFactory
- java.lang.Object
-
- org.jdom2.DefaultJDOMFactory
-
- org.jdom2.located.LocatedJDOMFactory
-
- All Implemented Interfaces:
JDOMFactory
public class LocatedJDOMFactory extends DefaultJDOMFactory
All Content instances (Element, Comment, CDATA, DocType, Text, EntityRef, and ProcessingInstruction) will implementLocated, 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
Constructors Constructor Description LocatedJDOMFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CDATAcdata(int line, int col, java.lang.String text)This creates the CDATA with the supplied text.Commentcomment(int line, int col, java.lang.String text)This creates the comment with the supplied text.DocTypedocType(int line, int col, java.lang.String elementName)This will create theDocTypewith the specified element nameDocTypedocType(int line, int col, java.lang.String elementName, java.lang.String systemID)This will create theDocTypewith the specified element name and reference to an external DTD.DocTypedocType(int line, int col, java.lang.String elementName, java.lang.String publicID, java.lang.String systemID)This will create theDocTypewith the specified element name and a reference to an external DTD.Elementelement(int line, int col, java.lang.String name)This will create anElementin no.NamespaceElementelement(int line, int col, java.lang.String name, java.lang.String uri)This will create a newElementwith the supplied (local) name, and specifies the URI of thetheNamespaceElementshould be in, resulting it being unprefixed (in the default namespace).Elementelement(int line, int col, java.lang.String name, java.lang.String prefix, java.lang.String uri)This will create a newElementwith the supplied (local) name, and specifies the prefix and URI of thetheNamespaceElementshould be in.Elementelement(int line, int col, java.lang.String name, Namespace namespace)This will create a newElementwith the supplied (local) name, and define theto be used.NamespaceEntityRefentityRef(int line, int col, java.lang.String name)This will create a newEntityRefwith the supplied name.EntityRefentityRef(int line, int col, java.lang.String name, java.lang.String systemID)This will create a newEntityRefwith the supplied name and system ID.EntityRefentityRef(int line, int col, java.lang.String name, java.lang.String publicID, java.lang.String systemID)This will create a newEntityRefwith the supplied name, public ID, and system ID.ProcessingInstructionprocessingInstruction(int line, int col, java.lang.String target)This will create a newProcessingInstructionwith the specified target and no data.ProcessingInstructionprocessingInstruction(int line, int col, java.lang.String target, java.lang.String data)This will create a newProcessingInstructionwith the specified target and data.ProcessingInstructionprocessingInstruction(int line, int col, java.lang.String target, java.util.Map<java.lang.String,java.lang.String> data)This will create a newProcessingInstructionwith the specified target and data.Texttext(int line, int col, java.lang.String text)This creates the Text with the supplied text.-
Methods inherited from class org.jdom2.DefaultJDOMFactory
addContent, addNamespaceDeclaration, attribute, attribute, attribute, attribute, attribute, attribute, cdata, comment, docType, docType, docType, document, document, document, element, element, element, element, entityRef, entityRef, entityRef, processingInstruction, processingInstruction, processingInstruction, setAttribute, setRoot, text
-
-
-
-
Method Detail
-
cdata
public CDATA cdata(int line, int col, java.lang.String text)
Description copied from interface:JDOMFactoryThis creates the CDATA with the supplied text.- Specified by:
cdatain interfaceJDOMFactory- Overrides:
cdatain classDefaultJDOMFactory- Parameters:
line- The line on which this content begins.col- The column on the line at which this content begins.text-Stringcontent of CDATA.- Returns:
- the created CDATA instance
-
text
public Text text(int line, int col, java.lang.String text)
Description copied from interface:JDOMFactoryThis creates the Text with the supplied text.- Specified by:
textin interfaceJDOMFactory- Overrides:
textin classDefaultJDOMFactory- Parameters:
line- The line on which this content begins.col- The column on the line at which this content begins.text-Stringcontent of Text.- Returns:
- the created Text instance
-
comment
public Comment comment(int line, int col, java.lang.String text)
Description copied from interface:JDOMFactoryThis creates the comment with the supplied text.- Specified by:
commentin interfaceJDOMFactory- Overrides:
commentin classDefaultJDOMFactory- Parameters:
line- The line on which this content begins.col- The column on the line at which this content begins.text-Stringcontent of comment.- Returns:
- the created Comment instance
-
docType
public DocType docType(int line, int col, java.lang.String elementName, java.lang.String publicID, java.lang.String systemID)
Description copied from interface:JDOMFactoryThis will create theDocTypewith the specified element name and a reference to an external DTD.- Specified by:
docTypein interfaceJDOMFactory- Overrides:
docTypein classDefaultJDOMFactory- Parameters:
line- The line on which this content begins.col- The column on the line at which this content begins.elementName-Stringname of element being constrained.publicID-Stringpublic ID of referenced DTDsystemID-Stringsystem ID of referenced DTD- Returns:
- the created DocType instance
-
docType
public DocType docType(int line, int col, java.lang.String elementName, java.lang.String systemID)
Description copied from interface:JDOMFactoryThis will create theDocTypewith the specified element name and reference to an external DTD.- Specified by:
docTypein interfaceJDOMFactory- Overrides:
docTypein classDefaultJDOMFactory- Parameters:
line- The line on which this content begins.col- The column on the line at which this content begins.elementName-Stringname of element being constrained.systemID-Stringsystem ID of referenced DTD- Returns:
- the created DocType instance
-
docType
public DocType docType(int line, int col, java.lang.String elementName)
Description copied from interface:JDOMFactoryThis will create theDocTypewith the specified element name- Specified by:
docTypein interfaceJDOMFactory- Overrides:
docTypein classDefaultJDOMFactory- Parameters:
line- The line on which this content begins.col- The column on the line at which this content begins.elementName-Stringname of element being constrained.- Returns:
- the created DocType instance
-
element
public Element element(int line, int col, java.lang.String name, Namespace namespace)
Description copied from interface:JDOMFactoryThis will create a newElementwith the supplied (local) name, and define theto be used.Namespace- Specified by:
elementin interfaceJDOMFactory- Overrides:
elementin classDefaultJDOMFactory- Parameters:
line- The line on which this content begins.col- The column on the line at which this content begins.name-Stringname of element.namespace-Namespaceto put element in.- Returns:
- the created Element instance
-
element
public Element element(int line, int col, java.lang.String name)
Description copied from interface:JDOMFactoryThis will create anElementin no.Namespace- Specified by:
elementin interfaceJDOMFactory- Overrides:
elementin classDefaultJDOMFactory- Parameters:
line- The line on which this content begins.col- The column on the line at which this content begins.name-Stringname of element.- Returns:
- the created Element instance
-
element
public Element element(int line, int col, java.lang.String name, java.lang.String uri)
Description copied from interface:JDOMFactoryThis will create a newElementwith the supplied (local) name, and specifies the URI of thetheNamespaceElementshould be in, resulting it being unprefixed (in the default namespace).- Specified by:
elementin interfaceJDOMFactory- Overrides:
elementin classDefaultJDOMFactory- Parameters:
line- The line on which this content begins.col- The column on the line at which this content begins.name-Stringname of element.uri-StringURI forNamespaceelement should be in.- Returns:
- the created Element instance
-
element
public Element element(int line, int col, java.lang.String name, java.lang.String prefix, java.lang.String uri)
Description copied from interface:JDOMFactoryThis will create a newElementwith the supplied (local) name, and specifies the prefix and URI of thetheNamespaceElementshould be in.- Specified by:
elementin interfaceJDOMFactory- Overrides:
elementin classDefaultJDOMFactory- Parameters:
line- The line on which this content begins.col- The column on the line at which this content begins.name-Stringname of element.prefix- the NamespacePrefic to use for this Elementuri-StringURI forNamespaceelement should be in.- Returns:
- the created Element instance
-
processingInstruction
public ProcessingInstruction processingInstruction(int line, int col, java.lang.String target)
Description copied from interface:JDOMFactoryThis will create a newProcessingInstructionwith the specified target and no data.- Specified by:
processingInstructionin interfaceJDOMFactory- Overrides:
processingInstructionin classDefaultJDOMFactory- Parameters:
line- The line on which this content begins.col- The column on the line at which this content begins.target-Stringtarget of PI.- Returns:
- the created ProcessingInstruction instance
-
processingInstruction
public ProcessingInstruction processingInstruction(int line, int col, java.lang.String target, java.util.Map<java.lang.String,java.lang.String> data)
Description copied from interface:JDOMFactoryThis will create a newProcessingInstructionwith the specified target and data.- Specified by:
processingInstructionin interfaceJDOMFactory- Overrides:
processingInstructionin classDefaultJDOMFactory- Parameters:
line- The line on which this content begins.col- The column on the line at which this content begins.target-Stringtarget of PI.data-Mapdata for PI, in name/value pairs- Returns:
- the created ProcessingInstruction instance
-
processingInstruction
public ProcessingInstruction processingInstruction(int line, int col, java.lang.String target, java.lang.String data)
Description copied from interface:JDOMFactoryThis will create a newProcessingInstructionwith the specified target and data.- Specified by:
processingInstructionin interfaceJDOMFactory- Overrides:
processingInstructionin classDefaultJDOMFactory- Parameters:
line- The line on which this content begins.col- The column on the line at which this content begins.target-Stringtarget of PI.data-Stringdata for PI.- Returns:
- the created ProcessingInstruction instance
-
entityRef
public EntityRef entityRef(int line, int col, java.lang.String name)
Description copied from interface:JDOMFactoryThis will create a newEntityRefwith the supplied name.- Specified by:
entityRefin interfaceJDOMFactory- Overrides:
entityRefin classDefaultJDOMFactory- Parameters:
line- The line on which this content begins.col- The column on the line at which this content begins.name-Stringname of element.- Returns:
- the created EntityRef instance
-
entityRef
public EntityRef entityRef(int line, int col, java.lang.String name, java.lang.String publicID, java.lang.String systemID)
Description copied from interface:JDOMFactoryThis will create a newEntityRefwith the supplied name, public ID, and system ID.- Specified by:
entityRefin interfaceJDOMFactory- Overrides:
entityRefin classDefaultJDOMFactory- Parameters:
line- The line on which this content begins.col- The column on the line at which this content begins.name-Stringname of element.publicID-Stringpublic ID of element.systemID-Stringsystem ID of element.- Returns:
- the created EntityRef instance
-
entityRef
public EntityRef entityRef(int line, int col, java.lang.String name, java.lang.String systemID)
Description copied from interface:JDOMFactoryThis will create a newEntityRefwith the supplied name and system ID.- Specified by:
entityRefin interfaceJDOMFactory- Overrides:
entityRefin classDefaultJDOMFactory- Parameters:
line- The line on which this content begins.col- The column on the line at which this content begins.name-Stringname of element.systemID-Stringsystem ID of element.- Returns:
- the created EntityRef instance
-
-