Package org.olap4j.impl
Class IdentifierParser
java.lang.Object
org.olap4j.impl.IdentifierParser
Utilities for parsing fully-qualified member names, tuples, member lists,
and tuple lists.
NOTE: Like other classes in the org.olap4j.impl package, this class is not part of the public olap4j API. It is subject to change or removal without notice. It is provided in the hope that it will be useful to implementors of olap4j drivers.
- Author:
- jhyde
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Callback that is called on completion of a structural element like a member or tuple.static class
Implementation ofIdentifierParser.Builder
that collects the segments that make up the name of a member in a list.static class
Implementation ofIdentifierParser.Builder
that collects segments into members, then collects members into lists. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List
<IdentifierSegment> Parses an MDX identifier such as[Foo].[Bar].Baz.invalid input: '&Key'invalid input: '&Key2'
and returns the result as a list of segments.static List
<List<IdentifierSegment>> Parses a string consisting of a sequence of MDX identifiers and returns the result as a list of compound identifiers, each of which is a list of segments.static int
parseMember
(IdentifierParser.Builder builder, String string, int i) static void
parseMemberList
(IdentifierParser.Builder builder, String string) static int
parseTuple
(IdentifierParser.Builder builder, String string, int i) Parses a tuple, of the form '(member, member, ...)', and calls builder methods when finding a segment, member or tuple.static void
parseTupleList
(IdentifierParser.Builder builder, String string) Parses a list of tuples (or a list of members).
-
Constructor Details
-
IdentifierParser
public IdentifierParser()
-
-
Method Details
-
parseTupleList
Parses a list of tuples (or a list of members).- Parameters:
builder
- Builder, called back when each segment, member and tuple is complete.string
- String to parse
-
parseTuple
Parses a tuple, of the form '(member, member, ...)', and calls builder methods when finding a segment, member or tuple.- Parameters:
builder
- Builderstring
- String to parsei
- Position to start parsing in string- Returns:
- Position where parsing ended in string
-
parseMemberList
-
parseMember
-
parseIdentifier
Parses an MDX identifier such as[Foo].[Bar].Baz.invalid input: '&Key'invalid input: '&Key2'
and returns the result as a list of segments.- Parameters:
s
- MDX identifier- Returns:
- List of segments
-
parseIdentifierList
Parses a string consisting of a sequence of MDX identifiers and returns the result as a list of compound identifiers, each of which is a list of segments.For example, parseIdentifierList("{foo.bar, baz}") returns { {"foo", "bar"}, {"baz"} }.
The braces around the list are optional; parseIdentifierList("foo.bar, baz") returns the same result as the previous example.
- Parameters:
s
- MDX identifier list- Returns:
- List of lists of segments
-