Bukkit  1.6.4-R2.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
org.bukkit.permissions.Permission Class Reference

Represents a unique permission that may be attached to a Permissible. More...

+ Collaboration diagram for org.bukkit.permissions.Permission:

Public Member Functions

 Permission (String name)
 
 Permission (String name, String description)
 
 Permission (String name, PermissionDefault defaultValue)
 
 Permission (String name, String description, PermissionDefault defaultValue)
 
 Permission (String name, Map< String, Boolean > children)
 
 Permission (String name, String description, Map< String, Boolean > children)
 
 Permission (String name, PermissionDefault defaultValue, Map< String, Boolean > children)
 
 Permission (String name, String description, PermissionDefault defaultValue, Map< String, Boolean > children)
 
String getName ()
 Returns the unique fully qualified name of this Permission.
 
Map< String, Boolean > getChildren ()
 Gets the children of this permission.
 
PermissionDefault getDefault ()
 Gets the default value of this permission.
 
void setDefault (PermissionDefault value)
 Sets the default value of this permission.
 
String getDescription ()
 Gets a brief description of this permission, if set.
 
void setDescription (String value)
 Sets the description of this permission.
 
Set< PermissiblegetPermissibles ()
 Gets a set containing every Permissible that has this permission.
 
void recalculatePermissibles ()
 Recalculates all Permissibles that contain this permission.
 
Permission addParent (String name, boolean value)
 Adds this permission to the specified parent permission.
 
void addParent (Permission perm, boolean value)
 Adds this permission to the specified parent permission.
 

Static Public Member Functions

static List< PermissionloadPermissions (Map<?,?> data, String error, PermissionDefault def)
 Loads a list of Permissions from a map of data, usually used from retrieval from a yaml file.
 
static Permission loadPermission (String name, Map< String, Object > data)
 Loads a Permission from a map of data, usually used from retrieval from a yaml file.
 
static Permission loadPermission (String name, Map<?,?> data, PermissionDefault def, List< Permission > output)
 Loads a Permission from a map of data, usually used from retrieval from a yaml file.
 

Static Public Attributes

static final PermissionDefault DEFAULT_PERMISSION = PermissionDefault.OP
 

Detailed Description

Represents a unique permission that may be attached to a Permissible.

Definition at line 17 of file Permission.java.

Constructor & Destructor Documentation

org.bukkit.permissions.Permission.Permission ( String  name)
org.bukkit.permissions.Permission.Permission ( String  name,
String  description 
)

Definition at line 29 of file Permission.java.

org.bukkit.permissions.Permission.Permission ( String  name,
PermissionDefault  defaultValue 
)

Definition at line 33 of file Permission.java.

org.bukkit.permissions.Permission.Permission ( String  name,
String  description,
PermissionDefault  defaultValue 
)

Definition at line 37 of file Permission.java.

org.bukkit.permissions.Permission.Permission ( String  name,
Map< String, Boolean >  children 
)

Definition at line 41 of file Permission.java.

org.bukkit.permissions.Permission.Permission ( String  name,
String  description,
Map< String, Boolean >  children 
)

Definition at line 45 of file Permission.java.

org.bukkit.permissions.Permission.Permission ( String  name,
PermissionDefault  defaultValue,
Map< String, Boolean >  children 
)

Definition at line 49 of file Permission.java.

org.bukkit.permissions.Permission.Permission ( String  name,
String  description,
PermissionDefault  defaultValue,
Map< String, Boolean >  children 
)

Member Function Documentation

Permission org.bukkit.permissions.Permission.addParent ( String  name,
boolean  value 
)

Adds this permission to the specified parent permission.

If the parent permission does not exist, it will be created and registered.

Parameters
nameName of the parent permission
valueThe value to set this permission to
Returns
Parent permission it created or loaded

Definition at line 173 of file Permission.java.

References org.bukkit.plugin.PluginManager.addPermission(), org.bukkit.plugin.PluginManager.getPermission(), org.bukkit.Server.getPluginManager(), org.bukkit.Bukkit.getServer(), and org.bukkit.permissions.Permission.Permission().

void org.bukkit.permissions.Permission.addParent ( Permission  perm,
boolean  value 
)

Adds this permission to the specified parent permission.

Parameters
permParent permission to register with
valueThe value to set this permission to

Definition at line 195 of file Permission.java.

References org.bukkit.permissions.Permission.getChildren(), org.bukkit.permissions.Permission.getName(), and org.bukkit.permissions.Permission.recalculatePermissibles().

Map<String, Boolean> org.bukkit.permissions.Permission.getChildren ( )

Gets the children of this permission.

If you change this map in any form, you must call recalculatePermissibles() to recalculate all Permissibles

Returns
Permission children

Definition at line 84 of file Permission.java.

Referenced by org.bukkit.permissions.Permission.addParent(), and org.bukkit.util.permissions.DefaultPermissions.registerPermission().

PermissionDefault org.bukkit.permissions.Permission.getDefault ( )

Gets the default value of this permission.

Returns
Default value of this permission.

Definition at line 93 of file Permission.java.

Referenced by org.bukkit.permissions.PermissibleBase.hasPermission().

String org.bukkit.permissions.Permission.getDescription ( )

Gets a brief description of this permission, if set.

Returns
Brief description of this permission

Definition at line 119 of file Permission.java.

Referenced by org.bukkit.util.permissions.DefaultPermissions.registerPermission().

Set<Permissible> org.bukkit.permissions.Permission.getPermissibles ( )

Gets a set containing every Permissible that has this permission.

This set cannot be modified.

Returns
Set containing permissibles with this permission

Definition at line 145 of file Permission.java.

References org.bukkit.plugin.PluginManager.getPermissionSubscriptions(), org.bukkit.Server.getPluginManager(), and org.bukkit.Bukkit.getServer().

Referenced by org.bukkit.permissions.Permission.recalculatePermissibles().

static Permission org.bukkit.permissions.Permission.loadPermission ( String  name,
Map< String, Object >  data 
)
static

Loads a Permission from a map of data, usually used from retrieval from a yaml file.

The data may contain the following keys: default: Boolean true or false. If not specified, false. children: Map<String, Boolean> of child permissions. If not specified, empty list. description: Short string containing a very small description of this description. If not specified, empty string.

Parameters
nameName of the permission
dataMap of keys
Returns
Permission object

Definition at line 239 of file Permission.java.

References org.bukkit.permissions.Permission.DEFAULT_PERMISSION.

Referenced by org.bukkit.permissions.Permission.loadPermissions().

static Permission org.bukkit.permissions.Permission.loadPermission ( String  name,
Map<?,?>  data,
PermissionDefault  def,
List< Permission output 
)
static

Loads a Permission from a map of data, usually used from retrieval from a yaml file.

The data may contain the following keys: default: Boolean true or false. If not specified, false. children: Map<String, Boolean> of child permissions. If not specified, empty list. description: Short string containing a very small description of this description. If not specified, empty string.

Parameters
nameName of the permission
dataMap of keys
defDefault permission value to use if not set
outputA list to append any created child-Permissions to, may be null
Returns
Permission object

Definition at line 257 of file Permission.java.

References org.bukkit.permissions.PermissionDefault.getByName(), and org.bukkit.permissions.Permission.Permission().

static List<Permission> org.bukkit.permissions.Permission.loadPermissions ( Map<?,?>  data,
String  error,
PermissionDefault  def 
)
static

Loads a list of Permissions from a map of data, usually used from retrieval from a yaml file.

The data may contain a list of name:data, where the data contains the following keys: default: Boolean true or false. If not specified, false. children: Map<String, Boolean> of child permissions. If not specified, empty list. description: Short string containing a very small description of this description. If not specified, empty string.

Parameters
dataMap of permissions
errorAn error message to show if a permission is invalid.
defDefault permission value to use if missing
Returns
Permission object

Definition at line 213 of file Permission.java.

References org.bukkit.Server.getLogger(), org.bukkit.Bukkit.getServer(), and org.bukkit.permissions.Permission.loadPermission().

Referenced by org.bukkit.plugin.PluginDescriptionFile.getPermissions().

void org.bukkit.permissions.Permission.setDefault ( PermissionDefault  value)

Sets the default value of this permission.

This will not be saved to disk, and is a temporary operation until the server reloads permissions. Changing this default will cause all Permissibles that contain this permission to recalculate their permissions

Parameters
valueThe new default to set

Definition at line 105 of file Permission.java.

References org.bukkit.permissions.Permission.recalculatePermissibles().

void org.bukkit.permissions.Permission.setDescription ( String  value)

Sets the description of this permission.

This will not be saved to disk, and is a temporary operation until the server reloads permissions.

Parameters
valueThe new description to set

Definition at line 130 of file Permission.java.

Member Data Documentation

final PermissionDefault org.bukkit.permissions.Permission.DEFAULT_PERMISSION = PermissionDefault.OP
static

The documentation for this class was generated from the following file: