|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.d2rq.lang.Microsyntax
public class Microsyntax
Static methods for handling various microsyntaxes used in the D2RQ mapping language.
Method Summary | |
---|---|
static ColumnName |
createColumn(String p1,
String p2,
String p3)
Assumes schema, table, column names without quotes or escape characters. |
static AliasDeclaration |
parseAlias(String expression)
Parses a SQL "foo AS bar" expression (for d2rq:alias). |
static ColumnName |
parseColumn(String s)
Parses a column in [Schema.]Table.Column notation. |
static List<ColumnName> |
parseColumnList(String commaSeparated)
Parses a comma-separated list of column names, e.g., for d2rq:bNodeIdColumns |
static Join |
parseJoin(String join)
Parses a d2rq:join value: "table1.col1 (<=|=|=>) table2.col2" |
static TemplateValueMaker |
parsePattern(String pattern)
Parses a pattern that combines one or more database columns into a String. |
static Expression |
parseSQLExpression(String expression,
DataType.GenericType dataType)
Parses a SQL expression, such as "table1.foo > 0", and returns a corresponding Expression . |
static TableName |
parseTable(String s)
Constructs a table name from a fully qualified name in [[catalog.]schema.]table notation. |
static String |
toString(AliasDeclaration alias)
Turns an AliasDeclaration into "foo AS bar" form for d2rq:alias. |
static String |
toString(ColumnName column)
Returns a [schema.]table.column string representation. |
static String |
toString(Join join)
Turns a Join into d2rq:join syntax: "table1.col1 (<=|=|=>) table2.col2" |
static String |
toString(List<ColumnName> columnList)
Serializes a column list to a string usable for d2rq:bNodeIdColumns |
static String |
toString(TableName tableName)
Returns a [schema.]table string representation. |
static String |
toString(TableName tableName,
Identifier column)
Returns a [schema.]table.column string representation. |
static String |
toString(TemplateValueMaker pattern)
Turns a TemplateValueMaker into a d2rq:pattern
style string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static List<ColumnName> parseColumnList(String commaSeparated)
public static String toString(List<ColumnName> columnList)
public static TableName parseTable(String s)
public static String toString(TableName tableName)
public static String toString(TableName tableName, Identifier column)
public static String toString(ColumnName column)
public static ColumnName parseColumn(String s)
public static Expression parseSQLExpression(String expression, DataType.GenericType dataType)
Expression
. Column names must be qualified
with table (and optional schema), and must be given without
quotes or escapes. Some effort is being made to avoid misidentifying
columns inside string literals, but it's safest to write the expression
so that it doesn't contain anything looking like a qualified column name
elsewhere.
public static ColumnName createColumn(String p1, String p2, String p3)
public static AliasDeclaration parseAlias(String expression)
public static String toString(AliasDeclaration alias)
AliasDeclaration
into "foo AS bar" form for d2rq:alias.
public static Join parseJoin(String join)
public static String toString(Join join)
Join
into d2rq:join syntax: "table1.col1 (<=|=|=>) table2.col2"
public static TemplateValueMaker parsePattern(String pattern)
d2rq:pattern
and d2rq:uriPattern
,
often for generating URIs from a column's primary key.
Patterns consist of alternating literal parts and column references.
The D2RQ syntax encloses column references
in @@...@@
. Column names must be fully qualified.
Example: aaa@@t.col1@@bbb@@t.col2@@@@t.col3@@ccc
This has four literal parts: "aaa", "bbb", "", "ccc".
It has three column references: t.col1, t.col2, t.col3
Each column reference can also include an encoding function, an instance
of TemplateValueMaker.ColumnFunction
: aaa@@t.col1|urlify@@bbb
.
The default encoding function is TemplateValueMaker.IDENTITY
.
public static String toString(TemplateValueMaker pattern)
TemplateValueMaker
into a d2rq:pattern
style string.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |