sk.uniba.euromath.document.schema.impl.export
Class NameListImplBuilder<R extends ISingleQNameP,E extends com.sun.msv.grammar.NameClassAndExpression>

java.lang.Object
  extended by sk.uniba.euromath.document.schema.impl.export.NameListImplBuilder<R,E>
Type Parameters:
R - result rule. If E is ElementExp then R must be instance of INewElementRuleP. If E is AttributeExp then R must be instance of IAttributeRuleP.
E - the expression instance. May be ElementExp or AttributeExp only.

public final class NameListImplBuilder<R extends ISingleQNameP,E extends com.sun.msv.grammar.NameClassAndExpression>
extends Object

Factory, that can build appropriate NameListImpl.

Author:
Martin Vysny

Method Summary
 NameListImpl<R> build(E exp, RulePool pool)
          Builds NameListImpl from given expression.
 NameListImpl<R> build(Map<String,Set<E>> map, RulePool pool)
          Builds NameListImpl from given map of element or attribute expressions.
 NameListImpl<R> build(Set<E> exps, RulePool pool)
          Builds NameListImpl from given set of element/attribute expressions.
static NameListImplBuilder<IAttributeRuleP,com.sun.msv.grammar.AttributeExp> getAttributeBuilder()
          Returns builder that builds attribute rules.
static NameListImplBuilder<INewElementRuleP,com.sun.msv.grammar.ElementExp> getElementBuilder()
          Returns builder that builds element rules.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getElementBuilder

public static NameListImplBuilder<INewElementRuleP,com.sun.msv.grammar.ElementExp> getElementBuilder()
Returns builder that builds element rules.

Returns:
element builder

getAttributeBuilder

public static NameListImplBuilder<IAttributeRuleP,com.sun.msv.grammar.AttributeExp> getAttributeBuilder()
Returns builder that builds attribute rules.

Returns:
attribute builder

build

public NameListImpl<R> build(E exp,
                             RulePool pool)
Builds NameListImpl from given expression.

Parameters:
exp - NameClassAndExpression instance.
pool - pool where to place new NewElementRuleImpl/ AttributeRuleImpl objects.
Returns:
namelist representing given element expressions.

build

public NameListImpl<R> build(Set<E> exps,
                             RulePool pool)
Builds NameListImpl from given set of element/attribute expressions. All expressions in given set must be either AttributeExp s or ElementExp, mixing is not allowed.

Parameters:
exps - Set of NameClassAndExpression instances.
pool - pool where to place new NewElementRuleImpl/ AttributeRuleImpl objects.
Returns:
namelist representing given element expressions.

build

public NameListImpl<R> build(Map<String,Set<E>> map,
                             RulePool pool)
Builds NameListImpl from given map of element or attribute expressions. This map maps element or attribute's localname string to set of NameClassAndExpressions, that may generate this element.

Parameters:
map - Maps localname String to Set of NameClassAndExpressions.
pool - pool where to place new NewElementRuleImpl (or AttributeRuleImpl) objects.
Returns:
namelist representing given element/attribute expressions.


Copyright © 2003-2006 null. All Rights Reserved.