Class IdentifierParser

java.lang.Object
org.olap4j.impl.IdentifierParser

public class IdentifierParser extends Object
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
  • Constructor Details

    • IdentifierParser

      public IdentifierParser()
  • Method Details

    • parseTupleList

      public static void parseTupleList(IdentifierParser.Builder builder, String string)
      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

      public 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.
      Parameters:
      builder - Builder
      string - String to parse
      i - Position to start parsing in string
      Returns:
      Position where parsing ended in string
    • parseMemberList

      public static void parseMemberList(IdentifierParser.Builder builder, String string)
    • parseMember

      public static int parseMember(IdentifierParser.Builder builder, String string, int i)
    • parseIdentifier

      public static List<IdentifierSegment> parseIdentifier(String s)
      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

      public static List<List<IdentifierSegment>> parseIdentifierList(String s)
      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