|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectde.unidu.is.retrieval.Schema
A schema definition. A schema consists of a list of attributes, which are extracted from the XML document using XPath expressions (similar to the HyREX DDL file).
| Field Summary | |
protected SchemaElement |
rootElement
The root element of the schema. |
protected java.lang.String |
schemaName
The schema name. |
protected boolean |
useXPathForQuery
A flag specifying if an XPath expression is used in the query, or if attributes are used. |
| Constructor Summary | |
Schema()
Creates a new, empty schema instance. |
|
Schema(java.lang.String schemaName)
Creates a new, empty schema instance. |
|
| Method Summary | |
void |
addAlias(java.lang.String xpath,
java.lang.String alias)
Adds an alias. |
void |
addAliases()
Adds standard aliases (use converted XPaths). |
void |
clearAliases()
Removes all aliases. |
java.lang.String |
convPath(java.lang.String path)
Converts a XPath path by removing the first element name and "/text()", transforming "/" into "__", "-" into "_" and "@" into "at": |
java.util.List |
extractValues(org.w3c.dom.Document document,
java.lang.String att)
Extract all values from the document for the given attribute. |
java.lang.String |
getAlias(java.lang.String path)
Returns the alias for the specified path. |
java.util.List |
getAliases()
Returns a list with all aliases. |
java.util.List |
getAliasesForXPath(java.lang.String path)
Returns the aliases for the specified path. |
SchemaElement |
getElement(java.lang.String path)
Returns the schema element for the specified path (XPath expression or alias). |
java.lang.String |
getHierarchicalView()
Returns a hierarchical view of this schema. |
java.lang.String |
getPath(java.lang.String path)
Returns the unified path for queries. |
SchemaElement |
getRootElement()
Returns the root schema element. |
java.lang.String |
getSchemaName()
Returns the schema name. |
java.lang.String |
getXPath(java.lang.String alias)
Returns the XPath expression for the specified path. |
java.util.List |
getXPaths()
Returns a list with the XPath expressions. |
java.util.List |
getXPathsForAlias(java.lang.String alias)
Returns the XPath expressions for the specified path. |
void |
setRootElement(SchemaElement element)
Sets the root schema element. |
void |
setSchemaName(java.lang.String schemaName)
Sets the schema name. |
void |
setUseXPathForQuery(boolean b)
Specifies if XPath expressions are used in the query instead of attributes. |
void |
unifyPathForCondition(QueryCondition condition)
Unifies the path in the specified query condition. |
boolean |
usesXPathForQuery()
Returns true iff XPath expressions are used in the query instead of attributes. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.lang.String schemaName
protected SchemaElement rootElement
protected boolean useXPathForQuery
| Constructor Detail |
public Schema()
public Schema(java.lang.String schemaName)
schemaName - schema name| Method Detail |
public java.lang.String getSchemaName()
public void setSchemaName(java.lang.String schemaName)
schemaName - schema namepublic SchemaElement getRootElement()
public void setRootElement(SchemaElement element)
element - new root schema elementpublic boolean usesXPathForQuery()
public void setUseXPathForQuery(boolean b)
b - if true, XPath expressions are used in the querypublic SchemaElement getElement(java.lang.String path)
path - path (XPath expression or alias)
public java.util.List getXPaths()
public java.util.List getAliases()
public java.lang.String getPath(java.lang.String path)
path - path (XPath expression or alias)
public void unifyPathForCondition(QueryCondition condition)
condition - query conditionpublic java.lang.String getAlias(java.lang.String path)
path - path (XPath expression or alias)
public java.util.List getAliasesForXPath(java.lang.String path)
path - XPath expression)
public java.lang.String getXPath(java.lang.String alias)
alias - path (XPath expression or alias)
public java.util.List getXPathsForAlias(java.lang.String alias)
alias - alias
public void addAlias(java.lang.String xpath,
java.lang.String alias)
xpath - XPath expressionalias - alias for the specified XPath expressionpublic void addAliases()
public void clearAliases()
public java.lang.String convPath(java.lang.String path)
path - XPath
public java.util.List extractValues(org.w3c.dom.Document document,
java.lang.String att)
document - XML documentatt - attribute (XPath or alias)
public java.lang.String getHierarchicalView()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||