sk.uniba.euromath.editor.widgets.namelist
Class SingleAttributeDNL

java.lang.Object
  extended by sk.uniba.euromath.editor.widgets.namelist.DisplayableNameList<AttributeRule>
      extended by sk.uniba.euromath.editor.widgets.namelist.SingleAttributeDNL

public final class SingleAttributeDNL
extends DisplayableNameList<AttributeRule>

Contains only one attribute rule. Works only with existing attributes; existing attribute must have been created by some known schema hence it shall never contain the namespace item type.

Author:
Martin Vysny

Field Summary
protected  QName attrName
          The attribute qname.
protected  AttributeRule rule
          Represents this single rule.
protected  String[] strings
          Displayable strings.
protected  DisplayableNameItemTypeEnum type
          The rule type.
 
Fields inherited from class sk.uniba.euromath.editor.widgets.namelist.DisplayableNameList
isElement, localNamespaceName, localNamespaceUri
 
Constructor Summary
SingleAttributeDNL(Attr attr, AttributeRule rule)
          Constructs object representing given attribute and its rule only.
SingleAttributeDNL(QName attrName, AttributeRule rule, String localNamespaceUri)
          Constructs object representing given attribute and its rule only.
 
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.
 AttributeRule 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.
 
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
 

Field Detail

rule

protected final AttributeRule rule
Represents this single rule.


type

protected final DisplayableNameItemTypeEnum type
The rule type.


attrName

protected final QName attrName
The attribute qname.


strings

protected final String[] strings
Displayable strings.

Constructor Detail

SingleAttributeDNL

public SingleAttributeDNL(Attr attr,
                          AttributeRule rule)
Constructs object representing given attribute and its rule only.

Parameters:
attr - the attribute to represent. It must have its owner element.
rule - rule for given attribute.

SingleAttributeDNL

public SingleAttributeDNL(QName attrName,
                          AttributeRule rule,
                          String localNamespaceUri)
Constructs object representing given attribute and its rule only.

Parameters:
attrName - the attribute to represent
rule - rule for given attribute.
localNamespaceUri - the namespace of the local elements/attributes.
Method Detail

getForeign

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

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

getLocal

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

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

getRule

public AttributeRule 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<AttributeRule>
Parameters:
i - index of the name, as in getStrings() array.
Returns:
the rule.

getStrings

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

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

getNamespace

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

Specified by:
getNamespace in class DisplayableNameList<AttributeRule>
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<AttributeRule>
Parameters:
i - index of the name, as in getStrings() array.
Returns:
item type.


Copyright © 2003-2006 null. All Rights Reserved.