Package moise.os.ss
Class Role
java.lang.Object
moise.common.MoiseElement
moise.os.ss.Role
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable,Identifiable,ToXML
public class Role extends MoiseElement implements ToXML
Represents a Role Definition (its name and inheritance).
- Author:
- Jomi Fred Hubner
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description protected booleanisAbstractprivate static longserialVersionUIDprotected SSssprotected java.util.Set<Role>superRolesFields inherited from class moise.common.MoiseElement
debug -
Constructor Summary
-
Method Summary
Modifier and Type Method Description voidaddSuperRole(java.lang.String superId)booleancontainsSuperRole(Role r)returns true if some of the direct super roles is equal rprivate voidgenerateFullSuperRolesBranch(org.w3c.dom.Element ele, java.util.Collection<Role> roles, org.w3c.dom.Document document)java.util.Map<java.lang.String,Role>getAllSuperRoles()gets the super roles of this role (including the super roles of the super roles...., but excluding this role).org.w3c.dom.ElementgetAsDetailedDom(org.w3c.dom.Document document)org.w3c.dom.ElementgetAsDOM(org.w3c.dom.Document document)java.util.Collection<Compatibility>getCompatibilities(Group gr)gets all compatibilities for this role (and its super roles) in the context of the GrSpecjava.util.Collection<Norm>getDeonticRelations()gets all deontic relations (obligations, permissions, ...) for this role (and its super roles)java.util.Map<java.lang.String,Role>getEntailedRoles()gets the super roles of this role (including this role, the super roles of the super roles....) The returned map keys are the roles' id (String) and the value is the rolejava.util.Collection<Group>getGroups()gets a list of groups where this role can be playedjava.util.Collection<Link>getLinks(Group gr)gets all links for this role (and its super roles) in the context of the GrSpecjava.util.Collection<Norm>getNorms(NS.OpTypes type, java.lang.String mission)gets norms for this role (and its super roles).java.lang.ObjectgetProperty(java.lang.String id)gets properties of this role (it also looks at super roles properties not "over written"java.util.Collection<Role>getSubRoles()gets the direct specialisations (sub-roles) of this role.java.util.Collection<Role>getSuperRoles()gets the super roles of this rolestatic java.lang.StringgetXMLTag()booleanhasNorm(NS.OpTypes type, java.lang.String mission)returns true if this role has a norm towards the mission.booleanisAbstract()protected voidsetAbstract(boolean a)voidsetFromDOM(org.w3c.dom.Element ele)voidsetSS(SS ss)Methods inherited from class moise.common.MoiseElement
compareTo, equals, getBoolProperty, getBoolProperty, getCreationDate, getFullId, getId, getId, getOwner, getPrefix, getPrefix, getProperties, getPropertiesAsDOM, getPropertiesAsProlog, getStrProperty, hashCode, setId, setOwner, setPrefix, setPropertiesFromDOM, setProperty, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
- Constant Field Values
-
superRoles
-
isAbstract
protected boolean isAbstract -
ss
-
-
Constructor Details
-
Role
Creates a new Role- Parameters:
ss- the SS this role will belongs toid- the identification of the role
-
-
Method Details
-
setSS
-
addSuperRole
- Throws:
MoiseConsistencyException
-
getSuperRoles
gets the super roles of this role -
containsSuperRole
returns true if some of the direct super roles is equal r -
getAllSuperRoles
gets the super roles of this role (including the super roles of the super roles...., but excluding this role). The returned map keys are the roles' id (String) and the value is the role (object of the class Role) -
getEntailedRoles
gets the super roles of this role (including this role, the super roles of the super roles....) The returned map keys are the roles' id (String) and the value is the role -
getSubRoles
gets the direct specialisations (sub-roles) of this role. It does not return the sub-sub-roles. -
getGroups
gets a list of groups where this role can be played -
getCompatibilities
gets all compatibilities for this role (and its super roles) in the context of the GrSpec -
getLinks
gets all links for this role (and its super roles) in the context of the GrSpec -
getDeonticRelations
gets all deontic relations (obligations, permissions, ...) for this role (and its super roles) -
getNorms
gets norms for this role (and its super roles). if type != null, the norm type must be equals to type (all obligation is a permission). if mission != null, the norm mission must be equals to mission -
hasNorm
returns true if this role has a norm towards the mission. if type != null, the norm type must be equals to type (all obligation is a permission). if mission != null, the norm mission must be equals to mission -
getProperty
public java.lang.Object getProperty(java.lang.String id)gets properties of this role (it also looks at super roles properties not "over written"- Overrides:
getPropertyin classMoiseElement
-
setAbstract
protected void setAbstract(boolean a) -
isAbstract
public boolean isAbstract() -
getXMLTag
public static java.lang.String getXMLTag() -
getAsDOM
public org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document) -
getAsDetailedDom
public org.w3c.dom.Element getAsDetailedDom(org.w3c.dom.Document document) -
generateFullSuperRolesBranch
private void generateFullSuperRolesBranch(org.w3c.dom.Element ele, java.util.Collection<Role> roles, org.w3c.dom.Document document) -
setFromDOM
- Throws:
MoiseException
-