|
JBoss MetaData Repository 2.2.0.SP1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.metadata.spi.scope.ScopeKey
org.jboss.metadata.spi.scope.UnmodifiableScopeKey
public final class UnmodifiableScopeKey
The UnmodifiableScopeKey represents a path which is made up of the path entries. The UnmodifiableScopeKey (Server=Bob,Deployment=Foo.war,Class=Bar) is the child of (Server=Bob,Deployment=Foo.war), which is the child of (Server=Bob). Think about this statement in terms of a path relationship. The server (Bob) contains a deployment (Foo.war) and the deployment contains a class (Bar). See historical design notes http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3972233#3972233 http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4013747#4013747 Thread Safety: This class is immutable and therefore thread safe. Note: this class requires that class Scope implement Comparable, so that it can correctly sort the array of Scopes. Note that is not needed for UnmodifiableScopeKey(ScopeKey), which is already sorted. Warning: This class (delicately) extends ScopeKey and overides all ScopeKey methods. Since there is no common interface class between the two classes, there are risks to be aware of. If a new method is added to ScopeKey and not to UnmodifiableScopeKey, undesireable behavior will occur when that new method is invoked (ScopeKey's member variables will be null).
Field Summary |
---|
Fields inherited from class org.jboss.metadata.spi.scope.ScopeKey |
---|
DEFAULT_SCOPE |
Constructor Summary | |
---|---|
UnmodifiableScopeKey(Collection<Scope> scopes)
Create a new ScopeKey. |
|
UnmodifiableScopeKey(int max,
Scope... scopes)
Create a new ScopeKey. |
|
UnmodifiableScopeKey(Scope... scopes)
Create a new ScopeKey. |
|
UnmodifiableScopeKey(ScopeKey key)
|
|
UnmodifiableScopeKey(ScopeLevel level,
Object qualifier)
Create a new ScopeKey. |
Method Summary | |
---|---|
Scope |
addScope(Scope scope)
Scope cannot be added to an UnmodifiableScopeKey (instead construct a new UnmodifiableScopeKey). |
Scope |
addScope(ScopeLevel level,
Object qualifier)
Scope cannot be added to an UnmodifiableScopeKey (instead construct a new UnmodifiableScopeKey). |
ScopeKey |
clone()
clone will always return a frozen copy of the UnmodifiableScopeKey. |
boolean |
equals(Object object)
|
void |
freeze()
This method is ignored as UnmodifiableScopeKey is always frozen |
protected Scope[] |
getArray()
|
ScopeLevel |
getMaxScopeLevel()
Get the maximum scope level |
ScopeKey |
getOptimizedKey()
The returned ScopeKey is immutable and optimized for use at runtime. |
ScopeKey |
getParent()
Get the parent scope key |
Scope |
getScope(ScopeLevel level)
Get a scope |
Scope |
getScopeLevel(ScopeLevel scopeLevel)
Get scope for the specified scopeLevel |
Collection<Scope> |
getScopes()
Get the scopes |
protected Collection<Scope> |
getScopesCollection()
|
int |
hashCode()
|
boolean |
isFrozen()
Get the frozen. |
boolean |
isParent(ScopeKey key)
Is this parent of key parameter. |
Scope |
removeScope(Scope scope)
Scope cannot be removed from an UnmodifiableScopeKey (instead construct a new UnmodifiableScopeKey). |
Scope |
removeScopeLevel(ScopeLevel scopeLevel)
ScopeLevel cannot be removed from an UnmodifiableScopeKey (instead construct a new UnmodifiableScopeKey). |
String |
toString()
|
Methods inherited from class org.jboss.metadata.spi.scope.ScopeKey |
---|
computeHashCode, computeHashCode |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public UnmodifiableScopeKey(ScopeKey key)
public UnmodifiableScopeKey(ScopeLevel level, Object qualifier)
level
- the scope levelqualifier
- the scope qualifierpublic UnmodifiableScopeKey(Collection<Scope> scopes)
scopes
- is a collection of Scope instances that make up the represented path
IllegalArgumentException
- if parameter scopes is nullpublic UnmodifiableScopeKey(Scope... scopes)
scopes
- is zero or more Scope instances that make up the represented path
IllegalArgumentException
- if parameter scopes is nullpublic UnmodifiableScopeKey(int max, Scope... scopes)
max
- number of passed Scope instances to usescopes
- is zero or more Scope instances that make up the represented path
IllegalArgumentException
- if parameter scopes is nullMethod Detail |
---|
public ScopeKey getOptimizedKey()
ScopeKey
getOptimizedKey
in class ScopeKey
public Collection<Scope> getScopes()
getScopes
in class ScopeKey
public Scope getScope(ScopeLevel level)
getScope
in class ScopeKey
level
- the scope level
IllegalArgumentException
- if level is null.public ScopeLevel getMaxScopeLevel()
getMaxScopeLevel
in class ScopeKey
public ScopeKey getParent()
getParent
in class ScopeKey
public boolean isParent(ScopeKey key)
isParent
in class ScopeKey
key
- the key parameter
IllegalArgumentException
- if parameter key is nullpublic Scope getScopeLevel(ScopeLevel scopeLevel)
getScopeLevel
in class ScopeKey
scopeLevel
- the scope level
IllegalArgumentException
- if parameter scopeLevel is nullpublic String toString()
toString
in class ScopeKey
public boolean equals(Object object)
equals
in class ScopeKey
public int hashCode()
hashCode
in class ScopeKey
public boolean isFrozen()
isFrozen
in class ScopeKey
public void freeze()
freeze
in class ScopeKey
public Scope addScope(Scope scope)
addScope
in class ScopeKey
scope
- the scope
IllegalArgumentException
- if scope is null.
IllegalStateException
- because UnmodifiableScopeKey is always frozenpublic Scope addScope(ScopeLevel level, Object qualifier)
addScope
in class ScopeKey
level
- the scope levelqualifier
- the scope qualifier
IllegalStateException
- because UnmodifiableScopeKey is always frozenpublic Scope removeScope(Scope scope)
removeScope
in class ScopeKey
scope
- the scope
IllegalStateException
- because UnmodifiableScopeKey is always frozenpublic Scope removeScopeLevel(ScopeLevel scopeLevel)
removeScopeLevel
in class ScopeKey
scopeLevel
- the scopeLevel
IllegalStateException
- because UnmodifiableScopeKey is always frozenpublic ScopeKey clone()
clone
in class ScopeKey
protected Scope[] getArray()
getArray
in class ScopeKey
protected Collection<Scope> getScopesCollection()
getScopesCollection
in class ScopeKey
|
JBoss MetaData Repository 2.2.0.SP1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |