|
Xindice API version 1.2m1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | 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 String |
NS_URI
|
static short |
UNKNOWN
|
static boolean |
USE_NS
|
Constructor Summary | |
MetaData()
|
|
MetaData(org.w3c.dom.Element elem)
|
|
MetaData(short type,
String owner,
long created,
long modified)
|
|
MetaData(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 |
Object |
getAttribute(Object name)
Retrieves the attribute by name |
Boolean |
getAttributeAsBoolean(Object name)
|
Integer |
getAttributeAsInteger(Object name)
|
Long |
getAttributeAsLong(Object name)
|
Short |
getAttributeAsShort(Object name)
|
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 |
String |
getLinkTargetURI()
Returns the linked target URI, if this is a link |
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 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(String str)
Return a short representing the string given. |
Object |
removeAttribute(Object name)
Remove an attribute by name |
Object |
setAttribute(Object name,
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(String link)
|
void |
setOwner(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 |
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 String NS_URI
public static final boolean USE_NS
Constructor Detail |
public MetaData()
public MetaData(String owner)
owner
- the owner of this metadata.public MetaData(short type, 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 String getOwner()
public Enumeration getAttributeKeys()
public Object getAttribute(Object name)
name
- the attribute name
public Boolean getAttributeAsBoolean(Object name)
public Integer getAttributeAsInteger(Object name)
public Long getAttributeAsLong(Object name)
public Short getAttributeAsShort(Object name)
public Object setAttribute(Object name, Object value)
name
- the attribute namevalue
- the attribute value
public Object removeAttribute(Object name)
name
- the attribute to remove
public 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 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.
org.w3c.dom.DOMException
- If an error occurspublic 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 times
org.w3c.dom.DOMException
public final void streamFromXML(org.w3c.dom.Element source) throws org.w3c.dom.DOMException
streamFromXML
in interface XMLSerializable
source
- The xml to populate metadata with
org.w3c.dom.DOMException
- If an error occurspublic 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 times
org.w3c.dom.DOMException
public static String getTypeString(short type)
type
- The type you want translated.
public static short parseTypeString(String str)
str
- The string to parse
public 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(String owner)
owner
- the owner to be asspublic void setLinkTargetURI(String link)
public String toString()
|
Xindice API version 1.2m1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |