|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmondrian.xmla.XmlaUtil
public class XmlaUtil
Utility methods for XML/A implementation.
Nested Class Summary | |
---|---|
static class |
XmlaUtil.MetadataRowset
Result of a metadata query. |
static class |
XmlaUtil.Wildcard
Wrapper which indicates that a restriction is to be treated as a SQL-style wildcard match. |
Field Summary |
---|
Constructor Summary | |
---|---|
XmlaUtil()
|
Method Summary | |
---|---|
static void |
element2Text(org.w3c.dom.Element elem,
java.io.StringWriter writer)
|
static java.lang.String |
encodeElementName(java.lang.String name)
Encodes an XML element name. |
static org.w3c.dom.Element[] |
filterChildElements(org.w3c.dom.Element parent,
java.lang.String ns,
java.lang.String lname)
|
static org.w3c.dom.Element |
firstChildElement(org.w3c.dom.Element parent,
java.lang.String ns,
java.lang.String lname)
Returns the first child element of an XML element, or null if there is no first child. |
static void |
generateMetamodelJavadoc()
Generates descriptions of the columns returned by each metadata query, in javadoc format, suitable for pasting into OlapDatabaseMetaData . |
static XmlaUtil.MetadataRowset |
getMetadataRowset(Connection connection,
java.lang.String catalogName,
java.lang.String methodName,
java.util.Map<java.lang.String,java.lang.Object> restrictionMap)
Returns a set of column headings and rows for a given metadata request. |
static java.lang.String |
normalizeNumericString(java.lang.String numericStr)
Corrects for the differences between numeric strings arising because JDBC drivers use different representations for numbers ( Double vs. |
static java.lang.Throwable |
rootThrowable(java.lang.Throwable throwable)
Finds root MondrianException in exception chain if exists, otherwise the input throwable. |
static org.w3c.dom.Element |
stream2Element(java.io.InputStream stream)
|
static org.w3c.dom.Element |
text2Element(java.lang.String text)
|
static java.lang.String |
textInElement(org.w3c.dom.Element elem)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlaUtil()
Method Detail |
---|
public static java.lang.String encodeElementName(java.lang.String name)
This function is mainly for encode element names in result of Drill Through execute, because its element names come from database, we cannot make sure they are valid XML contents.
Quoth the XML/A specification, version 1.1:
XML does not allow certain characters as element and attribute names. XML for Analysis supports encoding as defined by SQL Server 2000 to address this XML constraint. For column names that contain invalid XML name characters (according to the XML 1.0 specification), the nonvalid Unicode characters are encoded using the corresponding hexadecimal values. These are escaped as _xHHHH_ where HHHH stands for the four-digit hexadecimal UCS-2 code for the character in most-significant bit first order. For example, the name "Order Details" is encoded as Order_x0020_Details, where the space character is replaced by the corresponding hexadecimal code.
name
- Name of XML element
public static void element2Text(org.w3c.dom.Element elem, java.io.StringWriter writer) throws XmlaException
XmlaException
public static org.w3c.dom.Element text2Element(java.lang.String text) throws XmlaException
XmlaException
public static org.w3c.dom.Element stream2Element(java.io.InputStream stream) throws XmlaException
XmlaException
public static org.w3c.dom.Element firstChildElement(org.w3c.dom.Element parent, java.lang.String ns, java.lang.String lname)
parent
- XML elementns
- Namespacelname
- Local name of child
public static org.w3c.dom.Element[] filterChildElements(org.w3c.dom.Element parent, java.lang.String ns, java.lang.String lname)
public static java.lang.String textInElement(org.w3c.dom.Element elem)
public static java.lang.Throwable rootThrowable(java.lang.Throwable throwable)
throwable
- Exception
public static java.lang.String normalizeNumericString(java.lang.String numericStr)
Double
vs. BigDecimal
) and
these have different toString() behavior.
If it contains a decimal point, then strip off trailing '0's. After stripping off the '0's, if there is nothing right of the decimal point, then strip off decimal point.
numericStr
- Numeric string
public static XmlaUtil.MetadataRowset getMetadataRowset(Connection connection, java.lang.String catalogName, java.lang.String methodName, java.util.Map<java.lang.String,java.lang.Object> restrictionMap)
connection
- ConnectioncatalogName
- Catalog namemethodName
- Metadata method name per XMLA (e.g. "MDSCHEMA_CUBES")restrictionMap
- Restrictions
public static void generateMetamodelJavadoc() throws java.io.IOException
OlapDatabaseMetaData
.
java.io.IOException
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |