Package mondrian.olap
Class NameResolver
java.lang.Object
mondrian.olap.NameResolver
Resolves a list of segments (a parsed identifier) to an OLAP element.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Naming context within which elements are defined. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
matches
(Formula formula, OlapElement parent, org.olap4j.mdx.IdentifierSegment segment) Returns whether a formula (representing a calculated member or named set) matches a given parent and name segment.resolve
(OlapElement parent, List<org.olap4j.mdx.IdentifierSegment> segments, boolean failIfNotFound, int category, MatchType matchType, List<NameResolver.Namespace> namespaces) Resolves a list of segments (a parsed identifier) to an OLAP element.
-
Constructor Details
-
NameResolver
public NameResolver()Creates a NameResolver.
-
-
Method Details
-
resolve
public OlapElement resolve(OlapElement parent, List<org.olap4j.mdx.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 cubesegments
- Exploded compound name, such as {"Products", "Product Department", "Produce"}failIfNotFound
- If the element is not found, determines whether to return null or throw an errorcategory
- Type of returned element, aCategory
value;Category.Unknown
if it doesn't matter.matchType
- Match typenamespaces
- 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, org.olap4j.mdx.IdentifierSegment segment) Returns whether a formula (representing a calculated member or named set) matches a given parent and name segment.- Parameters:
formula
- Formulaparent
- Parent elementsegment
- Name segment- Returns:
- Whether formula matches
-