|
Xindice API version 1.1b3 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xindice.core.meta.MetaData
Implements the MetaData interface.
<meta> <system [type="doc|col"] [href="uri"]/> <attrs> <attr name="name" value="value"/> <attr name="name" value="value"/> </attrs> <custom> ... </custom> </meta>
Field Summary | |
static short |
COLLECTION
|
static short |
DOCUMENT
|
static short |
LINK
|
static java.lang.String |
NS_URI
|
static short |
UNKNOWN
|
static boolean |
USE_NS
|
Constructor Summary | |
MetaData()
|
|
MetaData(org.w3c.dom.Element elem)
|
|
MetaData(short type,
java.lang.String owner,
long created,
long modified)
|
|
MetaData(java.lang.String owner)
|
Method Summary | |
void |
copyDataFrom(MetaData meta)
Copies only user data (link, attributes, custom document) from another meta data |
void |
copyFrom(MetaData meta)
Copies from another meta data |
java.lang.Object |
getAttribute(java.lang.Object name)
Retrieves the attribute by name |
java.lang.Boolean |
getAttributeAsBoolean(java.lang.Object name)
|
java.lang.Integer |
getAttributeAsInteger(java.lang.Object name)
|
java.lang.Long |
getAttributeAsLong(java.lang.Object name)
|
java.lang.Short |
getAttributeAsShort(java.lang.Object name)
|
java.util.Enumeration |
getAttributeKeys()
Returns enumeration of all attributes |
long |
getCreatedTime()
Returns the time of creation |
org.w3c.dom.Document |
getCustomDocument()
Returns the (optional) custom meta document |
long |
getLastModifiedTime()
Returns the time of last modification |
java.lang.String |
getLinkTargetURI()
Returns the linked target URI, if this is a link |
java.lang.String |
getOwner()
Returns the canonical name of the owner object. |
short |
getType()
Returns the type of the owner object, e.g., COLLECTION, DOCUMENT, or LINK |
static java.lang.String |
getTypeString(short type)
Return a string representing which type passed in. |
boolean |
hasContext()
Determine whether this obect has created or modified times set |
boolean |
isDirty()
Returns whether this MetaData is dirty |
static short |
parseTypeString(java.lang.String str)
Return a short representing the string given. |
java.lang.Object |
removeAttribute(java.lang.Object name)
Remove an attribute by name |
java.lang.Object |
setAttribute(java.lang.Object name,
java.lang.Object value)
Sets the attribute by name |
void |
setContext(long created,
long modified)
Set the created and modified times. |
void |
setCustomDocument(org.w3c.dom.Document doc)
Sets the (optional) custom meta document |
void |
setDirty(boolean dirty)
Reset the dirtiness of this object |
void |
setLinkTargetURI(java.lang.String link)
|
void |
setOwner(java.lang.String owner)
Set the owner of this object |
void |
setType(short type)
Set the type for this object. |
void |
streamFromXML(org.w3c.dom.Element source)
Given some xml, populate the metadata. |
void |
streamFromXML(org.w3c.dom.Element source,
boolean includeTime)
Given some xml, populate the metadata. |
org.w3c.dom.Element |
streamToXML(org.w3c.dom.Document doc)
Stream this MetaData into an xml document |
org.w3c.dom.Element |
streamToXML(org.w3c.dom.Document doc,
boolean includeTime)
Stream this MetaData into an xml document |
java.lang.String |
toString()
Return a string representing this MetaData It will look like: META[doc owner=OWNER created=CREATED modified=MODIFIED link=LINK attrs=ATTRS] |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final short UNKNOWN
public static final short COLLECTION
public static final short DOCUMENT
public static final short LINK
public static final java.lang.String NS_URI
public static final boolean USE_NS
Constructor Detail |
public MetaData()
public MetaData(java.lang.String owner)
owner
- the owner of this metadata.public MetaData(short type, java.lang.String owner, long created, long modified)
type
- the type of object for this metadataowner
- the owner of this metadatacreated
- the time when this was createdmodified
- the time when this was modified.public MetaData(org.w3c.dom.Element elem)
elem
- an XML representation of the desired metadata.Method Detail |
public final boolean isDirty()
public final void setDirty(boolean dirty)
dirty
- public long getCreatedTime()
public long getLastModifiedTime()
public short getType()
public java.lang.String getOwner()
public java.util.Enumeration getAttributeKeys()
public java.lang.Object getAttribute(java.lang.Object name)
name
- the attribute namepublic java.lang.Boolean getAttributeAsBoolean(java.lang.Object name)
public java.lang.Integer getAttributeAsInteger(java.lang.Object name)
public java.lang.Long getAttributeAsLong(java.lang.Object name)
public java.lang.Short getAttributeAsShort(java.lang.Object name)
public java.lang.Object setAttribute(java.lang.Object name, java.lang.Object value)
name
- the attribute namevalue
- the attribute valuepublic java.lang.Object removeAttribute(java.lang.Object name)
name
- the attribute to removepublic org.w3c.dom.Document getCustomDocument()
public void setCustomDocument(org.w3c.dom.Document doc)
doc
- the Documentpublic void copyFrom(MetaData meta)
meta
- the meta to copy frompublic void copyDataFrom(MetaData meta)
meta
- the meta to copy frompublic java.lang.String getLinkTargetURI()
public final org.w3c.dom.Element streamToXML(org.w3c.dom.Document doc) throws org.w3c.dom.DOMException
streamToXML
in interface XMLSerializable
doc
- the xml document to be populated.public final org.w3c.dom.Element streamToXML(org.w3c.dom.Document doc, boolean includeTime) throws org.w3c.dom.DOMException
doc
- the xml document to populateincludeTime
- whether or not to include the create/modified timespublic final void streamFromXML(org.w3c.dom.Element source) throws org.w3c.dom.DOMException
streamFromXML
in interface XMLSerializable
source
- The xml to populate metadata withpublic final void streamFromXML(org.w3c.dom.Element source, boolean includeTime) throws org.w3c.dom.DOMException
source
- The xml to populate the metadata withincludeTime
- Whether or not to reset the create/modified timespublic static java.lang.String getTypeString(short type)
type
- The type you want translated.public static short parseTypeString(java.lang.String str)
str
- The string to parsepublic boolean hasContext()
public void setContext(long created, long modified)
created
- the new creation timemodified
- the new modified timepublic void setType(short type)
type
- the type for this object.public void setOwner(java.lang.String owner)
owner
- the owner to be asspublic void setLinkTargetURI(java.lang.String link)
public java.lang.String toString()
toString
in class java.lang.Object
|
Xindice API version 1.1b3 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |