|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.uniba.euromath.document.schema.NameListCustom<T,P>
T
- the rule type. Must be instance of AttributeRule
when P is instance of AttributeRuleP
, and
NewElementRule
when P is instance of
NewElementRuleP
.P
- the rule type. Can be instance of AttributeRuleP
or
NewElementRuleP
only.public final class NameListCustom<T extends BaseRule,P extends IBaseRuleP>
Maintains list of all creatable elements/attributes. It is not backed by a
NameListP
instance, it relies on the data provider.
Constructor Summary | |
---|---|
NameListCustom(String localNamespaceUri)
Creates instance of an empty namelist. |
|
NameListCustom(String localNamespaceUri,
INameListImplDataProvider<P> dataProvider)
Creates instance of namelist from a provider. |
|
NameListCustom(String localNamespaceUri,
Map<QName,T> rules)
Creates instance of namelist from a provider. |
Method Summary | |
---|---|
boolean |
acceptsNamespace(String namespaceURI)
Checks if the namelist accepts/contains at least one qname from given namespace. |
Set<QName> |
getForeignNames()
Returns set of all foreign names, that are in this namelist. |
Set<String> |
getLocalNames()
Returns set of all localnames, that are in this namelist. |
Set<String> |
getNamespaces()
Tries to obtain a list of namespaces of qnames that are contained in this name list. |
String |
getNamespaceUri()
Returns schema's namespace. |
T |
getRule(QName foreign)
Returns rule, that can be used to create node content. |
T |
getRule(QName qname,
boolean isElement)
Returns rule, that can be used to create node content. |
T |
getRule(String localName)
Returns rule, that can be used to create node content. |
boolean |
hasRule(QName qname,
boolean isElement)
Checks if this namelist contains given qname. |
boolean |
isEmpty()
Checks if this namelist is empty (it contains no rules). |
boolean |
isLocal(QName qname,
boolean isElement)
Checks if given qname is local. |
void |
refresh()
Refreshes the namelist to reflect the schema loading/unloading. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NameListCustom(String localNamespaceUri)
localNamespaceUri
- the local namespacepublic NameListCustom(String localNamespaceUri, INameListImplDataProvider<P> dataProvider)
localNamespaceUri
- the local namespacedataProvider
- the data provider.public NameListCustom(String localNamespaceUri, Map<QName,T> rules)
localNamespaceUri
- the local namespacerules
- the rules map.Method Detail |
---|
public Set<String> getLocalNames()
getLocalNames
in interface INameList<T extends BaseRule>
public Set<QName> getForeignNames()
getForeignNames
in interface INameList<T extends BaseRule>
public boolean isEmpty()
isEmpty
in interface INameList<T extends BaseRule>
public T getRule(String localName)
getRule
in interface INameList<T extends BaseRule>
localName
- local name of node (element or attribute).
AttributeRule
,
else it is of type NewElementRule
.public T getRule(QName foreign)
getRule
in interface INameList<T extends BaseRule>
foreign
- full name of foreign (not from our namespace) node
(element or attribute).
AttributeRule
,
else it is of type NewElementRule
.public T getRule(QName qname, boolean isElement)
getRule
in interface INameList<T extends BaseRule>
qname
- full name of node (element or attribute).isElement
- true if the namelist represents element rules, false if
attribute rules.
AttributeRule
,
else it is of type NewElementRule
.public String getNamespaceUri()
getNamespaceUri
in interface INameList<T extends BaseRule>
public boolean acceptsNamespace(String namespaceURI)
INameList
acceptsNamespace
in interface INameList<T extends BaseRule>
namespaceURI
- the namespace to check.
public Set<String> getNamespaces()
INameList
null
.
getNamespaces
in interface INameList<T extends BaseRule>
null
if it cannot be computed and/or represented.
null
namespace is represented as an empty string.public void refresh()
INameList
refresh
in interface INameList<T extends BaseRule>
public boolean hasRule(QName qname, boolean isElement)
INameList
hasRule
in interface INameList<T extends BaseRule>
qname
- full name of node (element or attribute).isElement
- true if the namelist represents element rules, false if
attribute rules.
true
if given qname is known and there is a rule
for it, false
otherwise.public boolean isLocal(QName qname, boolean isElement)
INameList
isLocal
in interface INameList<T extends BaseRule>
qname
- full name of node (element or attribute).isElement
- true if the namelist represents element rules, false if
attribute rules.
true
if given qname is local, false
otherwise. It should implement the following algorithm:
isElement ? DomTools.equalsURI(qname.getNamespaceURI(), getNamespaceUri()) : DomTools.equalsURI(
qname.getNamespaceURI(), null);
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |