Package org.apache.abdera.model
Interface Document<T extends Element>
- 
- All Superinterfaces:
 Base,java.lang.Cloneable,java.io.Serializable
public interface Document<T extends Element> extends Base, java.io.Serializable
The top level artifact of the Feed Object Model. The Parser component processes data from an InputStream and returns a Document instance. The type of Document returned depends on the XML format being parsed. The Feed Object Model supports four basic types of documents: FeedDocument, EntryDocument, ServiceDocument (Atom Publishing Protocol Introspection Documents) and XmlDocument (any arbitrary XML).
 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Document<T>addProcessingInstruction(java.lang.String target, java.lang.String value)Add a processing instruction to the documentDocument<T>addStylesheet(java.lang.String href, java.lang.String media)Add a xml-stylesheet processing instruction to the documentIRIgetBaseUri()Returns the Base URI of the document.java.lang.StringgetCharset()Gets the charset used for this documentjavax.activation.MimeTypegetContentType()Returns the content type of this documentEntityTaggetEntityTag()Return the entity tag for this documentjava.lang.StringgetLanguage()Get the languageLanggetLanguageTag()Returns the value of the xml:lang attribute as a Lang objectjava.util.DategetLastModified()Returns the last modified date for this documentbooleangetMustPreserveWhitespace()Return true if insignificant whitespace must be preservedjava.lang.String[]getProcessingInstruction(java.lang.String target)Get the values for the given processing instructionTgetRoot()Returns the root element of the document (equivalent to DOM's getDocumentElement)java.lang.StringgetSlug()Get the slug for this documentXmlUtil.XMLVersiongetXmlVersion()Get the XMLVersion used by this documentDocument<T>setBaseUri(java.lang.String base)Sets the Base URI of the document.Document<T>setCharset(java.lang.String charset)Sets the charset used for this documentDocument<T>setContentType(java.lang.String contentType)Sets the content type for this documentDocument<T>setEntityTag(java.lang.String tag)Set the entity tag for this documentDocument<T>setEntityTag(EntityTag tag)Set the entity tag for this documentDocument<T>setLanguage(java.lang.String lang)set the base languageDocument<T>setLastModified(java.util.Date lastModified)Sets the last modified date for this documentDocument<T>setMustPreserveWhitespace(boolean preserve)Set to true to preserve insignificant whitespaceDocument<T>setRoot(T root)Sets the root element of the documentDocument<T>setSlug(java.lang.String slug)Set the slug for this document 
 - 
 
- 
- 
Method Detail
- 
getRoot
T getRoot()
Returns the root element of the document (equivalent to DOM's getDocumentElement)- Returns:
 - The root element of the document
 
 
- 
setRoot
Document<T> setRoot(T root)
Sets the root element of the document- Parameters:
 root- Set the root element of the document
 
- 
getBaseUri
IRI getBaseUri()
Returns the Base URI of the document. All relative URI's contained in the document will be resolved according to this base.- Returns:
 - The Base IRI
 
 
- 
setBaseUri
Document<T> setBaseUri(java.lang.String base)
Sets the Base URI of the document. All relative URI's contained in the document will be resolved according to this base.- Parameters:
 base- The Base URI- Throws:
 IRISyntaxException- if the IRI is malformed
 
- 
getContentType
javax.activation.MimeType getContentType()
Returns the content type of this document- Returns:
 - The content type of this document
 
 
- 
setContentType
Document<T> setContentType(java.lang.String contentType)
Sets the content type for this document- Parameters:
 contentType- The content type of document- Throws:
 MimeTypeParseException- if the content type is malformed
 
- 
getLastModified
java.util.Date getLastModified()
Returns the last modified date for this document- Returns:
 - The last-modified date
 
 
- 
setLastModified
Document<T> setLastModified(java.util.Date lastModified)
Sets the last modified date for this document- Parameters:
 lastModified- the last-modified date
 
- 
getCharset
java.lang.String getCharset()
Gets the charset used for this document- Returns:
 - The character encoding used for this document
 
 
- 
setCharset
Document<T> setCharset(java.lang.String charset)
Sets the charset used for this document- Parameters:
 charset- The character encoding to use
 
- 
addProcessingInstruction
Document<T> addProcessingInstruction(java.lang.String target, java.lang.String value)
Add a processing instruction to the document- Parameters:
 target- The processing instruction targetvalue- The processing instruction value
 
- 
getProcessingInstruction
java.lang.String[] getProcessingInstruction(java.lang.String target)
Get the values for the given processing instruction 
- 
addStylesheet
Document<T> addStylesheet(java.lang.String href, java.lang.String media)
Add a xml-stylesheet processing instruction to the document- Parameters:
 href- The href of the stylesheetmedia- The media target for this stylesheet or null if none
 
- 
getEntityTag
EntityTag getEntityTag()
Return the entity tag for this document 
- 
getLanguage
java.lang.String getLanguage()
Get the language 
- 
getLanguageTag
Lang getLanguageTag()
Returns the value of the xml:lang attribute as a Lang object 
- 
getSlug
java.lang.String getSlug()
Get the slug for this document 
- 
getMustPreserveWhitespace
boolean getMustPreserveWhitespace()
Return true if insignificant whitespace must be preserved 
- 
setMustPreserveWhitespace
Document<T> setMustPreserveWhitespace(boolean preserve)
Set to true to preserve insignificant whitespace 
- 
getXmlVersion
XmlUtil.XMLVersion getXmlVersion()
Get the XMLVersion used by this document 
 - 
 
 -