Package org.gcube.common.security
Class ContextBean
- java.lang.Object
-
- org.gcube.common.security.ContextBean
-
public class ContextBean extends Object
A object model of a scope.- Author:
- Fabio Simeoni
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classContextBean.TypeScope types *
-
Constructor Summary
Constructors Constructor Description ContextBean(String scope)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContextBeanenclosingScope()Returns the enclosing scope, if any.booleanequals(Object obj)inthashCode()booleanis(ContextBean.Type type)Returnstrueif the scope has a givenContextBean.Type.Stringname()Returns the name of the scope.StringtoString()Returns the linear expression of the scope.ContextBean.Typetype()Returns theContextBean.Typeof the scope.
-
-
-
Field Detail
-
separator
protected static String separator
Scope separators used in linear syntax.
-
-
Constructor Detail
-
ContextBean
public ContextBean(String scope) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
-
Method Detail
-
name
public String name()
Returns the name of the scope.- Returns:
- the name
-
is
public boolean is(ContextBean.Type type)
Returnstrueif the scope has a givenContextBean.Type.- Parameters:
type- the type- Returns:
trueif the scope has the given type,falseotherwise
-
type
public ContextBean.Type type()
Returns theContextBean.Typeof the scope.- Returns:
- the type
-
enclosingScope
public ContextBean enclosingScope()
Returns the enclosing scope, if any.- Returns:
- the enclosing scope, or
nullif the scope is top-level
-
toString
public String toString()
Returns the linear expression of the scope.
-
-