mondrian.olap
Class NameResolver

java.lang.Object
  extended by mondrian.olap.NameResolver

public final class NameResolver
extends Object

Resolves a list of segments (a parsed identifier) to an OLAP element.


Nested Class Summary
static interface NameResolver.Namespace
          Naming context within which elements are defined.
 
Constructor Summary
NameResolver()
          Creates a NameResolver.
 
Method Summary
static boolean matches(Formula formula, OlapElement parent, IdentifierSegment segment)
          Returns whether a formula (representing a calculated member or named set) matches a given parent and name segment.
 OlapElement resolve(OlapElement parent, List<IdentifierSegment> segments, boolean failIfNotFound, int category, MatchType matchType, List<NameResolver.Namespace> namespaces)
          Resolves a list of segments (a parsed identifier) to an OLAP element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NameResolver

public NameResolver()
Creates a NameResolver.

Method Detail

resolve

public OlapElement resolve(OlapElement parent,
                           List<IdentifierSegment> segments,
                           boolean failIfNotFound,
                           int category,
                           MatchType matchType,
                           List<NameResolver.Namespace> namespaces)
Resolves a list of segments (a parsed identifier) to an OLAP element.

Parameters:
parent - Parent element to search in, usually a cube
segments - Exploded compound name, such as {"Products", "Product Department", "Produce"}
failIfNotFound - If the element is not found, determines whether to return null or throw an error
category - Type of returned element, a Category value; Category.Unknown if it doesn't matter.
matchType - Match type
namespaces - Namespaces wherein to find child element at each step
Returns:
OLAP element with given name, or null if not found

matches

public static boolean matches(Formula formula,
                              OlapElement parent,
                              IdentifierSegment segment)
Returns whether a formula (representing a calculated member or named set) matches a given parent and name segment.

Parameters:
formula - Formula
parent - Parent element
segment - Name segment
Returns:
Whether formula matches

Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads