public class Item extends AbstractCachingAwareObject
Both static assets and folders can have their own metadata files or descriptors. So we can also say that there are two types of descriptors: standalone descriptors and (static asset and folder) metadata files.
| Modifier and Type | Field and Description |
|---|---|
protected org.dom4j.Document |
descriptorDom
The DOM (Document Object Model) of the item's descriptor.
|
protected String |
descriptorUrl
The url or path of the item's descriptor in the content store.
|
protected boolean |
isFolder
Flag that indicates if the item is a folder or not.
|
protected String |
name
The name of the item (basically the file name).
|
protected Map<String,Object> |
properties
The properties of the item, which most of the time are metadata information on the item.
|
protected String |
url
The url or path of the item in the content store.
|
cachingTime, key, scope| Constructor and Description |
|---|
Item()
Default no-arg constructor.
|
Item(Item item)
Copy constructor.
|
Item(Item item,
boolean deepCopy)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o)
Returns true if the specified
Item's and this instance's name, url,
descriptorUrl and
isFolder are equal. |
org.dom4j.Document |
getDescriptorDom()
Returns the DOM (Document Object Model) of the item's descriptor.
|
String |
getDescriptorUrl()
Returns the url or path of the item's descriptor in the content store.
|
String |
getName()
Returns name of the item (basically the file name).
|
Map<String,Object> |
getProperties()
Returns the properties of the item, which most of the time are metadata information on the item.
|
Object |
getProperty(String key)
Returns the property value for the specified key.
|
String |
getUrl()
Returns the url or path of the item in the content store.
|
int |
hashCode()
Returns the hash code, which is the combination of the hash code of
name, url,
descriptorUrl and
folder. |
boolean |
isFolder()
Returns true if the item is a folder.
|
String |
queryDescriptorValue(String xpathQuery)
Queries a single descriptor node text value.
|
List<String> |
queryDescriptorValues(String xpathQuery)
Queries multiple descriptor node text values.
|
void |
setDescriptorDom(org.dom4j.Document descriptorDom)
Sets the DOM (Document Object Model) of the item's descriptor.
|
void |
setDescriptorUrl(String descriptorUrl)
Sets the url or path of the item's descriptor in the content store.
|
void |
setFolder(boolean folder)
Sets whether the item is a folder or not.
|
void |
setName(String name)
Sets the name of the item (basically the file name).
|
void |
setProperties(Map<String,Object> properties)
Sets properties of the item, which most of the time are metadata information on the item.
|
void |
setProperty(String key,
Object value)
Adds the specified property value, associated to the specified key.
|
void |
setUrl(String url)
Sets the url or path of the item in the content store.
|
String |
toString() |
getCachingTime, getKey, getScope, setCachingTime, setKey, setScopeprotected String name
protected String url
protected String descriptorUrl
descriptorUrl will be the same as the url.protected org.dom4j.Document descriptorDom
protected Map<String,Object> properties
protected boolean isFolder
public Item()
public Item(Item item)
Item(Item, boolean) with true).public Item(Item item, boolean deepCopy)
deepCopy flag. In a deep copy, the
descriptorDom and properties are cloned.public String getName()
public void setName(String name)
public String getUrl()
public void setUrl(String url)
public String getDescriptorUrl()
descriptorUrl will be the same as the url.public void setDescriptorUrl(String descriptorUrl)
descriptorUrl should be set to the same value as the url.public org.dom4j.Document getDescriptorDom()
public void setDescriptorDom(org.dom4j.Document descriptorDom)
public Map<String,Object> getProperties()
public void setProperties(Map<String,Object> properties)
public void setProperty(String key, Object value)
public String queryDescriptorValue(String xpathQuery)
public List<String> queryDescriptorValues(String xpathQuery)
public boolean isFolder()
public void setFolder(boolean folder)
public boolean equals(Object o)
Item's and this instance's name, url,
descriptorUrl and
isFolder are equal.public int hashCode()
name, url,
descriptorUrl and
folder.Copyright © 2018 CrafterCMS. All rights reserved.