sk.uniba.euromath.editor.widgets.namelist
Class DisplayableNameListImpl<R extends BaseRule>

java.lang.Object
  extended by sk.uniba.euromath.editor.widgets.namelist.DisplayableNameList<R>
      extended by sk.uniba.euromath.editor.widgets.namelist.DisplayableNameListImpl<R>
Type Parameters:
R - the rule type. Can be instance of AttributeRule or NewElementRule only.

public final class DisplayableNameListImpl<R extends BaseRule>
extends DisplayableNameList<R>

Represents the NameList object as a set of strings.

Author:
Martin Vysny

Field Summary
 
Fields inherited from class sk.uniba.euromath.editor.widgets.namelist.DisplayableNameList
isElement, localNamespaceName, localNamespaceUri
 
Constructor Summary
DisplayableNameListImpl(INameList<R> nameList, XMLAccess xmlAccess, NamespaceManager nsManager, boolean isElement)
          Constructs an instance of the object.
 
Method Summary
 QName getForeign(int i)
          Returns the foreign name.
 String getLocal(int i)
          Returns the local name.
 String getNamespace(int i)
          Returns the namespace item.
 R getRule(int i)
          Returns the rule for the name as returned by the NameList class.
 String[] getStrings()
          Returns array of a displayable representation of names.
 DisplayableNameItemTypeEnum getType(int i)
          Determines the type of the item.
 void refresh()
          Refreshes the namelist and the object itself.
 
Methods inherited from class sk.uniba.euromath.editor.widgets.namelist.DisplayableNameList
getDomNamespaceUri, getDomQName, getLength, getNamespaceDescription, getRealNamespaceDescription, getRealNamespaceUri, hasRule, isEmpty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisplayableNameListImpl

public DisplayableNameListImpl(INameList<R> nameList,
                               XMLAccess xmlAccess,
                               NamespaceManager nsManager,
                               boolean isElement)
Constructs an instance of the object.

Parameters:
nameList - the NameList to represent.
xmlAccess - the xml document
nsManager - current namespace manager, it may contain new defined prefixes.
isElement - true if this object will represent elements or attributes. There is a difference: elements from non-null namespace will have a prefix, attributes from non-null (local) namespace will have a prefix only if this namespace is different than a namespace of the owner element.
Method Detail

getStrings

public String[] getStrings()
Description copied from class: DisplayableNameList
Returns array of a displayable representation of names.

Specified by:
getStrings in class DisplayableNameList<R extends BaseRule>
Returns:
array of a displayable representation of names.

getLocal

public String getLocal(int i)
Description copied from class: DisplayableNameList
Returns the local name.

Specified by:
getLocal in class DisplayableNameList<R extends BaseRule>
Parameters:
i - index of the name, as in getStrings() array.
Returns:
a local name, that can be used to query the name list.

getForeign

public QName getForeign(int i)
Description copied from class: DisplayableNameList
Returns the foreign name.

Specified by:
getForeign in class DisplayableNameList<R extends BaseRule>
Parameters:
i - index of the name, as in getStrings() array.
Returns:
a foreign name, that can be used to query the name list.

getNamespace

public String getNamespace(int i)
Description copied from class: DisplayableNameList
Returns the namespace item.

Specified by:
getNamespace in class DisplayableNameList<R extends BaseRule>
Parameters:
i - index of the name, as in getStrings() array.
Returns:
a namespace denoting foreign qnames that doesn't have schema loaded or doesn't have schema at all.

getType

public DisplayableNameItemTypeEnum getType(int i)
Description copied from class: DisplayableNameList
Determines the type of the item.

Specified by:
getType in class DisplayableNameList<R extends BaseRule>
Parameters:
i - index of the name, as in getStrings() array.
Returns:
item type.

getRule

public R getRule(int i)
Description copied from class: DisplayableNameList
Returns the rule for the name as returned by the NameList class. Only local and foreign items can have a rule.

Specified by:
getRule in class DisplayableNameList<R extends BaseRule>
Parameters:
i - index of the name, as in getStrings() array.
Returns:
the rule.

refresh

public void refresh()
Refreshes the namelist and the object itself. Should be called when new schema is loaded.



Copyright © 2003-2006 null. All Rights Reserved.