code
stringlengths 2.5k
150k
| kind
stringclasses 1
value |
---|---|
groovy [Java] Class Node [Java] Class Node
=================
* groovy.xml.slurpersupport.Node
All Implemented Interfaces and Traits: [Writable](../../lang/writable)
```
public class Node
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [Writable](../../lang/writable)
```
Represents a node.
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Node](#Node(groovy.xml.slurpersupport.Node,%20java.lang.String,%20java.util.Map,%20java.util.Map,%20java.lang.String))**([Node](node) parent, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") attributes, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") attributeNamespaces, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") namespaceURI)`
**Parameters:**
`parent` - the parent node
|
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[addChild](#addChild(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") child)`Adds an object as a new child to this Node. |
| | `protected void` | `**[appendNode](#appendNode(java.lang.Object,%20groovy.xml.slurpersupport.GPathResult))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue, [GPathResult](gpathresult) result)` |
| | `public [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")` | `**[attributes](#attributes())**()`Returns a map of the attributes of this Node. |
| | `public void` | `**[build](#build(groovy.lang.GroovyObject,%20java.util.Map,%20Map))**([GroovyObject](../../lang/groovyobject) builder, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") namespaceMap, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)` |
| | `public void` | `**[build](#build(groovy.lang.GroovyObject,%20java.util.Map,%20Map))**([GroovyObject](../../lang/groovyobject) builder, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") namespaceMap, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)` |
| | `public void` | `**[build](#build(groovy.lang.GroovyObject,%20java.util.Map,%20Map))**([GroovyObject](../../lang/groovyobject) builder, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") namespaceMap, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)` |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[childNodes](#childNodes())**()`Returns an iterator over the child nodes of this Node. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")` | `**[children](#children())**()`Returns a list of the children of this Node. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[doCall](#doCall(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)` |
| | `public boolean` | `**[hasNext](#hasNext())**()` |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>` | `**[localText](#localText())**()`Returns the list of any direct String nodes of this node. |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[name](#name())**()`Returns the name of this Node. |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[namespaceURI](#namespaceURI())**()`Returns the URI of the namespace of this Node. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[next](#next())**()` |
| | `public [Node](node)` | `**[parent](#parent())**()`Returns the parent of this Node. |
| | `public void` | `**[remove](#remove())**()` |
| | `protected void` | `**[replaceBody](#replaceBody(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`Replaces the current body of this Node with the passed object. |
| | `public void` | `**[replaceNode](#replaceNode(groovy.lang.Closure,%20groovy.xml.slurpersupport.GPathResult))**([Closure](../../lang/closure) replacementClosure, [GPathResult](gpathresult) result)` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[text](#text())**()`Returns a string containing the text of the children of this Node. |
| | `public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer")` | `**[writeTo](#writeTo(java.io.Writer))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **Node**([Node](node) parent, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") attributes, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") attributeNamespaces, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") namespaceURI)
**Parameters:**
`parent` - the parent node
`name` - the name for the node
`attributes` - the attributes for the node
`attributeNamespaces` - the namespace mappings for attributes
`namespaceURI` - the namespace URI if any
Method Detail
-------------
### public void **addChild**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") child)
Adds an object as a new child to this Node.
**Parameters:**
`child` - the object to add as a child
### protected void **appendNode**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue, [GPathResult](gpathresult) result)
### public [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") **attributes**()
Returns a map of the attributes of this Node.
**Returns:**
a map of the attributes of this Node
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **build**([GroovyObject](../../lang/groovyobject) builder, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") namespaceMap, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **build**([GroovyObject](../../lang/groovyobject) builder, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") namespaceMap, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)
### public void **build**([GroovyObject](../../lang/groovyobject) builder, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") namespaceMap, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)
### public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **childNodes**()
Returns an iterator over the child nodes of this Node.
**Returns:**
an iterator over the child nodes of this Node
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") **children**()
Returns a list of the children of this Node.
**Returns:**
a list of the children of this Node
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **doCall**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **hasNext**()
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> **localText**()
Returns the list of any direct String nodes of this node.
**Returns:**
the list of String values from this node
**Since:**
2.3.0
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **name**()
Returns the name of this Node.
**Returns:**
the name of this Node
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **namespaceURI**()
Returns the URI of the namespace of this Node.
**Returns:**
the namespace of this Node
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **next**()
### public [Node](node) **parent**()
Returns the parent of this Node.
**Returns:**
the parent of this Node
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **remove**()
### protected void **replaceBody**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
Replaces the current body of this Node with the passed object.
**Parameters:**
`newValue` - the new body
### public void **replaceNode**([Closure](../../lang/closure) replacementClosure, [GPathResult](gpathresult) result)
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **text**()
Returns a string containing the text of the children of this Node.
**Returns:**
a string containing the text of the children of this Node
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") **writeTo**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out)
groovy [Java] Class FilteredNodeChildren [Java] Class FilteredNodeChildren
=================================
* groovy.xml.slurpersupport.FilteredNodeChildren
```
public class FilteredNodeChildren
extends [NodeChildren](nodechildren)
```
Lazy evaluated representation of child nodes filtered by a Closure.
Inherited fields
| Fields inherited from class | Fields |
| **`class [GPathResult](gpathresult)`** | `[name](gpathresult#name), [namespaceMap](gpathresult#namespaceMap), [namespacePrefix](gpathresult#namespacePrefix), [namespaceTagHints](gpathresult#namespaceTagHints), [parent](gpathresult#parent)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[FilteredNodeChildren](#FilteredNodeChildren(groovy.xml.slurpersupport.GPathResult,%20groovy.lang.Closure,%20Map))**([GPathResult](gpathresult) parent, [Closure](../../lang/closure) closure, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)`
**Parameters:**
`parent` - the GPathResult prior to the application of the expression creating this GPathResult
|
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `protected [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getNextNode](#getNextNode(java.util.Iterator))**([Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") iter)` |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[nodeIterator](#nodeIterator())**()` |
| | `public [GPathResult](gpathresult)` | `**[pop](#pop())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [NodeChildren](nodechildren)` | `[appendNode](nodechildren#appendNode(java.lang.Object)), [build](nodechildren#build(groovy.lang.GroovyObject)), [childNodes](nodechildren#childNodes()), [find](nodechildren#find(groovy.lang.Closure)), [findAll](nodechildren#findAll(groovy.lang.Closure)), [getNextNode](nodechildren#getNextNode(java.util.Iterator)), [hasNext](nodechildren#hasNext()), [hasNext](nodechildren#hasNext()), [iterator](nodechildren#iterator()), [next](nodechildren#next()), [next](nodechildren#next()), [nodeIterator](nodechildren#nodeIterator()), [parents](nodechildren#parents()), [remove](nodechildren#remove()), [remove](nodechildren#remove()), [replaceBody](nodechildren#replaceBody(java.lang.Object)), [replaceNode](nodechildren#replaceNode(groovy.lang.Closure)), [size](nodechildren#size()), [text](nodechildren#text()), [writeTo](nodechildren#writeTo(java.io.Writer))` |
| `class [GPathResult](gpathresult)` | `[appendNode](gpathresult#appendNode(java.lang.Object)), [breadthFirst](gpathresult#breadthFirst()), [childNodes](gpathresult#childNodes()), [children](gpathresult#children()), [createIterator](gpathresult#createIterator(java.lang.Object)), [declareNamespace](gpathresult#declareNamespace(java.util.Map)), [depthFirst](gpathresult#depthFirst()), [doCall](gpathresult#doCall(java.lang.Object)), [doCall](gpathresult#doCall(java.lang.Object)), [equals](gpathresult#equals(java.lang.Object)), [find](gpathresult#find(groovy.lang.Closure)), [findAll](gpathresult#findAll(groovy.lang.Closure)), [getAt](gpathresult#getAt(int)), [getAt](gpathresult#getAt(groovy.lang.IntRange)), [getAttribute](gpathresult#getAttribute(java.lang.Object,%20java.lang.String)), [getBody](gpathresult#getBody()), [getProperty](gpathresult#getProperty(java.lang.String)), [hasNext](gpathresult#hasNext()), [hasNext](gpathresult#hasNext()), [hasNext](gpathresult#hasNext()), [hashCode](gpathresult#hashCode()), [isEmpty](gpathresult#isEmpty()), [iterator](gpathresult#iterator()), [leftShift](gpathresult#leftShift(java.lang.Object)), [list](gpathresult#list()), [lookupNamespace](gpathresult#lookupNamespace(java.lang.String)), [name](gpathresult#name()), [next](gpathresult#next()), [next](gpathresult#next()), [next](gpathresult#next()), [nodeIterator](gpathresult#nodeIterator()), [parent](gpathresult#parent()), [parents](gpathresult#parents()), [plus](gpathresult#plus(java.lang.Object)), [plus](gpathresult#plus(groovy.lang.Closure)), [pop](gpathresult#pop()), [putAt](gpathresult#putAt(int,%20java.lang.Object)), [remove](gpathresult#remove()), [remove](gpathresult#remove()), [remove](gpathresult#remove()), [replaceBody](gpathresult#replaceBody(java.lang.Object)), [replaceNode](gpathresult#replaceNode(groovy.lang.Closure)), [setAttribute](gpathresult#setAttribute(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [setMetaClass](gpathresult#setMetaClass(groovy.lang.MetaClass)), [setProperty](gpathresult#setProperty(java.lang.String,%20java.lang.Object)), [size](gpathresult#size()), [text](gpathresult#text()), [toBigDecimal](gpathresult#toBigDecimal()), [toBigInteger](gpathresult#toBigInteger()), [toBoolean](gpathresult#toBoolean()), [toDouble](gpathresult#toDouble()), [toFloat](gpathresult#toFloat()), [toInteger](gpathresult#toInteger()), [toLong](gpathresult#toLong()), [toString](gpathresult#toString()), [toURI](gpathresult#toURI()), [toURL](gpathresult#toURL())` |
| `class [GroovyObjectSupport](../../lang/groovyobjectsupport)` | `[getMetaClass](../../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
### public **FilteredNodeChildren**([GPathResult](gpathresult) parent, [Closure](../../lang/closure) closure, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)
**Parameters:**
`parent` - the GPathResult prior to the application of the expression creating this GPathResult
`closure` - the Closure to use to filter the nodes
`namespaceTagHints` - the known tag to namespace mappings
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getNextNode**([Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") iter)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **nodeIterator**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [GPathResult](gpathresult) **pop**()
groovy [Java] Class NodeParents [Java] Class NodeParents
========================
* groovy.xml.slurpersupport.NodeParents
```
public class NodeParents
extends [NodeChildren](nodechildren)
```
Lazy evaluated representation of parent nodes without duplicates
Inherited fields
| Fields inherited from class | Fields |
| **`class [GPathResult](gpathresult)`** | `[name](gpathresult#name), [namespaceMap](gpathresult#namespaceMap), [namespacePrefix](gpathresult#namespacePrefix), [namespaceTagHints](gpathresult#namespaceTagHints), [parent](gpathresult#parent)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[NodeParents](#NodeParents(groovy.xml.slurpersupport.GPathResult,%20Map))**([GPathResult](gpathresult) parent, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)`
**Parameters:**
`parent` - the GPathResult prior to the application of the expression creating this GPathResult
|
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `protected [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getNextNode](#getNextNode(java.util.Iterator))**([Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") iter)` |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[nodeIterator](#nodeIterator())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [NodeChildren](nodechildren)` | `[appendNode](nodechildren#appendNode(java.lang.Object)), [build](nodechildren#build(groovy.lang.GroovyObject)), [childNodes](nodechildren#childNodes()), [find](nodechildren#find(groovy.lang.Closure)), [findAll](nodechildren#findAll(groovy.lang.Closure)), [getNextNode](nodechildren#getNextNode(java.util.Iterator)), [hasNext](nodechildren#hasNext()), [hasNext](nodechildren#hasNext()), [iterator](nodechildren#iterator()), [next](nodechildren#next()), [next](nodechildren#next()), [nodeIterator](nodechildren#nodeIterator()), [parents](nodechildren#parents()), [remove](nodechildren#remove()), [remove](nodechildren#remove()), [replaceBody](nodechildren#replaceBody(java.lang.Object)), [replaceNode](nodechildren#replaceNode(groovy.lang.Closure)), [size](nodechildren#size()), [text](nodechildren#text()), [writeTo](nodechildren#writeTo(java.io.Writer))` |
| `class [GPathResult](gpathresult)` | `[appendNode](gpathresult#appendNode(java.lang.Object)), [breadthFirst](gpathresult#breadthFirst()), [childNodes](gpathresult#childNodes()), [children](gpathresult#children()), [createIterator](gpathresult#createIterator(java.lang.Object)), [declareNamespace](gpathresult#declareNamespace(java.util.Map)), [depthFirst](gpathresult#depthFirst()), [doCall](gpathresult#doCall(java.lang.Object)), [doCall](gpathresult#doCall(java.lang.Object)), [equals](gpathresult#equals(java.lang.Object)), [find](gpathresult#find(groovy.lang.Closure)), [findAll](gpathresult#findAll(groovy.lang.Closure)), [getAt](gpathresult#getAt(int)), [getAt](gpathresult#getAt(groovy.lang.IntRange)), [getAttribute](gpathresult#getAttribute(java.lang.Object,%20java.lang.String)), [getBody](gpathresult#getBody()), [getProperty](gpathresult#getProperty(java.lang.String)), [hasNext](gpathresult#hasNext()), [hasNext](gpathresult#hasNext()), [hasNext](gpathresult#hasNext()), [hashCode](gpathresult#hashCode()), [isEmpty](gpathresult#isEmpty()), [iterator](gpathresult#iterator()), [leftShift](gpathresult#leftShift(java.lang.Object)), [list](gpathresult#list()), [lookupNamespace](gpathresult#lookupNamespace(java.lang.String)), [name](gpathresult#name()), [next](gpathresult#next()), [next](gpathresult#next()), [next](gpathresult#next()), [nodeIterator](gpathresult#nodeIterator()), [parent](gpathresult#parent()), [parents](gpathresult#parents()), [plus](gpathresult#plus(java.lang.Object)), [plus](gpathresult#plus(groovy.lang.Closure)), [pop](gpathresult#pop()), [putAt](gpathresult#putAt(int,%20java.lang.Object)), [remove](gpathresult#remove()), [remove](gpathresult#remove()), [remove](gpathresult#remove()), [replaceBody](gpathresult#replaceBody(java.lang.Object)), [replaceNode](gpathresult#replaceNode(groovy.lang.Closure)), [setAttribute](gpathresult#setAttribute(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [setMetaClass](gpathresult#setMetaClass(groovy.lang.MetaClass)), [setProperty](gpathresult#setProperty(java.lang.String,%20java.lang.Object)), [size](gpathresult#size()), [text](gpathresult#text()), [toBigDecimal](gpathresult#toBigDecimal()), [toBigInteger](gpathresult#toBigInteger()), [toBoolean](gpathresult#toBoolean()), [toDouble](gpathresult#toDouble()), [toFloat](gpathresult#toFloat()), [toInteger](gpathresult#toInteger()), [toLong](gpathresult#toLong()), [toString](gpathresult#toString()), [toURI](gpathresult#toURI()), [toURL](gpathresult#toURL())` |
| `class [GroovyObjectSupport](../../lang/groovyobjectsupport)` | `[getMetaClass](../../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
### public **NodeParents**([GPathResult](gpathresult) parent, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)
**Parameters:**
`parent` - the GPathResult prior to the application of the expression creating this GPathResult
`namespaceTagHints` - the known tag to namespace mappings
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getNextNode**([Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") iter)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **nodeIterator**()
| programming_docs |
groovy [Java] Class NodeIterator [Java] Class NodeIterator
=========================
* groovy.xml.slurpersupport.NodeIterator
All Implemented Interfaces and Traits: [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")
```
public abstract class NodeIterator
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")
```
Helper class for iterating through nodes.
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[NodeIterator](#NodeIterator(java.util.Iterator))**([Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") iter)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `protected abstract [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getNextNode](#getNextNode(java.util.Iterator))**([Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") iter)` |
| | `public boolean` | `**[hasNext](#hasNext())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[next](#next())**()` |
| | `public void` | `**[remove](#remove())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **NodeIterator**([Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") iter)
Method Detail
-------------
### protected abstract [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getNextNode**([Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") iter)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **hasNext**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **next**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **remove**()
groovy [Java] Class FilteredAttributes [Java] Class FilteredAttributes
===============================
* groovy.xml.slurpersupport.FilteredAttributes
```
public class FilteredAttributes
extends [Attributes](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/Attributes.html "Attributes")
```
Lazy evaluated representation of a node's attributes filtered by a Closure.
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[FilteredAttributes](#FilteredAttributes(groovy.xml.slurpersupport.GPathResult,%20groovy.lang.Closure,%20Map))**([GPathResult](gpathresult) parent, [Closure](../../lang/closure) closure, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)`
**Parameters:**
`parent` - the GPathResult prior to the application of the expression creating this GPathResult
|
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `protected [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getNextNode](#getNextNode(java.util.Iterator))**([Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") iter)` |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[nodeIterator](#nodeIterator())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `interface [Attributes](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/Attributes.html "Attributes")` | `[getLength](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/Attributes.html#getLength() "getLength"), [getValue](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/Attributes.html#getValue(int) "getValue"), [getValue](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/Attributes.html#getValue(java.lang.String) "getValue"), [getValue](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/Attributes.html#getValue(java.lang.String,%20java.lang.String) "getValue"), [getType](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/Attributes.html#getType(java.lang.String) "getType"), [getType](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/Attributes.html#getType(java.lang.String,%20java.lang.String) "getType"), [getType](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/Attributes.html#getType(int) "getType"), [getIndex](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/Attributes.html#getIndex(java.lang.String,%20java.lang.String) "getIndex"), [getIndex](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/Attributes.html#getIndex(java.lang.String) "getIndex"), [getURI](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/Attributes.html#getURI(int) "getURI"), [getLocalName](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/Attributes.html#getLocalName(int) "getLocalName"), [getQName](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/Attributes.html#getQName(int) "getQName")` |
Constructor Detail
------------------
### public **FilteredAttributes**([GPathResult](gpathresult) parent, [Closure](../../lang/closure) closure, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)
**Parameters:**
`parent` - the GPathResult prior to the application of the expression creating this GPathResult
`closure` - the Closure to use to filter the attributes
`namespaceTagHints` - the known tag to namespace mappings
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getNextNode**([Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") iter)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **nodeIterator**()
groovy [Java] Class NoChildren [Java] Class NoChildren
=======================
* groovy.xml.slurpersupport.NoChildren
```
public class NoChildren
extends [GPathResult](gpathresult)
```
Lazy evaluated representation of a GPath expression returning no children. As this class represents a GPath expression with no results, all methods are either NOPs or return an empty result.
Inherited fields
| Fields inherited from class | Fields |
| **`class [GPathResult](gpathresult)`** | `[name](gpathresult#name), [namespaceMap](gpathresult#namespaceMap), [namespacePrefix](gpathresult#namespacePrefix), [namespaceTagHints](gpathresult#namespaceTagHints), [parent](gpathresult#parent)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[NoChildren](#NoChildren(groovy.xml.slurpersupport.GPathResult,%20java.lang.String,%20Map))**([GPathResult](gpathresult) parent, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)`
**Parameters:**
`parent` - the GPathResult prior to the application of the expression creating this GPathResult
|
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `protected void` | `**[appendNode](#appendNode(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`NOP |
| | `public boolean` | `**[asBoolean](#asBoolean())**()`Returns `false`. |
| | `public void` | `**[build](#build(groovy.lang.GroovyObject))**([GroovyObject](../../lang/groovyobject) builder)`NOP |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[childNodes](#childNodes())**()`Returns an empty `Iterator`. |
| | `public [GPathResult](gpathresult)` | `**[find](#find(groovy.lang.Closure))**([Closure](../../lang/closure) closure)`Returns `this`. |
| | `public [GPathResult](gpathresult)` | `**[findAll](#findAll(groovy.lang.Closure))**([Closure](../../lang/closure) closure)`Returns `this`. |
| | `public boolean` | `**[hasNext](#hasNext())**()` |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[iterator](#iterator())**()`Returns an empty `Iterator`. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[next](#next())**()` |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[nodeIterator](#nodeIterator())**()`Returns an empty iterator. |
| | `public [GPathResult](gpathresult)` | `**[parents](#parents())**()`Throws a `GroovyRuntimeException`, because it is not implemented yet. |
| | `public void` | `**[remove](#remove())**()` |
| | `protected void` | `**[replaceBody](#replaceBody(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`NOP |
| | `protected void` | `**[replaceNode](#replaceNode(groovy.lang.Closure))**([Closure](../../lang/closure) newValue)`NOP |
| | `public int` | `**[size](#size())**()`Returns `0`. |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[text](#text())**()`Returns an empty `String`. |
| | `public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer")` | `**[writeTo](#writeTo(java.io.Writer))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out)`Does not write any output, just returns the writer. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GPathResult](gpathresult)` | `[appendNode](gpathresult#appendNode(java.lang.Object)), [breadthFirst](gpathresult#breadthFirst()), [childNodes](gpathresult#childNodes()), [children](gpathresult#children()), [createIterator](gpathresult#createIterator(java.lang.Object)), [declareNamespace](gpathresult#declareNamespace(java.util.Map)), [depthFirst](gpathresult#depthFirst()), [doCall](gpathresult#doCall(java.lang.Object)), [doCall](gpathresult#doCall(java.lang.Object)), [equals](gpathresult#equals(java.lang.Object)), [find](gpathresult#find(groovy.lang.Closure)), [findAll](gpathresult#findAll(groovy.lang.Closure)), [getAt](gpathresult#getAt(int)), [getAt](gpathresult#getAt(groovy.lang.IntRange)), [getAttribute](gpathresult#getAttribute(java.lang.Object,%20java.lang.String)), [getBody](gpathresult#getBody()), [getProperty](gpathresult#getProperty(java.lang.String)), [hasNext](gpathresult#hasNext()), [hasNext](gpathresult#hasNext()), [hasNext](gpathresult#hasNext()), [hashCode](gpathresult#hashCode()), [isEmpty](gpathresult#isEmpty()), [iterator](gpathresult#iterator()), [leftShift](gpathresult#leftShift(java.lang.Object)), [list](gpathresult#list()), [lookupNamespace](gpathresult#lookupNamespace(java.lang.String)), [name](gpathresult#name()), [next](gpathresult#next()), [next](gpathresult#next()), [next](gpathresult#next()), [nodeIterator](gpathresult#nodeIterator()), [parent](gpathresult#parent()), [parents](gpathresult#parents()), [plus](gpathresult#plus(java.lang.Object)), [plus](gpathresult#plus(groovy.lang.Closure)), [pop](gpathresult#pop()), [putAt](gpathresult#putAt(int,%20java.lang.Object)), [remove](gpathresult#remove()), [remove](gpathresult#remove()), [remove](gpathresult#remove()), [replaceBody](gpathresult#replaceBody(java.lang.Object)), [replaceNode](gpathresult#replaceNode(groovy.lang.Closure)), [setAttribute](gpathresult#setAttribute(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [setMetaClass](gpathresult#setMetaClass(groovy.lang.MetaClass)), [setProperty](gpathresult#setProperty(java.lang.String,%20java.lang.Object)), [size](gpathresult#size()), [text](gpathresult#text()), [toBigDecimal](gpathresult#toBigDecimal()), [toBigInteger](gpathresult#toBigInteger()), [toBoolean](gpathresult#toBoolean()), [toDouble](gpathresult#toDouble()), [toFloat](gpathresult#toFloat()), [toInteger](gpathresult#toInteger()), [toLong](gpathresult#toLong()), [toString](gpathresult#toString()), [toURI](gpathresult#toURI()), [toURL](gpathresult#toURL())` |
| `class [GroovyObjectSupport](../../lang/groovyobjectsupport)` | `[getMetaClass](../../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
### public **NoChildren**([GPathResult](gpathresult) parent, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)
**Parameters:**
`parent` - the GPathResult prior to the application of the expression creating this GPathResult
`name` - if the GPathResult corresponds to something with a name, e.g. a node
`namespaceTagHints` - the known tag to namespace mappings
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **appendNode**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
NOP
### public boolean **asBoolean**()
Returns `false`.
**Returns:**
`false`
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **build**([GroovyObject](../../lang/groovyobject) builder)
NOP
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **childNodes**()
Returns an empty `Iterator`.
**Returns:**
an empty `Iterator`
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [GPathResult](gpathresult) **find**([Closure](../../lang/closure) closure)
Returns `this`.
**Returns:**
`this`
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [GPathResult](gpathresult) **findAll**([Closure](../../lang/closure) closure)
Returns `this`.
**Returns:**
`this`
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **hasNext**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **iterator**()
Returns an empty `Iterator`.
**Returns:**
an empty `Iterator`
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **next**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **nodeIterator**()
Returns an empty iterator.
**Returns:**
an empty iterator
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [GPathResult](gpathresult) **parents**()
Throws a `GroovyRuntimeException`, because it is not implemented yet.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **remove**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **replaceBody**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
NOP
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **replaceNode**([Closure](../../lang/closure) newValue)
NOP
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **size**()
Returns `0`.
**Returns:**
`0`
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **text**()
Returns an empty `String`.
**Returns:**
an empty `String`
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") **writeTo**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out)
Does not write any output, just returns the writer.
**Returns:**
the `Writer` which was passed in
groovy [Java] Class ReplacementNode [Java] Class ReplacementNode
============================
* groovy.xml.slurpersupport.ReplacementNode
All Implemented Interfaces and Traits:
[Buildable](../../lang/buildable), [Writable](../../lang/writable)
```
public abstract class ReplacementNode
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [Buildable](../../lang/buildable), [Writable](../../lang/writable)
```
Helper base class used for lazy updates.
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public abstract void` | `**[build](#build(groovy.lang.GroovyObject,%20java.util.Map,%20Map))**([GroovyObject](../../lang/groovyobject) builder, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") namespaceMap, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)` |
| | `public void` | `**[build](#build(groovy.lang.GroovyObject))**([GroovyObject](../../lang/groovyobject) builder)` |
| | `public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer")` | `**[writeTo](#writeTo(java.io.Writer))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out)`NOP |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### public abstract void **build**([GroovyObject](../../lang/groovyobject) builder, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") namespaceMap, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **build**([GroovyObject](../../lang/groovyobject) builder)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") **writeTo**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out)
NOP
**Returns:**
the Writer that was passed
| programming_docs |
groovy [Java] Class Attribute [Java] Class Attribute
======================
* groovy.xml.slurpersupport.Attribute
```
public class Attribute
extends [GPathResult](gpathresult)
```
Lazy evaluated representation of a node attribute.
Inherited fields
| Fields inherited from class | Fields |
| **`class [GPathResult](gpathresult)`** | `[name](gpathresult#name), [namespaceMap](gpathresult#namespaceMap), [namespacePrefix](gpathresult#namespacePrefix), [namespaceTagHints](gpathresult#namespaceTagHints), [parent](gpathresult#parent)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Attribute](#Attribute(java.lang.String,%20java.lang.String,%20groovy.xml.slurpersupport.GPathResult,%20java.lang.String,%20Map))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") value, [GPathResult](gpathresult) parent, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") namespacePrefix, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)`
**Parameters:**
`name` - of the attribute
|
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `protected void` | `**[appendNode](#appendNode(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`NOP, because an node can not be appended to an attribute. |
| | `public void` | `**[build](#build(groovy.lang.GroovyObject))**([GroovyObject](../../lang/groovyobject) builder)` |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[childNodes](#childNodes())**()`Throws a `GroovyRuntimeException`, because an attribute can have no children. |
| | `public [GPathResult](gpathresult)` | `**[find](#find(groovy.lang.Closure))**([Closure](../../lang/closure) closure)` |
| | `public [GPathResult](gpathresult)` | `**[findAll](#findAll(groovy.lang.Closure))**([Closure](../../lang/closure) closure)` |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[iterator](#iterator())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[name](#name())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[namespaceURI](#namespaceURI())**()`Returns the URI of the namespace of this Attribute. |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[nodeIterator](#nodeIterator())**()` |
| | `public [GPathResult](gpathresult)` | `**[parents](#parents())**()`Throws a `GroovyRuntimeException`, because this method is not implemented yet. |
| | `protected void` | `**[replaceBody](#replaceBody(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`NOP, because an attribute does not have a Body. |
| | `protected void` | `**[replaceNode](#replaceNode(groovy.lang.Closure))**([Closure](../../lang/closure) newValue)`NOP, because an attribute does not have any Node to replace. |
| | `public int` | `**[size](#size())**()`Returns the size of this Attribute, which is always `1`. |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[text](#text())**()`Returns the value of this Attribute. |
| | `public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer")` | `**[writeTo](#writeTo(java.io.Writer))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GPathResult](gpathresult)` | `[appendNode](gpathresult#appendNode(java.lang.Object)), [breadthFirst](gpathresult#breadthFirst()), [childNodes](gpathresult#childNodes()), [children](gpathresult#children()), [createIterator](gpathresult#createIterator(java.lang.Object)), [declareNamespace](gpathresult#declareNamespace(java.util.Map)), [depthFirst](gpathresult#depthFirst()), [doCall](gpathresult#doCall(java.lang.Object)), [doCall](gpathresult#doCall(java.lang.Object)), [equals](gpathresult#equals(java.lang.Object)), [find](gpathresult#find(groovy.lang.Closure)), [findAll](gpathresult#findAll(groovy.lang.Closure)), [getAt](gpathresult#getAt(int)), [getAt](gpathresult#getAt(groovy.lang.IntRange)), [getAttribute](gpathresult#getAttribute(java.lang.Object,%20java.lang.String)), [getBody](gpathresult#getBody()), [getProperty](gpathresult#getProperty(java.lang.String)), [hasNext](gpathresult#hasNext()), [hasNext](gpathresult#hasNext()), [hasNext](gpathresult#hasNext()), [hashCode](gpathresult#hashCode()), [isEmpty](gpathresult#isEmpty()), [iterator](gpathresult#iterator()), [leftShift](gpathresult#leftShift(java.lang.Object)), [list](gpathresult#list()), [lookupNamespace](gpathresult#lookupNamespace(java.lang.String)), [name](gpathresult#name()), [next](gpathresult#next()), [next](gpathresult#next()), [next](gpathresult#next()), [nodeIterator](gpathresult#nodeIterator()), [parent](gpathresult#parent()), [parents](gpathresult#parents()), [plus](gpathresult#plus(java.lang.Object)), [plus](gpathresult#plus(groovy.lang.Closure)), [pop](gpathresult#pop()), [putAt](gpathresult#putAt(int,%20java.lang.Object)), [remove](gpathresult#remove()), [remove](gpathresult#remove()), [remove](gpathresult#remove()), [replaceBody](gpathresult#replaceBody(java.lang.Object)), [replaceNode](gpathresult#replaceNode(groovy.lang.Closure)), [setAttribute](gpathresult#setAttribute(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [setMetaClass](gpathresult#setMetaClass(groovy.lang.MetaClass)), [setProperty](gpathresult#setProperty(java.lang.String,%20java.lang.Object)), [size](gpathresult#size()), [text](gpathresult#text()), [toBigDecimal](gpathresult#toBigDecimal()), [toBigInteger](gpathresult#toBigInteger()), [toBoolean](gpathresult#toBoolean()), [toDouble](gpathresult#toDouble()), [toFloat](gpathresult#toFloat()), [toInteger](gpathresult#toInteger()), [toLong](gpathresult#toLong()), [toString](gpathresult#toString()), [toURI](gpathresult#toURI()), [toURL](gpathresult#toURL())` |
| `class [GroovyObjectSupport](../../lang/groovyobjectsupport)` | `[getMetaClass](../../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
### public **Attribute**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") value, [GPathResult](gpathresult) parent, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") namespacePrefix, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)
**Parameters:**
`name` - of the attribute
`value` - of the attribute
`parent` - the GPathResult prior to the application of the expression creating this GPathResult
`namespacePrefix` - the namespace prefix if any
`namespaceTagHints` - the known tag to namespace mappings
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **appendNode**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
NOP, because an node can not be appended to an attribute.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **build**([GroovyObject](../../lang/groovyobject) builder)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **childNodes**()
Throws a `GroovyRuntimeException`, because an attribute can have no children.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [GPathResult](gpathresult) **find**([Closure](../../lang/closure) closure)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [GPathResult](gpathresult) **findAll**([Closure](../../lang/closure) closure)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **iterator**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **name**()
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **namespaceURI**()
Returns the URI of the namespace of this Attribute.
**Returns:**
the namespace of this Attribute
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **nodeIterator**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [GPathResult](gpathresult) **parents**()
Throws a `GroovyRuntimeException`, because this method is not implemented yet.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **replaceBody**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
NOP, because an attribute does not have a Body.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **replaceNode**([Closure](../../lang/closure) newValue)
NOP, because an attribute does not have any Node to replace.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **size**()
Returns the size of this Attribute, which is always `1`.
**Returns:**
`1`
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **text**()
Returns the value of this Attribute.
**Returns:**
the value of this Attribute
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") **writeTo**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out)
groovy [Java] Class NamespaceAwareHashMap [Java] Class NamespaceAwareHashMap
==================================
* groovy.xml.slurpersupport.NamespaceAwareHashMap
```
public class NamespaceAwareHashMap
extends [HashMap](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html "HashMap")
```
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public boolean` | `**[containsKey](#containsKey(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") key)` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[get](#get(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") key)` |
| | `public [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")` | `**[getNamespaceTagHints](#getNamespaceTagHints())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[put](#put(java.lang.String,%20java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") key, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") value)` |
| | `public void` | `**[putAll](#putAll(Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<? extends [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), ? extends [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> m)` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[remove](#remove(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") key)` |
| | `public void` | `**[setNamespaceTagHints](#setNamespaceTagHints(java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") namespaceTagHints)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [HashMap](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html "HashMap")` | `[remove](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#remove(java.lang.Object,%20java.lang.Object) "remove"), [remove](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#remove(java.lang.Object) "remove"), [get](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#get(java.lang.Object) "get"), [put](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#put(java.lang.Object,%20java.lang.Object) "put"), [values](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#values() "values"), [clone](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#clone() "clone"), [clear](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#clear() "clear"), [isEmpty](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#isEmpty() "isEmpty"), [replace](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#replace(java.lang.Object,%20java.lang.Object) "replace"), [replace](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#replace(java.lang.Object,%20java.lang.Object,%20java.lang.Object) "replace"), [replaceAll](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#replaceAll(java.util.function.BiFunction) "replaceAll"), [size](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#size() "size"), [merge](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#merge(java.lang.Object,%20java.lang.Object,%20java.util.function.BiFunction) "merge"), [entrySet](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#entrySet() "entrySet"), [putAll](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#putAll(java.util.Map) "putAll"), [putIfAbsent](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#putIfAbsent(java.lang.Object,%20java.lang.Object) "putIfAbsent"), [compute](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#compute(java.lang.Object,%20java.util.function.BiFunction) "compute"), [forEach](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#forEach(java.util.function.BiConsumer) "forEach"), [containsKey](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#containsKey(java.lang.Object) "containsKey"), [computeIfAbsent](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#computeIfAbsent(java.lang.Object,%20java.util.function.Function) "computeIfAbsent"), [keySet](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#keySet() "keySet"), [containsValue](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#containsValue(java.lang.Object) "containsValue"), [getOrDefault](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#getOrDefault(java.lang.Object,%20java.lang.Object) "getOrDefault"), [computeIfPresent](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#computeIfPresent(java.lang.Object,%20java.util.function.BiFunction) "computeIfPresent"), [equals](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#hashCode() "hashCode"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#wait(long) "wait"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **containsKey**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") key)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **get**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") key)
### public [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") **getNamespaceTagHints**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **put**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") key, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") value)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **putAll**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<? extends [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), ? extends [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> m)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **remove**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") key)
### public void **setNamespaceTagHints**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") namespaceTagHints)
groovy [Java] Class GPathResult [Java] Class GPathResult
========================
* groovy.xml.slurpersupport.GPathResult
All Implemented Interfaces and Traits:
[Buildable](../../lang/buildable), [Writable](../../lang/writable), [Iterable](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html "Iterable")
```
public abstract class GPathResult
extends [GroovyObjectSupport](../../lang/groovyobjectsupport)
implements [Buildable](../../lang/buildable), [Writable](../../lang/writable), [Iterable](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html "Iterable")
```
Base class for representing lazy evaluated GPath expressions.
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**protected [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[name](#name)` | |
| `**protected [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")**` | `[namespaceMap](#namespaceMap)` | |
| `**protected [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[namespacePrefix](#namespacePrefix)` | |
| `**protected [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>**` | `[namespaceTagHints](#namespaceTagHints)` | |
| `**protected [GPathResult](gpathresult)**` | `[parent](#parent)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[GPathResult](#GPathResult(groovy.xml.slurpersupport.GPathResult,%20java.lang.String,%20java.lang.String,%20Map))**([GPathResult](gpathresult) parent, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") namespacePrefix, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)`Creates a new GPathResult named `name` with the parent `parent`, the namespacePrefix `namespacePrefix` and the namespaceTagHints specified in the `namespaceTagHints` Map. |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `protected abstract void` | `**[appendNode](#appendNode(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)` |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[breadthFirst](#breadthFirst())**()`Provides an Iterator over all the nodes of this GPathResult using a breadth-first traversal. |
| | `public abstract [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[childNodes](#childNodes())**()`Returns an iterator over the child nodes of this GPathResult. |
| | `public [GPathResult](gpathresult)` | `**[children](#children())**()`Returns the children of this GPathResult as a GPathResult object. |
| | `protected [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[createIterator](#createIterator(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj)` |
| | `public [GPathResult](gpathresult)` | `**[declareNamespace](#declareNamespace(java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") newNamespaceMapping)`Adds the specified map of prefix to namespace mappings to this GPathResult. |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[depthFirst](#depthFirst())**()`Provides an Iterator over all the nodes of this GPathResult using a depth-first traversal. |
| | `public void` | `**[doCall](#doCall(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)` |
| | `public void` | `**[doCall](#doCall(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)` |
| | `public boolean` | `**[equals](#equals(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj)` |
| | `public abstract [GPathResult](gpathresult)` | `**[find](#find(groovy.lang.Closure))**([Closure](../../lang/closure) closure)`Returns the first child of this GPathResult matching the condition(s) specified in the passed closure. |
| | `public abstract [GPathResult](gpathresult)` | `**[findAll](#findAll(groovy.lang.Closure))**([Closure](../../lang/closure) closure)`Returns the children of this GPathResult matching the condition(s) specified in the passed closure. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getAt](#getAt(int))**(int index)`Supports the subscript operator for a GPathResult. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getAt](#getAt(groovy.lang.IntRange))**([IntRange](../../lang/intrange) range)`Supports the range subscript operator for a GPathResult. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getAttribute](#getAttribute(java.lang.Object,%20java.lang.String))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") attribute)` |
| | `public [Closure](../../lang/closure)` | `**[getBody](#getBody())**()`Creates a Closure representing the body of this GPathResult. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)`Returns the specified Property of this GPathResult. |
| | `public boolean` | `**[hasNext](#hasNext())**()` |
| | `public boolean` | `**[hasNext](#hasNext())**()` |
| | `public boolean` | `**[hasNext](#hasNext())**()` |
| | `public int` | `**[hashCode](#hashCode())**()` |
| | `public boolean` | `**[isEmpty](#isEmpty())**()`Returns true if the GPathResult is empty, i.e. if, and only if, `size()` is 0. |
| | `public abstract [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[iterator](#iterator())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[leftShift](#leftShift(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`Overloads the left shift operator to provide an easy way to lazily append Objects to this GPathResult. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")` | `**[list](#list())**()`Creates a list of objects representing this GPathResult. |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[lookupNamespace](#lookupNamespace(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") prefix)`Returns the namespace mapped to the specified prefix. |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[name](#name())**()`Returns the name of this GPathResult. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[next](#next())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[next](#next())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[next](#next())**()` |
| | `public abstract [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[nodeIterator](#nodeIterator())**()` |
| | `public [GPathResult](gpathresult)` | `**[parent](#parent())**()`Returns as GPathResult with the parent nodes of the current GPathResult |
| | `public abstract [GPathResult](gpathresult)` | `**[parents](#parents())**()`Returns the parents of this GPathResult as a `GPathResult`. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[plus](#plus(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`Lazily adds the specified Object to this GPathResult. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[plus](#plus(groovy.lang.Closure))**([Closure](../../lang/closure) newValue)` |
| | `public [GPathResult](gpathresult)` | `**[pop](#pop())**()`Returns the parent of this GPathResult. |
| | `public void` | `**[putAt](#putAt(int,%20java.lang.Object))**(int index, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`A helper method to allow GPathResults to work with subscript operators |
| | `public void` | `**[remove](#remove())**()` |
| | `public void` | `**[remove](#remove())**()` |
| | `public void` | `**[remove](#remove())**()` |
| | `protected abstract void` | `**[replaceBody](#replaceBody(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)` |
| | `protected abstract void` | `**[replaceNode](#replaceNode(groovy.lang.Closure))**([Closure](../../lang/closure) newValue)` |
| | `public void` | `**[setAttribute](#setAttribute(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") attribute, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)` |
| | `public void` | `**[setMetaClass](#setMetaClass(groovy.lang.MetaClass))**([MetaClass](../../lang/metaclass) metaClass)`Replaces the MetaClass of this GPathResult. |
| | `public void` | `**[setProperty](#setProperty(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`Replaces the specified property of this GPathResult with a new value. |
| | `public abstract int` | `**[size](#size())**()`Returns the size of this GPathResult. |
| | `public abstract [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[text](#text())**()`Returns the text of this GPathResult as a `String`. |
| | `public [BigDecimal](https://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html "BigDecimal")` | `**[toBigDecimal](#toBigDecimal())**()`Converts the text of this GPathResult to a BigDecimal object. |
| | `public [BigInteger](https://docs.oracle.com/javase/8/docs/api/java/math/BigInteger.html "BigInteger")` | `**[toBigInteger](#toBigInteger())**()`Converts the text of this GPathResult to a BigInteger object. |
| | `public [Boolean](https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html "Boolean")` | `**[toBoolean](#toBoolean())**()`Converts the text of this GPathResult to a Boolean object. |
| | `public [Double](https://docs.oracle.com/javase/8/docs/api/java/lang/Double.html "Double")` | `**[toDouble](#toDouble())**()`Converts the text of this GPathResult to a Double object. |
| | `public [Float](https://docs.oracle.com/javase/8/docs/api/java/lang/Float.html "Float")` | `**[toFloat](#toFloat())**()`Converts the text of this GPathResult to a Float object. |
| | `public [Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer")` | `**[toInteger](#toInteger())**()`Converts the text of this GPathResult to a Integer object. |
| | `public [Long](https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html "Long")` | `**[toLong](#toLong())**()`Converts the text of this GPathResult to a Long object. |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()`Returns the text of this GPathResult. |
| | `public [URI](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html "URI")` | `**[toURI](#toURI())**()`Converts the text of this GPathResult to a URI object. |
| | `public [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL")` | `**[toURL](#toURL())**()`Converts the text of this GPathResult to a URL object. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyObjectSupport](../../lang/groovyobjectsupport)` | `[getMetaClass](../../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Field Detail
------------
### protected final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **name**
### protected final [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") **namespaceMap**
### protected final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **namespacePrefix**
### protected final [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> **namespaceTagHints**
### protected final [GPathResult](gpathresult) **parent**
Constructor Detail
------------------
### public **GPathResult**([GPathResult](gpathresult) parent, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") namespacePrefix, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)
Creates a new GPathResult named `name` with the parent `parent`, the namespacePrefix `namespacePrefix` and the namespaceTagHints specified in the `namespaceTagHints` Map.
**Parameters:**
`parent` - the GPathResult prior to the application of the expression creating this GPathResult
`name` - if the GPathResult corresponds to something with a name, e.g. a node
`namespacePrefix` - the namespace prefix if any
`namespaceTagHints` - the known tag to namespace mappings
Method Detail
-------------
### protected abstract void **appendNode**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
### public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **breadthFirst**()
Provides an Iterator over all the nodes of this GPathResult using a breadth-first traversal.
**Returns:**
the `Iterator` of (breadth-first) ordered GPathResults
### public abstract [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **childNodes**()
Returns an iterator over the child nodes of this GPathResult.
**Returns:**
an iterator over the child nodes of this GPathResult
### public [GPathResult](gpathresult) **children**()
Returns the children of this GPathResult as a GPathResult object.
**Returns:**
the children of this GPathResult
### protected [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **createIterator**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj)
### public [GPathResult](gpathresult) **declareNamespace**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") newNamespaceMapping)
Adds the specified map of prefix to namespace mappings to this GPathResult. Already existing prefixes are overwritten.
**Parameters:**
`newNamespaceMapping` - the mappings to add
**Returns:**
`this`
### public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **depthFirst**()
Provides an Iterator over all the nodes of this GPathResult using a depth-first traversal.
**Returns:**
the `Iterator` of (depth-first) ordered GPathResults
### public void **doCall**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)
### public void **doCall**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **equals**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj)
### public abstract [GPathResult](gpathresult) **find**([Closure](../../lang/closure) closure)
Returns the first child of this GPathResult matching the condition(s) specified in the passed closure.
**Parameters:**
`closure` - a closure to filters the children of this GPathResult
**Returns:**
the first child matching the closure
### public abstract [GPathResult](gpathresult) **findAll**([Closure](../../lang/closure) closure)
Returns the children of this GPathResult matching the condition(s) specified in the passed closure.
**Parameters:**
`closure` - a closure to filters the children of this GPathResult
**Returns:**
the children matching the closure
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getAt**(int index)
Supports the subscript operator for a GPathResult.
```
import groovy.xml.slurpersupport.*
import groovy.xml.XmlSlurper
def text = """
<characterList>
<character/>
<character>
<name>Gromit</name>
</character>
</characterList>"""
GPathResult characterList = new XmlSlurper().parseText(text)
assert characterList.character[1].name == 'Gromit'
```
**Parameters:**
`index` - an index
**Returns:**
the value at the given index
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getAt**([IntRange](../../lang/intrange) range)
Supports the range subscript operator for a GPathResult.
```
import groovy.xml.slurpersupport.*
import groovy.xml.XmlSlurper
def text = """
<characterList>
<character>Wallace</character>
<character>Gromit</character>
<character>Shaun</character>
</characterList>"""
GPathResult characterList = new XmlSlurper().parseText(text)
assert characterList.character[1..2].join(',') == 'Gromit,Shaun'
```
**Parameters:**
`range` - a Range indicating the items to get
**Returns:**
a new list based on range borders
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getAttribute**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") attribute)
### public [Closure](../../lang/closure) **getBody**()
Creates a Closure representing the body of this GPathResult.
**Returns:**
the body of this GPathResult, converted to a `Closure`
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)
Returns the specified Property of this GPathResult.
Realizes the follow shortcuts:
* `'..'` for `parent()`
* `'*'` for `children()`
* `'**'` for `depthFirst()`
* `'@'` for attribute access
**Parameters:**
`property` - the Property to fetch
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **hasNext**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **hasNext**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **hasNext**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **hashCode**()
### public boolean **isEmpty**()
Returns true if the GPathResult is empty, i.e. if, and only if, `size()` is 0.
**Returns:**
true if the GPathResult is empty
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public abstract [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **iterator**()
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **leftShift**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
Overloads the left shift operator to provide an easy way to lazily append Objects to this GPathResult.
**Parameters:**
`newValue` - the Object to append
**Returns:**
`this`
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") **list**()
Creates a list of objects representing this GPathResult.
**Returns:**
a list representing of this GPathResult
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **lookupNamespace**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") prefix)
Returns the namespace mapped to the specified prefix.
**Parameters:**
`prefix` - the prefix lookup
**Returns:**
the namespace of the prefix
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **name**()
Returns the name of this GPathResult.
**Returns:**
the name of this GPathResult
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **next**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **next**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **next**()
### public abstract [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **nodeIterator**()
### public [GPathResult](gpathresult) **parent**()
Returns as GPathResult with the parent nodes of the current GPathResult
**Returns:**
the parents GPathResult or `this` for the root
### public abstract [GPathResult](gpathresult) **parents**()
Returns the parents of this GPathResult as a `GPathResult`. Warning: The subclasses of this package do not implement this method yet.
**Returns:**
the parents of this GPathResult
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **plus**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
Lazily adds the specified Object to this GPathResult.
**Parameters:**
`newValue` - the Object to add
**Returns:**
`this`
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **plus**([Closure](../../lang/closure) newValue)
### public [GPathResult](gpathresult) **pop**()
Returns the parent of this GPathResult. If this GPathResult has no parent the GPathResult itself is returned. This is no navigation in the XML tree. It is backtracking on the GPath expression chain. It is the behavior of parent() prior to 2.2.0. Backtracking on '..' actually goes down one level in the tree again. find() and findAll() are popped along with the level they have been applied to.
**Returns:**
the parent or `this`
### public void **putAt**(int index, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
A helper method to allow GPathResults to work with subscript operators
**Parameters:**
`index` - an index
`newValue` - the value to put at the given index
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **remove**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **remove**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **remove**()
### protected abstract void **replaceBody**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
### protected abstract void **replaceNode**([Closure](../../lang/closure) newValue)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setAttribute**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") attribute, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setMetaClass**([MetaClass](../../lang/metaclass) metaClass)
Replaces the MetaClass of this GPathResult.
**Parameters:**
`metaClass` - the new MetaClass
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
Replaces the specified property of this GPathResult with a new value.
**Parameters:**
`property` - the property of this GPathResult to replace
`newValue` - the new value of the property
### public abstract int **size**()
Returns the size of this GPathResult.
**Returns:**
the size of this GPathResult
### public abstract [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **text**()
Returns the text of this GPathResult as a `String`.
**Returns:**
the text of this GPathResult
### public [BigDecimal](https://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html "BigDecimal") **toBigDecimal**()
Converts the text of this GPathResult to a BigDecimal object.
**Returns:**
the GPathResult, converted to a `BigDecimal`
### public [BigInteger](https://docs.oracle.com/javase/8/docs/api/java/math/BigInteger.html "BigInteger") **toBigInteger**()
Converts the text of this GPathResult to a BigInteger object.
**Returns:**
the GPathResult, converted to a `BigInteger`
### public [Boolean](https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html "Boolean") **toBoolean**()
Converts the text of this GPathResult to a Boolean object.
**Returns:**
the GPathResult, converted to a `Boolean`
### public [Double](https://docs.oracle.com/javase/8/docs/api/java/lang/Double.html "Double") **toDouble**()
Converts the text of this GPathResult to a Double object.
**Returns:**
the GPathResult, converted to a `Double`
### public [Float](https://docs.oracle.com/javase/8/docs/api/java/lang/Float.html "Float") **toFloat**()
Converts the text of this GPathResult to a Float object.
**Returns:**
the GPathResult, converted to a `Float`
### public [Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") **toInteger**()
Converts the text of this GPathResult to a Integer object.
**Returns:**
the GPathResult, converted to a `Integer`
### public [Long](https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html "Long") **toLong**()
Converts the text of this GPathResult to a Long object.
**Returns:**
the GPathResult, converted to a `Long`
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
Returns the text of this GPathResult.
**Returns:**
the GPathResult, converted to a `String`
### public [URI](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html "URI") **toURI**()
Converts the text of this GPathResult to a URI object.
**Returns:**
the GPathResult, converted to a `URI`
### public [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") **toURL**()
Converts the text of this GPathResult to a URL object.
**Returns:**
the GPathResult, converted to a `URL`
| programming_docs |
groovy [Java] Class NodeChild [Java] Class NodeChild
======================
* groovy.xml.slurpersupport.NodeChild
```
public class NodeChild
extends [GPathResult](gpathresult)
```
Lazy evaluated representation of a child node.
Inherited fields
| Fields inherited from class | Fields |
| **`class [GPathResult](gpathresult)`** | `[name](gpathresult#name), [namespaceMap](gpathresult#namespaceMap), [namespacePrefix](gpathresult#namespacePrefix), [namespaceTagHints](gpathresult#namespaceTagHints), [parent](gpathresult#parent)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[NodeChild](#NodeChild(groovy.xml.slurpersupport.Node,%20groovy.xml.slurpersupport.GPathResult,%20java.lang.String,%20Map))**([Node](node) node, [GPathResult](gpathresult) parent, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") namespacePrefix, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)`
**Parameters:**
`node` - a node
|
| `**[NodeChild](#NodeChild(groovy.xml.slurpersupport.Node,%20groovy.xml.slurpersupport.GPathResult,%20Map))**([Node](node) node, [GPathResult](gpathresult) parent, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)`
**Parameters:**
`node` - a node
|
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `protected void` | `**[appendNode](#appendNode(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)` |
| | `public [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")` | `**[attributes](#attributes())**()`Returns a map containing all attributes of the Node of this NodeChild. |
| | `public void` | `**[build](#build(groovy.lang.GroovyObject))**([GroovyObject](../../lang/groovyobject) builder)` |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[childNodes](#childNodes())**()` |
| | `public [GPathResult](gpathresult)` | `**[find](#find(groovy.lang.Closure))**([Closure](../../lang/closure) closure)` |
| | `public [GPathResult](gpathresult)` | `**[findAll](#findAll(groovy.lang.Closure))**([Closure](../../lang/closure) closure)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getAt](#getAt(int))**(int index)` |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[iterator](#iterator())**()` |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>` | `**[localText](#localText())**()`Returns the list of any direct String nodes of this NodeChild. |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[namespaceURI](#namespaceURI())**()`Returns the URI of the namespace of this NodeChild. |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[nodeIterator](#nodeIterator())**()` |
| | `public [GPathResult](gpathresult)` | `**[parent](#parent())**()` |
| | `public [GPathResult](gpathresult)` | `**[parents](#parents())**()`Throws a `GroovyRuntimeException`, because this method is not implemented yet. |
| | `protected void` | `**[replaceBody](#replaceBody(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)` |
| | `protected void` | `**[replaceNode](#replaceNode(groovy.lang.Closure))**([Closure](../../lang/closure) newValue)` |
| | `public int` | `**[size](#size())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[text](#text())**()` |
| | `public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer")` | `**[writeTo](#writeTo(java.io.Writer))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GPathResult](gpathresult)` | `[appendNode](gpathresult#appendNode(java.lang.Object)), [breadthFirst](gpathresult#breadthFirst()), [childNodes](gpathresult#childNodes()), [children](gpathresult#children()), [createIterator](gpathresult#createIterator(java.lang.Object)), [declareNamespace](gpathresult#declareNamespace(java.util.Map)), [depthFirst](gpathresult#depthFirst()), [doCall](gpathresult#doCall(java.lang.Object)), [doCall](gpathresult#doCall(java.lang.Object)), [equals](gpathresult#equals(java.lang.Object)), [find](gpathresult#find(groovy.lang.Closure)), [findAll](gpathresult#findAll(groovy.lang.Closure)), [getAt](gpathresult#getAt(int)), [getAt](gpathresult#getAt(groovy.lang.IntRange)), [getAttribute](gpathresult#getAttribute(java.lang.Object,%20java.lang.String)), [getBody](gpathresult#getBody()), [getProperty](gpathresult#getProperty(java.lang.String)), [hasNext](gpathresult#hasNext()), [hasNext](gpathresult#hasNext()), [hasNext](gpathresult#hasNext()), [hashCode](gpathresult#hashCode()), [isEmpty](gpathresult#isEmpty()), [iterator](gpathresult#iterator()), [leftShift](gpathresult#leftShift(java.lang.Object)), [list](gpathresult#list()), [lookupNamespace](gpathresult#lookupNamespace(java.lang.String)), [name](gpathresult#name()), [next](gpathresult#next()), [next](gpathresult#next()), [next](gpathresult#next()), [nodeIterator](gpathresult#nodeIterator()), [parent](gpathresult#parent()), [parents](gpathresult#parents()), [plus](gpathresult#plus(java.lang.Object)), [plus](gpathresult#plus(groovy.lang.Closure)), [pop](gpathresult#pop()), [putAt](gpathresult#putAt(int,%20java.lang.Object)), [remove](gpathresult#remove()), [remove](gpathresult#remove()), [remove](gpathresult#remove()), [replaceBody](gpathresult#replaceBody(java.lang.Object)), [replaceNode](gpathresult#replaceNode(groovy.lang.Closure)), [setAttribute](gpathresult#setAttribute(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [setMetaClass](gpathresult#setMetaClass(groovy.lang.MetaClass)), [setProperty](gpathresult#setProperty(java.lang.String,%20java.lang.Object)), [size](gpathresult#size()), [text](gpathresult#text()), [toBigDecimal](gpathresult#toBigDecimal()), [toBigInteger](gpathresult#toBigInteger()), [toBoolean](gpathresult#toBoolean()), [toDouble](gpathresult#toDouble()), [toFloat](gpathresult#toFloat()), [toInteger](gpathresult#toInteger()), [toLong](gpathresult#toLong()), [toString](gpathresult#toString()), [toURI](gpathresult#toURI()), [toURL](gpathresult#toURL())` |
| `class [GroovyObjectSupport](../../lang/groovyobjectsupport)` | `[getMetaClass](../../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
### public **NodeChild**([Node](node) node, [GPathResult](gpathresult) parent, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") namespacePrefix, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)
**Parameters:**
`node` - a node
`parent` - the GPathResult prior to the application of the expression creating this GPathResult
`namespacePrefix` - the namespace prefix if any
`namespaceTagHints` - the known tag to namespace mappings
### public **NodeChild**([Node](node) node, [GPathResult](gpathresult) parent, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)
**Parameters:**
`node` - a node
`parent` - the GPathResult prior to the application of the expression creating this GPathResult
`namespaceTagHints` - the known tag to namespace mappings
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **appendNode**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
### public [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") **attributes**()
Returns a map containing all attributes of the Node of this NodeChild.
**Returns:**
a map containing all attributes
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **build**([GroovyObject](../../lang/groovyobject) builder)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **childNodes**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [GPathResult](gpathresult) **find**([Closure](../../lang/closure) closure)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [GPathResult](gpathresult) **findAll**([Closure](../../lang/closure) closure)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getAt**(int index)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **iterator**()
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> **localText**()
Returns the list of any direct String nodes of this NodeChild.
**Returns:**
the list of String values from this node
**Since:**
2.3.0
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **namespaceURI**()
Returns the URI of the namespace of this NodeChild.
**Returns:**
the namespace of this NodeChild
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **nodeIterator**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [GPathResult](gpathresult) **parent**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [GPathResult](gpathresult) **parents**()
Throws a `GroovyRuntimeException`, because this method is not implemented yet.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **replaceBody**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **replaceNode**([Closure](../../lang/closure) newValue)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **size**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **text**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") **writeTo**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out)
groovy [Java] Class NodeChildren [Java] Class NodeChildren
=========================
* groovy.xml.slurpersupport.NodeChildren
```
public class NodeChildren
extends [GPathResult](gpathresult)
```
Lazy evaluated representation of child nodes.
Inherited fields
| Fields inherited from class | Fields |
| **`class [GPathResult](gpathresult)`** | `[name](gpathresult#name), [namespaceMap](gpathresult#namespaceMap), [namespacePrefix](gpathresult#namespacePrefix), [namespaceTagHints](gpathresult#namespaceTagHints), [parent](gpathresult#parent)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[NodeChildren](#NodeChildren(groovy.xml.slurpersupport.GPathResult,%20java.lang.String,%20java.lang.String,%20Map))**([GPathResult](gpathresult) parent, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") namespacePrefix, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)`
**Parameters:**
`parent` - the GPathResult prior to the application of the expression creating this GPathResult
|
| `**[NodeChildren](#NodeChildren(groovy.xml.slurpersupport.GPathResult,%20java.lang.String,%20Map))**([GPathResult](gpathresult) parent, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)`
**Parameters:**
`parent` - the GPathResult prior to the application of the expression creating this GPathResult
|
| `**[NodeChildren](#NodeChildren(groovy.xml.slurpersupport.GPathResult,%20Map))**([GPathResult](gpathresult) parent, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)`
**Parameters:**
`parent` - the GPathResult prior to the application of the expression creating this GPathResult
|
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `protected void` | `**[appendNode](#appendNode(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)` |
| | `public void` | `**[build](#build(groovy.lang.GroovyObject))**([GroovyObject](../../lang/groovyobject) builder)` |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[childNodes](#childNodes())**()` |
| | `public [GPathResult](gpathresult)` | `**[find](#find(groovy.lang.Closure))**([Closure](../../lang/closure) closure)` |
| | `public [GPathResult](gpathresult)` | `**[findAll](#findAll(groovy.lang.Closure))**([Closure](../../lang/closure) closure)` |
| | `protected [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getNextNode](#getNextNode(java.util.Iterator))**([Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") iter)` |
| | `public boolean` | `**[hasNext](#hasNext())**()` |
| | `public boolean` | `**[hasNext](#hasNext())**()` |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[iterator](#iterator())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[next](#next())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[next](#next())**()` |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[nodeIterator](#nodeIterator())**()` |
| | `public [GPathResult](gpathresult)` | `**[parents](#parents())**()`Throws a `GroovyRuntimeException`, because it is not implemented yet. |
| | `public void` | `**[remove](#remove())**()` |
| | `public void` | `**[remove](#remove())**()` |
| | `protected void` | `**[replaceBody](#replaceBody(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)` |
| | `protected void` | `**[replaceNode](#replaceNode(groovy.lang.Closure))**([Closure](../../lang/closure) newValue)` |
| | `public int` | `**[size](#size())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[text](#text())**()` |
| | `public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer")` | `**[writeTo](#writeTo(java.io.Writer))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GPathResult](gpathresult)` | `[appendNode](gpathresult#appendNode(java.lang.Object)), [breadthFirst](gpathresult#breadthFirst()), [childNodes](gpathresult#childNodes()), [children](gpathresult#children()), [createIterator](gpathresult#createIterator(java.lang.Object)), [declareNamespace](gpathresult#declareNamespace(java.util.Map)), [depthFirst](gpathresult#depthFirst()), [doCall](gpathresult#doCall(java.lang.Object)), [doCall](gpathresult#doCall(java.lang.Object)), [equals](gpathresult#equals(java.lang.Object)), [find](gpathresult#find(groovy.lang.Closure)), [findAll](gpathresult#findAll(groovy.lang.Closure)), [getAt](gpathresult#getAt(int)), [getAt](gpathresult#getAt(groovy.lang.IntRange)), [getAttribute](gpathresult#getAttribute(java.lang.Object,%20java.lang.String)), [getBody](gpathresult#getBody()), [getProperty](gpathresult#getProperty(java.lang.String)), [hasNext](gpathresult#hasNext()), [hasNext](gpathresult#hasNext()), [hasNext](gpathresult#hasNext()), [hashCode](gpathresult#hashCode()), [isEmpty](gpathresult#isEmpty()), [iterator](gpathresult#iterator()), [leftShift](gpathresult#leftShift(java.lang.Object)), [list](gpathresult#list()), [lookupNamespace](gpathresult#lookupNamespace(java.lang.String)), [name](gpathresult#name()), [next](gpathresult#next()), [next](gpathresult#next()), [next](gpathresult#next()), [nodeIterator](gpathresult#nodeIterator()), [parent](gpathresult#parent()), [parents](gpathresult#parents()), [plus](gpathresult#plus(java.lang.Object)), [plus](gpathresult#plus(groovy.lang.Closure)), [pop](gpathresult#pop()), [putAt](gpathresult#putAt(int,%20java.lang.Object)), [remove](gpathresult#remove()), [remove](gpathresult#remove()), [remove](gpathresult#remove()), [replaceBody](gpathresult#replaceBody(java.lang.Object)), [replaceNode](gpathresult#replaceNode(groovy.lang.Closure)), [setAttribute](gpathresult#setAttribute(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [setMetaClass](gpathresult#setMetaClass(groovy.lang.MetaClass)), [setProperty](gpathresult#setProperty(java.lang.String,%20java.lang.Object)), [size](gpathresult#size()), [text](gpathresult#text()), [toBigDecimal](gpathresult#toBigDecimal()), [toBigInteger](gpathresult#toBigInteger()), [toBoolean](gpathresult#toBoolean()), [toDouble](gpathresult#toDouble()), [toFloat](gpathresult#toFloat()), [toInteger](gpathresult#toInteger()), [toLong](gpathresult#toLong()), [toString](gpathresult#toString()), [toURI](gpathresult#toURI()), [toURL](gpathresult#toURL())` |
| `class [GroovyObjectSupport](../../lang/groovyobjectsupport)` | `[getMetaClass](../../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
### public **NodeChildren**([GPathResult](gpathresult) parent, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") namespacePrefix, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)
**Parameters:**
`parent` - the GPathResult prior to the application of the expression creating this GPathResult
`name` - if the GPathResult corresponds to something with a name, e.g. a node
`namespacePrefix` - the namespace prefix if any
`namespaceTagHints` - the known tag to namespace mappings
### public **NodeChildren**([GPathResult](gpathresult) parent, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)
**Parameters:**
`parent` - the GPathResult prior to the application of the expression creating this GPathResult
`name` - if the GPathResult corresponds to something with a name, e.g. a node
`namespaceTagHints` - the known tag to namespace mappings
### public **NodeChildren**([GPathResult](gpathresult) parent, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> namespaceTagHints)
**Parameters:**
`parent` - the GPathResult prior to the application of the expression creating this GPathResult
`namespaceTagHints` - the known tag to namespace mappings
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **appendNode**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **build**([GroovyObject](../../lang/groovyobject) builder)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **childNodes**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [GPathResult](gpathresult) **find**([Closure](../../lang/closure) closure)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [GPathResult](gpathresult) **findAll**([Closure](../../lang/closure) closure)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getNextNode**([Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") iter)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **hasNext**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **hasNext**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **iterator**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **next**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **next**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **nodeIterator**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [GPathResult](gpathresult) **parents**()
Throws a `GroovyRuntimeException`, because it is not implemented yet.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **remove**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **remove**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **replaceBody**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **replaceNode**([Closure](../../lang/closure) newValue)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **size**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **text**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") **writeTo**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out)
| programming_docs |
groovy [Java] Class DOMCategory [Java] Class DOMCategory
========================
* groovy.xml.dom.DOMCategory
```
public class DOMCategory
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Category class which adds GPath style operations to Java's DOM classes.
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public static [Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element")` | `**[appendNode](#appendNode(javax.swing.text.Element,%20java.lang.Object))**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") self, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") name)` |
| | `public static [Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element")` | `**[appendNode](#appendNode(javax.swing.text.Element,%20java.lang.Object,%20java.util.Map))**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") self, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") name, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") attributes)` |
| | `public static [Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element")` | `**[appendNode](#appendNode(javax.swing.text.Element,%20java.lang.Object,%20java.lang.String))**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") self, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") name, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") value)` |
| | `public static [Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element")` | `**[appendNode](#appendNode(javax.swing.text.Element,%20java.lang.Object,%20java.util.Map,%20java.lang.String))**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") self, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") name, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") attributes, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") value)` |
| | `public static [NamedNodeMap](https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/NamedNodeMap.html "NamedNodeMap")` | `**[attributes](#attributes(javax.swing.text.Element))**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") element)` |
| | `public static [NodeList](../../util/nodelist)` | `**[breadthFirst](#breadthFirst(javax.swing.text.Element))**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") self)` |
| | `public static [NodeList](../../util/nodelist)` | `**[children](#children(javax.swing.text.Element))**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") self)` |
| | `public static [NodeList](../../util/nodelist)` | `**[depthFirst](#depthFirst(javax.swing.text.Element))**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") self)` |
| | `public static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[get](#get(javax.swing.text.Element,%20java.lang.String))**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") element, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") elementName)` |
| | `public static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[get](#get(groovy.util.NodeList,%20java.lang.String))**([NodeList](../../util/nodelist) nodeList, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") elementName)` |
| | `public static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[get](#get(org.w3c.dom.NamedNodeMap,%20java.lang.String))**([NamedNodeMap](https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/NamedNodeMap.html "NamedNodeMap") nodeMap, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") elementName)` |
| | `public static [Node](../../util/node)` | `**[getAt](#getAt(groovy.util.Node,%20int))**([Node](../../util/node) o, int i)` |
| | `public static [Node](../../util/node)` | `**[getAt](#getAt(groovy.xml.dom.DOMCategory.NodeListsHolder,%20int))**([DOMCategory.NodeListsHolder](domcategory.nodelistsholder) o, int i)` |
| | `public static [Node](../../util/node)` | `**[getAt](#getAt(groovy.xml.dom.DOMCategory.NodesHolder,%20int))**([DOMCategory.NodesHolder](domcategory.nodesholder) o, int i)` |
| | `public static [NodeList](../../util/nodelist)` | `**[getAt](#getAt(groovy.util.Node,%20groovy.lang.IntRange))**([Node](../../util/node) o, [IntRange](../../lang/intrange) r)` |
| | `public static [NodeList](../../util/nodelist)` | `**[getAt](#getAt(groovy.xml.dom.DOMCategory.NodeListsHolder,%20groovy.lang.IntRange))**([DOMCategory.NodeListsHolder](domcategory.nodelistsholder) o, [IntRange](../../lang/intrange) r)` |
| | `public static [NodeList](../../util/nodelist)` | `**[getAt](#getAt(groovy.xml.dom.DOMCategory.NodesHolder,%20groovy.lang.IntRange))**([DOMCategory.NodesHolder](domcategory.nodesholder) o, [IntRange](../../lang/intrange) r)` |
| | `public static boolean` | `**[isEmpty](#isEmpty(groovy.util.NodeList))**([NodeList](../../util/nodelist) self)` |
| | `public static boolean` | `**[isGlobalKeepIgnorableWhitespace](#isGlobalKeepIgnorableWhitespace())**()`
**Returns:**
true if ignorable whitespace (e.g. whitespace between elements) is kept; default false
|
| | `public static boolean` | `**[isGlobalTrimWhitespace](#isGlobalTrimWhitespace())**()`
**Returns:**
true if text elements are trimmed before returning; default false
|
| | `public static [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Node](https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html "Node")>` | `**[list](#list(groovy.util.NodeList))**([NodeList](../../util/nodelist) self)` |
| | `public static [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>` | `**[localText](#localText(javax.swing.text.Element))**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") self)`Returns the list of any direct String nodes of this node. |
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[name](#name(groovy.util.Node))**([Node](../../util/node) node)` |
| | `public static [Node](../../util/node)` | `**[parent](#parent(groovy.util.Node))**([Node](../../util/node) node)` |
| | `public static void` | `**[plus](#plus(javax.swing.text.Element,%20groovy.lang.Closure))**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") self, [Closure](../../lang/closure) c)` |
| | `public static void` | `**[plus](#plus(groovy.util.NodeList,%20groovy.lang.Closure))**([NodeList](../../util/nodelist) self, [Closure](../../lang/closure) c)` |
| | `public static void` | `**[putAt](#putAt(javax.swing.text.Element,%20java.lang.String,%20java.lang.Object))**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") self, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [Node](../../util/node)` | `**[replaceNode](#replaceNode(groovy.xml.dom.DOMCategory.NodesHolder,%20groovy.lang.Closure))**([DOMCategory.NodesHolder](domcategory.nodesholder) self, [Closure](../../lang/closure) c)` |
| | `public static [Node](../../util/node)` | `**[replaceNode](#replaceNode(groovy.util.Node,%20groovy.lang.Closure))**([Node](../../util/node) self, [Closure](../../lang/closure) c)` |
| | `public static void` | `**[setGlobalKeepIgnorableWhitespace](#setGlobalKeepIgnorableWhitespace(boolean))**(boolean keepIgnorableWhitespace)`Whether ignorable whitespace (e.g. whitespace between elements) is kept (default false). |
| | `public static void` | `**[setGlobalTrimWhitespace](#setGlobalTrimWhitespace(boolean))**(boolean trimWhitespace)`Whether text content is trimmed (removing leading and trailing whitespace); default false. |
| | `public static void` | `**[setValue](#setValue(javax.swing.text.Element,%20java.lang.String))**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") self, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") value)` |
| | `public static int` | `**[size](#size(org.w3c.dom.NamedNodeMap))**([NamedNodeMap](https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/NamedNodeMap.html "NamedNodeMap") namedNodeMap)` |
| | `public static int` | `**[size](#size(groovy.util.NodeList))**([NodeList](../../util/nodelist) self)` |
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[text](#text(groovy.util.Node))**([Node](../../util/node) node)` |
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[text](#text(groovy.util.NodeList))**([NodeList](../../util/nodelist) nodeList)` |
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)` |
| | `public static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[xpath](#xpath(groovy.util.Node,%20java.lang.String,%20javax.xml.namespace.QName))**([Node](../../util/node) self, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") expression, [QName](https://docs.oracle.com/javase/8/docs/api/javax/xml/namespace/QName.html "QName") returnType)` |
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[xpath](#xpath(groovy.util.Node,%20java.lang.String))**([Node](../../util/node) self, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") expression)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### public static [Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") **appendNode**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") self, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") name)
### public static [Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") **appendNode**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") self, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") name, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") attributes)
### public static [Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") **appendNode**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") self, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") name, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") value)
### public static [Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") **appendNode**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") self, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") name, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") attributes, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") value)
### public static [NamedNodeMap](https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/NamedNodeMap.html "NamedNodeMap") **attributes**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") element)
### public static [NodeList](../../util/nodelist) **breadthFirst**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") self)
### public static [NodeList](../../util/nodelist) **children**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") self)
### public static [NodeList](../../util/nodelist) **depthFirst**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") self)
### public static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **get**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") element, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") elementName)
### public static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **get**([NodeList](../../util/nodelist) nodeList, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") elementName)
### public static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **get**([NamedNodeMap](https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/NamedNodeMap.html "NamedNodeMap") nodeMap, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") elementName)
### public static [Node](../../util/node) **getAt**([Node](../../util/node) o, int i)
### public static [Node](../../util/node) **getAt**([DOMCategory.NodeListsHolder](domcategory.nodelistsholder) o, int i)
### public static [Node](../../util/node) **getAt**([DOMCategory.NodesHolder](domcategory.nodesholder) o, int i)
### public static [NodeList](../../util/nodelist) **getAt**([Node](../../util/node) o, [IntRange](../../lang/intrange) r)
### public static [NodeList](../../util/nodelist) **getAt**([DOMCategory.NodeListsHolder](domcategory.nodelistsholder) o, [IntRange](../../lang/intrange) r)
### public static [NodeList](../../util/nodelist) **getAt**([DOMCategory.NodesHolder](domcategory.nodesholder) o, [IntRange](../../lang/intrange) r)
### public static boolean **isEmpty**([NodeList](../../util/nodelist) self)
### public static boolean **isGlobalKeepIgnorableWhitespace**()
**Returns:**
true if ignorable whitespace (e.g. whitespace between elements) is kept; default false
### public static boolean **isGlobalTrimWhitespace**()
**Returns:**
true if text elements are trimmed before returning; default false
### public static [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Node](https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Node.html "Node")> **list**([NodeList](../../util/nodelist) self)
### public static [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> **localText**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") self)
Returns the list of any direct String nodes of this node.
**Returns:**
the list of String values from this node
**Since:**
2.3.0
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **name**([Node](../../util/node) node)
### public static [Node](../../util/node) **parent**([Node](../../util/node) node)
### public static void **plus**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") self, [Closure](../../lang/closure) c)
### public static void **plus**([NodeList](../../util/nodelist) self, [Closure](../../lang/closure) c)
### public static void **putAt**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") self, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [Node](../../util/node) **replaceNode**([DOMCategory.NodesHolder](domcategory.nodesholder) self, [Closure](../../lang/closure) c)
### public static [Node](../../util/node) **replaceNode**([Node](../../util/node) self, [Closure](../../lang/closure) c)
### public static void **setGlobalKeepIgnorableWhitespace**(boolean keepIgnorableWhitespace)
Whether ignorable whitespace (e.g. whitespace between elements) is kept (default false). WARNING: this is a global setting. Altering it will affect all DOMCategory usage within the current Java process.
**Parameters:**
`keepIgnorableWhitespace` - the new value
### public static void **setGlobalTrimWhitespace**(boolean trimWhitespace)
Whether text content is trimmed (removing leading and trailing whitespace); default false. WARNING: this is a global setting. Altering it will affect all DOMCategory usage within the current Java process. It is not recommended that this is altered; instead call the trim() method on the returned text, but the flag is available to support legacy Groovy behavior.
**Parameters:**
`trimWhitespace` - the new value
### public static void **setValue**([Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") self, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") value)
### public static int **size**([NamedNodeMap](https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/NamedNodeMap.html "NamedNodeMap") namedNodeMap)
### public static int **size**([NodeList](../../util/nodelist) self)
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **text**([Node](../../util/node) node)
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **text**([NodeList](../../util/nodelist) nodeList)
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)
### public static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **xpath**([Node](../../util/node) self, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") expression, [QName](https://docs.oracle.com/javase/8/docs/api/javax/xml/namespace/QName.html "QName") returnType)
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **xpath**([Node](../../util/node) self, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") expression)
| programming_docs |
groovy [Java] Class Duration [Java] Class Duration
=====================
* groovy.time.Duration
```
public class Duration
extends [BaseDuration](baseduration)
```
Duration represents time periods which have values independent of the context. So, whilst we can't say how long a month is without knowing the year and the name of the month, we know how long a day is independent of the date.
This is not 100% true for days. Days can actually be 23, 24 or 25 hours long (due to daylight saving adjustments.)
If you ask Duration to convert itself to milliseconds then it will work on the basis of 24 hours in a day. If you add or subtract it from a date it will take daylight saving into account.
Inherited fields
| Fields inherited from class | Fields |
| **`class [BaseDuration](baseduration)`** | `[days](baseduration#days), [hours](baseduration#hours), [millis](baseduration#millis), [minutes](baseduration#minutes), [months](baseduration#months), [seconds](baseduration#seconds), [years](baseduration#years)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Duration](#Duration(int,%20int,%20int,%20int,%20int))**(int days, int hours, int minutes, int seconds, int millis)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date")` | `**[getAgo](#getAgo())**()` |
| | `public [BaseDuration.From](baseduration.from)` | `**[getFrom](#getFrom())**()` |
| | `public [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date")` | `**[getNow](#getNow())**()` |
| | `public [Duration](duration)` | `**[minus](#minus(groovy.time.Duration))**([Duration](duration) rhs)` |
| | `public [TimeDuration](timeduration)` | `**[minus](#minus(groovy.time.TimeDuration))**([TimeDuration](timeduration) rhs)` |
| | `public [DatumDependentDuration](datumdependentduration)` | `**[minus](#minus(groovy.time.DatumDependentDuration))**([DatumDependentDuration](datumdependentduration) rhs)` |
| | `public [TimeDatumDependentDuration](timedatumdependentduration)` | `**[minus](#minus(groovy.time.TimeDatumDependentDuration))**([TimeDatumDependentDuration](timedatumdependentduration) rhs)` |
| | `public [Duration](duration)` | `**[plus](#plus(groovy.time.Duration))**([Duration](duration) rhs)` |
| | `public [Duration](duration)` | `**[plus](#plus(groovy.time.TimeDuration))**([TimeDuration](timeduration) rhs)` |
| | `public [DatumDependentDuration](datumdependentduration)` | `**[plus](#plus(groovy.time.DatumDependentDuration))**([DatumDependentDuration](datumdependentduration) rhs)` |
| | `public long` | `**[toMilliseconds](#toMilliseconds())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [BaseDuration](baseduration)` | `[compareTo](baseduration#compareTo(groovy.time.BaseDuration)), [getAgo](baseduration#getAgo()), [getDays](baseduration#getDays()), [getFrom](baseduration#getFrom()), [getHours](baseduration#getHours()), [getMillis](baseduration#getMillis()), [getMinutes](baseduration#getMinutes()), [getMonths](baseduration#getMonths()), [getSeconds](baseduration#getSeconds()), [getYears](baseduration#getYears()), [plus](baseduration#plus(java.util.Date)), [toMilliseconds](baseduration#toMilliseconds()), [toString](baseduration#toString())` |
Constructor Detail
------------------
### public **Duration**(int days, int hours, int minutes, int seconds, int millis)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") **getAgo**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [BaseDuration.From](baseduration.from) **getFrom**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") **getNow**()
### public [Duration](duration) **minus**([Duration](duration) rhs)
### public [TimeDuration](timeduration) **minus**([TimeDuration](timeduration) rhs)
### public [DatumDependentDuration](datumdependentduration) **minus**([DatumDependentDuration](datumdependentduration) rhs)
### public [TimeDatumDependentDuration](timedatumdependentduration) **minus**([TimeDatumDependentDuration](timedatumdependentduration) rhs)
### public [Duration](duration) **plus**([Duration](duration) rhs)
### public [Duration](duration) **plus**([TimeDuration](timeduration) rhs)
### public [DatumDependentDuration](datumdependentduration) **plus**([DatumDependentDuration](datumdependentduration) rhs)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public long **toMilliseconds**()
groovy [Java] Class TimeDatumDependentDuration [Java] Class TimeDatumDependentDuration
=======================================
* groovy.time.TimeDatumDependentDuration
```
public class TimeDatumDependentDuration
extends [DatumDependentDuration](datumdependentduration)
```
TimeDatumDuration represents a time period which results from an arithmetic operation between a TimeDuration object and a DatumDuration object
Inherited fields
| Fields inherited from class | Fields |
| **`class [BaseDuration](baseduration)`** | `[days](baseduration#days), [hours](baseduration#hours), [millis](baseduration#millis), [minutes](baseduration#minutes), [months](baseduration#months), [seconds](baseduration#seconds), [years](baseduration#years)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[TimeDatumDependentDuration](#TimeDatumDependentDuration(int,%20int,%20int,%20int,%20int,%20int,%20int))**(int years, int months, int days, int hours, int minutes, int seconds, int millis)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [BaseDuration.From](baseduration.from)` | `**[getFrom](#getFrom())**()` |
| | `public [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date")` | `**[getNow](#getNow())**()` |
| | `public [DatumDependentDuration](datumdependentduration)` | `**[minus](#minus(groovy.time.Duration))**([Duration](duration) rhs)` |
| | `public [DatumDependentDuration](datumdependentduration)` | `**[minus](#minus(groovy.time.DatumDependentDuration))**([DatumDependentDuration](datumdependentduration) rhs)` |
| | `public [DatumDependentDuration](datumdependentduration)` | `**[plus](#plus(groovy.time.Duration))**([Duration](duration) rhs)` |
| | `public [DatumDependentDuration](datumdependentduration)` | `**[plus](#plus(groovy.time.DatumDependentDuration))**([DatumDependentDuration](datumdependentduration) rhs)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [DatumDependentDuration](datumdependentduration)` | `[getAgo](datumdependentduration#getAgo()), [getFrom](datumdependentduration#getFrom()), [getMonths](datumdependentduration#getMonths()), [getNow](datumdependentduration#getNow()), [getYears](datumdependentduration#getYears()), [minus](datumdependentduration#minus(groovy.time.DatumDependentDuration)), [minus](datumdependentduration#minus(groovy.time.Duration)), [plus](datumdependentduration#plus(groovy.time.DatumDependentDuration)), [plus](datumdependentduration#plus(groovy.time.TimeDatumDependentDuration)), [plus](datumdependentduration#plus(groovy.time.Duration)), [plus](datumdependentduration#plus(groovy.time.TimeDuration)), [toMilliseconds](datumdependentduration#toMilliseconds())` |
| `class [BaseDuration](baseduration)` | `[compareTo](baseduration#compareTo(groovy.time.BaseDuration)), [getAgo](baseduration#getAgo()), [getDays](baseduration#getDays()), [getFrom](baseduration#getFrom()), [getHours](baseduration#getHours()), [getMillis](baseduration#getMillis()), [getMinutes](baseduration#getMinutes()), [getMonths](baseduration#getMonths()), [getSeconds](baseduration#getSeconds()), [getYears](baseduration#getYears()), [plus](baseduration#plus(java.util.Date)), [toMilliseconds](baseduration#toMilliseconds()), [toString](baseduration#toString())` |
Constructor Detail
------------------
### public **TimeDatumDependentDuration**(int years, int months, int days, int hours, int minutes, int seconds, int millis)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [BaseDuration.From](baseduration.from) **getFrom**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") **getNow**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [DatumDependentDuration](datumdependentduration) **minus**([Duration](duration) rhs)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [DatumDependentDuration](datumdependentduration) **minus**([DatumDependentDuration](datumdependentduration) rhs)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [DatumDependentDuration](datumdependentduration) **plus**([Duration](duration) rhs)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [DatumDependentDuration](datumdependentduration) **plus**([DatumDependentDuration](datumdependentduration) rhs)
groovy [Java] Class DatumDependentDuration [Java] Class DatumDependentDuration
===================================
* groovy.time.DatumDependentDuration
```
public class DatumDependentDuration
extends [BaseDuration](baseduration)
```
DatumDependentDuration represents durations whose length in milliseconds cannot be determined without knowing the datum point.
I don't know how many days in a year unless I know if it's a leap year or not.
I don't know how many days in a month unless I know the name of the month (and if it's a leap year if the month is February)
Inherited fields
| Fields inherited from class | Fields |
| **`class [BaseDuration](baseduration)`** | `[days](baseduration#days), [hours](baseduration#hours), [millis](baseduration#millis), [minutes](baseduration#minutes), [months](baseduration#months), [seconds](baseduration#seconds), [years](baseduration#years)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[DatumDependentDuration](#DatumDependentDuration(int,%20int,%20int,%20int,%20int,%20int,%20int))**(int years, int months, int days, int hours, int minutes, int seconds, int millis)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date")` | `**[getAgo](#getAgo())**()` |
| | `public [BaseDuration.From](baseduration.from)` | `**[getFrom](#getFrom())**()` |
| | `public int` | `**[getMonths](#getMonths())**()` |
| | `public [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date")` | `**[getNow](#getNow())**()` |
| | `public int` | `**[getYears](#getYears())**()` |
| | `public [DatumDependentDuration](datumdependentduration)` | `**[minus](#minus(groovy.time.DatumDependentDuration))**([DatumDependentDuration](datumdependentduration) rhs)` |
| | `public [DatumDependentDuration](datumdependentduration)` | `**[minus](#minus(groovy.time.Duration))**([Duration](duration) rhs)` |
| | `public [DatumDependentDuration](datumdependentduration)` | `**[plus](#plus(groovy.time.DatumDependentDuration))**([DatumDependentDuration](datumdependentduration) rhs)` |
| | `public [DatumDependentDuration](datumdependentduration)` | `**[plus](#plus(groovy.time.TimeDatumDependentDuration))**([TimeDatumDependentDuration](timedatumdependentduration) rhs)` |
| | `public [DatumDependentDuration](datumdependentduration)` | `**[plus](#plus(groovy.time.Duration))**([Duration](duration) rhs)` |
| | `public [DatumDependentDuration](datumdependentduration)` | `**[plus](#plus(groovy.time.TimeDuration))**([TimeDuration](timeduration) rhs)` |
| | `public long` | `**[toMilliseconds](#toMilliseconds())**()`
**See Also:**
[BaseDuration.toMilliseconds](baseduration#toMilliseconds() "BaseDuration.toMilliseconds")
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [BaseDuration](baseduration)` | `[compareTo](baseduration#compareTo(groovy.time.BaseDuration)), [getAgo](baseduration#getAgo()), [getDays](baseduration#getDays()), [getFrom](baseduration#getFrom()), [getHours](baseduration#getHours()), [getMillis](baseduration#getMillis()), [getMinutes](baseduration#getMinutes()), [getMonths](baseduration#getMonths()), [getSeconds](baseduration#getSeconds()), [getYears](baseduration#getYears()), [plus](baseduration#plus(java.util.Date)), [toMilliseconds](baseduration#toMilliseconds()), [toString](baseduration#toString())` |
Constructor Detail
------------------
### public **DatumDependentDuration**(int years, int months, int days, int hours, int minutes, int seconds, int millis)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") **getAgo**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [BaseDuration.From](baseduration.from) **getFrom**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getMonths**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") **getNow**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getYears**()
### public [DatumDependentDuration](datumdependentduration) **minus**([DatumDependentDuration](datumdependentduration) rhs)
### public [DatumDependentDuration](datumdependentduration) **minus**([Duration](duration) rhs)
### public [DatumDependentDuration](datumdependentduration) **plus**([DatumDependentDuration](datumdependentduration) rhs)
### public [DatumDependentDuration](datumdependentduration) **plus**([TimeDatumDependentDuration](timedatumdependentduration) rhs)
### public [DatumDependentDuration](datumdependentduration) **plus**([Duration](duration) rhs)
### public [DatumDependentDuration](datumdependentduration) **plus**([TimeDuration](timeduration) rhs)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public long **toMilliseconds**()
**See Also:**
groovy [Java] Class BaseDuration [Java] Class BaseDuration
=========================
* groovy.time.BaseDuration
All Implemented Interfaces and Traits: [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")
```
public abstract class BaseDuration
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")
```
Base class for date and time durations.
**See Also:**
[Duration](duration "Duration")
Nested Class Summary
--------------------
Nested classes
| Modifiers | Name | Description |
| `**static class**` | `[BaseDuration.From](baseduration.from)` | |
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**protected int**` | `[days](#days)` | |
| `**protected int**` | `[hours](#hours)` | |
| `**protected int**` | `[millis](#millis)` | |
| `**protected int**` | `[minutes](#minutes)` | |
| `**protected int**` | `[months](#months)` | |
| `**protected int**` | `[seconds](#seconds)` | |
| `**protected int**` | `[years](#years)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `protected **[BaseDuration](#BaseDuration(int,%20int,%20int,%20int,%20int,%20int,%20int))**(int years, int months, int days, int hours, int minutes, int seconds, int millis)` |
| `protected **[BaseDuration](#BaseDuration(int,%20int,%20int,%20int,%20int))**(int days, int hours, int minutes, int seconds, int millis)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public int` | `**[compareTo](#compareTo(groovy.time.BaseDuration))**([BaseDuration](baseduration) otherDuration)` |
| | `public abstract [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date")` | `**[getAgo](#getAgo())**()` |
| | `public int` | `**[getDays](#getDays())**()` |
| | `public abstract [BaseDuration.From](baseduration.from)` | `**[getFrom](#getFrom())**()` |
| | `public int` | `**[getHours](#getHours())**()` |
| | `public int` | `**[getMillis](#getMillis())**()` |
| | `public int` | `**[getMinutes](#getMinutes())**()` |
| | `public int` | `**[getMonths](#getMonths())**()` |
| | `public int` | `**[getSeconds](#getSeconds())**()` |
| | `public int` | `**[getYears](#getYears())**()` |
| | `public [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date")` | `**[plus](#plus(java.util.Date))**([Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") date)` |
| | `public abstract long` | `**[toMilliseconds](#toMilliseconds())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### protected final int **days**
### protected final int **hours**
### protected final int **millis**
### protected final int **minutes**
### protected final int **months**
### protected final int **seconds**
### protected final int **years**
Constructor Detail
------------------
### protected **BaseDuration**(int years, int months, int days, int hours, int minutes, int seconds, int millis)
### protected **BaseDuration**(int days, int hours, int minutes, int seconds, int millis)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **compareTo**([BaseDuration](baseduration) otherDuration)
### public abstract [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") **getAgo**()
### public int **getDays**()
### public abstract [BaseDuration.From](baseduration.from) **getFrom**()
### public int **getHours**()
### public int **getMillis**()
### public int **getMinutes**()
### public int **getMonths**()
### public int **getSeconds**()
### public int **getYears**()
### public [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") **plus**([Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") date)
### public abstract long **toMilliseconds**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
| programming_docs |
groovy [Java] Class TimeDuration [Java] Class TimeDuration
=========================
* groovy.time.TimeDuration
```
public class TimeDuration
extends [Duration](duration)
```
Inherited fields
| Fields inherited from class | Fields |
| **`class [BaseDuration](baseduration)`** | `[days](baseduration#days), [hours](baseduration#hours), [millis](baseduration#millis), [minutes](baseduration#minutes), [months](baseduration#months), [seconds](baseduration#seconds), [years](baseduration#years)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[TimeDuration](#TimeDuration(int,%20int,%20int,%20int))**(int hours, int minutes, int seconds, int millis)` |
| `**[TimeDuration](#TimeDuration(int,%20int,%20int,%20int,%20int))**(int days, int hours, int minutes, int seconds, int millis)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date")` | `**[getAgo](#getAgo())**()` |
| | `public [BaseDuration.From](baseduration.from)` | `**[getFrom](#getFrom())**()` |
| | `public [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date")` | `**[getNow](#getNow())**()` |
| | `public [Duration](duration)` | `**[minus](#minus(groovy.time.Duration))**([Duration](duration) rhs)` |
| | `public [DatumDependentDuration](datumdependentduration)` | `**[minus](#minus(groovy.time.DatumDependentDuration))**([DatumDependentDuration](datumdependentduration) rhs)` |
| | `public [Duration](duration)` | `**[plus](#plus(groovy.time.Duration))**([Duration](duration) rhs)` |
| | `public [DatumDependentDuration](datumdependentduration)` | `**[plus](#plus(groovy.time.DatumDependentDuration))**([DatumDependentDuration](datumdependentduration) rhs)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Duration](duration)` | `[getAgo](duration#getAgo()), [getFrom](duration#getFrom()), [getNow](duration#getNow()), [minus](duration#minus(groovy.time.Duration)), [minus](duration#minus(groovy.time.TimeDuration)), [minus](duration#minus(groovy.time.DatumDependentDuration)), [minus](duration#minus(groovy.time.TimeDatumDependentDuration)), [plus](duration#plus(groovy.time.Duration)), [plus](duration#plus(groovy.time.TimeDuration)), [plus](duration#plus(groovy.time.DatumDependentDuration)), [toMilliseconds](duration#toMilliseconds())` |
| `class [BaseDuration](baseduration)` | `[compareTo](baseduration#compareTo(groovy.time.BaseDuration)), [getAgo](baseduration#getAgo()), [getDays](baseduration#getDays()), [getFrom](baseduration#getFrom()), [getHours](baseduration#getHours()), [getMillis](baseduration#getMillis()), [getMinutes](baseduration#getMinutes()), [getMonths](baseduration#getMonths()), [getSeconds](baseduration#getSeconds()), [getYears](baseduration#getYears()), [plus](baseduration#plus(java.util.Date)), [toMilliseconds](baseduration#toMilliseconds()), [toString](baseduration#toString())` |
Constructor Detail
------------------
### public **TimeDuration**(int hours, int minutes, int seconds, int millis)
### public **TimeDuration**(int days, int hours, int minutes, int seconds, int millis)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") **getAgo**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [BaseDuration.From](baseduration.from) **getFrom**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") **getNow**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Duration](duration) **minus**([Duration](duration) rhs)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [DatumDependentDuration](datumdependentduration) **minus**([DatumDependentDuration](datumdependentduration) rhs)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Duration](duration) **plus**([Duration](duration) rhs)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [DatumDependentDuration](datumdependentduration) **plus**([DatumDependentDuration](datumdependentduration) rhs)
groovy [Java] Class BaseDuration.From [Java] Class BaseDuration.From
==============================
* groovy.time.BaseDuration.From
```
public static abstract class BaseDuration.From
```
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public abstract [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date")` | `**[getNow](#getNow())**()` |
| | `public [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date")` | `**[getToday](#getToday())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### public abstract [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") **getNow**()
### public [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") **getToday**()
groovy [Java] Class TimeCategory [Java] Class TimeCategory
=========================
* groovy.time.TimeCategory
```
public class TimeCategory
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Apply a number of methods to allow convenient Date/Time manipulation,such as:
```
use (groovy.time.TimeCategory) {
// application on numbers:
println 1.minute.from.now
println 10.hours.ago
// application on dates
def someDate = new Date()
println someDate - 3.months
}
```
**See Also:**
[BaseDuration](baseduration "BaseDuration")
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public static [Duration](duration)` | `**[getDay](#getDay(java.lang.Integer))**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)` |
| | `public static [Duration](duration)` | `**[getDaylightSavingsOffset](#getDaylightSavingsOffset(java.util.Date))**([Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") self)`Get the DST offset (if any) for the default locale and the given date. |
| | `public static [Duration](duration)` | `**[getDaylightSavingsOffset](#getDaylightSavingsOffset(groovy.time.BaseDuration))**([BaseDuration](baseduration) self)` |
| | `public static [Duration](duration)` | `**[getDays](#getDays(java.lang.Integer))**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)` |
| | `public static [TimeDuration](timeduration)` | `**[getHour](#getHour(java.lang.Integer))**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)` |
| | `public static [TimeDuration](timeduration)` | `**[getHours](#getHours(java.lang.Integer))**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)` |
| | `public static [TimeDuration](timeduration)` | `**[getMillisecond](#getMillisecond(java.lang.Integer))**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)` |
| | `public static [TimeDuration](timeduration)` | `**[getMilliseconds](#getMilliseconds(java.lang.Integer))**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)` |
| | `public static [TimeDuration](timeduration)` | `**[getMinute](#getMinute(java.lang.Integer))**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)` |
| | `public static [TimeDuration](timeduration)` | `**[getMinutes](#getMinutes(java.lang.Integer))**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)` |
| | `public static [DatumDependentDuration](datumdependentduration)` | `**[getMonth](#getMonth(java.lang.Integer))**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)` |
| | `public static [DatumDependentDuration](datumdependentduration)` | `**[getMonths](#getMonths(java.lang.Integer))**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)` |
| | `public static [Duration](duration)` | `**[getRelativeDaylightSavingsOffset](#getRelativeDaylightSavingsOffset(java.util.Date,%20java.util.Date))**([Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") self, [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") other)`Return a Duration representing the DST difference (if any) between two dates. |
| | `public static [TimeDuration](timeduration)` | `**[getSecond](#getSecond(java.lang.Integer))**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)` |
| | `public static [TimeDuration](timeduration)` | `**[getSeconds](#getSeconds(java.lang.Integer))**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)` |
| | `public static [TimeZone](https://docs.oracle.com/javase/8/docs/api/java/util/TimeZone.html "TimeZone")` | `**[getTimeZone](#getTimeZone(java.util.Date))**([Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") self)`Retrieves the default TimeZone for a date by using the default Locale settings. |
| | `public static [Duration](duration)` | `**[getWeek](#getWeek(java.lang.Integer))**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)` |
| | `public static [Duration](duration)` | `**[getWeeks](#getWeeks(java.lang.Integer))**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)` |
| | `public static [DatumDependentDuration](datumdependentduration)` | `**[getYear](#getYear(java.lang.Integer))**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)` |
| | `public static [DatumDependentDuration](datumdependentduration)` | `**[getYears](#getYears(java.lang.Integer))**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)` |
| | `public static [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date")` | `**[minus](#minus(java.util.Date,%20groovy.time.BaseDuration))**([Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") date, [BaseDuration](baseduration) duration)` |
| | `public static [TimeDuration](timeduration)` | `**[minus](#minus(java.util.Date,%20java.util.Date))**([Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") lhs, [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") rhs)`Subtract one date from the other. |
| | `public static [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date")` | `**[plus](#plus(java.util.Date,%20groovy.time.BaseDuration))**([Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") date, [BaseDuration](baseduration) duration)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### public static [Duration](duration) **getDay**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)
### public static [Duration](duration) **getDaylightSavingsOffset**([Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") self)
Get the DST offset (if any) for the default locale and the given date.
**Parameters:**
`self` - a Date
**Returns:**
the DST offset as a Duration.
### public static [Duration](duration) **getDaylightSavingsOffset**([BaseDuration](baseduration) self)
### public static [Duration](duration) **getDays**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)
### public static [TimeDuration](timeduration) **getHour**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)
### public static [TimeDuration](timeduration) **getHours**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)
### public static [TimeDuration](timeduration) **getMillisecond**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)
### public static [TimeDuration](timeduration) **getMilliseconds**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)
### public static [TimeDuration](timeduration) **getMinute**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)
### public static [TimeDuration](timeduration) **getMinutes**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)
### public static [DatumDependentDuration](datumdependentduration) **getMonth**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)
### public static [DatumDependentDuration](datumdependentduration) **getMonths**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)
### public static [Duration](duration) **getRelativeDaylightSavingsOffset**([Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") self, [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") other)
Return a Duration representing the DST difference (if any) between two dates. i.e. if one date is before the DST changeover, and the other date is after, the resulting duration will represent the DST offset.
**Parameters:**
`self` - a Date
`other` - another Date
**Returns:**
a Duration
### public static [TimeDuration](timeduration) **getSecond**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)
### public static [TimeDuration](timeduration) **getSeconds**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public static [TimeZone](https://docs.oracle.com/javase/8/docs/api/java/util/TimeZone.html "TimeZone") **getTimeZone**([Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") self)
Retrieves the default TimeZone for a date by using the default Locale settings. Recommended that you use `TimeZone.getDefault()` instead.
**Parameters:**
`self` - a Date
**Returns:**
the TimeZone
### public static [Duration](duration) **getWeek**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)
### public static [Duration](duration) **getWeeks**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)
### public static [DatumDependentDuration](datumdependentduration) **getYear**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)
### public static [DatumDependentDuration](datumdependentduration) **getYears**([Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") self)
### public static [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") **minus**([Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") date, [BaseDuration](baseduration) duration)
### public static [TimeDuration](timeduration) **minus**([Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") lhs, [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") rhs)
Subtract one date from the other.
**Parameters:**
`lhs` - a Date
`rhs` - another Date
**Returns:**
a Duration
### public static [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") **plus**([Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") date, [BaseDuration](baseduration) duration)
groovy [Java] Class ExpandoMetaClass [Java] Class ExpandoMetaClass
=============================
* groovy.lang.ExpandoMetaClass
All Implemented Interfaces and Traits: [GroovyObject](groovyobject)
```
public class ExpandoMetaClass
extends [MetaClassImpl](metaclassimpl)
implements [GroovyObject](groovyobject)
```
ExpandoMetaClass is a MetaClass that behaves like an Expando, allowing the addition or replacement of methods, properties and constructors on the fly.
Some examples of usage:
```
// defines or replaces instance method:
metaClass.myMethod = { args -> }
// defines a new instance method
metaClass.myMethod << { args -> }
// creates multiple overloaded methods of the same name
metaClass.myMethod << { String s -> } << { Integer i -> }
// defines or replaces a static method with the 'static' qualifier
metaClass.'static'.myMethod = { args -> }
// defines a new static method with the 'static' qualifier
metaClass.'static'.myMethod << { args -> }
// defines a new constructor
metaClass.constructor << { String arg -> }
// defines or replaces a constructor
metaClass.constructor = { String arg -> }
// defines a new property with an initial value of "blah"
metaClass.myProperty = "blah"
```
ExpandoMetaClass also supports a DSL/builder like notation to combine multiple definitions together. So instead of this:
```
Number.metaClass.multiply = { Amount amount -> amount.times(delegate) }
Number.metaClass.div = { Amount amount -> amount.inverse().times(delegate) }
```
You can also now do this:
```
Number.metaClass {
multiply { Amount amount -> amount.times(delegate) }
div { Amount amount -> amount.inverse().times(delegate) }
}
```
ExpandoMetaClass also supports runtime mixins. While `@Mixin` allows you to mix in new behavior to classes you own and are designing, you can not easily mixin anything to types you didn't own, e.g. from third party libraries or from JDK library classes. Runtime mixins let you add a mixin on any type at runtime.
```
interface Vehicle {
String getName()
}
// Category annotation style
@Category(Vehicle) class FlyingAbility {
def fly() { "I'm the ${name} and I fly!" }
}
// traditional category style
class DivingAbility {
static dive(Vehicle self) { "I'm the ${self.name} and I dive!" }
}
// provided by a third-party, so can't augment using Mixin annotation
class JamesBondVehicle implements Vehicle {
String getName() { "James Bond's vehicle" }
}
// Can be added via metaClass, e.g.:
// JamesBondVehicle.metaClass.mixin DivingAbility, FlyingAbility
// Or using shorthand through DGM method on Class
JamesBondVehicle.mixin DivingAbility, FlyingAbility
assert new JamesBondVehicle().fly() ==
"I'm the James Bond's vehicle and I fly!"
assert new JamesBondVehicle().dive() ==
"I'm the James Bond's vehicle and I dive!"
```
As another example, consider the following class definitions:
```
class Student {
List schedule = []
def addLecture(String lecture) { schedule `<<` lecture }
}
class Worker {
List schedule = []
def addMeeting(String meeting) { schedule `<<` meeting }
}
```
We can mimic a form of multiple inheritance as follows:
```
class CollegeStudent {
static { mixin Student, Worker }
}
new CollegeStudent().with {
addMeeting('Performance review with Boss')
addLecture('Learn about Groovy Mixins')
println schedule
println mixedIn[Student].schedule
println mixedIn[Worker].schedule
}
```
Which outputs these lines when run:
```
[Performance review with Boss]
[Learn about Groovy Mixins]
[Performance review with Boss]
```
Perhaps some explanation is required here. The methods and properties of Student and Worker are added to CollegeStudent. Worker is added last, so for overlapping methods, its methods will be used, e.g. when calling `schedule`, it will be the schedule property (getSchedule method) from Worker that is used. The schedule property from Student will be shadowed but the `mixedIn` notation allows us to get to that too if we need as the last two lines show. We can also be a little more dynamic and not require the CollegeStudent class to be defined at all, e.g.:
```
def cs = new Object()
cs.metaClass {
mixin Student, Worker
getSchedule {
mixedIn[Student].schedule + mixedIn[Worker].schedule
}
}
cs.with {
addMeeting('Performance review with Boss')
addLecture('Learn about Groovy Mixins')
println schedule
}
```
Which outputs this line when run:
```
[Learn about Groovy Mixins, Performance review with Boss]
```
As another example, we can also define a no dup queue by mixing in some Queue and Set functionality as follows:
```
def ndq = new Object()
ndq.metaClass {
mixin ArrayDeque
mixin HashSet
leftShift = { Object o ->
if (!mixedIn[Set].contains(o)) {
mixedIn[Queue].push(o)
mixedIn[Set].add(o)
}
}
}
ndq << 1
ndq << 2
ndq << 1
assert ndq.size() == 2
```
As a final example, we sometimes need to pass such mixed in classes or objects into Java methods which require a given static type but the ExpandoMetaClass mixin approach uses a very dynamic approach based on duck typing rather than static interface definitions, so doesn't by default produce objects matching the required static type. Luckily, there is a mixins capability within ExpandoMetaClass which supports the use of Groovy's common 'as StaticType' notation to produce an object having the correct static type so that it can be passed to the Java method call in question. A slightly contrived example illustrating this feature:
```
class CustomComparator implements Comparator {
int compare(Object a, b) { return a.size() - b.size() }
}
class CustomCloseable implements Closeable {
void close() { println 'Lights out - I am closing' }
}
import static mypackage.IOUtils.closeQuietly
import static java.util.Collections.sort
def o = new Object()
o.metaClass.mixin CustomComparator, CustomCloseable
def items = ['a', 'bbb', 'cc']
sort(items, o as Comparator)
println items // => [a, cc, bbb]
closeQuietly(o as Closeable) // => Lights out - I am closing
```
**Further details**
When using the default implementations of MetaClass, methods are only allowed to be added before initialize() is called. In other words you create a new MetaClass, add some methods and then call initialize(). If you attempt to add new methods after initialize() has been called, an error will be thrown. This is to ensure that the MetaClass can operate appropriately in multi-threaded environments as it forces you to do all method additions at the beginning, before using the MetaClass.
ExpandoMetaClass differs here from the default in that it allows you to add methods after initialize has been called. This is done by setting the initialize flag internally to false and then add the methods. Since this is not thread safe it has to be done in a synchronized block. The methods to check for modification and initialization are therefore synchronized as well. Any method call done through this meta class will first check if the it is synchronized. Should this happen during a modification, then the method cannot be selected or called unless the modification is completed.
**Since:**
1.5
Nested Class Summary
--------------------
Nested classes
| Modifiers | Name | Description |
| `**protected class**` | `[ExpandoMetaClass.ExpandoMetaConstructor](expandometaclass.expandometaconstructor)` | Handles the ability to use the left shift operator to append new constructors |
| `**protected class**` | `[ExpandoMetaClass.ExpandoMetaProperty](expandometaclass.expandometaproperty)` | Instances of this class are returned when using the `<<` left shift operator. |
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[CONSTRUCTOR](#CONSTRUCTOR)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[STATIC\_QUALIFIER](#STATIC_QUALIFIER)` | |
| `**boolean**` | `[inRegistry](#inRegistry)` | |
Inherited fields
| Fields inherited from class | Fields |
| **`class [MetaClassImpl](metaclassimpl)`** | `[EMPTY\_ARGUMENTS](metaclassimpl#EMPTY_ARGUMENTS), [INVOKE\_METHOD\_METHOD](metaclassimpl#INVOKE_METHOD_METHOD), [METHOD\_MISSING](metaclassimpl#METHOD_MISSING), [PROPERTY\_MISSING](metaclassimpl#PROPERTY_MISSING), [STATIC\_METHOD\_MISSING](metaclassimpl#STATIC_METHOD_MISSING), [STATIC\_PROPERTY\_MISSING](metaclassimpl#STATIC_PROPERTY_MISSING), [getPropertyMethod](metaclassimpl#getPropertyMethod), [invokeMethodMethod](metaclassimpl#invokeMethodMethod), [isGroovyObject](metaclassimpl#isGroovyObject), [isMap](metaclassimpl#isMap), [metaMethodIndex](metaclassimpl#metaMethodIndex), [registry](metaclassimpl#registry), [setPropertyMethod](metaclassimpl#setPropertyMethod), [theCachedClass](metaclassimpl#theCachedClass), [theClass](metaclassimpl#theClass)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[ExpandoMetaClass](#ExpandoMetaClass(java.lang.Class,%20boolean,%20boolean,%20groovy.lang.MetaMethod))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, boolean register, boolean allowChangesAfterInit, [MetaMethod](metamethod)[] add)` |
| `**[ExpandoMetaClass](#ExpandoMetaClass(groovy.lang.MetaClassRegistry,%20java.lang.Class,%20boolean,%20boolean,%20groovy.lang.MetaMethod))**([MetaClassRegistry](metaclassregistry) registry, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, boolean register, boolean allowChangesAfterInit, [MetaMethod](metamethod)[] add)` |
| `**[ExpandoMetaClass](#ExpandoMetaClass(java.lang.Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass)`Constructs a new ExpandoMetaClass instance for the given class |
| `**[ExpandoMetaClass](#ExpandoMetaClass(java.lang.Class,%20groovy.lang.MetaMethod))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, [MetaMethod](metamethod)[] add)` |
| `**[ExpandoMetaClass](#ExpandoMetaClass(java.lang.Class,%20boolean))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, boolean register)`Constructs a new ExpandoMetaClass instance for the given class optionally placing the MetaClass in the MetaClassRegistry automatically |
| `**[ExpandoMetaClass](#ExpandoMetaClass(java.lang.Class,%20boolean,%20groovy.lang.MetaMethod))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, boolean register, [MetaMethod](metamethod)[] add)` |
| `**[ExpandoMetaClass](#ExpandoMetaClass(java.lang.Class,%20boolean,%20boolean))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, boolean register, boolean allowChangesAfterInit)`Constructs a new ExpandoMetaClass instance for the given class optionally placing the MetaClass in the MetaClassRegistry automatically |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[addMixinClass](#addMixinClass(org.codehaus.groovy.reflection.MixinInMetaClass))**([MixinInMetaClass](../../org/codehaus/groovy/reflection/mixininmetaclass) mixin)` |
| | `public void` | `**[call](#call())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[castToMixedType](#castToMixedType(java.lang.Object,%20java.lang.Class))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type)` |
| | `protected void` | `**[checkInitalised](#checkInitalised())**()` |
| | `public [CallSite](../../org/codehaus/groovy/runtime/callsite/callsite)` | `**[createConstructorSite](#createConstructorSite(org.codehaus.groovy.runtime.callsite.CallSite,%20java.lang.Object))**([CallSite](../../org/codehaus/groovy/runtime/callsite/callsite) site, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)` |
| | `public [CallSite](../../org/codehaus/groovy/runtime/callsite/callsite)` | `**[createPogoCallCurrentSite](#createPogoCallCurrentSite(org.codehaus.groovy.runtime.callsite.CallSite,%20java.lang.Class,%20java.lang.String,%20java.lang.Object))**([CallSite](../../org/codehaus/groovy/runtime/callsite/callsite) site, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)` |
| | `public [CallSite](../../org/codehaus/groovy/runtime/callsite/callsite)` | `**[createPogoCallSite](#createPogoCallSite(org.codehaus.groovy.runtime.callsite.CallSite,%20java.lang.Object))**([CallSite](../../org/codehaus/groovy/runtime/callsite/callsite) site, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)` |
| | `public [CallSite](../../org/codehaus/groovy/runtime/callsite/callsite)` | `**[createPojoCallSite](#createPojoCallSite(org.codehaus.groovy.runtime.callsite.CallSite,%20java.lang.Object,%20java.lang.Object))**([CallSite](../../org/codehaus/groovy/runtime/callsite/callsite) site, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") receiver, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)` |
| | `public [CallSite](../../org/codehaus/groovy/runtime/callsite/callsite)` | `**[createStaticSite](#createStaticSite(org.codehaus.groovy.runtime.callsite.CallSite,%20java.lang.Object))**([CallSite](../../org/codehaus/groovy/runtime/callsite/callsite) site, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)` |
| | `public [ExpandoMetaClass](expandometaclass)` | `**[define](#define(groovy.lang.Closure))**([Closure](closure) closure)` |
| | `public static void` | `**[disableGlobally](#disableGlobally())**()`Call to disable the global use of ExpandoMetaClass |
| | `public static void` | `**[enableGlobally](#enableGlobally())**()`Call to enable global use of ExpandoMetaClass within the registry. |
| | `public [MetaMethod](metamethod)` | `**[findMixinMethod](#findMixinMethod(java.lang.String,%20java.lang.Class))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] arguments)` |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaMethod](metamethod "MetaMethod")>` | `**[getExpandoMethods](#getExpandoMethods())**()`Returns a list of expando MetaMethod instances added to this ExpandoMetaClass |
| | `public [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<[MetaProperty](metaproperty "MetaProperty")>` | `**[getExpandoProperties](#getExpandoProperties())**()`Returns a list of MetaBeanProperty instances added to this ExpandoMetaClass |
| | `public [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")` | `**[getExpandoSubclassMethods](#getExpandoSubclassMethods())**()` |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[getJavaClass](#getJavaClass())**()`
**Returns:**
The Java class enhanced by this MetaClass
|
| | `public [MetaClass](metaclass)` | `**[getMetaClass](#getMetaClass())**()` |
| | `public [MetaProperty](metaproperty)` | `**[getMetaProperty](#getMetaProperty(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)`Looks up an existing MetaProperty by name |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaMethod](metamethod "MetaMethod")>` | `**[getMethods](#getMethods())**()`Overrides the behavior of parent getMethods() method to make MetaClass aware of added Expando methods |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaProperty](metaproperty "MetaProperty")>` | `**[getProperties](#getProperties())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20boolean,%20boolean))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, boolean useSuper, boolean fromInsideClass)`Overrides default implementation just in case getProperty method has been overridden by ExpandoMetaClass |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.Object,%20java.lang.String))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)`Overrides default implementation just in case getProperty method has been overridden by ExpandoMetaClass |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getPropertyForSetter](#getPropertyForSetter(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") setterName)`Returns a property name equivalent for the given setter name or null if it is not a getter |
| | `protected [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getSubclassMetaMethods](#getSubclassMetaMethods(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName)` |
| | `public boolean` | `**[hasCustomStaticInvokeMethod](#hasCustomStaticInvokeMethod())**()` |
| | `public boolean` | `**[hasMetaMethod](#hasMetaMethod(java.lang.String,%20java.lang.Class))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] args)`Checks whether a MetaMethod for the given name and arguments exists |
| | `public boolean` | `**[hasMetaProperty](#hasMetaProperty(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)`Returns true if the MetaClass has the given property |
| | `public void` | `**[initialize](#initialize())**()`{@inheritDoc} |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeConstructor](#invokeConstructor(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20java.lang.Object,%20boolean,%20boolean))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] originalArguments, boolean isCallToSuper, boolean fromInsideClass)`Overrides default implementation just in case invokeMethod has been overridden by ExpandoMetaClass |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeStaticMethod](#invokeStaticMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)`Overrides default implementation just in case a static invoke method has been set on ExpandoMetaClass |
| | `protected boolean` | `**[isInitialized](#isInitialized())**()`Checks if the meta class is initialized. |
| | `public boolean` | `**[isModified](#isModified())**()` |
| | `public boolean` | `**[isSetter](#isSetter(java.lang.String,%20org.codehaus.groovy.reflection.CachedClass))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [CachedClass](../../org/codehaus/groovy/reflection/cachedclass)[] args)` |
| | `public static boolean` | `**[isValidExpandoProperty](#isValidExpandoProperty(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)` |
| | `protected void` | `**[onGetPropertyFoundInHierarchy](#onGetPropertyFoundInHierarchy(groovy.lang.MetaMethod))**([MetaMethod](metamethod) method)` |
| | `protected void` | `**[onInvokeMethodFoundInHierarchy](#onInvokeMethodFoundInHierarchy(groovy.lang.MetaMethod))**([MetaMethod](metamethod) method)` |
| | `protected void` | `**[onSetPropertyFoundInHierarchy](#onSetPropertyFoundInHierarchy(groovy.lang.MetaMethod))**([MetaMethod](metamethod) method)` |
| | `protected void` | `**[onSuperMethodFoundInHierarchy](#onSuperMethodFoundInHierarchy(groovy.lang.MetaMethod))**([MetaMethod](metamethod) method)` |
| | `protected void` | `**[onSuperPropertyFoundInHierarchy](#onSuperPropertyFoundInHierarchy(groovy.lang.MetaBeanProperty))**([MetaBeanProperty](metabeanproperty) property)` |
| | `protected void` | `**[performOperationOnMetaClass](#performOperationOnMetaClass(groovy.lang.ExpandoMetaClass.Callable))**([ExpandoMetaClass.Callable](expandometaclass.callable) c)` |
| | `public void` | `**[refreshInheritedMethods](#refreshInheritedMethods(java.util.Set))**([Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set") modifiedSuperExpandos)`Called from ExpandoMetaClassCreationHandle in the registry if it exists to set up inheritance handling |
| | `public void` | `**[registerBeanProperty](#registerBeanProperty(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`Registers a new bean property |
| | `public void` | `**[registerInstanceMethod](#registerInstanceMethod(groovy.lang.MetaMethod))**([MetaMethod](metamethod) metaMethod)`Registers a new instance method for the given method name and closure on this MetaClass |
| | `public void` | `**[registerInstanceMethod](#registerInstanceMethod(java.lang.String,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Closure](closure) closure)` |
| | `protected void` | `**[registerStaticMethod](#registerStaticMethod(java.lang.String,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Closure](closure) callable)` |
| | `protected void` | `**[registerStaticMethod](#registerStaticMethod(java.lang.String,%20groovy.lang.Closure,%20java.lang.Class))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Closure](closure) callable, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] paramTypes)`Registers a new static method for the given method name and closure on this MetaClass |
| | `public void` | `**[registerSubclassInstanceMethod](#registerSubclassInstanceMethod(java.lang.String,%20java.lang.Class,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") klazz, [Closure](closure) closure)` |
| | `public void` | `**[registerSubclassInstanceMethod](#registerSubclassInstanceMethod(groovy.lang.MetaMethod))**([MetaMethod](metamethod) metaMethod)` |
| | `public [MetaMethod](metamethod)` | `**[retrieveConstructor](#retrieveConstructor(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)` |
| | `protected void` | `**[setInitialized](#setInitialized(boolean))**(boolean b)` |
| | `public void` | `**[setMetaClass](#setMetaClass(groovy.lang.MetaClass))**([MetaClass](metaclass) metaClass)` |
| | `public void` | `**[setProperty](#setProperty(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)` |
| | `public void` | `**[setProperty](#setProperty(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20java.lang.Object,%20boolean,%20boolean))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue, boolean useSuper, boolean fromInsideClass)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [MetaClassImpl](metaclassimpl)` | `[getMetaMethod](metaclassimpl#getMetaMethod(java.lang.String,%20java.lang.Object)), [getMetaProperty](metaclassimpl#getMetaProperty(java.lang.String)), [getRegistry](metaclassimpl#getRegistry()), [getStaticMetaMethod](metaclassimpl#getStaticMetaMethod(java.lang.String,%20java.lang.Object)), [getSuperClasses](metaclassimpl#getSuperClasses()), [getTheCachedClass](metaclassimpl#getTheCachedClass()), [getTheClass](metaclassimpl#getTheClass()), [hasProperty](metaclassimpl#hasProperty(java.lang.Object,%20java.lang.String)), [isGroovyObject](metaclassimpl#isGroovyObject()), [methodNameAction](metaclassimpl#methodNameAction(Class,%20org.codehaus.groovy.runtime.metaclass.MetaMethodIndex.Entry)), [respondsTo](metaclassimpl#respondsTo(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [respondsTo](metaclassimpl#respondsTo(java.lang.Object,%20java.lang.String)), [skipClass](metaclassimpl#skipClass(Class))` |
Field Detail
------------
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **CONSTRUCTOR**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **STATIC\_QUALIFIER**
### public boolean **inRegistry**
Constructor Detail
------------------
### public **ExpandoMetaClass**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, boolean register, boolean allowChangesAfterInit, [MetaMethod](metamethod)[] add)
### public **ExpandoMetaClass**([MetaClassRegistry](metaclassregistry) registry, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, boolean register, boolean allowChangesAfterInit, [MetaMethod](metamethod)[] add)
### public **ExpandoMetaClass**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass)
Constructs a new ExpandoMetaClass instance for the given class
**Parameters:**
`theClass` - The class that the MetaClass applies to
### public **ExpandoMetaClass**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, [MetaMethod](metamethod)[] add)
### public **ExpandoMetaClass**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, boolean register)
Constructs a new ExpandoMetaClass instance for the given class optionally placing the MetaClass in the MetaClassRegistry automatically
**Parameters:**
`theClass` - The class that the MetaClass applies to
`register` - True if the MetaClass should be registered inside the MetaClassRegistry. This defaults to true and ExpandoMetaClass will effect all instances if changed
### public **ExpandoMetaClass**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, boolean register, [MetaMethod](metamethod)[] add)
### public **ExpandoMetaClass**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, boolean register, boolean allowChangesAfterInit)
Constructs a new ExpandoMetaClass instance for the given class optionally placing the MetaClass in the MetaClassRegistry automatically
**Parameters:**
`theClass` - The class that the MetaClass applies to
`register` - True if the MetaClass should be registered inside the MetaClassRegistry. This defaults to true and ExpandoMetaClass will effect all instances if changed
`allowChangesAfterInit` - Should the meta class be modifiable after initialization. Default is false.
Method Detail
-------------
### public void **addMixinClass**([MixinInMetaClass](../../org/codehaus/groovy/reflection/mixininmetaclass) mixin)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **call**()
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **castToMixedType**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **checkInitalised**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [CallSite](../../org/codehaus/groovy/runtime/callsite/callsite) **createConstructorSite**([CallSite](../../org/codehaus/groovy/runtime/callsite/callsite) site, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)
### public [CallSite](../../org/codehaus/groovy/runtime/callsite/callsite) **createPogoCallCurrentSite**([CallSite](../../org/codehaus/groovy/runtime/callsite/callsite) site, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [CallSite](../../org/codehaus/groovy/runtime/callsite/callsite) **createPogoCallSite**([CallSite](../../org/codehaus/groovy/runtime/callsite/callsite) site, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [CallSite](../../org/codehaus/groovy/runtime/callsite/callsite) **createPojoCallSite**([CallSite](../../org/codehaus/groovy/runtime/callsite/callsite) site, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") receiver, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [CallSite](../../org/codehaus/groovy/runtime/callsite/callsite) **createStaticSite**([CallSite](../../org/codehaus/groovy/runtime/callsite/callsite) site, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)
### public [ExpandoMetaClass](expandometaclass) **define**(@[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.lang.Object") @[DelegatesTo](delegatesto "DelegatesTo")(value=DefiningClosure.class, strategy=Closure.DELEGATE\_ONLY) [Closure](closure) closure)
### public static void **disableGlobally**()
Call to disable the global use of ExpandoMetaClass
### public static void **enableGlobally**()
Call to enable global use of ExpandoMetaClass within the registry. This has the advantage that inheritance will function correctly and metaclass modifications will also apply to existing objects, but has a higher memory usage on the JVM than normal Groovy
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [MetaMethod](metamethod) **findMixinMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] arguments)
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaMethod](metamethod "MetaMethod")> **getExpandoMethods**()
Returns a list of expando MetaMethod instances added to this ExpandoMetaClass
**Returns:**
the expandoMethods
### public [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<[MetaProperty](metaproperty "MetaProperty")> **getExpandoProperties**()
Returns a list of MetaBeanProperty instances added to this ExpandoMetaClass
**Returns:**
the expandoProperties
### public [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") **getExpandoSubclassMethods**()
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **getJavaClass**()
**Returns:**
The Java class enhanced by this MetaClass
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [MetaClass](metaclass) **getMetaClass**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [MetaProperty](metaproperty) **getMetaProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
Looks up an existing MetaProperty by name
**Parameters:**
`name` - The name of the MetaProperty
**Returns:**
The MetaProperty or null if it doesn't exist
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaMethod](metamethod "MetaMethod")> **getMethods**()
Overrides the behavior of parent getMethods() method to make MetaClass aware of added Expando methods
**Returns:**
A list of MetaMethods
**See Also:**
[MetaObjectProtocol.getMethods](metaobjectprotocol#getMethods() "MetaObjectProtocol.getMethods")
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaProperty](metaproperty "MetaProperty")> **getProperties**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, boolean useSuper, boolean fromInsideClass)
Overrides default implementation just in case getProperty method has been overridden by ExpandoMetaClass
**See Also:**
[MetaClassImpl.getProperty](metaclassimpl#getProperty(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20boolean,%20boolean) "MetaClassImpl.getProperty")
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
Overrides default implementation just in case getProperty method has been overridden by ExpandoMetaClass
**See Also:**
[MetaClassImpl.getProperty](metaclassimpl#getProperty(java.lang.Object,%20java.lang.String) "MetaClassImpl.getProperty")
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getPropertyForSetter**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") setterName)
Returns a property name equivalent for the given setter name or null if it is not a getter
**Parameters:**
`setterName` - The setter name
**Returns:**
The property name equivalent
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getSubclassMetaMethods**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **hasCustomStaticInvokeMethod**()
### public boolean **hasMetaMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] args)
Checks whether a MetaMethod for the given name and arguments exists
**Parameters:**
`name` - The name of the MetaMethod
`args` - The arguments to the meta method
**Returns:**
True if the method exists otherwise null
### public boolean **hasMetaProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
Returns true if the MetaClass has the given property
**Parameters:**
`name` - The name of the MetaProperty
**Returns:**
True it exists as a MetaProperty
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **initialize**()
{@inheritDoc}
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeConstructor**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] originalArguments, boolean isCallToSuper, boolean fromInsideClass)
Overrides default implementation just in case invokeMethod has been overridden by ExpandoMetaClass
**See Also:**
[MetaClassImpl.invokeMethod](metaclassimpl#invokeMethod(Class,%20Object,%20String,%20Object%5B%5D,%20boolean,%20boolean) "MetaClassImpl.invokeMethod")
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeStaticMethod**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)
Overrides default implementation just in case a static invoke method has been set on ExpandoMetaClass
**See Also:**
[MetaClassImpl.invokeStaticMethod](metaclassimpl#invokeStaticMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object) "MetaClassImpl.invokeStaticMethod")
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected boolean **isInitialized**()
Checks if the meta class is initialized.
**See Also:**
[MetaClassImpl.isInitialized](metaclassimpl#isInitialized() "MetaClassImpl.isInitialized")
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **isModified**()
### public boolean **isSetter**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [CachedClass](../../org/codehaus/groovy/reflection/cachedclass)[] args)
### public static boolean **isValidExpandoProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **onGetPropertyFoundInHierarchy**([MetaMethod](metamethod) method)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **onInvokeMethodFoundInHierarchy**([MetaMethod](metamethod) method)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **onSetPropertyFoundInHierarchy**([MetaMethod](metamethod) method)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **onSuperMethodFoundInHierarchy**([MetaMethod](metamethod) method)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **onSuperPropertyFoundInHierarchy**([MetaBeanProperty](metabeanproperty) property)
### protected void **performOperationOnMetaClass**([ExpandoMetaClass.Callable](expandometaclass.callable) c)
### public void **refreshInheritedMethods**([Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set") modifiedSuperExpandos)
Called from ExpandoMetaClassCreationHandle in the registry if it exists to set up inheritance handling
**Parameters:**
`modifiedSuperExpandos` - A list of modified super ExpandoMetaClass
### public void **registerBeanProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
Registers a new bean property
**Parameters:**
`property` - The property name
`newValue` - The properties initial value
### public void **registerInstanceMethod**([MetaMethod](metamethod) metaMethod)
Registers a new instance method for the given method name and closure on this MetaClass
**Parameters:**
metaMethod
### public void **registerInstanceMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Closure](closure) closure)
### protected void **registerStaticMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Closure](closure) callable)
### protected void **registerStaticMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Closure](closure) callable, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] paramTypes)
Registers a new static method for the given method name and closure on this MetaClass
**Parameters:**
`name` - The method name
`callable` - The callable Closure
### public void **registerSubclassInstanceMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") klazz, [Closure](closure) closure)
### public void **registerSubclassInstanceMethod**([MetaMethod](metamethod) metaMethod)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [MetaMethod](metamethod) **retrieveConstructor**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **setInitialized**(boolean b)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setMetaClass**([MetaClass](metaclass) metaClass)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setProperty**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue, boolean useSuper, boolean fromInsideClass)
| programming_docs |
groovy [Java] Class MissingFieldException [Java] Class MissingFieldException
==================================
* groovy.lang.MissingFieldException
```
public class MissingFieldException
extends [GroovyRuntimeException](groovyruntimeexception)
```
An exception occurred if a dynamic field dispatch fails with an unknown field. Note that the Missing\*Exception classes were named for consistency and to avoid conflicts with JDK exceptions of the same name.
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[MissingFieldException](#MissingFieldException(java.lang.String,%20java.lang.Class))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") field, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type)` |
| `**[MissingFieldException](#MissingFieldException(java.lang.String,%20java.lang.Class,%20java.lang.Throwable))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") field, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type, [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") e)` |
| `**[MissingFieldException](#MissingFieldException(java.lang.String,%20java.lang.String,%20java.lang.Class))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") field, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getField](#getField())**()`
**Returns:**
the name of the field that could not be found
|
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[getType](#getType())**()`
**Returns:**
The type on which the field was attempted to be called
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyRuntimeException](groovyruntimeexception)` | `[getLocationText](groovyruntimeexception#getLocationText()), [getMessage](groovyruntimeexception#getMessage()), [getMessageWithoutLocationText](groovyruntimeexception#getMessageWithoutLocationText()), [getModule](groovyruntimeexception#getModule()), [getNode](groovyruntimeexception#getNode()), [setModule](groovyruntimeexception#setModule(org.codehaus.groovy.ast.ModuleNode))` |
Constructor Detail
------------------
### public **MissingFieldException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") field, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type)
### public **MissingFieldException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") field, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type, [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") e)
### public **MissingFieldException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") field, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type)
Method Detail
-------------
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getField**()
**Returns:**
the name of the field that could not be found
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **getType**()
**Returns:**
The type on which the field was attempted to be called
groovy [Java] Class MetaBeanProperty [Java] Class MetaBeanProperty
=============================
* groovy.lang.MetaBeanProperty
```
public class MetaBeanProperty
extends [MetaProperty](metaproperty)
```
Represents a property on a bean which may have a getter and/or a setter
Inherited fields
| Fields inherited from class | Fields |
| **`class [MetaProperty](metaproperty)`** | `[PROPERTY\_SET\_PREFIX](metaproperty#PROPERTY_SET_PREFIX), [name](metaproperty#name), [type](metaproperty#type)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[MetaBeanProperty](#MetaBeanProperty(java.lang.String,%20java.lang.Class,%20groovy.lang.MetaMethod,%20groovy.lang.MetaMethod))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type, [MetaMethod](metamethod) getter, [MetaMethod](metamethod) setter)`Sole constructor setting name, type (class), getter and setter. |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [CachedField](../../org/codehaus/groovy/reflection/cachedfield)` | `**[getField](#getField())**()`Gets the field of this property |
| | `public [MetaMethod](metamethod)` | `**[getGetter](#getGetter())**()`Get the getter method. |
| | `public int` | `**[getModifiers](#getModifiers())**()`Gets the visibility modifiers for the property as defined by the getter and setter methods. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object)`Get the property of the given object. |
| | `public [MetaMethod](metamethod)` | `**[getSetter](#getSetter())**()`Get the setter method. |
| | `public void` | `**[setField](#setField(org.codehaus.groovy.reflection.CachedField))**([CachedField](../../org/codehaus/groovy/reflection/cachedfield) field)`Sets the field of this property |
| | `public void` | `**[setProperty](#setProperty(java.lang.Object,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`Set the property on the given object to the new value. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [MetaProperty](metaproperty)` | `[getGetterName](metaproperty#getGetterName(java.lang.String,%20java.lang.Class)), [getModifiers](metaproperty#getModifiers()), [getName](metaproperty#getName()), [getProperty](metaproperty#getProperty(java.lang.Object)), [getSetterName](metaproperty#getSetterName(java.lang.String)), [getType](metaproperty#getType()), [setProperty](metaproperty#setProperty(java.lang.Object,%20java.lang.Object))` |
Constructor Detail
------------------
### public **MetaBeanProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type, [MetaMethod](metamethod) getter, [MetaMethod](metamethod) setter)
Sole constructor setting name, type (class), getter and setter.
Method Detail
-------------
### public [CachedField](../../org/codehaus/groovy/reflection/cachedfield) **getField**()
Gets the field of this property
**Returns:**
The field of this property
### public [MetaMethod](metamethod) **getGetter**()
Get the getter method.
**Returns:**
the getter method for this property.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getModifiers**()
Gets the visibility modifiers for the property as defined by the getter and setter methods.
**Returns:**
the visibility modifier of the getter, the setter, or both depending on which exist
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object)
Get the property of the given object.
**throws:**
RuntimeException if the property could not be evaluated
**Parameters:**
`object` - which to be got
**Returns:**
the property of the given object
### public [MetaMethod](metamethod) **getSetter**()
Get the setter method.
**Returns:**
the setter method for this property.
### public void **setField**([CachedField](../../org/codehaus/groovy/reflection/cachedfield) field)
Sets the field of this property
**Parameters:**
field
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setProperty**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
Set the property on the given object to the new value.
**throws:**
RuntimeException if the property could not be set
**Parameters:**
`object` - on which to set the property
`newValue` - the new value of the property
groovy [Java] Interface GroovyInterceptable [Java] Interface GroovyInterceptable
====================================
* groovy.lang.GroovyObject
All Superinterfaces: [GroovyObject](groovyobject)
```
public interface GroovyInterceptable
extends [GroovyObject](groovyobject)
```
Marker interface used to notify that all methods should be intercepted through the `invokeMethod` mechanism of `GroovyObject`.
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `interface [GroovyObject](groovyobject)` | `[getMetaClass](groovyobject#getMetaClass()), [getProperty](groovyobject#getProperty(java.lang.String)), [invokeMethod](groovyobject#invokeMethod(java.lang.String,%20java.lang.Object)), [setMetaClass](groovyobject#setMetaClass(groovy.lang.MetaClass)), [setProperty](groovyobject#setProperty(java.lang.String,%20java.lang.Object))` |
groovy [Java] Annotation Type GrabExclude [Java] Annotation Type GrabExclude
==================================
* groovy.lang.GrabExclude
```
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({
ElementType.CONSTRUCTOR,
ElementType.FIELD,
ElementType.LOCAL_VARIABLE,
ElementType.METHOD,
ElementType.PARAMETER,
ElementType.TYPE})
public @interface GrabExclude
```
Used to exclude an indirectly referenced artifact (a transitive dependency) from the classpath.
Examples:
`@GrabExclude(group='mysql', module='mysql-connector-java') // group/module form`
`@GrabExclude('mysql:mysql-connector-java') // compact form`
Further information about customising grape behavior can be found on the Grape documentation page: <http://groovy-lang.org/grape.html>.
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[group](#group)`The organisation or group, e.g.: "org.apache.ant"; required unless the compact form is used. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[module](#module)`The module or artifact, e.g.: "ant-junit"; required unless the compact form is used. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[value](#value)`Allows you to specify the group (organisation) and the module (artifact) in one of two compact convenience formats, e.g.: `@GrabExclude('org.apache.ant:ant-junit')` or `@GrabExclude('org.apache.ant#ant-junit')`
**Default:**
""
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **group**
The organisation or group, e.g.: "org.apache.ant"; required unless the compact form is used.
**Default:**
""
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **module**
The module or artifact, e.g.: "ant-junit"; required unless the compact form is used.
**Default:**
""
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **value**
Allows you to specify the group (organisation) and the module (artifact) in one of two compact convenience formats, e.g.: `@GrabExclude('org.apache.ant:ant-junit')` or `@GrabExclude('org.apache.ant#ant-junit')`
**Default:**
""
groovy [Java] Class GroovyClassLoader [Java] Class GroovyClassLoader
==============================
* groovy.lang.GroovyClassLoader
```
public class GroovyClassLoader
extends [URLClassLoader](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html "URLClassLoader")
```
A ClassLoader which can load Groovy classes. The loaded classes are cached, classes from other classloaders should not be cached. To be able to load a script that was asked for earlier but was created later it is essential not to keep anything like a "class not found" information for that class name. This includes possible parent loaders. Classes that are not cached are always reloaded.
Nested Class Summary
--------------------
Nested classes
| Modifiers | Name | Description |
| `**static class**` | `[GroovyClassLoader.ClassCollector](groovyclassloader.classcollector)` | |
| `**static class**` | `[GroovyClassLoader.InnerLoader](groovyclassloader.innerloader)` | |
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**protected [EvictableCache](../../org/codehaus/groovy/runtime/memoize/evictablecache "EvictableCache")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")>**` | `[classCache](#classCache)` | this cache contains the loaded classes or PARSING, if the class is currently parsed |
| `**protected [StampedCommonCache](../../org/codehaus/groovy/runtime/memoize/stampedcommoncache "StampedCommonCache")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")>**` | `[sourceCache](#sourceCache)` | This cache contains mappings of file name to class. |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[GroovyClassLoader](#GroovyClassLoader())**()`creates a GroovyClassLoader using the current Thread's context Class loader as parent. |
| `**[GroovyClassLoader](#GroovyClassLoader(java.lang.ClassLoader))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") loader)`creates a GroovyClassLoader using the given ClassLoader as parent |
| `**[GroovyClassLoader](#GroovyClassLoader(groovy.lang.GroovyClassLoader))**([GroovyClassLoader](groovyclassloader) parent)`creates a GroovyClassLoader using the given GroovyClassLoader as parent. |
| `**[GroovyClassLoader](#GroovyClassLoader(java.lang.ClassLoader,%20org.codehaus.groovy.control.CompilerConfiguration,%20boolean))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parent, [CompilerConfiguration](../../org/codehaus/groovy/control/compilerconfiguration) config, boolean useConfigurationClasspath)`creates a GroovyClassLoader. |
| `**[GroovyClassLoader](#GroovyClassLoader(java.lang.ClassLoader,%20org.codehaus.groovy.control.CompilerConfiguration))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") loader, [CompilerConfiguration](../../org/codehaus/groovy/control/compilerconfiguration) config)`creates a GroovyClassLoader using the given ClassLoader as parent. |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[addClasspath](#addClasspath(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") path)`adds a classpath to this classloader. |
| | `public void` | `**[addURL](#addURL(java.net.URL))**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url)`adds a URL to the classloader. |
| | `public void` | `**[clearCache](#clearCache())**()`Removes all classes from the class cache. |
| | `public void` | `**[close](#close())**()`Closes this GroovyClassLoader and clears any caches it maintains. |
| | `protected [GroovyClassLoader.ClassCollector](groovyclassloader.classcollector)` | `**[createCollector](#createCollector(org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.control.SourceUnit))**([CompilationUnit](../../org/codehaus/groovy/control/compilationunit) unit, [SourceUnit](../../org/codehaus/groovy/control/sourceunit) su)`creates a ClassCollector for a new compilation. |
| | `protected [CompilationUnit](../../org/codehaus/groovy/control/compilationunit)` | `**[createCompilationUnit](#createCompilationUnit(org.codehaus.groovy.control.CompilerConfiguration,%20java.security.CodeSource))**([CompilerConfiguration](../../org/codehaus/groovy/control/compilerconfiguration) config, [CodeSource](https://docs.oracle.com/javase/8/docs/api/java/security/CodeSource.html "CodeSource") source)`creates a new CompilationUnit. |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[defineClass](#defineClass(org.codehaus.groovy.ast.ClassNode,%20java.lang.String,%20java.lang.String))**([ClassNode](../../org/codehaus/groovy/ast/classnode) classNode, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") file, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") newCodeBase)`Loads the given class node returning the implementation Class. |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[defineClass](#defineClass(java.lang.String,%20byte%5B%5D))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, byte[] bytes)`Converts an array of bytes into an instance of `Class`. |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[generateScriptName](#generateScriptName())**()` |
| | `protected [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[getClassCacheEntry](#getClassCacheEntry(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)`gets a class from the class cache. |
| | `protected [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]` | `**[getClassPath](#getClassPath())**()`gets the currently used classpath. |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[]` | `**[getLoadedClasses](#getLoadedClasses())**()` |
| | `protected [PermissionCollection](https://docs.oracle.com/javase/8/docs/api/java/security/PermissionCollection.html "PermissionCollection")` | `**[getPermissions](#getPermissions(java.security.CodeSource))**([CodeSource](https://docs.oracle.com/javase/8/docs/api/java/security/CodeSource.html "CodeSource") codeSource)` |
| | `public [GroovyResourceLoader](groovyresourceloader)` | `**[getResourceLoader](#getResourceLoader())**()` |
| | `protected long` | `**[getTimeStamp](#getTimeStamp(java.lang.Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") cls)`gets the time stamp of a given class. |
| | `public boolean` | `**[hasCompatibleConfiguration](#hasCompatibleConfiguration(org.codehaus.groovy.control.CompilerConfiguration))**([CompilerConfiguration](../../org/codehaus/groovy/control/compilerconfiguration) config)`Check if this class loader has compatible [CompilerConfiguration](../../org/codehaus/groovy/control/compilerconfiguration "CompilerConfiguration") with the provided one. |
| | `protected boolean` | `**[isRecompilable](#isRecompilable(java.lang.Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") cls)`Indicates if a class is recompilable. |
| | `public [Boolean](https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html "Boolean")` | `**[isShouldRecompile](#isShouldRecompile())**()`gets the currently set recompilation mode. null means, the compiler configuration is used. |
| | `protected boolean` | `**[isSourceNewer](#isSourceNewer(java.net.URL,%20java.lang.Class))**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") source, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") cls)`Decides if the given source is newer than a class. |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[loadClass](#loadClass(java.lang.String,%20boolean,%20boolean))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, boolean lookupScriptFiles, boolean preferClassOverScript)`loads a class from a file or a parent classloader. |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[loadClass](#loadClass(java.lang.String,%20boolean,%20boolean,%20boolean))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, boolean lookupScriptFiles, boolean preferClassOverScript, boolean resolve)`loads a class from a file or a parent classloader. |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?>` | `**[loadClass](#loadClass(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)` |
| | `protected [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[loadClass](#loadClass(java.lang.String,%20boolean))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, boolean resolve)`Implemented here to check package access prior to returning an already loaded class. |
| | `public [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL")` | `**[loadGroovySource](#loadGroovySource(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") filename)` |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[parseClass](#parseClass(java.io.File))**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file)`Parses the given file into a Java class capable of being run |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[parseClass](#parseClass(java.lang.String,%20java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") fileName)`Parses the given text into a Java class capable of being run |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[parseClass](#parseClass(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text)`Parses the given text into a Java class capable of being run |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[parseClass](#parseClass(java.io.Reader,%20java.lang.String))**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") fileName)` |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[parseClass](#parseClass(groovy.lang.GroovyCodeSource))**([GroovyCodeSource](groovycodesource) codeSource)` |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[parseClass](#parseClass(groovy.lang.GroovyCodeSource,%20boolean))**([GroovyCodeSource](groovycodesource) codeSource, boolean shouldCacheSource)`Parses the given code source into a Java class. |
| | `protected [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[recompile](#recompile(java.net.URL,%20java.lang.String,%20java.lang.Class))**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") source, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") className, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") oldClass)`(Re)Compiles the given source. |
| | `protected void` | `**[removeClassCacheEntry](#removeClassCacheEntry(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)`removes a class from the class cache. |
| | `public [ProtectionDomain](https://docs.oracle.com/javase/8/docs/api/java/security/ProtectionDomain.html "ProtectionDomain")` | `**[run](#run())**()` |
| | `protected void` | `**[setClassCacheEntry](#setClassCacheEntry(java.lang.Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") cls)`sets an entry in the class cache. |
| | `public void` | `**[setResourceLoader](#setResourceLoader(groovy.lang.GroovyResourceLoader))**([GroovyResourceLoader](groovyresourceloader) resourceLoader)` |
| | `public void` | `**[setShouldRecompile](#setShouldRecompile(java.lang.Boolean))**([Boolean](https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html "Boolean") mode)`sets if the recompilation should be enable. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [URLClassLoader](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html "URLClassLoader")` | `[newInstance](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#newInstance(%5BLjava.net.URL;,%20java.lang.ClassLoader) "newInstance"), [newInstance](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#newInstance(%5BLjava.net.URL;) "newInstance"), [findResource](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#findResource(java.lang.String) "findResource"), [getResourceAsStream](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#getResourceAsStream(java.lang.String) "getResourceAsStream"), [findResources](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#findResources(java.lang.String) "findResources"), [close](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#close() "close"), [getURLs](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#getURLs() "getURLs"), [getName](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#getName() "getName"), [loadClass](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#loadClass(java.lang.String) "loadClass"), [getPlatformClassLoader](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#getPlatformClassLoader() "getPlatformClassLoader"), [getSystemClassLoader](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#getSystemClassLoader() "getSystemClassLoader"), [getSystemResourceAsStream](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#getSystemResourceAsStream(java.lang.String) "getSystemResourceAsStream"), [getSystemResource](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#getSystemResource(java.lang.String) "getSystemResource"), [getResource](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#getResource(java.lang.String) "getResource"), [getResources](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#getResources(java.lang.String) "getResources"), [getDefinedPackage](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#getDefinedPackage(java.lang.String) "getDefinedPackage"), [resources](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#resources(java.lang.String) "resources"), [isRegisteredAsParallelCapable](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#isRegisteredAsParallelCapable() "isRegisteredAsParallelCapable"), [getSystemResources](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#getSystemResources(java.lang.String) "getSystemResources"), [getParent](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#getParent() "getParent"), [getUnnamedModule](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#getUnnamedModule() "getUnnamedModule"), [getDefinedPackages](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#getDefinedPackages() "getDefinedPackages"), [setDefaultAssertionStatus](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#setDefaultAssertionStatus(boolean) "setDefaultAssertionStatus"), [setPackageAssertionStatus](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#setPackageAssertionStatus(java.lang.String,%20boolean) "setPackageAssertionStatus"), [setClassAssertionStatus](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#setClassAssertionStatus(java.lang.String,%20boolean) "setClassAssertionStatus"), [clearAssertionStatus](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#clearAssertionStatus() "clearAssertionStatus"), [wait](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#notifyAll() "notifyAll")` |
Field Detail
------------
### protected final [EvictableCache](../../org/codehaus/groovy/runtime/memoize/evictablecache "EvictableCache")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")> **classCache**
this cache contains the loaded classes or PARSING, if the class is currently parsed
### protected final [StampedCommonCache](../../org/codehaus/groovy/runtime/memoize/stampedcommoncache "StampedCommonCache")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")> **sourceCache**
This cache contains mappings of file name to class. It is used to bypass compilation.
Constructor Detail
------------------
### public **GroovyClassLoader**()
creates a GroovyClassLoader using the current Thread's context Class loader as parent.
### public **GroovyClassLoader**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") loader)
creates a GroovyClassLoader using the given ClassLoader as parent
### public **GroovyClassLoader**([GroovyClassLoader](groovyclassloader) parent)
creates a GroovyClassLoader using the given GroovyClassLoader as parent. This loader will get the parent's CompilerConfiguration
### public **GroovyClassLoader**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parent, [CompilerConfiguration](../../org/codehaus/groovy/control/compilerconfiguration) config, boolean useConfigurationClasspath)
creates a GroovyClassLoader.
**Parameters:**
`parent` - the parent class loader
`config` - the compiler configuration
`useConfigurationClasspath` - determines if the configurations classpath should be added
### public **GroovyClassLoader**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") loader, [CompilerConfiguration](../../org/codehaus/groovy/control/compilerconfiguration) config)
creates a GroovyClassLoader using the given ClassLoader as parent.
Method Detail
-------------
### public void **addClasspath**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") path)
adds a classpath to this classloader.
**Parameters:**
`path` - is a jar file or a directory.
**See Also:**
[addURL(URL)](#addURL(java.net.URL))
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **addURL**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url)
adds a URL to the classloader.
**Parameters:**
`url` - the new classpath element
### public void **clearCache**()
Removes all classes from the class cache.
In addition to internal caches this method also clears any previously set MetaClass information for the given set of classes being removed.
**See Also:**
[getClassCacheEntry(String)](#getClassCacheEntry(java.lang.String))
[setClassCacheEntry(Class)](#setClassCacheEntry(java.lang.Class))
[removeClassCacheEntry(String)](#removeClassCacheEntry(java.lang.String))
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **close**()
Closes this GroovyClassLoader and clears any caches it maintains.
No use should be made of this instance after this method is invoked. Any classes that are already loaded are still accessible.
**throws:**
IOException
**See Also:**
[URLClassLoader.close](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html#close() "URLClassLoader.close")
[clearCache()](#clearCache())
**Since:**
2.5.0
### protected [GroovyClassLoader.ClassCollector](groovyclassloader.classcollector) **createCollector**([CompilationUnit](../../org/codehaus/groovy/control/compilationunit) unit, [SourceUnit](../../org/codehaus/groovy/control/sourceunit) su)
creates a ClassCollector for a new compilation.
**Parameters:**
`unit` - the compilationUnit
`su` - the SourceUnit
**Returns:**
the ClassCollector
### protected [CompilationUnit](../../org/codehaus/groovy/control/compilationunit) **createCompilationUnit**([CompilerConfiguration](../../org/codehaus/groovy/control/compilerconfiguration) config, [CodeSource](https://docs.oracle.com/javase/8/docs/api/java/security/CodeSource.html "CodeSource") source)
creates a new CompilationUnit. If you want to add additional phase operations to the CompilationUnit (for example to inject additional methods, variables, fields), then you should overwrite this method.
**Parameters:**
`config` - the compiler configuration, usually the same as for this class loader
`source` - the source containing the initial file to compile, more files may follow during compilation
**Returns:**
the CompilationUnit
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **defineClass**([ClassNode](../../org/codehaus/groovy/ast/classnode) classNode, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") file, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") newCodeBase)
Loads the given class node returning the implementation Class.
WARNING: this compilation is not synchronized
**Parameters:**
classNode
**Returns:**
a class
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **defineClass**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, byte[] bytes)
Converts an array of bytes into an instance of `Class`.
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **generateScriptName**()
### protected [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **getClassCacheEntry**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
gets a class from the class cache. This cache contains only classes loaded through this class loader or an InnerLoader instance. If no class is stored for a specific name, then the method should return null.
**Parameters:**
`name` - of the class
**Returns:**
the class stored for the given name
**See Also:**
[removeClassCacheEntry(String)](#removeClassCacheEntry(java.lang.String))
[setClassCacheEntry(Class)](#setClassCacheEntry(java.lang.Class))
[clearCache()](#clearCache())
### protected [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **getClassPath**()
gets the currently used classpath.
**Returns:**
a String[] containing the file information of the urls
**See Also:**
[getURLs()](#getURLs())
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] **getLoadedClasses**()
Returns all Groovy classes loaded by this class loader.
**Returns:**
all classes loaded by this class loader
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected [PermissionCollection](https://docs.oracle.com/javase/8/docs/api/java/security/PermissionCollection.html "PermissionCollection") **getPermissions**([CodeSource](https://docs.oracle.com/javase/8/docs/api/java/security/CodeSource.html "CodeSource") codeSource)
### public [GroovyResourceLoader](groovyresourceloader) **getResourceLoader**()
### protected long **getTimeStamp**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") cls)
gets the time stamp of a given class. For groovy generated classes this usually means to return the value of the static field \_\_timeStamp. If the parameter doesn't have such a field, then Long.MAX\_VALUE is returned
**Parameters:**
`cls` - the class
**Returns:**
the time stamp
### public boolean **hasCompatibleConfiguration**([CompilerConfiguration](../../org/codehaus/groovy/control/compilerconfiguration) config)
Check if this class loader has compatible [CompilerConfiguration](../../org/codehaus/groovy/control/compilerconfiguration "CompilerConfiguration") with the provided one.
**Parameters:**
`config` - the compiler configuration to test for compatibility
**Returns:**
`true` if the provided config is exactly the same instance of [CompilerConfiguration](../../org/codehaus/groovy/control/compilerconfiguration "CompilerConfiguration") as this loader has
### protected boolean **isRecompilable**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") cls)
Indicates if a class is recompilable. Recompilable means, that the classloader will try to locate a groovy source file for this class and then compile it again, adding the resulting class as entry to the cache. Giving null as class is like a recompilation, so the method should always return true here. Only classes that are implementing GroovyObject are compilable and only if the timestamp in the class is lower than Long.MAX\_VALUE.
NOTE: First the parent loaders will be asked and only if they don't return a class the recompilation will happen. Recompilation also only happen if the source file is newer.
**Parameters:**
`cls` - the class to be tested. If null the method should return true
**Returns:**
true if the class should be compiled again
**See Also:**
[isSourceNewer(URL, Class)](#isSourceNewer(java.net.URL,%20java.lang.Class))
### public [Boolean](https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html "Boolean") **isShouldRecompile**()
gets the currently set recompilation mode. null means, the compiler configuration is used. False means no recompilation and true means that recompilation will be done if needed.
**Returns:**
the recompilation mode
### protected boolean **isSourceNewer**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") source, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") cls)
Decides if the given source is newer than a class.
**throws:**
IOException if it is not possible to open an connection for the given source
**Parameters:**
`source` - the source we may want to compile
`cls` - the former class
**Returns:**
true if the source is newer, false else
**See Also:**
[getTimeStamp(Class)](#getTimeStamp(java.lang.Class))
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **loadClass**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, boolean lookupScriptFiles, boolean preferClassOverScript)
loads a class from a file or a parent classloader. This method does call loadClass(String, boolean, boolean, boolean) with the last parameter set to false.
**throws:**
CompilationFailedException if compilation was not successful
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **loadClass**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, boolean lookupScriptFiles, boolean preferClassOverScript, boolean resolve)
loads a class from a file or a parent classloader.
**throws:**
ClassNotFoundException if the class could not be found
**throws:**
CompilationFailedException if the source file could not be compiled
**Parameters:**
`name` - of the class to be loaded
`lookupScriptFiles` - if false no lookup at files is done at all
`preferClassOverScript` - if true the file lookup is only done if there is no class
`resolve` - see [ClassLoader.loadClass](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html#loadClass(java.lang.String,%20boolean) "ClassLoader.loadClass")
**Returns:**
the class found or the class created from a file lookup
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> **loadClass**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **loadClass**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, boolean resolve)
Implemented here to check package access prior to returning an already loaded class.
**throws:**
CompilationFailedException if the compilation failed
**throws:**
ClassNotFoundException if the class was not found
**See Also:**
[ClassLoader.loadClass](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html#loadClass(java.lang.String,%20boolean) "ClassLoader.loadClass")
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") **loadGroovySource**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") filename)
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **parseClass**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file)
Parses the given file into a Java class capable of being run
**Parameters:**
`file` - the file name to parse
**Returns:**
the main class defined in the given script
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **parseClass**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") fileName)
Parses the given text into a Java class capable of being run
**Parameters:**
`text` - the text of the script/class to parse
`fileName` - the file name to use as the name of the class
**Returns:**
the main class defined in the given script
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **parseClass**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text)
Parses the given text into a Java class capable of being run
**Parameters:**
`text` - the text of the script/class to parse
**Returns:**
the main class defined in the given script
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **parseClass**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") fileName)
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **parseClass**([GroovyCodeSource](groovycodesource) codeSource)
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **parseClass**([GroovyCodeSource](groovycodesource) codeSource, boolean shouldCacheSource)
Parses the given code source into a Java class. If there is a class file for the given code source, then no parsing is done, instead the cached class is returned.
**Parameters:**
`shouldCacheSource` - if true then the generated class will be stored in the source cache
**Returns:**
the main class defined in the given script
### protected [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **recompile**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") source, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") className, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") oldClass)
(Re)Compiles the given source. This method starts the compilation of a given source, if the source has changed since the class was created. For this isSourceNewer is called.
**throws:**
CompilationFailedException if the compilation failed
**throws:**
IOException if the source is not readable
**Parameters:**
`source` - the source pointer for the compilation
`className` - the name of the class to be generated
`oldClass` - a possible former class
**Returns:**
the old class if the source wasn't new enough, the new class else
**See Also:**
[isSourceNewer(URL, Class)](#isSourceNewer(java.net.URL,%20java.lang.Class))
### protected void **removeClassCacheEntry**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
removes a class from the class cache.
**Parameters:**
`name` - of the class
**See Also:**
[getClassCacheEntry(String)](#getClassCacheEntry(java.lang.String))
[setClassCacheEntry(Class)](#setClassCacheEntry(java.lang.Class))
[clearCache()](#clearCache())
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [ProtectionDomain](https://docs.oracle.com/javase/8/docs/api/java/security/ProtectionDomain.html "ProtectionDomain") **run**()
### protected void **setClassCacheEntry**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") cls)
sets an entry in the class cache.
**Parameters:**
`cls` - the class
**See Also:**
[removeClassCacheEntry(String)](#removeClassCacheEntry(java.lang.String))
[getClassCacheEntry(String)](#getClassCacheEntry(java.lang.String))
[clearCache()](#clearCache())
### public void **setResourceLoader**([GroovyResourceLoader](groovyresourceloader) resourceLoader)
### public void **setShouldRecompile**([Boolean](https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html "Boolean") mode)
sets if the recompilation should be enable. There are 3 possible values for this. Any value different than null overrides the value from the compiler configuration. true means to recompile if needed false means to never recompile.
**Parameters:**
`mode` - the recompilation mode
**See Also:**
[CompilerConfiguration](../../org/codehaus/groovy/control/compilerconfiguration "CompilerConfiguration")
| programming_docs |
groovy [Java] Class StringWriterIOException [Java] Class StringWriterIOException
====================================
* groovy.lang.StringWriterIOException
```
public class StringWriterIOException
extends [RuntimeException](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html "RuntimeException")
```
An IO exception occurred trying to append to a StringWriter which should never happen.
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[StringWriterIOException](#StringWriterIOException(java.io.IOException))**([IOException](https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html "IOException") e)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [IOException](https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html "IOException")` | `**[getIOException](#getIOException())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [RuntimeException](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html "RuntimeException")` | `[printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#printStackTrace() "printStackTrace"), [printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#printStackTrace(java.io.PrintStream) "printStackTrace"), [printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#printStackTrace(java.io.PrintWriter) "printStackTrace"), [fillInStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#fillInStackTrace() "fillInStackTrace"), [getCause](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getCause() "getCause"), [initCause](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#initCause(java.lang.Throwable) "initCause"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#toString() "toString"), [getMessage](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getMessage() "getMessage"), [getSuppressed](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getSuppressed() "getSuppressed"), [getLocalizedMessage](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getLocalizedMessage() "getLocalizedMessage"), [getStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getStackTrace() "getStackTrace"), [setStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#setStackTrace(%5BLjava.lang.StackTraceElement;) "setStackTrace"), [addSuppressed](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#addSuppressed(java.lang.Throwable) "addSuppressed"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#equals(java.lang.Object) "equals"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **StringWriterIOException**([IOException](https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html "IOException") e)
Method Detail
-------------
### public [IOException](https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html "IOException") **getIOException**()
groovy [Java] Class BenchmarkInterceptor [Java] Class BenchmarkInterceptor
=================================
* groovy.lang.BenchmarkInterceptor
All Implemented Interfaces and Traits: [Interceptor](interceptor)
```
public class BenchmarkInterceptor
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [Interceptor](interceptor)
```
Interceptor that registers the timestamp of each method call before and after invocation. The timestamps are stored internally and can be retrieved through the with the
```
getCalls()
```
and
```
statistic()
```
API. Example usage:
```
def proxy = ProxyMetaClass.getInstance(ArrayList.class)
proxy.interceptor = new BenchmarkInterceptor()
proxy.use {
def list = (0..10000).collect{ it }
4.times { list.size() }
4000.times { list.set(it, it+1) }
}
proxy.interceptor.statistic()
```
Which produces the following output:
```
[[size, 4, 0], [set, 4000, 21]]
```
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**protected [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")**` | `[calls](#calls)` | |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[afterInvoke](#afterInvoke(java.lang.Object,%20java.lang.String,%20java.lang.Object,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") result)`This code is executed after the method is called. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[beforeInvoke](#beforeInvoke(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)`This code is executed before the method is called. |
| | `public boolean` | `**[doInvoke](#doInvoke())**()`The call should be invoked separately |
| | `public [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")` | `**[getCalls](#getCalls())**()`Returns the raw data associated with the current benchmark run. |
| | `public void` | `**[reset](#reset())**()`Resets all the benchmark data on this object. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")` | `**[statistic](#statistic())**()`Returns benchmark statistics as a List<Object[]>. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### protected [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") **calls**
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **afterInvoke**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") result)
This code is executed after the method is called.
**Parameters:**
`object` - receiver object for the called method
`methodName` - name of the called method
`arguments` - arguments to the called method
`result` - result of the executed method call or result of beforeInvoke if method was not called
**Returns:**
result
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **beforeInvoke**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)
This code is executed before the method is called.
**Parameters:**
`object` - receiver object for the method call
`methodName` - name of the method to call
`arguments` - arguments to the method call
**Returns:**
null relays this result.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **doInvoke**()
The call should be invoked separately
**Returns:**
true
### public [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") **getCalls**()
Returns the raw data associated with the current benchmark run.
### public void **reset**()
Resets all the benchmark data on this object.
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") **statistic**()
Returns benchmark statistics as a List<Object[]>. AccumulateTime is measured in milliseconds and is as accurate as System.currentTimeMillis() allows it to be.
**Returns:**
a list of lines, each item is [methodname, numberOfCalls, accumulatedTime]
groovy [Java] Annotation Type Mixin [Java] Annotation Type Mixin
============================
* groovy.lang.Mixin
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")(ElementType.TYPE)
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.ast.MixinASTTransformation")
@[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated")
public @interface Mixin
```
Provides a mechanism for mixing in methods into a class.
**deprecated:**
static mixins have been deprecated in favour of traits (trait keyword).
Element Summary
---------------
Required Element Summary
| Type | Name and Description |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[]**` | `[value](#value)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] **value**
groovy [Java] Annotation Type DelegatesTo [Java] Annotation Type DelegatesTo
==================================
* groovy.lang.DelegatesTo
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.PARAMETER, ElementType.METHOD})
public @interface DelegatesTo
```
This annotation can be used by API or DSL writers to document parameters which accept a closure. In that case, using this annotation, you can specify what the delegate type of the closure will be. This is important for IDE support.
This annotation can also be used to help the type checker ([TypeChecked](../transform/typechecked "TypeChecked")) which would not report errors then if the delegate is of the documented type. Of course, it is also compatible with [CompileStatic](../transform/compilestatic "CompileStatic").
Example:
```
// Document the fact that the delegate of the closure will be an ExecSpec
ExecResult exec(@DelegatesTo(ExecSpec) Closure closure) { ... }
```
**Since:**
2.1.0
Nested Class Summary
--------------------
Nested classes
| Modifiers | Name | Description |
| `**@interface**` | `[DelegatesTo.Target](delegatesto.target)` | Parameter annotation used to specify the delegate for a `@DelegatesTo` annotated parameter of the same method. |
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**int**` | `[genericTypeIndex](#genericTypeIndex)`The index of the generic type that will be the type of the closure's delegate. |
| `**int**` | `[strategy](#strategy)`The [Closure.resolveStrategy](closure#resolveStrategy "Closure.resolveStrategy") used by the closure. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[target](#target)`In cases when there are multiple `@DelegatesTo.Target` annotated parameters, this member should be set to the DelegatesTo.Target#value() of the correct target. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[type](#type)`The type member should be used when the type of the delegate cannot be represented with [value()](#value()), [genericTypeIndex()](#genericTypeIndex()) or [target()](#target()). |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")**` | `[value](#value)`
**Default:**
Target.class
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public int **genericTypeIndex**
The index of the generic type that will be the type of the closure's delegate. The generic types are considered with respect to the `@DelegatesTo.Target` annotated parameter for this usage, with the index starting at 0.
**Default:**
-1
### public int **strategy**
The [Closure.resolveStrategy](closure#resolveStrategy "Closure.resolveStrategy") used by the closure.
**Default:**
Closure.OWNER\_FIRST
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **target**
In cases when there are multiple `@DelegatesTo.Target` annotated parameters, this member should be set to the DelegatesTo.Target#value() of the correct target.
**Default:**
""
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **type**
The type member should be used when the type of the delegate cannot be represented with [value()](#value()), [genericTypeIndex()](#genericTypeIndex()) or [target()](#target()). In this case, it is possible to use a String to represent the type, at the cost of potential uncaught errors at compile time if the type is invalid and increased compile time.
**Returns:**
a String representation of a type
**Since:**
2.4.0
**Default:**
""
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **value**
**Default:**
Target.class
groovy [Java] Class ObjectRange [Java] Class ObjectRange
========================
* groovy.lang.ObjectRange
All Implemented Interfaces and Traits: [Range](range)
```
public class ObjectRange
extends [AbstractList](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html "AbstractList")
implements [Range](range)
```
Represents an inclusive list of objects from a value to a value using comparators.
Note: This class is similar to [IntRange](intrange "IntRange"). If you make any changes to this class, you might consider making parallel changes to [IntRange](intrange "IntRange").
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[ObjectRange](#ObjectRange(java.lang.Comparable,%20java.lang.Comparable))**([Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable") from, [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable") to)`Creates a new [ObjectRange](objectrange "ObjectRange"). |
| `**[ObjectRange](#ObjectRange(java.lang.Comparable,%20java.lang.Comparable,%20boolean))**([Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable") smaller, [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable") larger, boolean reverse)`Creates a new [ObjectRange](objectrange "ObjectRange") assumes smaller <= larger, else behavior is undefined. |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `protected void` | `**[checkBoundaryCompatibility](#checkBoundaryCompatibility())**()`throws IllegalArgumentException if to and from are incompatible, meaning they e.g. |
| | `protected int` | `**[compareTo](#compareTo(java.lang.Comparable,%20java.lang.Comparable))**([Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable") first, [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable") second)` |
| | `public boolean` | `**[contains](#contains(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)`Iterates over all values and returns true if one value matches. |
| | `public boolean` | `**[containsWithinBounds](#containsWithinBounds(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)`Checks whether a value is between the from and to values of a Range |
| | `protected [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[decrement](#decrement(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)`Decrements by one |
| | `public boolean` | `**[equals](#equals(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") that)` |
| | `public boolean` | `**[equals](#equals(groovy.lang.ObjectRange))**([ObjectRange](objectrange) that)`Compares an [ObjectRange](objectrange "ObjectRange") to another [ObjectRange](objectrange "ObjectRange"). |
| | `public [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")` | `**[get](#get(int))**(int index)` |
| | `public [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")` | `**[getFrom](#getFrom())**()` |
| | `public [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")` | `**[getTo](#getTo())**()` |
| | `protected [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[increment](#increment(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)`Increments by one |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[inspect](#inspect())**()` |
| | `public boolean` | `**[isReverse](#isReverse())**()` |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")<[Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")>` | `**[iterator](#iterator())**()`{@inheritDoc} |
| | `public int` | `**[size](#size())**()` |
| | `public void` | `**[step](#step(int,%20groovy.lang.Closure))**(int step, [Closure](closure) closure)` |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")>` | `**[step](#step(int))**(int step)` |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")>` | `**[subList](#subList(int,%20int))**(int fromIndex, int toIndex)` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [AbstractList](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html "AbstractList")` | `[add](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#add(int,%20java.lang.Object) "add"), [add](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#add(java.lang.Object) "add"), [remove](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#remove(int) "remove"), [get](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#get(int) "get"), [equals](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#equals(java.lang.Object) "equals"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#hashCode() "hashCode"), [indexOf](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#indexOf(java.lang.Object) "indexOf"), [clear](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#clear() "clear"), [lastIndexOf](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#lastIndexOf(java.lang.Object) "lastIndexOf"), [subList](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#subList(int,%20int) "subList"), [iterator](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#iterator() "iterator"), [addAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#addAll(int,%20java.util.Collection) "addAll"), [set](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#set(int,%20java.lang.Object) "set"), [listIterator](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#listIterator() "listIterator"), [listIterator](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#listIterator(int) "listIterator"), [remove](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#remove(java.lang.Object) "remove"), [toString](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#toString() "toString"), [isEmpty](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#isEmpty() "isEmpty"), [size](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#size() "size"), [toArray](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#toArray() "toArray"), [toArray](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#toArray(%5BLjava.lang.Object;) "toArray"), [contains](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#contains(java.lang.Object) "contains"), [addAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#addAll(java.util.Collection) "addAll"), [removeAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#removeAll(java.util.Collection) "removeAll"), [retainAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#retainAll(java.util.Collection) "retainAll"), [containsAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#containsAll(java.util.Collection) "containsAll"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#wait(long) "wait"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#notifyAll() "notifyAll"), [toArray](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#toArray(java.util.function.IntFunction) "toArray"), [stream](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#stream() "stream"), [spliterator](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#spliterator() "spliterator"), [removeIf](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#removeIf(java.util.function.Predicate) "removeIf"), [parallelStream](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#parallelStream() "parallelStream"), [forEach](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#forEach(java.util.function.Consumer) "forEach"), [replaceAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#replaceAll(java.util.function.UnaryOperator) "replaceAll"), [sort](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#sort(java.util.Comparator) "sort")` |
Constructor Detail
------------------
### public **ObjectRange**([Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable") from, [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable") to)
Creates a new [ObjectRange](objectrange "ObjectRange"). Creates a reversed range if `from` < `to`.
**Parameters:**
`from` - the first value in the range.
`to` - the last value in the range.
### public **ObjectRange**([Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable") smaller, [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable") larger, boolean reverse)
Creates a new [ObjectRange](objectrange "ObjectRange") assumes smaller <= larger, else behavior is undefined. Caution: Prefer the other constructor when in doubt.
Optimized Constructor avoiding initial computation of comparison.
Method Detail
-------------
### protected void **checkBoundaryCompatibility**()
throws IllegalArgumentException if to and from are incompatible, meaning they e.g. (likely) produce infinite sequences. Called at construction time, subclasses may override cautiously (using only members to and from).
### protected int **compareTo**([Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable") first, [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable") second)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **contains**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
Iterates over all values and returns true if one value matches.
**See Also:**
[containsWithinBounds(Object)](#containsWithinBounds(java.lang.Object))
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **containsWithinBounds**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
Checks whether a value is between the from and to values of a Range
**Parameters:**
`value` - the value of interest
**Returns:**
true if the value is within the bounds
### protected [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **decrement**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
Decrements by one
**Parameters:**
`value` - the value to decrement
**Returns:**
the decremented value
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **equals**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") that)
### public boolean **equals**([ObjectRange](objectrange) that)
Compares an [ObjectRange](objectrange "ObjectRange") to another [ObjectRange](objectrange "ObjectRange").
**Parameters:**
`that` - the object to check equality with
**Returns:**
`true` if the ranges are equal
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable") **get**(int index)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable") **getFrom**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable") **getTo**()
### protected [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **increment**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
Increments by one
**Parameters:**
`value` - the value to increment
**Returns:**
the incremented value
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **inspect**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **isReverse**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")<[Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")> **iterator**()
{@inheritDoc}
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **size**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **step**(int step, [Closure](closure) closure)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")> **step**(int step)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")> **subList**(int fromIndex, int toIndex)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
| programming_docs |
groovy [Java] Interface GeneratedGroovyProxy [Java] Interface GeneratedGroovyProxy
=====================================
```
public interface GeneratedGroovyProxy
```
An interface implemented by some Groovy proxies which gives access to the proxied object. In particular, dynamically generated proxies that implement traits will implement this interface in order to give access to the proxied instance.
**Since:**
2.3.0
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProxyTarget](#getProxyTarget())**()`
**Returns:**
the proxy target.
|
Method Detail
-------------
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProxyTarget**()
**Returns:**
the proxy target.
groovy [Java] Interface Interceptor [Java] Interface Interceptor
============================
```
public interface Interceptor
```
Implementers of this interface can be registered in the ProxyMetaClass for notifications about method calls for objects managed by the ProxyMetaClass. See groovy/lang/InterceptorTest.groovy for details.
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[afterInvoke](#afterInvoke(java.lang.Object,%20java.lang.String,%20java.lang.Object,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") result)`This code is executed after the method is optionally called. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[beforeInvoke](#beforeInvoke(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)`This code is executed before the method is optionally called. |
| | `public boolean` | `**[doInvoke](#doInvoke())**()`
**Returns:**
whether the target method should be invoked at all.
|
Method Detail
-------------
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **afterInvoke**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") result)
This code is executed after the method is optionally called.
**Parameters:**
`object` - receiver object for the called method
`methodName` - name of the called method
`arguments` - arguments to the called method
`result` - result of the executed method call or result of beforeInvoke if method was not called
**Returns:**
any arbitrary result that can replace the result of the original method call. Typically, the result parameter is returned.
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **beforeInvoke**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)
This code is executed before the method is optionally called.
**Parameters:**
`object` - receiver object for the method call
`methodName` - name of the method to call
`arguments` - arguments to the method call
**Returns:**
any arbitrary result that replaces the result of the original method call only if doInvoke() returns false and afterInvoke() relays this result.
### public boolean **doInvoke**()
**Returns:**
whether the target method should be invoked at all.
groovy [Java] Class Sequence [Java] Class Sequence
=====================
* groovy.lang.Sequence
All Implemented Interfaces and Traits: [GroovyObject](groovyobject)
```
public class Sequence
extends [ArrayList](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html "ArrayList")
implements [GroovyObject](groovyobject)
```
Represents a sequence of zero or more objects of a given type. The type can be omitted in which case any type of object can be added.
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Sequence](#Sequence())**()` |
| `**[Sequence](#Sequence(java.lang.Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type)` |
| `**[Sequence](#Sequence(java.lang.Class,%20java.util.List))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") content)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[add](#add(int,%20java.lang.Object))**(int index, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") element)` |
| | `public boolean` | `**[add](#add(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") element)` |
| | `public boolean` | `**[addAll](#addAll(java.util.Collection))**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") c)` |
| | `public boolean` | `**[addAll](#addAll(int,%20java.util.Collection))**(int index, [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") c)` |
| | `protected void` | `**[checkCollectionType](#checkCollectionType(java.util.Collection))**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") c)`Checks that each member of the given collection are of the correct type |
| | `protected void` | `**[checkType](#checkType(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object)`Checks that the given object instance is of the correct type otherwise a runtime exception is thrown |
| | `public void` | `**[clear](#clear())**()` |
| | `public boolean` | `**[equals](#equals(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") that)` |
| | `public boolean` | `**[equals](#equals(groovy.lang.Sequence))**([Sequence](sequence) that)` |
| | `public [MetaClass](metaclass)` | `**[getMetaClass](#getMetaClass())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)` |
| | `public int` | `**[hashCode](#hashCode())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)` |
| | `public int` | `**[minimumSize](#minimumSize())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[remove](#remove(int))**(int index)` |
| | `protected void` | `**[removeRange](#removeRange(int,%20int))**(int fromIndex, int toIndex)` |
| | `public void` | `**[set](#set(java.util.Collection))**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") collection)`Sets the contents of this sequence to that of the given collection. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[set](#set(int,%20java.lang.Object))**(int index, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") element)` |
| | `public void` | `**[setMetaClass](#setMetaClass(groovy.lang.MetaClass))**([MetaClass](metaclass) metaClass)` |
| | `public void` | `**[setProperty](#setProperty(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)` |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[type](#type())**()`
**Returns:**
the type of the elements in the sequence or null if there is no type constraint on this sequence
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [ArrayList](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html "ArrayList")` | `[add](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#add(java.lang.Object) "add"), [add](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#add(int,%20java.lang.Object) "add"), [remove](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#remove(java.lang.Object) "remove"), [remove](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#remove(int) "remove"), [get](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#get(int) "get"), [equals](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#equals(java.lang.Object) "equals"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#hashCode() "hashCode"), [clone](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#clone() "clone"), [indexOf](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#indexOf(java.lang.Object) "indexOf"), [clear](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#clear() "clear"), [lastIndexOf](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#lastIndexOf(java.lang.Object) "lastIndexOf"), [isEmpty](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#isEmpty() "isEmpty"), [replaceAll](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#replaceAll(java.util.function.UnaryOperator) "replaceAll"), [size](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#size() "size"), [subList](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#subList(int,%20int) "subList"), [toArray](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#toArray(%5BLjava.lang.Object;) "toArray"), [toArray](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#toArray() "toArray"), [iterator](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#iterator() "iterator"), [contains](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#contains(java.lang.Object) "contains"), [spliterator](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#spliterator() "spliterator"), [addAll](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#addAll(java.util.Collection) "addAll"), [addAll](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#addAll(int,%20java.util.Collection) "addAll"), [set](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#set(int,%20java.lang.Object) "set"), [forEach](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#forEach(java.util.function.Consumer) "forEach"), [ensureCapacity](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#ensureCapacity(int) "ensureCapacity"), [trimToSize](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#trimToSize() "trimToSize"), [removeIf](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#removeIf(java.util.function.Predicate) "removeIf"), [sort](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#sort(java.util.Comparator) "sort"), [removeAll](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#removeAll(java.util.Collection) "removeAll"), [retainAll](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#retainAll(java.util.Collection) "retainAll"), [listIterator](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#listIterator() "listIterator"), [listIterator](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#listIterator(int) "listIterator"), [toString](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#toString() "toString"), [containsAll](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#containsAll(java.util.Collection) "containsAll"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#wait(long) "wait"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#notifyAll() "notifyAll"), [toArray](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#toArray(java.util.function.IntFunction) "toArray"), [stream](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#stream() "stream"), [parallelStream](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#parallelStream() "parallelStream")` |
Constructor Detail
------------------
### public **Sequence**()
### public **Sequence**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type)
### public **Sequence**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") content)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **add**(int index, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") element)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **add**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") element)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **addAll**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") c)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **addAll**(int index, [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") c)
### protected void **checkCollectionType**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") c)
Checks that each member of the given collection are of the correct type
### protected void **checkType**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object)
Checks that the given object instance is of the correct type otherwise a runtime exception is thrown
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **clear**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **equals**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") that)
### public boolean **equals**([Sequence](sequence) that)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [MetaClass](metaclass) **getMetaClass**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **hashCode**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
### public int **minimumSize**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **remove**(int index)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **removeRange**(int fromIndex, int toIndex)
### public void **set**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") collection)
Sets the contents of this sequence to that of the given collection.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **set**(int index, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") element)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setMetaClass**([MetaClass](metaclass) metaClass)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **type**()
**Returns:**
the type of the elements in the sequence or null if there is no type constraint on this sequence
groovy [Java] Class MissingPropertyException [Java] Class MissingPropertyException
=====================================
* groovy.lang.MissingPropertyException
```
public class MissingPropertyException
extends [GroovyRuntimeException](groovyruntimeexception)
```
An exception occurred if a dynamic property dispatch fails with an unknown property. Note that the Missing\*Exception classes were named for consistency and to avoid conflicts with JDK exceptions of the same name.
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")**` | `[MPE](#MPE)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[MissingPropertyException](#MissingPropertyException(java.lang.String,%20java.lang.Class))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type)` |
| `**[MissingPropertyException](#MissingPropertyException(java.lang.String,%20java.lang.Class,%20java.lang.Throwable))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type, [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") t)` |
| `**[MissingPropertyException](#MissingPropertyException(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message)` |
| `**[MissingPropertyException](#MissingPropertyException(java.lang.String,%20java.lang.String,%20java.lang.Class))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getMessageWithoutLocationText](#getMessageWithoutLocationText())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getProperty](#getProperty())**()`
**Returns:**
the name of the property that could not be found
|
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[getType](#getType())**()`
**Returns:**
The type on which the property was attempted to be called
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyRuntimeException](groovyruntimeexception)` | `[getLocationText](groovyruntimeexception#getLocationText()), [getMessage](groovyruntimeexception#getMessage()), [getMessageWithoutLocationText](groovyruntimeexception#getMessageWithoutLocationText()), [getModule](groovyruntimeexception#getModule()), [getNode](groovyruntimeexception#getNode()), [setModule](groovyruntimeexception#setModule(org.codehaus.groovy.ast.ModuleNode))` |
Field Detail
------------
### public static final [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **MPE**
Constructor Detail
------------------
### public **MissingPropertyException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type)
### public **MissingPropertyException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type, [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") t)
### public **MissingPropertyException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message)
### public **MissingPropertyException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getMessageWithoutLocationText**()
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getProperty**()
**Returns:**
the name of the property that could not be found
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **getType**()
**Returns:**
The type on which the property was attempted to be called
| programming_docs |
groovy [Java] Class Tuple16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> [Java] Class Tuple16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>
===========================================================================================
* groovy.lang.Tuple16
```
public final class Tuple16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>
extends [Tuple](tuple)
```
Represents a list of 16 typed Objects.
**Since:**
3.0.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Tuple16](#Tuple16(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15,%20T16))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11, [T12](../../t12) v12, [T13](../../t13) v13, [T14](../../t14) v14, [T15](../../t15) v15, [T16](../../t16) v16)` |
| `**[Tuple16](#Tuple16(Tuple16))**([Tuple16](tuple16 "Tuple16")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> tuple)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Tuple16](tuple16 "Tuple16")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>` | `**[clone](#clone())**()` |
| | `public [T1](../../t1)` | `**[getV1](#getV1())**()` |
| | `public [T10](../../t10)` | `**[getV10](#getV10())**()` |
| | `public [T11](../../t11)` | `**[getV11](#getV11())**()` |
| | `public [T12](../../t12)` | `**[getV12](#getV12())**()` |
| | `public [T13](../../t13)` | `**[getV13](#getV13())**()` |
| | `public [T14](../../t14)` | `**[getV14](#getV14())**()` |
| | `public [T15](../../t15)` | `**[getV15](#getV15())**()` |
| | `public [T16](../../t16)` | `**[getV16](#getV16())**()` |
| | `public [T2](../../t2)` | `**[getV2](#getV2())**()` |
| | `public [T3](../../t3)` | `**[getV3](#getV3())**()` |
| | `public [T4](../../t4)` | `**[getV4](#getV4())**()` |
| | `public [T5](../../t5)` | `**[getV5](#getV5())**()` |
| | `public [T6](../../t6)` | `**[getV6](#getV6())**()` |
| | `public [T7](../../t7)` | `**[getV7](#getV7())**()` |
| | `public [T8](../../t8)` | `**[getV8](#getV8())**()` |
| | `public [T9](../../t9)` | `**[getV9](#getV9())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Tuple](tuple)` | `[clone](tuple#clone()), [compareTo](tuple#compareTo(Tuple)), [equals](tuple#equals(java.lang.Object)), [get](tuple#get(int)), [hashCode](tuple#hashCode()), [size](tuple#size()), [subList](tuple#subList(int,%20int)), [subTuple](tuple#subTuple(int,%20int)), [toArray](tuple#toArray()), [tuple](tuple#tuple()), [tuple](tuple#tuple(T1)), [tuple](tuple#tuple(T1,%20T2)), [tuple](tuple#tuple(T1,%20T2,%20T3)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15,%20T16))` |
Constructor Detail
------------------
### public **Tuple16**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11, [T12](../../t12) v12, [T13](../../t13) v13, [T14](../../t14) v14, [T15](../../t15) v15, [T16](../../t16) v16)
### public **Tuple16**([Tuple16](tuple16 "Tuple16")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> tuple)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Tuple16](tuple16 "Tuple16")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> **clone**()
### public [T1](../../t1) **getV1**()
### public [T10](../../t10) **getV10**()
### public [T11](../../t11) **getV11**()
### public [T12](../../t12) **getV12**()
### public [T13](../../t13) **getV13**()
### public [T14](../../t14) **getV14**()
### public [T15](../../t15) **getV15**()
### public [T16](../../t16) **getV16**()
### public [T2](../../t2) **getV2**()
### public [T3](../../t3) **getV3**()
### public [T4](../../t4) **getV4**()
### public [T5](../../t5) **getV5**()
### public [T6](../../t6) **getV6**()
### public [T7](../../t7) **getV7**()
### public [T8](../../t8) **getV8**()
### public [T9](../../t9) **getV9**()
groovy [Java] Class Tuple0 [Java] Class Tuple0
===================
* groovy.lang.Tuple0
```
public final class Tuple0
extends [Tuple](tuple)
```
Represents a list of 0 typed Object.
**Since:**
3.0.0
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [Tuple0](tuple0)**` | `[INSTANCE](#INSTANCE)` | |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Tuple0](tuple0)` | `**[clone](#clone())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Tuple](tuple)` | `[clone](tuple#clone()), [compareTo](tuple#compareTo(Tuple)), [equals](tuple#equals(java.lang.Object)), [get](tuple#get(int)), [hashCode](tuple#hashCode()), [size](tuple#size()), [subList](tuple#subList(int,%20int)), [subTuple](tuple#subTuple(int,%20int)), [toArray](tuple#toArray()), [tuple](tuple#tuple()), [tuple](tuple#tuple(T1)), [tuple](tuple#tuple(T1,%20T2)), [tuple](tuple#tuple(T1,%20T2,%20T3)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15,%20T16))` |
Field Detail
------------
### public static final [Tuple0](tuple0) **INSTANCE**
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Tuple0](tuple0) **clone**()
groovy [Java] Class Tuple1<T1> [Java] Class Tuple1<T1>
=======================
* groovy.lang.Tuple1
```
public final class Tuple1<T1>
extends [Tuple](tuple)
```
Represents a list of 1 typed Object.
**Since:**
2.5.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Tuple1](#Tuple1(T1))**([T1](../../t1) t1)` |
| `**[Tuple1](#Tuple1(Tuple1))**([Tuple1](tuple1 "Tuple1")<T1> tuple)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Tuple1](tuple1 "Tuple1")<T1>` | `**[clone](#clone())**()` |
| | `public [T1](../../t1)` | `**[getFirst](#getFirst())**()` |
| | `public [T1](../../t1)` | `**[getV1](#getV1())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Tuple](tuple)` | `[clone](tuple#clone()), [compareTo](tuple#compareTo(Tuple)), [equals](tuple#equals(java.lang.Object)), [get](tuple#get(int)), [hashCode](tuple#hashCode()), [size](tuple#size()), [subList](tuple#subList(int,%20int)), [subTuple](tuple#subTuple(int,%20int)), [toArray](tuple#toArray()), [tuple](tuple#tuple()), [tuple](tuple#tuple(T1)), [tuple](tuple#tuple(T1,%20T2)), [tuple](tuple#tuple(T1,%20T2,%20T3)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15,%20T16))` |
Constructor Detail
------------------
### public **Tuple1**([T1](../../t1) t1)
### public **Tuple1**([Tuple1](tuple1 "Tuple1")<T1> tuple)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Tuple1](tuple1 "Tuple1")<T1> **clone**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T1](../../t1) **getFirst**()
### public [T1](../../t1) **getV1**()
groovy [Java] Class MOPIter.MetaConstructor [Java] Class MOPIter.MetaConstructor
====================================
* groovy.lang.MOPIter.MetaConstructor
```
public static final class MOPIter.MetaConstructor
extends [MetaMethod](metamethod)
```
This is a helper class introduced in Groovy 2.1.0, which is used only by indy. This class is for internal use only.
**Since:**
Groovy 2.1.0
Inherited fields
| Fields inherited from class | Fields |
| **`class [MetaMethod](metamethod)`** | `[EMPTY\_ARRAY](metamethod#EMPTY_ARRAY)` |
| **`class [ParameterTypes](../../org/codehaus/groovy/reflection/parametertypes)`** | `[isVargsMethod](../../org/codehaus/groovy/reflection/parametertypes#isVargsMethod), [nativeParamTypes](../../org/codehaus/groovy/reflection/parametertypes#nativeParamTypes), [parameterTypes](../../org/codehaus/groovy/reflection/parametertypes#parameterTypes)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [CachedConstructor](../../org/codehaus/groovy/reflection/cachedconstructor)` | `**[getCachedConstrcutor](#getCachedConstrcutor())**()` |
| | `public [CachedClass](../../org/codehaus/groovy/reflection/cachedclass)` | `**[getDeclaringClass](#getDeclaringClass())**()` |
| | `public int` | `**[getModifiers](#getModifiers())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getName](#getName())**()` |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[getReturnType](#getReturnType())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invoke](#invoke(java.lang.Object,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)` |
| | `public boolean` | `**[isBeanConstructor](#isBeanConstructor())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [MetaMethod](metamethod)` | `[checkParameters](metamethod#checkParameters(java.lang.Class)), [clone](metamethod#clone()), [doMethodInvoke](metamethod#doMethodInvoke(java.lang.Object,%20java.lang.Object)), [equal](metamethod#equal(org.codehaus.groovy.reflection.CachedClass,%20java.lang.Class)), [equal](metamethod#equal(org.codehaus.groovy.reflection.CachedClass,%20org.codehaus.groovy.reflection.CachedClass)), [getDeclaringClass](metamethod#getDeclaringClass()), [getDescriptor](metamethod#getDescriptor()), [getModifiers](metamethod#getModifiers()), [getMopName](metamethod#getMopName()), [getName](metamethod#getName()), [getReturnType](metamethod#getReturnType()), [getSignature](metamethod#getSignature()), [invoke](metamethod#invoke(java.lang.Object,%20java.lang.Object)), [isAbstract](metamethod#isAbstract()), [isCacheable](metamethod#isCacheable()), [isDefault](metamethod#isDefault()), [isMethod](metamethod#isMethod(groovy.lang.MetaMethod)), [isPrivate](metamethod#isPrivate()), [isProtected](metamethod#isProtected()), [isPublic](metamethod#isPublic()), [isSame](metamethod#isSame(groovy.lang.MetaMethod)), [isStatic](metamethod#isStatic()), [processDoMethodInvokeException](metamethod#processDoMethodInvokeException(java.lang.Exception,%20java.lang.Object,%20java.lang.Object)), [toString](metamethod#toString())` |
| `class [ParameterTypes](../../org/codehaus/groovy/reflection/parametertypes)` | `[coerceArgumentsToClasses](../../org/codehaus/groovy/reflection/parametertypes#coerceArgumentsToClasses(java.lang.Object)), [correctArguments](../../org/codehaus/groovy/reflection/parametertypes#correctArguments(java.lang.Object)), [getNativeParameterTypes](../../org/codehaus/groovy/reflection/parametertypes#getNativeParameterTypes()), [getPT](../../org/codehaus/groovy/reflection/parametertypes#getPT()), [getParameterTypes](../../org/codehaus/groovy/reflection/parametertypes#getParameterTypes()), [isValidExactMethod](../../org/codehaus/groovy/reflection/parametertypes#isValidExactMethod(java.lang.Object)), [isValidExactMethod](../../org/codehaus/groovy/reflection/parametertypes#isValidExactMethod(java.lang.Class)), [isValidMethod](../../org/codehaus/groovy/reflection/parametertypes#isValidMethod(java.lang.Class)), [isValidMethod](../../org/codehaus/groovy/reflection/parametertypes#isValidMethod(java.lang.Object)), [isVargsMethod](../../org/codehaus/groovy/reflection/parametertypes#isVargsMethod()), [isVargsMethod](../../org/codehaus/groovy/reflection/parametertypes#isVargsMethod(java.lang.Object)), [setParametersTypes](../../org/codehaus/groovy/reflection/parametertypes#setParametersTypes(org.codehaus.groovy.reflection.CachedClass))` |
Method Detail
-------------
### public [CachedConstructor](../../org/codehaus/groovy/reflection/cachedconstructor) **getCachedConstrcutor**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [CachedClass](../../org/codehaus/groovy/reflection/cachedclass) **getDeclaringClass**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getModifiers**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getName**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **getReturnType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invoke**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)
### public boolean **isBeanConstructor**()
groovy [Java] Class MetaProperty [Java] Class MetaProperty
=========================
* groovy.lang.MetaProperty
```
public abstract class MetaProperty
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Represents a property on a bean which may have a getter and/or a setter
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[PROPERTY\_SET\_PREFIX](#PROPERTY_SET_PREFIX)` | |
| `**protected [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[name](#name)` | |
| `**protected [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")**` | `[type](#type)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[MetaProperty](#MetaProperty(java.lang.String,%20java.lang.Class))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type)`Constructor that sets the property name and type (class) |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getGetterName](#getGetterName(java.lang.String,%20java.lang.Class))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type)`Gets the name for the getter for this property |
| | `public int` | `**[getModifiers](#getModifiers())**()`Returns the access modifier. |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getName](#getName())**()`Return the name of the property |
| | `public abstract [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object)`
**Returns:**
the property of the given object
|
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getSetterName](#getSetterName(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName)`Gets the setter for the getter for this property. |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[getType](#getType())**()`
**Returns:**
the type of the property
|
| | `public abstract void` | `**[setProperty](#setProperty(java.lang.Object,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`Sets the property on the given object to the new value |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **PROPERTY\_SET\_PREFIX**
### protected final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **name**
### protected [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **type**
Constructor Detail
------------------
### public **MetaProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type)
Constructor that sets the property name and type (class)
Method Detail
-------------
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getGetterName**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type)
Gets the name for the getter for this property
**Returns:**
The name of the property. The name is "get" + the capitalized propertyName or, in the case of boolean values, "is" + the capitalized propertyName
### public int **getModifiers**()
Returns the access modifier.
**Returns:**
Modifier.PUBLIC
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getName**()
Return the name of the property
**Returns:**
the name of the property
### public abstract [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object)
**throws:**
Exception if the property could not be evaluated
**Returns:**
the property of the given object
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getSetterName**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName)
Gets the setter for the getter for this property.
**Returns:**
The name of the property. The name is "set"+ the capitalized propertyName.
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **getType**()
**Returns:**
the type of the property
### public abstract void **setProperty**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
Sets the property on the given object to the new value
**throws:**
RuntimeException if the property could not be set
**Parameters:**
`object` - on which to set the property
`newValue` - the new value of the property
| programming_docs |
groovy [Java] Class ExpandoMetaClass.ExpandoMetaConstructor [Java] Class ExpandoMetaClass.ExpandoMetaConstructor
====================================================
* groovy.lang.ExpandoMetaClass.ExpandoMetaConstructor
```
protected class ExpandoMetaClass.ExpandoMetaConstructor
extends [GroovyObjectSupport](groovyobjectsupport)
```
Handles the ability to use the left shift operator to append new constructors
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[leftShift](#leftShift(groovy.lang.Closure))**([Closure](closure) c)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyObjectSupport](groovyobjectsupport)` | `[getMetaClass](groovyobjectsupport#getMetaClass()), [setMetaClass](groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Method Detail
-------------
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **leftShift**([Closure](closure) c)
groovy [Java] Class GroovyObjectSupport [Java] Class GroovyObjectSupport
================================
* groovy.lang.GroovyObjectSupport
All Implemented Interfaces and Traits: [GroovyObject](groovyobject)
```
public abstract class GroovyObjectSupport
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [GroovyObject](groovyobject)
```
Base class for Java objects wishing to be Groovy objects.
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [MetaClass](metaclass)` | `**[getMetaClass](#getMetaClass())**()` |
| | `public void` | `**[setMetaClass](#setMetaClass(groovy.lang.MetaClass))**([MetaClass](metaclass) metaClass)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") @[Transient](https://docs.oracle.com/javase/8/docs/api/java/beans/Transient.html "Transient") public [MetaClass](metaclass) **getMetaClass**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setMetaClass**([MetaClass](metaclass) metaClass)
groovy [Java] Class Closure<V> [Java] Class Closure<V>
=======================
* groovy.lang.Closure
All Implemented Interfaces and Traits:
[Cloneable](https://docs.oracle.com/javase/8/docs/api/java/lang/Cloneable.html "Cloneable"), [GroovyCallable](groovycallable), [Runnable](https://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html "Runnable"), [Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html "Serializable")
```
public abstract class Closure<V>
extends [GroovyObjectSupport](groovyobjectsupport)
implements [Cloneable](https://docs.oracle.com/javase/8/docs/api/java/lang/Cloneable.html "Cloneable"), [GroovyCallable](groovycallable), [Runnable](https://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html "Runnable"), [Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html "Serializable")
```
Represents any closure object in Groovy.
Groovy allows instances of Closures to be called in a short form. For example:
```
def a = 1
def c = { a }
assert c() == 1
```
To be able to use a Closure in this way with your own subclass, you need to provide a doCall method with any signature you want to. This ensures that [getMaximumNumberOfParameters()](#getMaximumNumberOfParameters()) and [getParameterTypes()](#getParameterTypes()) will work too without any additional code. If no doCall method is provided a closure must be used in its long form like
```
def a = 1
def c = {a}
assert c.call() == 1
```
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static int**` | `[DELEGATE\_FIRST](#DELEGATE_FIRST)` | With this resolveStrategy set the closure will attempt to resolve property references and methods to the delegate first then the owner. |
| `**static int**` | `[DELEGATE\_ONLY](#DELEGATE_ONLY)` | With this resolveStrategy set the closure will resolve property references and methods to the delegate only and entirely bypass the owner. |
| `**static int**` | `[DONE](#DONE)` | |
| `**static [Closure](closure)**` | `[IDENTITY](#IDENTITY)` | |
| `**static int**` | `[OWNER\_FIRST](#OWNER_FIRST)` | With this resolveStrategy set the closure will attempt to resolve property references and methods to the owner first, then the delegate (**this is the default strategy**). |
| `**static int**` | `[OWNER\_ONLY](#OWNER_ONLY)` | With this resolveStrategy set the closure will resolve property references and methods to the owner only and not call the delegate at all. |
| `**static int**` | `[TO\_SELF](#TO_SELF)` | With this resolveStrategy set the closure will resolve property references to itself and go through the usual MetaClass look-up process. |
| `**protected int**` | `[maximumNumberOfParameters](#maximumNumberOfParameters)` | |
| `**protected [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?>[]**` | `[parameterTypes](#parameterTypes)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Closure](#Closure(java.lang.Object,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") owner, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") thisObject)` |
| `**[Closure](#Closure(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") owner)`Constructor used when the "this" object for the Closure is null. |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| `<W>` | `public [Closure](closure "Closure")<W>` | `**[andThen](#andThen(Closure))**([Closure](closure "Closure")<W> other)`Alias for [rightShift(Closure)](#rightShift(groovy.lang.Closure)) |
| | `public [Closure](closure "Closure")<V>` | `**[andThenSelf](#andThenSelf())**()`Call [andThen(Closure)](#andThen(groovy.lang.Closure)) on `this`. |
| | `public [Closure](closure "Closure")<V>` | `**[andThenSelf](#andThenSelf(int))**(int times)`Call [andThen(Closure)](#andThen(groovy.lang.Closure)) on `this` exactly `times` times. |
| | `public [Closure](closure)` | `**[asWritable](#asWritable())**()`
**Returns:**
a version of this closure which implements Writable.
|
| | `public V` | `**[call](#call())**()`Invokes the closure without any parameters, returning any value if applicable. |
| | `public V` | `**[call](#call(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)` |
| | `public V` | `**[call](#call(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") arguments)`Invokes the closure, returning any value if applicable. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[clone](#clone())**()` |
| | `public [Closure](closure "Closure")<V>` | `**[compose](#compose(groovy.lang.Closure))**([Closure](closure) other)`Alias for [leftShift(Closure)](#leftShift(groovy.lang.Closure)) |
| | `public [Closure](closure "Closure")<V>` | `**[composeSelf](#composeSelf())**()`Call [compose(Closure)](#compose(groovy.lang.Closure)) on `this`. |
| | `public [Closure](closure "Closure")<V>` | `**[composeSelf](#composeSelf(int))**(int times)`Call [compose(Closure)](#compose(groovy.lang.Closure)) on `this` exactly `times` times. |
| | `public [Closure](closure "Closure")<V>` | `**[curry](#curry(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") arguments)`Support for Closure currying. |
| | `public [Closure](closure "Closure")<V>` | `**[curry](#curry(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") argument)`Support for Closure currying. |
| | `public [Closure](closure "Closure")<V>` | `**[dehydrate](#dehydrate())**()`Returns a copy of this closure where the "owner", "delegate" and "thisObject" fields are null, allowing proper serialization when one of them is not serializable. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[doCall](#doCall(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getDelegate](#getDelegate())**()`
**Returns:**
the delegate Object to which method calls will go which is typically the outer class when the closure is constructed
|
| | `public int` | `**[getDirective](#getDirective())**()`
**Returns:**
Returns the directive.
|
| | `public int` | `**[getMaximumNumberOfParameters](#getMaximumNumberOfParameters())**()`
**Returns:**
the maximum number of parameters a doCall method of this closure can take
|
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getOwner](#getOwner())**()`
**Returns:**
the owner Object to which method calls will go which is typically the outer class when the closure is constructed
|
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?>[]` | `**[getParameterTypes](#getParameterTypes())**()`
**Returns:**
the parameter types of the longest doCall method of this closure
|
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)` |
| | `public int` | `**[getResolveStrategy](#getResolveStrategy())**()`Gets the strategy which the closure uses to resolve methods and properties |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getThisObject](#getThisObject())**()` |
| | `public boolean` | `**[isCase](#isCase(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") candidate)` |
| | `public [Closure](closure "Closure")<V>` | `**[leftShift](#leftShift(groovy.lang.Closure))**([Closure](closure) other)`Support for Closure reverse composition. |
| | `public V` | `**[leftShift](#leftShift(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") arg)`Alias for calling a Closure for non-closure arguments. |
| | `public [Closure](closure "Closure")<V>` | `**[memoize](#memoize())**()`Creates a caching variant of the closure. |
| | `public [Closure](closure "Closure")<V>` | `**[memoizeAtLeast](#memoizeAtLeast(int))**(int protectedCacheSize)`Creates a caching variant of the closure with automatic cache size adjustment and lower limit on the cache size. |
| | `public [Closure](closure "Closure")<V>` | `**[memoizeAtMost](#memoizeAtMost(int))**(int maxCacheSize)`Creates a caching variant of the closure with upper limit on the cache size. |
| | `public [Closure](closure "Closure")<V>` | `**[memoizeBetween](#memoizeBetween(int,%20int))**(int protectedCacheSize, int maxCacheSize)`Creates a caching variant of the closure with automatic cache size adjustment and lower and upper limits on the cache size. |
| | `public [Closure](closure "Closure")<V>` | `**[ncurry](#ncurry(int,%20java.lang.Object))**(int n, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") arguments)`Support for Closure currying at a given index. |
| | `public [Closure](closure "Closure")<V>` | `**[ncurry](#ncurry(int,%20java.lang.Object))**(int n, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") argument)`Support for Closure currying at a given index. |
| | `public [Closure](closure "Closure")<V>` | `**[rcurry](#rcurry(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") arguments)`Support for Closure "right" currying. |
| | `public [Closure](closure "Closure")<V>` | `**[rcurry](#rcurry(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") argument)`Support for Closure "right" currying. |
| | `public [Closure](closure "Closure")<V>` | `**[rehydrate](#rehydrate(java.lang.Object,%20java.lang.Object,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") delegate, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") owner, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") thisObject)`Returns a copy of this closure for which the delegate, owner and thisObject are replaced with the supplied parameters. |
| `<W>` | `public [Closure](closure "Closure")<W>` | `**[rightShift](#rightShift(Closure))**([Closure](closure "Closure")<W> other)`Support for Closure forward composition. |
| | `public void` | `**[run](#run())**()` |
| | `public void` | `**[setDelegate](#setDelegate(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") delegate)`Allows the delegate to be changed such as when performing markup building |
| | `public void` | `**[setDirective](#setDirective(int))**(int directive)`
**Parameters:**
`directive` - The directive to set.
|
| | `public void` | `**[setProperty](#setProperty(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)` |
| | `public void` | `**[setResolveStrategy](#setResolveStrategy(int))**(int resolveStrategy)`Sets the strategy which the closure uses to resolve property references and methods. |
| | `protected static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[throwRuntimeException](#throwRuntimeException(java.lang.Throwable))**([Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") throwable)` |
| | `public [Closure](closure "Closure")<V>` | `**[trampoline](#trampoline(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)`Builds a trampolined variant of the current closure. |
| | `public [Closure](closure "Closure")<V>` | `**[trampoline](#trampoline())**()`Builds a trampolined variant of the current closure. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyObjectSupport](groovyobjectsupport)` | `[getMetaClass](groovyobjectsupport#getMetaClass()), [setMetaClass](groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Field Detail
------------
### public static final int **DELEGATE\_FIRST**
With this resolveStrategy set the closure will attempt to resolve property references and methods to the delegate first then the owner. For example the following code:
```
class Test {
def x = 30
def y = 40
def run() {
def data = [ x: 10, y: 20 ]
def cl = { y = x + y }
cl.delegate = data
cl.resolveStrategy = Closure.DELEGATE_FIRST
cl()
assert x == 30
assert y == 40
assert data == [x:10, y:30]
}
}
new Test().run()
```
This will succeed, because the x and y variables declared in the delegate shadow the fields in the owner class. *Note that local variables are always looked up first, independently of the resolution strategy.*
### public static final int **DELEGATE\_ONLY**
With this resolveStrategy set the closure will resolve property references and methods to the delegate only and entirely bypass the owner. For example the following code :
```
class Test {
def x = 30
def y = 40
def z = 50
def run() {
def data = [ x: 10, y: 20 ]
def cl = { y = x + y + z }
cl.delegate = data
cl.resolveStrategy = Closure.DELEGATE_ONLY
cl()
println x
println y
println data
}
}
groovy.test.GroovyAssert.shouldFail {
new Test().run()
}
```
will throw an error because even if the owner declares a "z" field, the resolution strategy will bypass lookup in the owner. *Note that local variables are always looked up first, independently of the resolution strategy.*
### public static final int **DONE**
### public static final [Closure](closure) **IDENTITY**
### public static final int **OWNER\_FIRST**
With this resolveStrategy set the closure will attempt to resolve property references and methods to the owner first, then the delegate (**this is the default strategy**). For example the following code:
```
class Test {
def x = 30
def y = 40
def run() {
def data = [ x: 10, y: 20 ]
def cl = { y = x + y }
cl.delegate = data
cl()
assert x == 30
assert y == 70
assert data == [x:10, y:20]
}
}
new Test().run()
```
Will succeed, because the x and y fields declared in the Test class shadow the variables in the delegate. *Note that local variables are always looked up first, independently of the resolution strategy.*
### public static final int **OWNER\_ONLY**
With this resolveStrategy set the closure will resolve property references and methods to the owner only and not call the delegate at all. For example the following code :
```
class Test {
def x = 30
def y = 40
def run() {
def data = [ x: 10, y: 20, z: 30 ]
def cl = { y = x + y + z }
cl.delegate = data
cl.resolveStrategy = Closure.OWNER_ONLY
cl()
println x
println y
println data
}
}
groovy.test.GroovyAssert.shouldFail(MissingPropertyException) {
new Test().run()
}
```
will throw "No such property: z" error because even if the z variable is declared in the delegate, no lookup is made. *Note that local variables are always looked up first, independently of the resolution strategy.*
### public static final int **TO\_SELF**
With this resolveStrategy set the closure will resolve property references to itself and go through the usual MetaClass look-up process. This means that properties and methods are neither resolved from the owner nor the delegate, but only on the closure object itself. This allows the developer to override getProperty using ExpandoMetaClass of the closure itself.
*Note that local variables are always looked up first, independently of the resolution strategy.*
### protected int **maximumNumberOfParameters**
### protected [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?>[] **parameterTypes**
Constructor Detail
------------------
### public **Closure**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") owner, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") thisObject)
### public **Closure**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") owner)
Constructor used when the "this" object for the Closure is null. This is rarely the case in normal Groovy usage.
**Parameters:**
`owner` - the Closure owner
Method Detail
-------------
### <W> public [Closure](closure "Closure")<W> **andThen**([Closure](closure "Closure")<W> other)
Alias for [rightShift(Closure)](#rightShift(groovy.lang.Closure))
**Returns:**
the newly composed closure
### public [Closure](closure "Closure")<V> **andThenSelf**()
Call [andThen(Closure)](#andThen(groovy.lang.Closure)) on `this`.
**Returns:**
the newly composed closure
### public [Closure](closure "Closure")<V> **andThenSelf**(int times)
Call [andThen(Closure)](#andThen(groovy.lang.Closure)) on `this` exactly `times` times.
**Parameters:**
`times` - the number of times to reverse compose the closure with itself
**Returns:**
the newly composed closure
### public [Closure](closure) **asWritable**()
**Returns:**
a version of this closure which implements Writable. Note that the returned Writable also overrides [toString()](#toString()) in order to allow rendering the result directly to a String.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public V **call**()
Invokes the closure without any parameters, returning any value if applicable.
**Returns:**
the value if applicable or null if there is no return statement in the closure
### @[SuppressWarnings](https://docs.oracle.com/javase/8/docs/api/java/lang/SuppressWarnings.html "SuppressWarnings")("unchecked") public V **call**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
### public V **call**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") arguments)
Invokes the closure, returning any value if applicable.
**Parameters:**
`arguments` - could be a single value or a List of values
**Returns:**
the value if applicable or null if there is no return statement in the closure
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **clone**()
### public [Closure](closure "Closure")<V> **compose**([Closure](closure) other)
Alias for [leftShift(Closure)](#leftShift(groovy.lang.Closure))
**Returns:**
the newly composed closure
### public [Closure](closure "Closure")<V> **composeSelf**()
Call [compose(Closure)](#compose(groovy.lang.Closure)) on `this`.
**Returns:**
the newly composed closure
### public [Closure](closure "Closure")<V> **composeSelf**(int times)
Call [compose(Closure)](#compose(groovy.lang.Closure)) on `this` exactly `times` times.
**Parameters:**
`times` - the number of times to compose the closure with itself
**Returns:**
the newly composed closure
### public [Closure](closure "Closure")<V> **curry**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") arguments)
Support for Closure currying.
Typical usage:
```
def multiply = { a, b -> a * b }
def doubler = multiply.curry(2)
assert doubler(4) == 8
```
Note: special treatment is given to Closure vararg-style capability. If you curry a vararg parameter, you don't consume the entire vararg array but instead the first parameter of the vararg array as the following example shows:
```
def a = { one, two, Object[] others -> one + two + others.sum() }
assert a.parameterTypes.name == ['java.lang.Object', 'java.lang.Object', '[Ljava.lang.Object;']
assert a(1,2,3,4) == 10
def b = a.curry(1)
assert b.parameterTypes.name == ['java.lang.Object', '[Ljava.lang.Object;']
assert b(2,3,4) == 10
def c = b.curry(2)
assert c.parameterTypes.name == ['[Ljava.lang.Object;']
assert c(3,4) == 10
def d = c.curry(3)
assert d.parameterTypes.name == ['[Ljava.lang.Object;']
assert d(4) == 10
def e = d.curry(4)
assert e.parameterTypes.name == ['[Ljava.lang.Object;']
assert e() == 10
assert e(5) == 15
```
**Parameters:**
`arguments` - the arguments to bind
**Returns:**
the new closure with its arguments bound
### public [Closure](closure "Closure")<V> **curry**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") argument)
Support for Closure currying.
**Parameters:**
`argument` - the argument to bind
**Returns:**
the new closure with the argument bound
**See Also:**
[curry(Object...)](#curry(Object...))
### @[SuppressWarnings](https://docs.oracle.com/javase/8/docs/api/java/lang/SuppressWarnings.html "SuppressWarnings")("unchecked") public [Closure](closure "Closure")<V> **dehydrate**()
Returns a copy of this closure where the "owner", "delegate" and "thisObject" fields are null, allowing proper serialization when one of them is not serializable.
**Returns:**
a serializable closure.
**Since:**
1.8.5
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **doCall**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getDelegate**()
**Returns:**
the delegate Object to which method calls will go which is typically the outer class when the closure is constructed
### public int **getDirective**()
**Returns:**
Returns the directive.
### public int **getMaximumNumberOfParameters**()
**Returns:**
the maximum number of parameters a doCall method of this closure can take
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getOwner**()
**Returns:**
the owner Object to which method calls will go which is typically the outer class when the closure is constructed
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?>[] **getParameterTypes**()
**Returns:**
the parameter types of the longest doCall method of this closure
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)
### public int **getResolveStrategy**()
Gets the strategy which the closure uses to resolve methods and properties
**Returns:**
The resolve strategy
**See Also:**
[Closure.DELEGATE\_FIRST](closure#DELEGATE_FIRST "Closure.DELEGATE_FIRST")
[Closure.DELEGATE\_ONLY](closure#DELEGATE_ONLY "Closure.DELEGATE_ONLY")
[Closure.OWNER\_FIRST](closure#OWNER_FIRST "Closure.OWNER_FIRST")
[Closure.OWNER\_ONLY](closure#OWNER_ONLY "Closure.OWNER_ONLY")
[Closure.TO\_SELF](closure#TO_SELF "Closure.TO_SELF")
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getThisObject**()
### public boolean **isCase**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") candidate)
### public [Closure](closure "Closure")<V> **leftShift**([Closure](closure) other)
Support for Closure reverse composition.
Typical usage:
```
def times2 = { a -> a * 2 }
def add3 = { a -> a + 3 }
def addThenTimes = times2 << add3
// equivalent: addThenTimes = { a -> times2(add3(a)) }
assert addThenTimes(3) == 12
```
**Parameters:**
`other` - the Closure to compose with the current Closure
**Returns:**
the new composed Closure
### public V **leftShift**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") arg)
Alias for calling a Closure for non-closure arguments.
Typical usage:
```
def times2 = { a -> a * 2 }
def add3 = { a -> a + 3 }
assert add3 << times2 << 3 == 9
```
**Parameters:**
`arg` - the argument to call the closure with
**Returns:**
the result of calling the Closure
### public [Closure](closure "Closure")<V> **memoize**()
Creates a caching variant of the closure. Whenever the closure is called, the mapping between the parameters and the return value is preserved in cache making subsequent calls with the same arguments fast. This variant will keep all cached values forever, i.e. till the closure gets garbage-collected. The returned function can be safely used concurrently from multiple threads, however, the implementation values high average-scenario performance and so concurrent calls on the memoized function with identical argument values may not necessarily be able to benefit from each other's cached return value. With this having been mentioned, the performance trade-off still makes concurrent use of memoized functions safe and highly recommended. The cache gets garbage-collected together with the memoized closure.
**Returns:**
A new closure forwarding to the original one while caching the results
### public [Closure](closure "Closure")<V> **memoizeAtLeast**(int protectedCacheSize)
Creates a caching variant of the closure with automatic cache size adjustment and lower limit on the cache size. Whenever the closure is called, the mapping between the parameters and the return value is preserved in cache making subsequent calls with the same arguments fast. This variant allows the garbage collector to release entries from the cache and at the same time allows the user to specify how many entries should be protected from the eventual gc-initiated eviction. Cached entries exceeding the specified preservation threshold are made available for eviction based on the LRU (Last Recently Used) strategy. Given the non-deterministic nature of garbage collector, the actual cache size may grow well beyond the limits set by the user if memory is plentiful. The returned function can be safely used concurrently from multiple threads, however, the implementation values high average-scenario performance and so concurrent calls on the memoized function with identical argument values may not necessarily be able to benefit from each other's cached return value. Also the protectedCacheSize parameter might not be respected accurately in such scenarios for some periods of time. With this having been mentioned, the performance trade-off still makes concurrent use of memoized functions safe and highly recommended. The cache gets garbage-collected together with the memoized closure.
**Parameters:**
`protectedCacheSize` - Number of cached return values to protect from garbage collection
**Returns:**
A new function forwarding to the original one while caching the results
### public [Closure](closure "Closure")<V> **memoizeAtMost**(int maxCacheSize)
Creates a caching variant of the closure with upper limit on the cache size. Whenever the closure is called, the mapping between the parameters and the return value is preserved in cache making subsequent calls with the same arguments fast. This variant will keep all values until the upper size limit is reached. Then the values in the cache start rotating using the LRU (Last Recently Used) strategy. The returned function can be safely used concurrently from multiple threads, however, the implementation values high average-scenario performance and so concurrent calls on the memoized function with identical argument values may not necessarily be able to benefit from each other's cached return value. With this having been mentioned, the performance trade-off still makes concurrent use of memoized functions safe and highly recommended. The cache gets garbage-collected together with the memoized closure.
**Parameters:**
`maxCacheSize` - The maximum size the cache can grow to
**Returns:**
A new function forwarding to the original one while caching the results
### public [Closure](closure "Closure")<V> **memoizeBetween**(int protectedCacheSize, int maxCacheSize)
Creates a caching variant of the closure with automatic cache size adjustment and lower and upper limits on the cache size. Whenever the closure is called, the mapping between the parameters and the return value is preserved in cache making subsequent calls with the same arguments fast. This variant allows the garbage collector to release entries from the cache and at the same time allows the user to specify how many entries should be protected from the eventual gc-initiated eviction. Cached entries exceeding the specified preservation threshold are made available for eviction based on the LRU (Last Recently Used) strategy. Given the non-deterministic nature of garbage collector, the actual cache size may grow well beyond the protected size limits set by the user, if memory is plentiful. Also, this variant will never exceed in size the upper size limit. Once the upper size limit has been reached, the values in the cache start rotating using the LRU (Last Recently Used) strategy. The returned function can be safely used concurrently from multiple threads, however, the implementation values high average-scenario performance and so concurrent calls on the memoized function with identical argument values may not necessarily be able to benefit from each other's cached return value. Also the protectedCacheSize parameter might not be respected accurately in such scenarios for some periods of time. With this having been mentioned, the performance trade-off still makes concurrent use of memoized functions safe and highly recommended. The cache gets garbage-collected together with the memoized closure.
**Parameters:**
`protectedCacheSize` - Number of cached return values to protect from garbage collection
`maxCacheSize` - The maximum size the cache can grow to
**Returns:**
A new function forwarding to the original one while caching the results
### public [Closure](closure "Closure")<V> **ncurry**(int n, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") arguments)
Support for Closure currying at a given index. Parameters are supplied from index position "n". Typical usage:
```
def caseInsensitive = { a, b -> a.toLowerCase() <=> b.toLowerCase() } as Comparator
def caseSensitive = { a, b -> a <=> b } as Comparator
def animals1 = ['ant', 'dog', 'BEE']
def animals2 = animals1 + ['Cat']
// curry middle param of this utility method:
// Collections#binarySearch(List list, Object key, Comparator c)
def catSearcher = Collections.&binarySearch.ncurry(1, "cat")
[[animals1, animals2], [caseInsensitive, caseSensitive]].combinations().each{ a, c ->
def idx = catSearcher(a.sort(c), c)
print a.sort(c).toString().padRight(22)
if (idx < 0) println "Not found but would belong in position ${-idx - 1"}
else println "Found at index $idx"
}
// =>
// [ant, BEE, dog] Not found but would belong in position 2
// [ant, BEE, Cat, dog] Found at index 2
// [BEE, ant, dog] Not found but would belong in position 2
// [BEE, Cat, ant, dog] Not found but would belong in position 3
```
The position of the curried parameters will be calculated eagerly and implies all arguments prior to the specified n index are supplied. Default parameter values prior to the n index will not be available.
**Parameters:**
`n` - the index from which to bind parameters (may be -ve in which case it will be normalized)
`arguments` - the arguments to bind
**Returns:**
the new closure with its arguments bound
**See Also:**
[curry(Object...)](#curry(Object...))
### public [Closure](closure "Closure")<V> **ncurry**(int n, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") argument)
Support for Closure currying at a given index.
**Parameters:**
`argument` - the argument to bind
**Returns:**
the new closure with the argument bound
**See Also:**
[ncurry(int, Object...)](#ncurry(int,%20Object...))
### public [Closure](closure "Closure")<V> **rcurry**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") arguments)
Support for Closure "right" currying. Parameters are supplied on the right rather than left as per the normal curry() method. Typical usage:
```
def divide = { a, b -> a / b }
def halver = divide.rcurry(2)
assert halver(8) == 4
```
The position of the curried parameters will be calculated lazily, for example, if two overloaded doCall methods are available, the supplied arguments plus the curried arguments will be concatenated and the result used for method selection.
**Parameters:**
`arguments` - the arguments to bind
**Returns:**
the new closure with its arguments bound
**See Also:**
[curry(Object...)](#curry(Object...))
### public [Closure](closure "Closure")<V> **rcurry**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") argument)
Support for Closure "right" currying.
**Parameters:**
`argument` - the argument to bind
**Returns:**
the new closure with the argument bound
**See Also:**
[rcurry(Object...)](#rcurry(Object...))
### @[SuppressWarnings](https://docs.oracle.com/javase/8/docs/api/java/lang/SuppressWarnings.html "SuppressWarnings")("unchecked") public [Closure](closure "Closure")<V> **rehydrate**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") delegate, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") owner, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") thisObject)
Returns a copy of this closure for which the delegate, owner and thisObject are replaced with the supplied parameters. Use this when you want to rehydrate a closure which has been made serializable thanks to the [dehydrate()](#dehydrate()) method.
**Parameters:**
`delegate` - the closure delegate
`owner` - the closure owner
`thisObject` - the closure "this" object
**Returns:**
a copy of this closure where owner, delegate and thisObject are replaced
**Since:**
1.8.5
### <W> public [Closure](closure "Closure")<W> **rightShift**([Closure](closure "Closure")<W> other)
Support for Closure forward composition.
Typical usage:
```
def times2 = { a -> a * 2 }
def add3 = { a -> a + 3 }
def timesThenAdd = times2 >> add3
// equivalent: timesThenAdd = { a -> add3(times2(a)) }
assert timesThenAdd(3) == 9
```
**Parameters:**
`other` - the Closure to compose with the current Closure
**Returns:**
the new composed Closure
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **run**()
### public void **setDelegate**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") delegate)
Allows the delegate to be changed such as when performing markup building
**Parameters:**
`delegate` - the new delegate
### public void **setDirective**(int directive)
**Parameters:**
`directive` - The directive to set.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
### public void **setResolveStrategy**(int resolveStrategy)
Sets the strategy which the closure uses to resolve property references and methods. The default is Closure.OWNER\_FIRST
**Parameters:**
`resolveStrategy` - The resolve strategy to set
**See Also:**
[Closure.DELEGATE\_FIRST](closure#DELEGATE_FIRST "Closure.DELEGATE_FIRST")
[Closure.DELEGATE\_ONLY](closure#DELEGATE_ONLY "Closure.DELEGATE_ONLY")
[Closure.OWNER\_FIRST](closure#OWNER_FIRST "Closure.OWNER_FIRST")
[Closure.OWNER\_ONLY](closure#OWNER_ONLY "Closure.OWNER_ONLY")
[Closure.TO\_SELF](closure#TO_SELF "Closure.TO_SELF")
### protected static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **throwRuntimeException**([Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") throwable)
### public [Closure](closure "Closure")<V> **trampoline**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
Builds a trampolined variant of the current closure. To prevent stack overflow due to deep recursion, functions can instead leverage the trampoline mechanism and avoid recursive calls altogether. Under trampoline, the function is supposed to perform one step of the calculation and, instead of a recursive call to itself or another function, it return back a new closure, which will be executed by the trampoline as the next step. Once a non-closure value is returned, the trampoline stops and returns the value as the final result. Here is an example:
```
def fact
fact = { n, total ->
n == 0 ? total : fact.trampoline(n - 1, n * total)
}.trampoline()
def factorial = { n -> fact(n, 1G)}
println factorial(20) // => 2432902008176640000
```
**Parameters:**
`args` - Parameters to the closure, so as the trampoline mechanism can call it
**Returns:**
A closure, which will execute the original closure on a trampoline.
### public [Closure](closure "Closure")<V> **trampoline**()
Builds a trampolined variant of the current closure. To prevent stack overflow due to deep recursion, functions can instead leverage the trampoline mechanism and avoid recursive calls altogether. Under trampoline, the function is supposed to perform one step of the calculation and, instead of a recursive call to itself or another function, it return back a new closure, which will be executed by the trampoline as the next step. Once a non-closure value is returned, the trampoline stops and returns the value as the final result.
**Returns:**
A closure, which will execute the original closure on a trampoline.
**See Also:**
[trampoline(Object...)](#trampoline(Object...))
| programming_docs |
groovy [Java] Annotation Type Newify [Java] Annotation Type Newify
=============================
* groovy.lang.Newify
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.NewifyASTTransformation")
public @interface Newify
```
Annotation that supports writing constructor call expressions without the 'new' keyword. Instead they can be written "Ruby-style" as a method call to a 'new' method or "Python-style" by just omitting the 'new' keyword.
WARNING: For the Python style with class-name-matching pattern, the pattern should be chosen as to avoid matching method names if possible. If following Java/Groovy naming conventions, class names (contrary to method names) start with an uppercase letter. In this case `pattern="[A-Z].*"` (see [Pattern](https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html "Pattern") for supported Java pattern syntax) is the recommended pattern to allow all classes to be created without requiring a new keyword. Using a pattern that also matches method names (e.g. ".+", ".\*" or "[a-zA-Z].\*") might negatively impact build performance, since the Groovy compiler will have to match every class in context against any potential constructor call.
@Newify allows you to write code snippets like this ("Python-style"):
```
@Newify([Tree,Leaf]) class MyTreeProcessor {
def myTree = Tree(Tree(Leaf("A"), Leaf("B")), Leaf("C"))
def process() { ... }
}
```
```
// Any class whose name matches pattern can be created without new
@Newify(pattern="[A-Z].*") class MyTreeProcessor {
final myTree = Tree(Tree(Leaf("A"), Leaf("B")), Leaf("C"))
final sb = StringBuilder("...")
def dir = File('.')
def root = XmlSlurper().parseText(File(dir, sb.toString()).text)
}
```
or this ("Ruby-style"):
```
@Newify class MyTreeProcessor {
def myTree = Tree.new(Tree.new(Leaf.new("A"), Leaf.new("B")), Leaf.new("C"))
def process() { ... }
}
```
After the AST transformation, the following code is passed on for further compilation:
```
class MyTreeProcessor {
def myTree = new Tree(new Tree(new Leaf("A"), new Leaf("B")), new Leaf("C"))
def process() { ... }
}
```
The annotation can be used on a whole class as shown above or selectively on a particular method, constructor or field. The "Ruby-style" new conversions occur automatically unless the 'auto=false' flag is given when using the annotation. You might do this if you create a new method using meta programming.
For the "Python-style" conversions you can either specify each class name on which you want them to apply, or supply a pattern to match class names against. The transformation then works by matching the basename of the provided classes to any similarly named instance method calls not specifically bound to an object, i.e. associated with the 'this' object. In other words `Leaf("A")` would be transformed to `new Leaf("A")` but `x.Leaf("A")` would not be touched.
An example showing how to use the annotation at different levels:
```
@Newify(auto=false, value=Foo)
class Main {
@Newify // turn auto on for field
def field1 = java.math.BigInteger.new(42)
def field2, field3, field4
@Newify(pattern="[A-z][A-Za-z0-9_]*") // Any class name that starts with an uppercase letter
def process() {
field2 = A(Bb(Ccc("my bar")))
}
@Newify(Baz)
Main() {
field3 = Foo("my foo")
field4 = Baz("my baz")
}
}
```
The annotation is intended to be used sparingly; perhaps in DSL scenarios or when using deeply nested structural types. In particular, there is no support for using the facility with two similarly named classes from different packages at the same time. Though it is OK to have different packages in different contexts. Also, there is no support for turning "Ruby-style" conversions off at the method, constructor or field level if already turned on at the class level. Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[auto](#auto)`
**Returns:**
if automatic conversion of "Ruby-style" new method calls should occur
**Default:**
true
|
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[pattern](#pattern)`
**Since:**
2.5.0
|
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?>[]**` | `[value](#value)`
**Returns:**
one or more classes where "Python-style" constructor notation will be supported
**Default:**
{}
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **auto**
**Returns:**
if automatic conversion of "Ruby-style" new method calls should occur
**Default:**
true
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **pattern**
**Since:**
2.5.0
**Returns:**
a regex pattern for class names where "Python-style" constructor notation will be supported
**Default:**
""
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?>[] **value**
**Returns:**
one or more classes where "Python-style" constructor notation will be supported
**Default:**
{}
groovy [Java] Class ExpandoMetaClassCreationHandle [Java] Class ExpandoMetaClassCreationHandle
===========================================
* groovy.lang.ExpandoMetaClassCreationHandle
```
public class ExpandoMetaClassCreationHandle
extends [MetaClassCreationHandle](metaclassregistry.metaclasscreationhandle)
```
A handle for the MetaClassRegistry that changes all classes loaded into the Grails VM to use ExpandoMetaClass instances
The handle should be registered with the Groovy runtime **before** Groovy loads, for example in your main method. `GroovySystem.metaClassRegistry.metaClassCreationHandle = new ExpandoMetaClassCreationHandle()`
**See Also:**
[MetaClassRegistry](metaclassregistry "MetaClassRegistry")
groovy.lang.MetaClassRegistry.MetaClassCreationHandle
[MetaClassRegistryImpl.setMetaClassCreationHandle](../../org/codehaus/groovy/runtime/metaclass/metaclassregistryimpl#setMetaClassCreationHandle(groovy.lang.MetaClassRegistry.MetaClassCreationHandle) "MetaClassRegistryImpl.setMetaClassCreationHandle")
**Since:**
1.5
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [ExpandoMetaClassCreationHandle](expandometaclasscreationhandle)**` | `[instance](#instance)` | |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `protected [MetaClass](metaclass)` | `**[createNormalMetaClass](#createNormalMetaClass(java.lang.Class,%20groovy.lang.MetaClassRegistry))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, [MetaClassRegistry](metaclassregistry) registry)` |
| | `public static void` | `**[disable](#disable())**()` |
| | `public static void` | `**[enable](#enable())**()` |
| | `public boolean` | `**[hasModifiedMetaClass](#hasModifiedMetaClass(groovy.lang.ExpandoMetaClass))**([ExpandoMetaClass](expandometaclass) emc)` |
| | `public void` | `**[registerModifiedMetaClass](#registerModifiedMetaClass(groovy.lang.ExpandoMetaClass))**([ExpandoMetaClass](expandometaclass) emc)`Registers a modified ExpandoMetaClass with the creation handle |
Field Detail
------------
### public static final [ExpandoMetaClassCreationHandle](expandometaclasscreationhandle) **instance**
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected [MetaClass](metaclass) **createNormalMetaClass**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, [MetaClassRegistry](metaclassregistry) registry)
### public static void **disable**()
### public static void **enable**()
Enables the ExpandoMetaClassCreationHandle with the registry `ExpandoMetaClassCreationHandle.enable();`
### public boolean **hasModifiedMetaClass**([ExpandoMetaClass](expandometaclass) emc)
### public void **registerModifiedMetaClass**([ExpandoMetaClass](expandometaclass) emc)
Registers a modified ExpandoMetaClass with the creation handle
**Parameters:**
`emc` - The EMC
groovy [Java] Class Tuple<E> [Java] Class Tuple<E>
=====================
* groovy.lang.Tuple
All Implemented Interfaces and Traits:
[Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html "Serializable"), [Cloneable](https://docs.oracle.com/javase/8/docs/api/java/lang/Cloneable.html "Cloneable"), [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")
```
public class Tuple<E>
extends [AbstractList](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html "AbstractList")
implements [Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html "Serializable"), [Cloneable](https://docs.oracle.com/javase/8/docs/api/java/lang/Cloneable.html "Cloneable"), [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")
```
Represents a list of Objects.
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Tuple](#Tuple(E))**(E contents)` |
| `**[Tuple](#Tuple(Tuple))**([Tuple](tuple "Tuple")<E> tuple)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Tuple](tuple "Tuple")<E>` | `**[clone](#clone())**()` |
| | `public int` | `**[compareTo](#compareTo(Tuple))**([Tuple](tuple "Tuple")<E> other)` |
| | `public boolean` | `**[equals](#equals(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)` |
| | `public E` | `**[get](#get(int))**(int index)` |
| | `public int` | `**[hashCode](#hashCode())**()` |
| | `public int` | `**[size](#size())**()` |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<E>` | `**[subList](#subList(int,%20int))**(int fromIndex, int toIndex)` |
| | `public [Tuple](tuple "Tuple")<E>` | `**[subTuple](#subTuple(int,%20int))**(int fromIndex, int toIndex)` |
| | `public E[]` | `**[toArray](#toArray())**()` |
| | `public static [Tuple0](tuple0)` | `**[tuple](#tuple())**()`Construct a tuple of degree 0. |
| `<T1>` | `public static [Tuple1](tuple1 "Tuple1")<T1>` | `**[tuple](#tuple(T1))**([T1](../../t1) v1)`Construct a tuple of degree 1. |
| `<T1, T2>` | `public static [Tuple2](tuple2 "Tuple2")<T1, T2>` | `**[tuple](#tuple(T1,%20T2))**([T1](../../t1) v1, [T2](../../t2) v2)`Construct a tuple of degree 2. |
| `<T1, T2, T3>` | `public static [Tuple3](tuple3 "Tuple3")<T1, T2, T3>` | `**[tuple](#tuple(T1,%20T2,%20T3))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3)`Construct a tuple of degree 3. |
| `<T1, T2, T3, T4>` | `public static [Tuple4](tuple4 "Tuple4")<T1, T2, T3, T4>` | `**[tuple](#tuple(T1,%20T2,%20T3,%20T4))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4)`Construct a tuple of degree 4. |
| `<T1, T2, T3, T4, T5>` | `public static [Tuple5](tuple5 "Tuple5")<T1, T2, T3, T4, T5>` | `**[tuple](#tuple(T1,%20T2,%20T3,%20T4,%20T5))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5)`Construct a tuple of degree 5. |
| `<T1, T2, T3, T4, T5, T6>` | `public static [Tuple6](tuple6 "Tuple6")<T1, T2, T3, T4, T5, T6>` | `**[tuple](#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6)`Construct a tuple of degree 6. |
| `<T1, T2, T3, T4, T5, T6, T7>` | `public static [Tuple7](tuple7 "Tuple7")<T1, T2, T3, T4, T5, T6, T7>` | `**[tuple](#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7)`Construct a tuple of degree 7. |
| `<T1, T2, T3, T4, T5, T6, T7, T8>` | `public static [Tuple8](tuple8 "Tuple8")<T1, T2, T3, T4, T5, T6, T7, T8>` | `**[tuple](#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8)`Construct a tuple of degree 8. |
| `<T1, T2, T3, T4, T5, T6, T7, T8, T9>` | `public static [Tuple9](tuple9 "Tuple9")<T1, T2, T3, T4, T5, T6, T7, T8, T9>` | `**[tuple](#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9)`Construct a tuple of degree 9. |
| `<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>` | `public static [Tuple10](tuple10 "Tuple10")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>` | `**[tuple](#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10)`Construct a tuple of degree 10. |
| `<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>` | `public static [Tuple11](tuple11 "Tuple11")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>` | `**[tuple](#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11)`Construct a tuple of degree 11. |
| `<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>` | `public static [Tuple12](tuple12 "Tuple12")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>` | `**[tuple](#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11, [T12](../../t12) v12)`Construct a tuple of degree 12. |
| `<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>` | `public static [Tuple13](tuple13 "Tuple13")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>` | `**[tuple](#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11, [T12](../../t12) v12, [T13](../../t13) v13)`Construct a tuple of degree 13. |
| `<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>` | `public static [Tuple14](tuple14 "Tuple14")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>` | `**[tuple](#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11, [T12](../../t12) v12, [T13](../../t13) v13, [T14](../../t14) v14)`Construct a tuple of degree 14. |
| `<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>` | `public static [Tuple15](tuple15 "Tuple15")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>` | `**[tuple](#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11, [T12](../../t12) v12, [T13](../../t13) v13, [T14](../../t14) v14, [T15](../../t15) v15)`Construct a tuple of degree 15. |
| `<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>` | `public static [Tuple16](tuple16 "Tuple16")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>` | `**[tuple](#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15,%20T16))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11, [T12](../../t12) v12, [T13](../../t13) v13, [T14](../../t14) v14, [T15](../../t15) v15, [T16](../../t16) v16)`Construct a tuple of degree 16. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [AbstractList](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html "AbstractList")` | `[add](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#add(int,%20java.lang.Object) "add"), [add](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#add(java.lang.Object) "add"), [remove](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#remove(int) "remove"), [get](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#get(int) "get"), [equals](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#equals(java.lang.Object) "equals"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#hashCode() "hashCode"), [indexOf](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#indexOf(java.lang.Object) "indexOf"), [clear](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#clear() "clear"), [lastIndexOf](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#lastIndexOf(java.lang.Object) "lastIndexOf"), [subList](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#subList(int,%20int) "subList"), [iterator](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#iterator() "iterator"), [addAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#addAll(int,%20java.util.Collection) "addAll"), [set](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#set(int,%20java.lang.Object) "set"), [listIterator](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#listIterator() "listIterator"), [listIterator](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#listIterator(int) "listIterator"), [remove](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#remove(java.lang.Object) "remove"), [toString](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#toString() "toString"), [isEmpty](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#isEmpty() "isEmpty"), [size](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#size() "size"), [toArray](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#toArray() "toArray"), [toArray](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#toArray(%5BLjava.lang.Object;) "toArray"), [contains](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#contains(java.lang.Object) "contains"), [addAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#addAll(java.util.Collection) "addAll"), [removeAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#removeAll(java.util.Collection) "removeAll"), [retainAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#retainAll(java.util.Collection) "retainAll"), [containsAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#containsAll(java.util.Collection) "containsAll"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#wait(long) "wait"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#notifyAll() "notifyAll"), [toArray](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#toArray(java.util.function.IntFunction) "toArray"), [stream](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#stream() "stream"), [spliterator](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#spliterator() "spliterator"), [removeIf](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#removeIf(java.util.function.Predicate) "removeIf"), [parallelStream](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#parallelStream() "parallelStream"), [forEach](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#forEach(java.util.function.Consumer) "forEach"), [replaceAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#replaceAll(java.util.function.UnaryOperator) "replaceAll"), [sort](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#sort(java.util.Comparator) "sort")` |
Constructor Detail
------------------
### @[SafeVarargs](https://docs.oracle.com/javase/8/docs/api/java/lang/SafeVarargs.html "SafeVarargs") public **Tuple**(E contents)
### public **Tuple**([Tuple](tuple "Tuple")<E> tuple)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Tuple](tuple "Tuple")<E> **clone**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **compareTo**([Tuple](tuple "Tuple")<E> other)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **equals**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public E **get**(int index)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **hashCode**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **size**()
### @[SuppressWarnings](https://docs.oracle.com/javase/8/docs/api/java/lang/SuppressWarnings.html "SuppressWarnings")("unchecked") @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<E> **subList**(int fromIndex, int toIndex)
### public [Tuple](tuple "Tuple")<E> **subTuple**(int fromIndex, int toIndex)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public E[] **toArray**()
### public static [Tuple0](tuple0) **tuple**()
Construct a tuple of degree 0.
### <T1> public static [Tuple1](tuple1 "Tuple1")<T1> **tuple**([T1](../../t1) v1)
Construct a tuple of degree 1.
### <T1, T2> public static [Tuple2](tuple2 "Tuple2")<T1, T2> **tuple**([T1](../../t1) v1, [T2](../../t2) v2)
Construct a tuple of degree 2.
### <T1, T2, T3> public static [Tuple3](tuple3 "Tuple3")<T1, T2, T3> **tuple**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3)
Construct a tuple of degree 3.
### <T1, T2, T3, T4> public static [Tuple4](tuple4 "Tuple4")<T1, T2, T3, T4> **tuple**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4)
Construct a tuple of degree 4.
### <T1, T2, T3, T4, T5> public static [Tuple5](tuple5 "Tuple5")<T1, T2, T3, T4, T5> **tuple**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5)
Construct a tuple of degree 5.
### <T1, T2, T3, T4, T5, T6> public static [Tuple6](tuple6 "Tuple6")<T1, T2, T3, T4, T5, T6> **tuple**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6)
Construct a tuple of degree 6.
### <T1, T2, T3, T4, T5, T6, T7> public static [Tuple7](tuple7 "Tuple7")<T1, T2, T3, T4, T5, T6, T7> **tuple**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7)
Construct a tuple of degree 7.
### <T1, T2, T3, T4, T5, T6, T7, T8> public static [Tuple8](tuple8 "Tuple8")<T1, T2, T3, T4, T5, T6, T7, T8> **tuple**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8)
Construct a tuple of degree 8.
### <T1, T2, T3, T4, T5, T6, T7, T8, T9> public static [Tuple9](tuple9 "Tuple9")<T1, T2, T3, T4, T5, T6, T7, T8, T9> **tuple**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9)
Construct a tuple of degree 9.
### <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> public static [Tuple10](tuple10 "Tuple10")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> **tuple**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10)
Construct a tuple of degree 10.
### <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> public static [Tuple11](tuple11 "Tuple11")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> **tuple**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11)
Construct a tuple of degree 11.
### <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> public static [Tuple12](tuple12 "Tuple12")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> **tuple**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11, [T12](../../t12) v12)
Construct a tuple of degree 12.
### <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> public static [Tuple13](tuple13 "Tuple13")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> **tuple**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11, [T12](../../t12) v12, [T13](../../t13) v13)
Construct a tuple of degree 13.
### <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> public static [Tuple14](tuple14 "Tuple14")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> **tuple**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11, [T12](../../t12) v12, [T13](../../t13) v13, [T14](../../t14) v14)
Construct a tuple of degree 14.
### <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> public static [Tuple15](tuple15 "Tuple15")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> **tuple**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11, [T12](../../t12) v12, [T13](../../t13) v13, [T14](../../t14) v14, [T15](../../t15) v15)
Construct a tuple of degree 15.
### <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> public static [Tuple16](tuple16 "Tuple16")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> **tuple**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11, [T12](../../t12) v12, [T13](../../t13) v13, [T14](../../t14) v14, [T15](../../t15) v15, [T16](../../t16) v16)
Construct a tuple of degree 16.
| programming_docs |
groovy [Java] Class GroovyCodeSource [Java] Class GroovyCodeSource
=============================
* groovy.lang.GroovyCodeSource
```
public class GroovyCodeSource
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
CodeSource wrapper class that allows specific security policies to be associated with a class compiled from groovy source.
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[GroovyCodeSource](#GroovyCodeSource(java.lang.String,%20java.lang.String,%20java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") script, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") codeBase)` |
| `**[GroovyCodeSource](#GroovyCodeSource(java.io.Reader,%20java.lang.String,%20java.lang.String))**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") codeBase)`Construct a GroovyCodeSource for an inputStream of groovyCode that has an unknown provenance -- meaning it didn't come from a File or a URL (e.g. a String). |
| `**[GroovyCodeSource](#GroovyCodeSource(java.io.File,%20java.lang.String))**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") infile, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") encoding)` |
| `**[GroovyCodeSource](#GroovyCodeSource(java.io.File))**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") infile)`
**Parameters:**
`infile` - the file to create a GroovyCodeSource for.
|
| `**[GroovyCodeSource](#GroovyCodeSource(java.net.URI))**([URI](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html "URI") uri)` |
| `**[GroovyCodeSource](#GroovyCodeSource(java.net.URL))**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public boolean` | `**[equals](#equals(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)` |
| | `public [CodeSource](https://docs.oracle.com/javase/8/docs/api/java/security/CodeSource.html "CodeSource")` | `**[getCodeSource](#getCodeSource())**()` |
| | `public [File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File")` | `**[getFile](#getFile())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getName](#getName())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getScriptText](#getScriptText())**()` |
| | `public [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL")` | `**[getURL](#getURL())**()` |
| | `public int` | `**[hashCode](#hashCode())**()` |
| | `public boolean` | `**[isCachable](#isCachable())**()` |
| | `public void` | `**[setCachable](#setCachable(boolean))**(boolean b)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **GroovyCodeSource**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") script, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") codeBase)
### public **GroovyCodeSource**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") codeBase)
Construct a GroovyCodeSource for an inputStream of groovyCode that has an unknown provenance -- meaning it didn't come from a File or a URL (e.g. a String). The supplied codeBase will be used to construct a File URL that should match up with a java Policy entry that determines the grants to be associated with the class that will be built from the InputStream.
The permission groovy.security.GroovyCodeSourcePermission will be used to determine if the given codeBase may be specified. That is, the current Policy set must have a GroovyCodeSourcePermission that implies the codeBase, or an exception will be thrown. This is to prevent callers from hijacking existing codeBase policy entries unless explicitly authorized by the user.
### public **GroovyCodeSource**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") infile, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") encoding)
### public **GroovyCodeSource**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") infile)
**throws:**
IOException if an issue arises opening and reading the file.
**Parameters:**
`infile` - the file to create a GroovyCodeSource for.
### public **GroovyCodeSource**([URI](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html "URI") uri)
### public **GroovyCodeSource**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **equals**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)
### public [CodeSource](https://docs.oracle.com/javase/8/docs/api/java/security/CodeSource.html "CodeSource") **getCodeSource**()
### public [File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") **getFile**()
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getName**()
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getScriptText**()
### public [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") **getURL**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **hashCode**()
### public boolean **isCachable**()
### public void **setCachable**(boolean b)
groovy [Java] Class MissingMethodException [Java] Class MissingMethodException
===================================
* groovy.lang.MissingMethodException
```
public class MissingMethodException
extends [GroovyRuntimeException](groovyruntimeexception)
```
An exception occurred if a dynamic method dispatch fails with an unknown method.
Note that the Missing\*Exception classes were named for consistency and to avoid conflicts with JDK exceptions of the same name.
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[MissingMethodException](#MissingMethodException(java.lang.String,%20Class,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") method, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> type, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)` |
| `**[MissingMethodException](#MissingMethodException(java.lang.String,%20Class,%20java.lang.Object,%20boolean))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") method, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> type, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments, boolean isStatic)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[]` | `**[getArguments](#getArguments())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getMessage](#getMessage())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getMethod](#getMethod())**()`
**Returns:**
the name of the method that could not be found
|
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?>` | `**[getType](#getType())**()`
**Returns:**
The type on which the method was attempted to be called
|
| | `public boolean` | `**[isStatic](#isStatic())**()`
**Returns:**
Whether the method was called in a static way, i.e. on a class rather than an object.
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyRuntimeException](groovyruntimeexception)` | `[getLocationText](groovyruntimeexception#getLocationText()), [getMessage](groovyruntimeexception#getMessage()), [getMessageWithoutLocationText](groovyruntimeexception#getMessageWithoutLocationText()), [getModule](groovyruntimeexception#getModule()), [getNode](groovyruntimeexception#getNode()), [setModule](groovyruntimeexception#setModule(org.codehaus.groovy.ast.ModuleNode))` |
Constructor Detail
------------------
### public **MissingMethodException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") method, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> type, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)
### public **MissingMethodException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") method, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> type, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments, boolean isStatic)
Method Detail
-------------
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] **getArguments**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getMessage**()
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getMethod**()
**Returns:**
the name of the method that could not be found
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> **getType**()
**Returns:**
The type on which the method was attempted to be called
### public boolean **isStatic**()
**Returns:**
Whether the method was called in a static way, i.e. on a class rather than an object.
groovy [Java] Interface MetaClass [Java] Interface MetaClass
==========================
* groovy.lang.MetaObjectProtocol
All Superinterfaces: [MetaObjectProtocol](metaobjectprotocol)
```
public interface MetaClass
extends [MetaObjectProtocol](metaobjectprotocol)
```
A MetaClass within Groovy defines the behaviour of any given Groovy or Java class. The MetaClass interface defines two parts. The client API, which is defined via the extend MetaObjectProtocol interface and the contract with the Groovy runtime system. In general the compiler and Groovy runtime engine interact with methods on this class whilst MetaClass clients interact with the method defined by the MetaObjectProtocol interface
**See Also:**
[MetaClassImpl](metaclassimpl "MetaClassImpl")
[MetaObjectProtocol](metaobjectprotocol "MetaObjectProtocol")
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getAttribute](#getAttribute(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20boolean))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") receiver, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") messageName, boolean useSuper)`Retrieves the value of an attribute (field). |
| | `public [ClassNode](../../org/codehaus/groovy/ast/classnode)` | `**[getClassNode](#getClassNode())**()`Obtains a reference to the original AST for the MetaClass if it is available at runtime |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaMethod](metamethod "MetaMethod")>` | `**[getMetaMethods](#getMetaMethods())**()`Retrieves a list of MetaMethods held by this class. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaMethod](metamethod "MetaMethod")>` | `**[getMethods](#getMethods())**()`Retrieves a list of MetaMethods held by the class. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaProperty](metaproperty "MetaProperty")>` | `**[getProperties](#getProperties())**()`Retrieves a list of MetaProperty instances that the MetaClass has |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20boolean,%20boolean))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") receiver, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, boolean isCallToSuper, boolean fromInsideClass)` |
| | `public void` | `**[initialize](#initialize())**()`Complete the initialisation process. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20java.lang.Object,%20boolean,%20boolean))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") receiver, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments, boolean isCallToSuper, boolean fromInsideClass)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMissingMethod](#invokeMissingMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") instance, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMissingProperty](#invokeMissingProperty(java.lang.Object,%20java.lang.String,%20java.lang.Object,%20boolean))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") instance, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") optionalValue, boolean isGetter)`Invokes the propertyMissing method otherwise throws a MissingPropertyException |
| | `public [MetaMethod](metamethod)` | `**[pickMethod](#pickMethod(java.lang.String,%20java.lang.Class))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] arguments)`Selects a method by name and argument classes. |
| | `public int` | `**[selectConstructorAndTransformArguments](#selectConstructorAndTransformArguments(int,%20java.lang.Object))**(int numberOfConstructors, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)`Internal method to support Groovy runtime. |
| | `public void` | `**[setAttribute](#setAttribute(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20java.lang.Object,%20boolean,%20boolean))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") receiver, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") messageName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") messageValue, boolean useSuper, boolean fromInsideClass)`Sets the value of an attribute (field). |
| | `public void` | `**[setProperty](#setProperty(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20java.lang.Object,%20boolean,%20boolean))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") receiver, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value, boolean isCallToSuper, boolean fromInsideClass)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `interface [MetaObjectProtocol](metaobjectprotocol)` | `[getAttribute](metaobjectprotocol#getAttribute(java.lang.Object,%20java.lang.String)), [getMetaMethod](metaobjectprotocol#getMetaMethod(java.lang.String,%20java.lang.Object)), [getMetaProperty](metaobjectprotocol#getMetaProperty(java.lang.String)), [getMethods](metaobjectprotocol#getMethods()), [getProperties](metaobjectprotocol#getProperties()), [getProperty](metaobjectprotocol#getProperty(java.lang.Object,%20java.lang.String)), [getStaticMetaMethod](metaobjectprotocol#getStaticMetaMethod(java.lang.String,%20java.lang.Object)), [getTheClass](metaobjectprotocol#getTheClass()), [hasProperty](metaobjectprotocol#hasProperty(java.lang.Object,%20java.lang.String)), [invokeConstructor](metaobjectprotocol#invokeConstructor(java.lang.Object)), [invokeMethod](metaobjectprotocol#invokeMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [invokeMethod](metaobjectprotocol#invokeMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [invokeStaticMethod](metaobjectprotocol#invokeStaticMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [respondsTo](metaobjectprotocol#respondsTo(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [respondsTo](metaobjectprotocol#respondsTo(java.lang.Object,%20java.lang.String)), [setAttribute](metaobjectprotocol#setAttribute(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [setProperty](metaobjectprotocol#setProperty(java.lang.Object,%20java.lang.String,%20java.lang.Object))` |
Method Detail
-------------
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getAttribute**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") receiver, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") messageName, boolean useSuper)
Retrieves the value of an attribute (field). This method is to support the Groovy runtime and not for general client API usage.
**Parameters:**
`sender` - The class of the object that requested the attribute
`receiver` - The instance
`messageName` - The name of the attribute
`useSuper` - Whether to look-up on the super class or not
**Returns:**
The attribute value
### public [ClassNode](../../org/codehaus/groovy/ast/classnode) **getClassNode**()
Obtains a reference to the original AST for the MetaClass if it is available at runtime
**Returns:**
The original AST or null if it cannot be returned
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaMethod](metamethod "MetaMethod")> **getMetaMethods**()
Retrieves a list of MetaMethods held by this class. This list includes MetaMethods added by groovy.lang.ExpandoMetaClass.
**Returns:**
A list of MetaMethods
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaMethod](metamethod "MetaMethod")> **getMethods**()
Retrieves a list of MetaMethods held by the class. This list does not include MetaMethods added by groovy.lang.ExpandoMetaClass.
**Returns:**
A list of MetaMethods
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaProperty](metaproperty "MetaProperty")> **getProperties**()
Retrieves a list of MetaProperty instances that the MetaClass has
**See Also:**
[MetaProperty](metaproperty "MetaProperty")
**Returns:**
A list of MetaProperty instances
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") receiver, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, boolean isCallToSuper, boolean fromInsideClass)
Retrieves a property on the given receiver for the specified arguments. The sender is the class that is requesting the property from the object. The MetaClass will attempt to establish the method to invoke based on the name and arguments provided.
The isCallToSuper and fromInsideClass help the Groovy runtime perform optimisations on the call to go directly to the super class if necessary
**Parameters:**
`sender` - The java.lang.Class instance that requested the property
`receiver` - The Object which the property is being retrieved from
`property` - The name of the property
`isCallToSuper` - Whether the call is to a super class property
`fromInsideClass` - ??
**Returns:**
The properties value
### public void **initialize**()
Complete the initialisation process. After this method is called no methods should be added to the meta class. Invocation of methods or access to fields/properties is forbidden unless this method is called. This method should contain any initialisation code, taking a longer time to complete. An example is the creation of the Reflector. It is suggested to synchronize this method.
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") receiver, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments, boolean isCallToSuper, boolean fromInsideClass)
Invokes a method on the given receiver for the specified arguments. The sender is the class that invoked the method on the object. The MetaClass will attempt to establish the method to invoke based on the name and arguments provided.
The isCallToSuper and fromInsideClass help the Groovy runtime perform optimisations on the call to go directly to the super class if necessary
**Parameters:**
`sender` - The java.lang.Class instance that invoked the method
`receiver` - The object which the method was invoked on
`methodName` - The name of the method
`arguments` - The arguments to the method
`isCallToSuper` - Whether the method is a call to a super class method
`fromInsideClass` - Whether the call was invoked from the inside or the outside of the class
**Returns:**
The return value of the method
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMissingMethod**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") instance, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)
Attempts to invoke the methodMissing method otherwise throws a MissingMethodException
**See Also:**
[MissingMethodException](missingmethodexception "MissingMethodException")
**Parameters:**
`instance` - The instance to invoke methodMissing on
`methodName` - The name of the method
`arguments` - The arguments to the method
**Returns:**
The results of methodMissing or throws MissingMethodException
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMissingProperty**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") instance, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") optionalValue, boolean isGetter)
Invokes the propertyMissing method otherwise throws a MissingPropertyException
**Parameters:**
`instance` - The instance of the class
`propertyName` - The name of the property
`optionalValue` - The value of the property which could be null in the case of a getter
`isGetter` - Whether the missing property event was the result of a getter or a setter
**Returns:**
The result of the propertyMissing method or throws MissingPropertyException
### public [MetaMethod](metamethod) **pickMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] arguments)
Selects a method by name and argument classes. This method does not search for an exact match, it searches for a compatible method. For this the method selection mechanism is used as provided by the implementation of this MetaClass. pickMethod may or may not be used during the method selection process when invoking a method. There is no warranty for that.
**throws:**
GroovyRuntimeException if there is more than one matching method
**Returns:**
a matching MetaMethod or null
**Parameters:**
`methodName` - the name of the method to pick
`arguments` - the method arguments
### public int **selectConstructorAndTransformArguments**(int numberOfConstructors, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)
Internal method to support Groovy runtime. Not for client usage.
**Parameters:**
`numberOfConstructors` - The number of constructors
`arguments` - The arguments
**Returns:**
selected index
### public void **setAttribute**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") receiver, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") messageName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") messageValue, boolean useSuper, boolean fromInsideClass)
Sets the value of an attribute (field). This method is to support the Groovy runtime and not for general client API usage.
**Parameters:**
`sender` - The class of the object that requested the attribute
`receiver` - The instance
`messageName` - The name of the attribute
`messageValue` - The value of the attribute
`useSuper` - Whether to look-up on the super class or not
`fromInsideClass` - Whether the call happened from the inside or the outside of a class
### public void **setProperty**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") receiver, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value, boolean isCallToSuper, boolean fromInsideClass)
Sets a property on the given receiver for the specified arguments. The sender is the class that is setting the property from the object. The MetaClass will attempt to establish the method to invoke based on the name and arguments provided.
The isCallToSuper and fromInsideClass help the Groovy runtime perform optimisations on the call to go directly to the super class if necessary
**Parameters:**
`sender` - The java.lang.Class instance that is mutating the property
`receiver` - The Object which the property is being set on
`property` - The name of the property
`value` - The new value of the property to set
`isCallToSuper` - Whether the call is to a super class property
`fromInsideClass` - Whether the call was invoked from the inside or the outside of the class
| programming_docs |
groovy [Java] Class MetaClassImpl [Java] Class MetaClassImpl
==========================
* groovy.lang.MetaClassImpl
All Implemented Interfaces and Traits:
[MetaClass](metaclass), [MutableMetaClass](mutablemetaclass)
```
public class MetaClassImpl
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [MetaClass](metaclass), [MutableMetaClass](mutablemetaclass)
```
Allows methods to be dynamically added to existing classes at runtime
**See Also:**
[MetaClass](metaclass "MetaClass")
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[]**` | `[EMPTY\_ARGUMENTS](#EMPTY_ARGUMENTS)` | |
| `**protected static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[INVOKE\_METHOD\_METHOD](#INVOKE_METHOD_METHOD)` | |
| `**protected static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[METHOD\_MISSING](#METHOD_MISSING)` | |
| `**protected static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[PROPERTY\_MISSING](#PROPERTY_MISSING)` | |
| `**protected static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[STATIC\_METHOD\_MISSING](#STATIC_METHOD_MISSING)` | |
| `**protected static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[STATIC\_PROPERTY\_MISSING](#STATIC_PROPERTY_MISSING)` | |
| `**protected [MetaMethod](metamethod)**` | `[getPropertyMethod](#getPropertyMethod)` | |
| `**protected [MetaMethod](metamethod)**` | `[invokeMethodMethod](#invokeMethodMethod)` | |
| `**protected boolean**` | `[isGroovyObject](#isGroovyObject)` | |
| `**protected boolean**` | `[isMap](#isMap)` | |
| `**protected [MetaMethodIndex](../../org/codehaus/groovy/runtime/metaclass/metamethodindex)**` | `[metaMethodIndex](#metaMethodIndex)` | |
| `**protected [MetaClassRegistry](metaclassregistry)**` | `[registry](#registry)` | |
| `**protected [MetaMethod](metamethod)**` | `[setPropertyMethod](#setPropertyMethod)` | |
| `**protected [CachedClass](../../org/codehaus/groovy/reflection/cachedclass)**` | `[theCachedClass](#theCachedClass)` | |
| `**protected [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")**` | `[theClass](#theClass)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[MetaClassImpl](#MetaClassImpl(java.lang.Class,%20groovy.lang.MetaMethod))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, [MetaMethod](metamethod)[] add)`Constructor |
| `**[MetaClassImpl](#MetaClassImpl(java.lang.Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass)`Constructor that sets the methods to null |
| `**[MetaClassImpl](#MetaClassImpl(groovy.lang.MetaClassRegistry,%20java.lang.Class,%20groovy.lang.MetaMethod))**([MetaClassRegistry](metaclassregistry) registry, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, [MetaMethod](metamethod)[] add)`Constructor with registry |
| `**[MetaClassImpl](#MetaClassImpl(groovy.lang.MetaClassRegistry,%20java.lang.Class))**([MetaClassRegistry](metaclassregistry) registry, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass)`Constructor with registry setting methods to null |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [MetaMethod](metamethod)` | `**[getMetaMethod](#getMetaMethod(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] argTypes)`
**See Also:**
[MetaObjectProtocol.getMetaMethod](metaobjectprotocol#getMetaMethod(java.lang.String,%20java.lang.Object) "MetaObjectProtocol.getMetaMethod")
|
| | `public [MetaProperty](metaproperty)` | `**[getMetaProperty](#getMetaProperty(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)`
**See Also:**
[MetaObjectProtocol.getMetaProperty](metaobjectprotocol#getMetaProperty(java.lang.String) "MetaObjectProtocol.getMetaProperty")
|
| | `public [MetaClassRegistry](metaclassregistry)` | `**[getRegistry](#getRegistry())**()`Returns the registry for this metaclass |
| | `public [MetaMethod](metamethod)` | `**[getStaticMetaMethod](#getStaticMetaMethod(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] argTypes)`
**See Also:**
[MetaObjectProtocol.getStaticMetaMethod](metaobjectprotocol#getStaticMetaMethod(java.lang.String,%20java.lang.Object) "MetaObjectProtocol.getStaticMetaMethod")
|
| | `protected [LinkedList](https://docs.oracle.com/javase/8/docs/api/java/util/LinkedList.html "LinkedList")<[CachedClass](../../org/codehaus/groovy/reflection/cachedclass "CachedClass")>` | `**[getSuperClasses](#getSuperClasses())**()` |
| | `public final [CachedClass](../../org/codehaus/groovy/reflection/cachedclass)` | `**[getTheCachedClass](#getTheCachedClass())**()`Returns the cached class for this metaclass |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[getTheClass](#getTheClass())**()`Returns the class this object this is the metaclass of. |
| | `public [MetaProperty](metaproperty)` | `**[hasProperty](#hasProperty(java.lang.Object,%20java.lang.String))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)`
**See Also:**
[MetaObjectProtocol.hasProperty](metaobjectprotocol#hasProperty(java.lang.Object,%20java.lang.String) "MetaObjectProtocol.hasProperty")
|
| | `public boolean` | `**[isGroovyObject](#isGroovyObject())**()`Return whether the class represented by this metaclass instance is an instance of the GroovyObject class |
| | `public void` | `**[methodNameAction](#methodNameAction(Class,%20org.codehaus.groovy.runtime.metaclass.MetaMethodIndex.Entry))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> clazz, [Entry](../../org/codehaus/groovy/runtime/metaclass/metamethodindex.entry) e)` |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")` | `**[respondsTo](#respondsTo(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] argTypes)`
**See Also:**
[MetaObjectProtocol.respondsTo](metaobjectprotocol#respondsTo(java.lang.Object,%20java.lang.String,%20java.lang.Object) "MetaObjectProtocol.respondsTo")
|
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")` | `**[respondsTo](#respondsTo(java.lang.Object,%20java.lang.String))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)`
**See Also:**
[MetaObjectProtocol.respondsTo](metaobjectprotocol#respondsTo(java.lang.Object,%20java.lang.String) "MetaObjectProtocol.respondsTo")
|
| | `public boolean` | `**[skipClass](#skipClass(Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> clazz)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### public static final [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] **EMPTY\_ARGUMENTS**
### protected static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **INVOKE\_METHOD\_METHOD**
### protected static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **METHOD\_MISSING**
### protected static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **PROPERTY\_MISSING**
### protected static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **STATIC\_METHOD\_MISSING**
### protected static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **STATIC\_PROPERTY\_MISSING**
### protected [MetaMethod](metamethod) **getPropertyMethod**
### protected [MetaMethod](metamethod) **invokeMethodMethod**
### protected final boolean **isGroovyObject**
### protected final boolean **isMap**
### protected final [MetaMethodIndex](../../org/codehaus/groovy/runtime/metaclass/metamethodindex) **metaMethodIndex**
### protected [MetaClassRegistry](metaclassregistry) **registry**
### protected [MetaMethod](metamethod) **setPropertyMethod**
### protected final [CachedClass](../../org/codehaus/groovy/reflection/cachedclass) **theCachedClass**
### protected final [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **theClass**
Constructor Detail
------------------
### public **MetaClassImpl**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, [MetaMethod](metamethod)[] add)
Constructor
**Parameters:**
`theClass` - The class this is the metaclass dor
`add` - The methods for this class
### public **MetaClassImpl**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass)
Constructor that sets the methods to null
**Parameters:**
`theClass` - The class this is the metaclass dor
### public **MetaClassImpl**([MetaClassRegistry](metaclassregistry) registry, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, [MetaMethod](metamethod)[] add)
Constructor with registry
**Parameters:**
`registry` - The metaclass registry for this MetaClass
`theClass` - The class
`add` - The methods
### public **MetaClassImpl**([MetaClassRegistry](metaclassregistry) registry, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass)
Constructor with registry setting methods to null
**Parameters:**
`registry` - The metaclass registry for this MetaClass
`theClass` - The class
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [MetaMethod](metamethod) **getMetaMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] argTypes)
**See Also:**
[MetaObjectProtocol.getMetaMethod](metaobjectprotocol#getMetaMethod(java.lang.String,%20java.lang.Object) "MetaObjectProtocol.getMetaMethod")
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [MetaProperty](metaproperty) **getMetaProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
**See Also:**
[MetaObjectProtocol.getMetaProperty](metaobjectprotocol#getMetaProperty(java.lang.String) "MetaObjectProtocol.getMetaProperty")
### public [MetaClassRegistry](metaclassregistry) **getRegistry**()
Returns the registry for this metaclass
**Returns:**
The resgistry
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [MetaMethod](metamethod) **getStaticMetaMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] argTypes)
**See Also:**
[MetaObjectProtocol.getStaticMetaMethod](metaobjectprotocol#getStaticMetaMethod(java.lang.String,%20java.lang.Object) "MetaObjectProtocol.getStaticMetaMethod")
### protected [LinkedList](https://docs.oracle.com/javase/8/docs/api/java/util/LinkedList.html "LinkedList")<[CachedClass](../../org/codehaus/groovy/reflection/cachedclass "CachedClass")> **getSuperClasses**()
### public final [CachedClass](../../org/codehaus/groovy/reflection/cachedclass) **getTheCachedClass**()
Returns the cached class for this metaclass
**Returns:**
The cached class.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **getTheClass**()
Returns the class this object this is the metaclass of.
**Returns:**
The class contained by this metaclass
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [MetaProperty](metaproperty) **hasProperty**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
**See Also:**
[MetaObjectProtocol.hasProperty](metaobjectprotocol#hasProperty(java.lang.Object,%20java.lang.String) "MetaObjectProtocol.hasProperty")
### public boolean **isGroovyObject**()
Return whether the class represented by this metaclass instance is an instance of the GroovyObject class
**Returns:**
true if this is a groovy class, false otherwise.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **methodNameAction**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> clazz, [Entry](../../org/codehaus/groovy/runtime/metaclass/metamethodindex.entry) e)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") **respondsTo**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] argTypes)
**See Also:**
[MetaObjectProtocol.respondsTo](metaobjectprotocol#respondsTo(java.lang.Object,%20java.lang.String,%20java.lang.Object) "MetaObjectProtocol.respondsTo")
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") **respondsTo**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
**See Also:**
[MetaObjectProtocol.respondsTo](metaobjectprotocol#respondsTo(java.lang.Object,%20java.lang.String) "MetaObjectProtocol.respondsTo")
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **skipClass**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> clazz)
groovy [Java] Class NamedValue<T> [Java] Class NamedValue<T>
==========================
* groovy.lang.NamedValue
All Implemented Interfaces and Traits: [Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html "Serializable")
```
@[Incubating](../../org/apache/groovy/lang/annotation/incubating "Incubating")
public class NamedValue<T>
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html "Serializable")
```
Represents a value with name
**Type Parameters:**
`T` - the value type
**Since:**
4.0.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[NamedValue](#NamedValue(java.lang.String,%20T))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, T val)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public boolean` | `**[equals](#equals(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getName](#getName())**()` |
| | `public T` | `**[getVal](#getVal())**()` |
| | `public int` | `**[hashCode](#hashCode())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString(Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> options)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **NamedValue**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, T val)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **equals**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getName**()
### public T **getVal**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **hashCode**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> options)
| programming_docs |
groovy [Java] Class Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> [Java] Class Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>
=============================================================
* groovy.lang.Tuple10
```
public final class Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>
extends [Tuple](tuple)
```
Represents a list of 10 typed Objects.
**Since:**
3.0.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Tuple10](#Tuple10(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10)` |
| `**[Tuple10](#Tuple10(Tuple10))**([Tuple10](tuple10 "Tuple10")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> tuple)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Tuple10](tuple10 "Tuple10")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>` | `**[clone](#clone())**()` |
| | `public [T1](../../t1)` | `**[getV1](#getV1())**()` |
| | `public [T10](../../t10)` | `**[getV10](#getV10())**()` |
| | `public [T2](../../t2)` | `**[getV2](#getV2())**()` |
| | `public [T3](../../t3)` | `**[getV3](#getV3())**()` |
| | `public [T4](../../t4)` | `**[getV4](#getV4())**()` |
| | `public [T5](../../t5)` | `**[getV5](#getV5())**()` |
| | `public [T6](../../t6)` | `**[getV6](#getV6())**()` |
| | `public [T7](../../t7)` | `**[getV7](#getV7())**()` |
| | `public [T8](../../t8)` | `**[getV8](#getV8())**()` |
| | `public [T9](../../t9)` | `**[getV9](#getV9())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Tuple](tuple)` | `[clone](tuple#clone()), [compareTo](tuple#compareTo(Tuple)), [equals](tuple#equals(java.lang.Object)), [get](tuple#get(int)), [hashCode](tuple#hashCode()), [size](tuple#size()), [subList](tuple#subList(int,%20int)), [subTuple](tuple#subTuple(int,%20int)), [toArray](tuple#toArray()), [tuple](tuple#tuple()), [tuple](tuple#tuple(T1)), [tuple](tuple#tuple(T1,%20T2)), [tuple](tuple#tuple(T1,%20T2,%20T3)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15,%20T16))` |
Constructor Detail
------------------
### public **Tuple10**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10)
### public **Tuple10**([Tuple10](tuple10 "Tuple10")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> tuple)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Tuple10](tuple10 "Tuple10")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> **clone**()
### public [T1](../../t1) **getV1**()
### public [T10](../../t10) **getV10**()
### public [T2](../../t2) **getV2**()
### public [T3](../../t3) **getV3**()
### public [T4](../../t4) **getV4**()
### public [T5](../../t5) **getV5**()
### public [T6](../../t6) **getV6**()
### public [T7](../../t7) **getV7**()
### public [T8](../../t8) **getV8**()
### public [T9](../../t9) **getV9**()
groovy [Java] Class Tuple6<T1, T2, T3, T4, T5, T6> [Java] Class Tuple6<T1, T2, T3, T4, T5, T6>
===========================================
* groovy.lang.Tuple6
```
public final class Tuple6<T1, T2, T3, T4, T5, T6>
extends [Tuple](tuple)
```
Represents a list of 6 typed Objects.
**Since:**
2.5.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Tuple6](#Tuple6(T1,%20T2,%20T3,%20T4,%20T5,%20T6))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6)` |
| `**[Tuple6](#Tuple6(Tuple6))**([Tuple6](tuple6 "Tuple6")<T1, T2, T3, T4, T5, T6> tuple)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Tuple6](tuple6 "Tuple6")<T1, T2, T3, T4, T5, T6>` | `**[clone](#clone())**()` |
| | `public [T5](../../t5)` | `**[getFifth](#getFifth())**()` |
| | `public [T1](../../t1)` | `**[getFirst](#getFirst())**()` |
| | `public [T4](../../t4)` | `**[getFourth](#getFourth())**()` |
| | `public [T2](../../t2)` | `**[getSecond](#getSecond())**()` |
| | `public [T6](../../t6)` | `**[getSixth](#getSixth())**()` |
| | `public [T3](../../t3)` | `**[getThird](#getThird())**()` |
| | `public [T1](../../t1)` | `**[getV1](#getV1())**()` |
| | `public [T2](../../t2)` | `**[getV2](#getV2())**()` |
| | `public [T3](../../t3)` | `**[getV3](#getV3())**()` |
| | `public [T4](../../t4)` | `**[getV4](#getV4())**()` |
| | `public [T5](../../t5)` | `**[getV5](#getV5())**()` |
| | `public [T6](../../t6)` | `**[getV6](#getV6())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Tuple](tuple)` | `[clone](tuple#clone()), [compareTo](tuple#compareTo(Tuple)), [equals](tuple#equals(java.lang.Object)), [get](tuple#get(int)), [hashCode](tuple#hashCode()), [size](tuple#size()), [subList](tuple#subList(int,%20int)), [subTuple](tuple#subTuple(int,%20int)), [toArray](tuple#toArray()), [tuple](tuple#tuple()), [tuple](tuple#tuple(T1)), [tuple](tuple#tuple(T1,%20T2)), [tuple](tuple#tuple(T1,%20T2,%20T3)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15,%20T16))` |
Constructor Detail
------------------
### public **Tuple6**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6)
### public **Tuple6**([Tuple6](tuple6 "Tuple6")<T1, T2, T3, T4, T5, T6> tuple)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Tuple6](tuple6 "Tuple6")<T1, T2, T3, T4, T5, T6> **clone**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T5](../../t5) **getFifth**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T1](../../t1) **getFirst**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T4](../../t4) **getFourth**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T2](../../t2) **getSecond**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T6](../../t6) **getSixth**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T3](../../t3) **getThird**()
### public [T1](../../t1) **getV1**()
### public [T2](../../t2) **getV2**()
### public [T3](../../t3) **getV3**()
### public [T4](../../t4) **getV4**()
### public [T5](../../t5) **getV5**()
### public [T6](../../t6) **getV6**()
groovy [Java] Class GroovyShell [Java] Class GroovyShell
========================
* groovy.lang.GroovyShell
```
public class GroovyShell
extends [GroovyObjectSupport](groovyobjectsupport)
```
Represents a groovy shell capable of running arbitrary groovy scripts
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[DEFAULT\_CODE\_BASE](#DEFAULT_CODE_BASE)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[GroovyShell](#GroovyShell())**()` |
| `**[GroovyShell](#GroovyShell(groovy.lang.Binding))**([Binding](binding) binding)` |
| `**[GroovyShell](#GroovyShell(java.lang.ClassLoader,%20org.codehaus.groovy.control.CompilerConfiguration))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parent, [CompilerConfiguration](../../org/codehaus/groovy/control/compilerconfiguration) config)` |
| `**[GroovyShell](#GroovyShell(org.codehaus.groovy.control.CompilerConfiguration))**([CompilerConfiguration](../../org/codehaus/groovy/control/compilerconfiguration) config)` |
| `**[GroovyShell](#GroovyShell(groovy.lang.Binding,%20org.codehaus.groovy.control.CompilerConfiguration))**([Binding](binding) binding, [CompilerConfiguration](../../org/codehaus/groovy/control/compilerconfiguration) config)` |
| `**[GroovyShell](#GroovyShell(java.lang.ClassLoader,%20groovy.lang.Binding))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parent, [Binding](binding) binding)` |
| `**[GroovyShell](#GroovyShell(java.lang.ClassLoader))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parent)` |
| `**[GroovyShell](#GroovyShell(java.lang.ClassLoader,%20groovy.lang.Binding,%20org.codehaus.groovy.control.CompilerConfiguration))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parent, [Binding](binding) binding, [CompilerConfiguration](../../org/codehaus/groovy/control/compilerconfiguration) config)` |
| `**[GroovyShell](#GroovyShell(groovy.lang.GroovyShell))**([GroovyShell](groovyshell) shell)`Creates a child shell using a new ClassLoader which uses the parent shell's class loader as its parent |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [GroovyClassLoader](groovyclassloader)` | `**[getClassLoader](#getClassLoader())**()` |
| | `public [Binding](binding)` | `**[getContext](#getContext())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)` |
| | `public static void` | `**[main](#main(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)` |
| | `public void` | `**[resetLoadedClasses](#resetLoadedClasses())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[run](#run(java.io.File,%20List))**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") scriptFile, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> list)`A helper method which runs the given script file with the given command line arguments |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[run](#run(java.lang.String,%20java.lang.String,%20List))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") scriptText, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") fileName, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> list)`A helper method which runs the given cl script with the given command line arguments |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[run](#run(java.io.File,%20java.lang.String))**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") scriptFile, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)`Runs the given script file name with the given command line arguments |
| | `public void` | `**[setProperty](#setProperty(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyObjectSupport](groovyobjectsupport)` | `[getMetaClass](groovyobjectsupport#getMetaClass()), [setMetaClass](groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Field Detail
------------
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **DEFAULT\_CODE\_BASE**
Constructor Detail
------------------
### public **GroovyShell**()
### public **GroovyShell**([Binding](binding) binding)
### public **GroovyShell**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parent, [CompilerConfiguration](../../org/codehaus/groovy/control/compilerconfiguration) config)
### public **GroovyShell**([CompilerConfiguration](../../org/codehaus/groovy/control/compilerconfiguration) config)
### public **GroovyShell**([Binding](binding) binding, [CompilerConfiguration](../../org/codehaus/groovy/control/compilerconfiguration) config)
### public **GroovyShell**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parent, [Binding](binding) binding)
### public **GroovyShell**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parent)
### public **GroovyShell**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parent, [Binding](binding) binding, [CompilerConfiguration](../../org/codehaus/groovy/control/compilerconfiguration) config)
### public **GroovyShell**([GroovyShell](groovyshell) shell)
Creates a child shell using a new ClassLoader which uses the parent shell's class loader as its parent
**Parameters:**
`shell` - is the parent shell used for the variable bindings and the parent class loader
Method Detail
-------------
### public [GroovyClassLoader](groovyclassloader) **getClassLoader**()
### public [Binding](binding) **getContext**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)
### public static void **main**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)
### public void **resetLoadedClasses**()
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **run**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") scriptFile, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> list)
A helper method which runs the given script file with the given command line arguments
**Parameters:**
`scriptFile` - the file of the script to run
`list` - the command line arguments to pass in
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **run**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") scriptText, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") fileName, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> list)
A helper method which runs the given cl script with the given command line arguments
**Parameters:**
`scriptText` - is the text content of the script
`fileName` - is the logical file name of the script (which is used to create the class name of the script)
`list` - the command line arguments to pass in
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **run**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") scriptFile, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)
Runs the given script file name with the given command line arguments
**Parameters:**
`scriptFile` - the file name of the script to run
`args` - the command line arguments to pass in
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
groovy [Java] Class SpreadMapEvaluatingException [Java] Class SpreadMapEvaluatingException
=========================================
* groovy.lang.SpreadMapEvaluatingException
```
public class SpreadMapEvaluatingException
extends [GroovyRuntimeException](groovyruntimeexception)
```
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[SpreadMapEvaluatingException](#SpreadMapEvaluatingException(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyRuntimeException](groovyruntimeexception)` | `[getLocationText](groovyruntimeexception#getLocationText()), [getMessage](groovyruntimeexception#getMessage()), [getMessageWithoutLocationText](groovyruntimeexception#getMessageWithoutLocationText()), [getModule](groovyruntimeexception#getModule()), [getNode](groovyruntimeexception#getNode()), [setModule](groovyruntimeexception#setModule(org.codehaus.groovy.ast.ModuleNode))` |
Constructor Detail
------------------
### public **SpreadMapEvaluatingException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message)
groovy [Java] Annotation Type Category [Java] Annotation Type Category
===============================
* groovy.lang.Category
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")(ElementType.TYPE)
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.CategoryASTTransformation")
public @interface Category
```
Transforms an instance-style Groovy class or interface to become a static-style conventional Groovy category.
Groovy categories are the original mechanism used by Groovy when augmenting classes with new methods. Writing categories required using a class writing style where all methods were static and an additional self parameter was defined. The self parameter and static nature of the methods disappeared once applied by Groovy's metaclass framework but some regarded the writing style as a little noisy. This transformation allows you to write your categories without the "apparent noise" but adds it back in during compilation so that the classes appear as normal categories.
It might seem strange writing your class/object enhancements using a succinct notation, then having "noise" added, then having the noise removed during category application. If this worries you, then you may also like to consider using Groovy's `ExpandoMetaClass` mechanism which avoids the category definition altogether. If you already have an investment in categories or like some of the other features which categories currently give you, then read on.
The mechanics: during compilation, all methods are transformed to static ones with an additional self parameter of the type you supply as the annotation parameter (the default type for the self parameters is `Object` which might be more broad reaching than you like so it is usually wise to specify a type). Properties invoked using 'this' references are transformed so that they are instead invoked on the additional self parameter and not on the Category instance. (Remember that once the category is applied, the reverse will occur and we will be back to conceptually having methods on the `this` references again!)
Classes conforming to the conventional Groovy category conventions can be used within `use` statements or mixed in at runtime with the `mixin` method on classes.
An example showing a `use` statement (allowing fine-grained application of the category methods):
```
@Category(Integer)
class IntegerOps {
def triple() {
this * 3
}
}
use (IntegerOps) {
assert 25.triple() == 75
}
```
Or, "mixing in" your methods at runtime:
```
@Category(List)
class Shuffler {
def shuffle() {
def result = new ArrayList(this)
Collections.shuffle(result)
result
}
}
class Sentence extends ArrayList {
Sentence(Collection initial) { super(initial) }
}
Sentence.mixin Shuffler
def words = ["The", "quick", "brown", "fox"]
println new Sentence(words).shuffle()
// => [quick, fox, The, brown] (order will vary)
```
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")**` | `[value](#value)`
**Default:**
Object.class
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **value**
**Default:**
Object.class
| programming_docs |
groovy [Java] Interface PropertyAccessInterceptor [Java] Interface PropertyAccessInterceptor
==========================================
* groovy.lang.Interceptor
All Superinterfaces: [Interceptor](interceptor)
```
public interface PropertyAccessInterceptor
extends [Interceptor](interceptor)
```
An interface that adds the ability to intercept property getters/setters
**Since:**
Oct 24, 2005
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[beforeGet](#beforeGet(java.lang.Object,%20java.lang.String))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)`Intercepts a getXXX call and returns a result. |
| | `public void` | `**[beforeSet](#beforeSet(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`Intercepts a setXXX call |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `interface [Interceptor](interceptor)` | `[afterInvoke](interceptor#afterInvoke(java.lang.Object,%20java.lang.String,%20java.lang.Object,%20java.lang.Object)), [beforeInvoke](interceptor#beforeInvoke(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [doInvoke](interceptor#doInvoke())` |
Method Detail
-------------
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **beforeGet**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)
Intercepts a getXXX call and returns a result. The result is replaced by the real value if doGet() return false
**Parameters:**
`object` - The target object
`property` - The property to get
**Returns:**
A value supplied by the interceptor
### public void **beforeSet**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
Intercepts a setXXX call
**Parameters:**
`object` - The target object
`property` - The property to set
`newValue` - The new value
groovy [Java] Annotation Type Singleton [Java] Annotation Type Singleton
================================
* groovy.lang.Singleton
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.SingletonASTTransformation")
public @interface Singleton
```
Class annotation to make a singleton class. The singleton is obtained through normal property access using the singleton property (defaults to "instance"). Such classes can be initialized during normal static initialization of the class or lazily (on first access). To make the singleton lazy use `@Singleton(lazy=true)`. Lazy singletons are implemented with double-checked locking and a volatile backing field. By default, no explicit constructors are allowed. To create one or more explicit constructors use `@Singleton(strict=false)`. This could be used to:
* provide your own custom initialization logic in your own no-arg constructor - you will be responsible for the entire code (the `@Singleton` annotation becomes merely documentation)
* provide one or more constructors with arguments for a quasi-singleton - these constructors will be used to create instances that are independent of the singleton instance returned by the singleton property
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[lazy](#lazy)`
**Returns:**
if this singleton should be lazy
**Default:**
false
|
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[property](#property)`
**Returns:**
the singleton property name
**Default:**
"instance"
|
| `**boolean**` | `[strict](#strict)`
**Returns:**
if this singleton should have strict semantics
**Default:**
true
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **lazy**
**Returns:**
if this singleton should be lazy
**Default:**
false
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **property**
**Returns:**
the singleton property name
**Default:**
"instance"
### public boolean **strict**
**Returns:**
if this singleton should have strict semantics
**Default:**
true
groovy [Java] Class PropertyValue [Java] Class PropertyValue
==========================
* groovy.lang.PropertyValue
```
public class PropertyValue
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[PropertyValue](#PropertyValue(java.lang.Object,%20groovy.lang.MetaProperty))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") bean, [MetaProperty](metaproperty) mp)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getName](#getName())**()` |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[getType](#getType())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getValue](#getValue())**()` |
| | `public void` | `**[setValue](#setValue(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **PropertyValue**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") bean, [MetaProperty](metaproperty) mp)
Method Detail
-------------
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getName**()
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **getType**()
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getValue**()
### public void **setValue**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
groovy [Java] Class Tuple7<T1, T2, T3, T4, T5, T6, T7> [Java] Class Tuple7<T1, T2, T3, T4, T5, T6, T7>
===============================================
* groovy.lang.Tuple7
```
public final class Tuple7<T1, T2, T3, T4, T5, T6, T7>
extends [Tuple](tuple)
```
Represents a list of 7 typed Objects.
**Since:**
2.5.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Tuple7](#Tuple7(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7)` |
| `**[Tuple7](#Tuple7(Tuple7))**([Tuple7](tuple7 "Tuple7")<T1, T2, T3, T4, T5, T6, T7> tuple)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Tuple7](tuple7 "Tuple7")<T1, T2, T3, T4, T5, T6, T7>` | `**[clone](#clone())**()` |
| | `public [T5](../../t5)` | `**[getFifth](#getFifth())**()` |
| | `public [T1](../../t1)` | `**[getFirst](#getFirst())**()` |
| | `public [T4](../../t4)` | `**[getFourth](#getFourth())**()` |
| | `public [T2](../../t2)` | `**[getSecond](#getSecond())**()` |
| | `public [T7](../../t7)` | `**[getSeventh](#getSeventh())**()` |
| | `public [T6](../../t6)` | `**[getSixth](#getSixth())**()` |
| | `public [T3](../../t3)` | `**[getThird](#getThird())**()` |
| | `public [T1](../../t1)` | `**[getV1](#getV1())**()` |
| | `public [T2](../../t2)` | `**[getV2](#getV2())**()` |
| | `public [T3](../../t3)` | `**[getV3](#getV3())**()` |
| | `public [T4](../../t4)` | `**[getV4](#getV4())**()` |
| | `public [T5](../../t5)` | `**[getV5](#getV5())**()` |
| | `public [T6](../../t6)` | `**[getV6](#getV6())**()` |
| | `public [T7](../../t7)` | `**[getV7](#getV7())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Tuple](tuple)` | `[clone](tuple#clone()), [compareTo](tuple#compareTo(Tuple)), [equals](tuple#equals(java.lang.Object)), [get](tuple#get(int)), [hashCode](tuple#hashCode()), [size](tuple#size()), [subList](tuple#subList(int,%20int)), [subTuple](tuple#subTuple(int,%20int)), [toArray](tuple#toArray()), [tuple](tuple#tuple()), [tuple](tuple#tuple(T1)), [tuple](tuple#tuple(T1,%20T2)), [tuple](tuple#tuple(T1,%20T2,%20T3)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15,%20T16))` |
Constructor Detail
------------------
### public **Tuple7**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7)
### public **Tuple7**([Tuple7](tuple7 "Tuple7")<T1, T2, T3, T4, T5, T6, T7> tuple)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Tuple7](tuple7 "Tuple7")<T1, T2, T3, T4, T5, T6, T7> **clone**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T5](../../t5) **getFifth**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T1](../../t1) **getFirst**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T4](../../t4) **getFourth**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T2](../../t2) **getSecond**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T7](../../t7) **getSeventh**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T6](../../t6) **getSixth**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T3](../../t3) **getThird**()
### public [T1](../../t1) **getV1**()
### public [T2](../../t2) **getV2**()
### public [T3](../../t3) **getV3**()
### public [T4](../../t4) **getV4**()
### public [T5](../../t5) **getV5**()
### public [T6](../../t6) **getV6**()
### public [T7](../../t7) **getV7**()
groovy [Java] Class ClosureException [Java] Class ClosureException
=============================
* groovy.lang.ClosureException
```
public class ClosureException
extends [RuntimeException](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html "RuntimeException")
```
An exception thrown by a closure invocation
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[ClosureException](#ClosureException(groovy.lang.Closure,%20java.lang.Throwable))**([Closure](closure) closure, [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") cause)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Closure](closure)` | `**[getClosure](#getClosure())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [RuntimeException](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html "RuntimeException")` | `[printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#printStackTrace() "printStackTrace"), [printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#printStackTrace(java.io.PrintStream) "printStackTrace"), [printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#printStackTrace(java.io.PrintWriter) "printStackTrace"), [fillInStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#fillInStackTrace() "fillInStackTrace"), [getCause](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getCause() "getCause"), [initCause](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#initCause(java.lang.Throwable) "initCause"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#toString() "toString"), [getMessage](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getMessage() "getMessage"), [getSuppressed](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getSuppressed() "getSuppressed"), [getLocalizedMessage](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getLocalizedMessage() "getLocalizedMessage"), [getStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getStackTrace() "getStackTrace"), [setStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#setStackTrace(%5BLjava.lang.StackTraceElement;) "setStackTrace"), [addSuppressed](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#addSuppressed(java.lang.Throwable) "addSuppressed"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#equals(java.lang.Object) "equals"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **ClosureException**([Closure](closure) closure, [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") cause)
Method Detail
-------------
### public [Closure](closure) **getClosure**()
groovy [Java] Class Tuple11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> [Java] Class Tuple11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>
==================================================================
* groovy.lang.Tuple11
```
public final class Tuple11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>
extends [Tuple](tuple)
```
Represents a list of 10 typed Objects.
**Since:**
3.0.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Tuple11](#Tuple11(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11)` |
| `**[Tuple11](#Tuple11(Tuple11))**([Tuple11](tuple11 "Tuple11")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> tuple)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Tuple11](tuple11 "Tuple11")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>` | `**[clone](#clone())**()` |
| | `public [T1](../../t1)` | `**[getV1](#getV1())**()` |
| | `public [T10](../../t10)` | `**[getV10](#getV10())**()` |
| | `public [T11](../../t11)` | `**[getV11](#getV11())**()` |
| | `public [T2](../../t2)` | `**[getV2](#getV2())**()` |
| | `public [T3](../../t3)` | `**[getV3](#getV3())**()` |
| | `public [T4](../../t4)` | `**[getV4](#getV4())**()` |
| | `public [T5](../../t5)` | `**[getV5](#getV5())**()` |
| | `public [T6](../../t6)` | `**[getV6](#getV6())**()` |
| | `public [T7](../../t7)` | `**[getV7](#getV7())**()` |
| | `public [T8](../../t8)` | `**[getV8](#getV8())**()` |
| | `public [T9](../../t9)` | `**[getV9](#getV9())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Tuple](tuple)` | `[clone](tuple#clone()), [compareTo](tuple#compareTo(Tuple)), [equals](tuple#equals(java.lang.Object)), [get](tuple#get(int)), [hashCode](tuple#hashCode()), [size](tuple#size()), [subList](tuple#subList(int,%20int)), [subTuple](tuple#subTuple(int,%20int)), [toArray](tuple#toArray()), [tuple](tuple#tuple()), [tuple](tuple#tuple(T1)), [tuple](tuple#tuple(T1,%20T2)), [tuple](tuple#tuple(T1,%20T2,%20T3)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15,%20T16))` |
Constructor Detail
------------------
### public **Tuple11**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11)
### public **Tuple11**([Tuple11](tuple11 "Tuple11")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> tuple)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Tuple11](tuple11 "Tuple11")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> **clone**()
### public [T1](../../t1) **getV1**()
### public [T10](../../t10) **getV10**()
### public [T11](../../t11) **getV11**()
### public [T2](../../t2) **getV2**()
### public [T3](../../t3) **getV3**()
### public [T4](../../t4) **getV4**()
### public [T5](../../t5) **getV5**()
### public [T6](../../t6) **getV6**()
### public [T7](../../t7) **getV7**()
### public [T8](../../t8) **getV8**()
### public [T9](../../t9) **getV9**()
| programming_docs |
groovy [Java] Annotation Type GrabConfig [Java] Annotation Type GrabConfig
=================================
* groovy.lang.GrabConfig
```
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({
ElementType.CONSTRUCTOR,
ElementType.FIELD,
ElementType.LOCAL_VARIABLE,
ElementType.METHOD,
ElementType.PARAMETER,
ElementType.TYPE})
public @interface GrabConfig
```
Used to modify the grape configuration for grab requests.
An example involving databases:
```
@Grab('mysql:mysql-connector-java:5.1.6')
@GrabConfig(systemClassLoader=true)
import groovy.sql.Sql
def sql=Sql.newInstance("jdbc:mysql://localhost/test", "user", "password", "com.mysql.jdbc.Driver")
println sql.firstRow('SELECT * FROM INFORMATION_SCHEMA.COLUMNS')
```
Another example involving XStream:
```
@Grab('com.thoughtworks.xstream:xstream:1.4.9')
@Grab('xpp3:xpp3_min:1.1.4c')
@GrabConfig(systemClassLoader=true, initContextClassLoader=true)
import com.thoughtworks.xstream.*
class Staff {
String firstname, lastname, position
def xstream = new XStream()
def john1 = new Staff(firstname:'John',
lastname:'Connor',
position:'Resistance Leader')
// write out to XML file
new File("john.xml").withOutputStream { out ->
xstream.toXML(john1, out)
}
// now read back in
def john2
new File("john.xml").withInputStream { ins ->
john2 = xstream.fromXML(ins)
}
println john2.dump()
}
```
Further information about customising grape behavior can be found on the Grape documentation page: <http://groovy-lang.org/grape.html>.
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[autoDownload](#autoDownload)`Set to false if you want to disable automatic downloading of locally missing jars. |
| `**boolean**` | `[disableChecksums](#disableChecksums)`Set to true if you want to disable checksum checking. |
| `**boolean**` | `[initContextClassLoader](#initContextClassLoader)`Set to true if you want the context classloader to be initialised to the classloader of the current class or script. |
| `**boolean**` | `[systemClassLoader](#systemClassLoader)`Set to true if you want to use the system classloader when loading the grape. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[systemProperties](#systemProperties)`Define any system properties which must be set before invoking the grab - useful for declaring SSL certificates or proxy settings. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **autoDownload**
Set to false if you want to disable automatic downloading of locally missing jars.
**Default:**
true
### public boolean **disableChecksums**
Set to true if you want to disable checksum checking.
**Default:**
false
### public boolean **initContextClassLoader**
Set to true if you want the context classloader to be initialised to the classloader of the current class or script. This is useful for libraries or frameworks that assume that the context classloader has been set. But be careful when using this flag as your script or class might behave differently when called directly (from the command line or from an IDE) versus when called from within a container, e.g. a web container or a JEE container.
**Default:**
false
### public boolean **systemClassLoader**
Set to true if you want to use the system classloader when loading the grape. This is normally only required when a core Java class needs to reference the grabbed classes, e.g. for a database driver accessed using DriverManager.
**Default:**
false
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **systemProperties**
Define any system properties which must be set before invoking the grab - useful for declaring SSL certificates or proxy settings. Currently, this only affects the generated class or script. You may need to also set those same properties for the Groovy compiler. For convenience, a String with comma separated name=value pairs can be used in addition to an array (using Groovy's literal list notation) of String name=value items. The single String shorthand form can't be used if value part of a property contains a comma.
**Since:**
2.4.5
**Default:**
""
groovy [Java] Class Reference<T> [Java] Class Reference<T>
=========================
* groovy.lang.Reference
All Implemented Interfaces and Traits: [Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html "Serializable")
```
public class Reference<T>
extends [GroovyObjectSupport](groovyobjectsupport)
implements [Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html "Serializable")
```
Represents a reference to a value
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Reference](#Reference())**()` |
| `**[Reference](#Reference(T))**(T value)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public T` | `**[get](#get())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)` |
| | `public void` | `**[set](#set(T))**(T value)` |
| | `public void` | `**[setProperty](#setProperty(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyObjectSupport](groovyobjectsupport)` | `[getMetaClass](groovyobjectsupport#getMetaClass()), [setMetaClass](groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
### public **Reference**()
### public **Reference**(T value)
Method Detail
-------------
### public T **get**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
### public void **set**(T value)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
groovy [Java] Annotation Type Groovydoc [Java] Annotation Type Groovydoc
================================
* groovy.lang.Groovydoc
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE, ElementType.ANNOTATION_TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR})
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
public @interface Groovydoc
```
An annotation to hold the groovydoc for the annotated element at runtime, we call it "Runtime Groovydoc". Runtime Groovydoc is a bit like Python's Documentation Strings and will be useful for IDE and developers who set a high value on documentations. The usage is very simple, just place @ at the beginning of the content of groovydoc, i.e. starts with /\*\*@, then the new parser Parrot will attach the annotation Groovydoc automatically
**Since:**
3.0.0
Element Summary
---------------
Required Element Summary
| Type | Name and Description |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[value](#value)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **value**
groovy [Java] Interface Writable [Java] Interface Writable
=========================
```
public interface Writable
```
Represents an object which is capable of writing itself to a text stream in a more efficient format than just creating a toString() representation of itself. This mechanism is particularly useful for templates and such like.
It is worth noting that writable implementations often override their toString() implementation as well to allow rendering the same result directly to a String; however this is not required.
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer")` | `**[writeTo](#writeTo(java.io.Writer))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out)`Writes this object to the given writer. |
Method Detail
-------------
### public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") **writeTo**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out)
Writes this object to the given writer.
This is used to defer content creation until the point when it is streamed to the output destination. Oftentimes, content will be defined but not necessarily created (as is may be the case with a Closure definition.) In that case, the output is then 'deferred' to the point when it is serialized to the writer. This class may be used whenever an object should be responsible for creating its own textual representation, but creating the entire output as a single String would be inefficient (such as outputting a multi-gigabyte XML document.)
**throws:**
IOException if an error occurred while outputting data to the writer
**Parameters:**
`out` - the Writer to which this Writable should output its data.
**Returns:**
the Writer that was passed
groovy [Java] Class MissingClassException [Java] Class MissingClassException
==================================
* groovy.lang.MissingClassException
```
public class MissingClassException
extends [GroovyRuntimeException](groovyruntimeexception)
```
An exception occurred if a dynamic method dispatch fails with an unknown class. Note that the Missing\*Exception classes were named for consistency and to avoid conflicts with JDK exceptions of the same name.
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[MissingClassException](#MissingClassException(java.lang.String,%20org.codehaus.groovy.ast.ASTNode,%20java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") type, [ASTNode](../../org/codehaus/groovy/ast/astnode) node, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message)` |
| `**[MissingClassException](#MissingClassException(org.codehaus.groovy.ast.ClassNode,%20java.lang.String))**([ClassNode](../../org/codehaus/groovy/ast/classnode) type, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getType](#getType())**()`
**Returns:**
The type that could not be resolved
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyRuntimeException](groovyruntimeexception)` | `[getLocationText](groovyruntimeexception#getLocationText()), [getMessage](groovyruntimeexception#getMessage()), [getMessageWithoutLocationText](groovyruntimeexception#getMessageWithoutLocationText()), [getModule](groovyruntimeexception#getModule()), [getNode](groovyruntimeexception#getNode()), [setModule](groovyruntimeexception#setModule(org.codehaus.groovy.ast.ModuleNode))` |
Constructor Detail
------------------
### public **MissingClassException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") type, [ASTNode](../../org/codehaus/groovy/ast/astnode) node, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message)
### public **MissingClassException**([ClassNode](../../org/codehaus/groovy/ast/classnode) type, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message)
Method Detail
-------------
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getType**()
**Returns:**
The type that could not be resolved
groovy [Java] Class Tuple4<T1, T2, T3, T4> [Java] Class Tuple4<T1, T2, T3, T4>
===================================
* groovy.lang.Tuple4
```
public final class Tuple4<T1, T2, T3, T4>
extends [Tuple](tuple)
```
Represents a list of 4 typed Objects.
**Since:**
2.5.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Tuple4](#Tuple4(T1,%20T2,%20T3,%20T4))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4)` |
| `**[Tuple4](#Tuple4(Tuple4))**([Tuple4](tuple4 "Tuple4")<T1, T2, T3, T4> tuple)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Tuple4](tuple4 "Tuple4")<T1, T2, T3, T4>` | `**[clone](#clone())**()` |
| | `public [T1](../../t1)` | `**[getFirst](#getFirst())**()` |
| | `public [T4](../../t4)` | `**[getFourth](#getFourth())**()` |
| | `public [T2](../../t2)` | `**[getSecond](#getSecond())**()` |
| | `public [T3](../../t3)` | `**[getThird](#getThird())**()` |
| | `public [T1](../../t1)` | `**[getV1](#getV1())**()` |
| | `public [T2](../../t2)` | `**[getV2](#getV2())**()` |
| | `public [T3](../../t3)` | `**[getV3](#getV3())**()` |
| | `public [T4](../../t4)` | `**[getV4](#getV4())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Tuple](tuple)` | `[clone](tuple#clone()), [compareTo](tuple#compareTo(Tuple)), [equals](tuple#equals(java.lang.Object)), [get](tuple#get(int)), [hashCode](tuple#hashCode()), [size](tuple#size()), [subList](tuple#subList(int,%20int)), [subTuple](tuple#subTuple(int,%20int)), [toArray](tuple#toArray()), [tuple](tuple#tuple()), [tuple](tuple#tuple(T1)), [tuple](tuple#tuple(T1,%20T2)), [tuple](tuple#tuple(T1,%20T2,%20T3)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15,%20T16))` |
Constructor Detail
------------------
### public **Tuple4**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4)
### public **Tuple4**([Tuple4](tuple4 "Tuple4")<T1, T2, T3, T4> tuple)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Tuple4](tuple4 "Tuple4")<T1, T2, T3, T4> **clone**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T1](../../t1) **getFirst**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T4](../../t4) **getFourth**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T2](../../t2) **getSecond**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T3](../../t3) **getThird**()
### public [T1](../../t1) **getV1**()
### public [T2](../../t2) **getV2**()
### public [T3](../../t3) **getV3**()
### public [T4](../../t4) **getV4**()
| programming_docs |
groovy [Java] Class Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> [Java] Class Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>
=======================================================================
* groovy.lang.Tuple12
```
public final class Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>
extends [Tuple](tuple)
```
Represents a list of 12 typed Objects.
**Since:**
3.0.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Tuple12](#Tuple12(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11, [T12](../../t12) v12)` |
| `**[Tuple12](#Tuple12(Tuple12))**([Tuple12](tuple12 "Tuple12")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> tuple)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Tuple12](tuple12 "Tuple12")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>` | `**[clone](#clone())**()` |
| | `public [T1](../../t1)` | `**[getV1](#getV1())**()` |
| | `public [T10](../../t10)` | `**[getV10](#getV10())**()` |
| | `public [T11](../../t11)` | `**[getV11](#getV11())**()` |
| | `public [T12](../../t12)` | `**[getV12](#getV12())**()` |
| | `public [T2](../../t2)` | `**[getV2](#getV2())**()` |
| | `public [T3](../../t3)` | `**[getV3](#getV3())**()` |
| | `public [T4](../../t4)` | `**[getV4](#getV4())**()` |
| | `public [T5](../../t5)` | `**[getV5](#getV5())**()` |
| | `public [T6](../../t6)` | `**[getV6](#getV6())**()` |
| | `public [T7](../../t7)` | `**[getV7](#getV7())**()` |
| | `public [T8](../../t8)` | `**[getV8](#getV8())**()` |
| | `public [T9](../../t9)` | `**[getV9](#getV9())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Tuple](tuple)` | `[clone](tuple#clone()), [compareTo](tuple#compareTo(Tuple)), [equals](tuple#equals(java.lang.Object)), [get](tuple#get(int)), [hashCode](tuple#hashCode()), [size](tuple#size()), [subList](tuple#subList(int,%20int)), [subTuple](tuple#subTuple(int,%20int)), [toArray](tuple#toArray()), [tuple](tuple#tuple()), [tuple](tuple#tuple(T1)), [tuple](tuple#tuple(T1,%20T2)), [tuple](tuple#tuple(T1,%20T2,%20T3)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15,%20T16))` |
Constructor Detail
------------------
### public **Tuple12**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11, [T12](../../t12) v12)
### public **Tuple12**([Tuple12](tuple12 "Tuple12")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> tuple)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Tuple12](tuple12 "Tuple12")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> **clone**()
### public [T1](../../t1) **getV1**()
### public [T10](../../t10) **getV10**()
### public [T11](../../t11) **getV11**()
### public [T12](../../t12) **getV12**()
### public [T2](../../t2) **getV2**()
### public [T3](../../t3) **getV3**()
### public [T4](../../t4) **getV4**()
### public [T5](../../t5) **getV5**()
### public [T6](../../t6) **getV6**()
### public [T7](../../t7) **getV7**()
### public [T8](../../t8) **getV8**()
### public [T9](../../t9) **getV9**()
groovy [Java] Annotation Type Delegate [Java] Annotation Type Delegate
===============================
* groovy.lang.Delegate
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.FIELD, ElementType.METHOD})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.DelegateASTTransformation")
public @interface Delegate
```
Annotation to automatically delegate part of the functionality of an owner class to the annotated delegation target. The target can be a field (or property) or a method's return value.
The delegate type is either the type of the annotated field (or property) or the return type of the annotated method. The method can be thought of as a getter or factory method for the delegate. All public instance methods present in the delegate type and not present in the owner class will be added to owner class at compile time. The implementation of such automatically added methods is code which calls through to the delegate as per the normal delegate pattern.
As an example, consider this code:
```
class Event {
@Delegate Date when
String title, url
}
def gr8conf = new Event(title: "GR8 Conference",
url: "http://www.gr8conf.org",
when: Date.parse("yyyy/MM/dd", "2009/05/18"))
def javaOne = new Event(title: "JavaOne",
url: "http://java.sun.com/javaone/",
when: Date.parse("yyyy/MM/dd", "2009/06/02"))
assert gr8conf.before(javaOne.when)
```
In this example, the `Event` class will have a method called `before(Date otherDate)` as well as other public methods of the `Date` class. The implementation of the `before()` method will look like this:
```
public boolean before(Date otherDate) {
return when.before(otherDate);
}
```
By default, the owner class will also be modified to implement any interfaces implemented by the delegate type. So, in the example above, because `Date` implements `Cloneable` the following will be true:
```
assert gr8conf instanceof Cloneable
```
This behavior can be disabled by setting the annotation's `interfaces` element to false, i.e. `@Delegate(interfaces = false)`, e.g. in the above example, the delegate definition would become:
```
@Delegate(interfaces = false) Date when
```
and the following would be true:
```
assert !(gr8conf instanceof Cloneable)
```
If multiple delegation targets are used and the same method signature occurs in more than one of the respective delegate types, then the delegate will be made to the first defined target having that signature. If this does occur, it might be regarded as a smell (or at least poor style) and it might be clearer to do the delegation by long hand. By default, methods of the delegate type marked as `@Deprecated` are not automatically added to the owner class (but see the technical note about interfaces below). You can force these methods to be added by setting the annotation's `deprecated` element to true, i.e. `@Delegate(deprecated = true)`.
For example, in the example above if we change the delegate definition to:
```
@Delegate(deprecated = true) Date when
```
then the following additional lines will execute successfully (during 2009):
```
assert gr8conf.year + 1900 == 2009
assert gr8conf.toGMTString().contains(" 2009 ")
```
Otherwise these lines produce a groovy.lang.MissingPropertyException or groovy.lang.MissingMethodException respectively as those two methods are `@Deprecated` in `Date`. **Technical notes**:
* Static methods, synthetic methods or methods from the `GroovyObject` interface are not candidates for delegation
* Non-abstract non-static methods defined in the owner class or its superclasses take precedence over methods with identical signatures from a `@Delegate` target
* All methods defined in the owner class (including static, abstract or private etc.) take precedence over methods with identical signatures from a `@Delegate` target
* Recursive delegation to your own class is not allowed
* Mixing of `@Delegate` with default method arguments is known not to work in some cases. We recommend not using these features together.
* When the delegate type is an interface, the `deprecated` attribute will be ignored if the owner class implements that interface (i.e. you must set `interfaces=false` if you want the `deprecated` attribute to be used). Otherwise, the resulting class would not compile anyway without manually adding in any deprecated methods in the interface.
* `@Delegate` can work in combination with `@Lazy` when annotating a field (or property)
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[allNames](#allNames)`Whether to apply the delegate pattern to all methods, including those with names that are considered internal. |
| `**boolean**` | `[deprecated](#deprecated)`Whether to apply the delegate pattern to deprecated methods; to avoid compilation errors, this is ignored if the type of the delegate target is an interface and `interfaces=true`. |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[]**` | `[excludeTypes](#excludeTypes)`List of interfaces containing method signatures to exclude when delegating. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[excludes](#excludes)`List of method and/or property names to exclude when delegating. |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[]**` | `[includeTypes](#includeTypes)`List of interfaces containing method signatures to include when delegating. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[includes](#includes)`List of method and/or property names to include when delegating. |
| `**boolean**` | `[interfaces](#interfaces)`
**Returns:**
true if owner class should implement interfaces implemented by delegate type
**Default:**
true
|
| `**boolean**` | `[methodAnnotations](#methodAnnotations)`Whether to carry over annotations from the methods of the delegate to your delegating method. |
| `**boolean**` | `[parameterAnnotations](#parameterAnnotations)`Whether to carry over annotations from the parameters of delegate methods to your delegating method. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **allNames**
Whether to apply the delegate pattern to all methods, including those with names that are considered internal.
**Returns:**
true if owner class should delegate to methods which have internal names
**Since:**
2.5.0
**Default:**
false
### public boolean **deprecated**
Whether to apply the delegate pattern to deprecated methods; to avoid compilation errors, this is ignored if the type of the delegate target is an interface and `interfaces=true`.
**Deprecated:**
@default false
**Returns:**
true if owner class should delegate to methods annotated with
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] **excludeTypes**
List of interfaces containing method signatures to exclude when delegating. Only one of 'includes', 'includeTypes', 'excludes', 'excludeTypes' should be used. If interfaces is true (the default), you will need to manually supply any methods excluded from delegation that are required for the interface.
**Since:**
2.3.0
**Default:**
{}
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **excludes**
List of method and/or property names to exclude when delegating. Only one of 'includes', 'includeTypes', 'excludes' or 'excludeTypes' should be used. For convenience, a String with comma separated names can be used in addition to an array (using Groovy's literal list notation) of String values. If interfaces is true (the default), you will need to manually supply any methods excluded from delegation that are required for the interface.
**Since:**
2.2.0
**Default:**
{}
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] **includeTypes**
List of interfaces containing method signatures to include when delegating. Only one of 'includes', 'includeTypes', 'excludes' or 'excludeTypes' should be used. The default value is a special marker value indicating that no includeTypes are defined. If interfaces is true (the default), you will need to manually supply any methods excluded from delegation that are required for the interface.
**Since:**
2.3.0
**Default:**
{ Undefined.CLASS.class }
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **includes**
List of method and/or property names to include when delegating. Only one of 'includes', 'includeTypes', 'excludes' or 'excludeTypes' should be used. For convenience, a String with comma separated names can be used in addition to an array (using Groovy's literal list notation) of String values. The default value is a special marker value indicating that no includes are defined; all fields are included if 'includes' remains undefined and 'excludes' is explicitly or implicitly an empty list. If interfaces is true (the default), you will need to manually supply any methods not included via delegation that are required for the interface.
**Since:**
2.2.0
**Default:**
{ Undefined.STRING }
### public boolean **interfaces**
**Returns:**
true if owner class should implement interfaces implemented by delegate type
**Default:**
true
### public boolean **methodAnnotations**
Whether to carry over annotations from the methods of the delegate to your delegating method. Currently Closure annotation members are not supported.
**Returns:**
true if generated delegate methods should keep method annotations
**Default:**
false
### public boolean **parameterAnnotations**
Whether to carry over annotations from the parameters of delegate methods to your delegating method. Currently Closure annotation members are not supported.
**Returns:**
true if generated delegate methods should keep parameter annotations
**Default:**
false
groovy [Java] Interface MetaClassRegistryChangeEventListener [Java] Interface MetaClassRegistryChangeEventListener
=====================================================
```
public interface MetaClassRegistryChangeEventListener
extends [EventListener](https://docs.oracle.com/javase/8/docs/api/java/util/EventListener.html "EventListener")
```
A listener called whenever a constant MetaClass is set, removed or replaced.
**See Also:**
[MetaClassRegistry](metaclassregistry "MetaClassRegistry")
[MetaClassRegistryChangeEvent](metaclassregistrychangeevent "MetaClassRegistryChangeEvent")
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[updateConstantMetaClass](#updateConstantMetaClass(groovy.lang.MetaClassRegistryChangeEvent))**([MetaClassRegistryChangeEvent](metaclassregistrychangeevent) cmcu)`Called when the a constant MetaClass is updated. |
Method Detail
-------------
### public void **updateConstantMetaClass**([MetaClassRegistryChangeEvent](metaclassregistrychangeevent) cmcu)
Called when the a constant MetaClass is updated. If the new MetaClass is null, then the MetaClass is removed. Be careful, while this method is executed other updates may happen. If you want this method thread safe, you have to take care of that by yourself.
**Parameters:**
`cmcu` - - the change event
groovy [Java] Class ReadOnlyPropertyException [Java] Class ReadOnlyPropertyException
======================================
* groovy.lang.ReadOnlyPropertyException
```
public class ReadOnlyPropertyException
extends [MissingPropertyException](missingpropertyexception)
```
This exception is thrown if an attempt is made to set a read only property
Inherited fields
| Fields inherited from class | Fields |
| **`class [MissingPropertyException](missingpropertyexception)`** | `[MPE](missingpropertyexception#MPE)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[ReadOnlyPropertyException](#ReadOnlyPropertyException(java.lang.String,%20java.lang.Class))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type)` |
| `**[ReadOnlyPropertyException](#ReadOnlyPropertyException(java.lang.String,%20java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") classname)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [MissingPropertyException](missingpropertyexception)` | `[getMessageWithoutLocationText](missingpropertyexception#getMessageWithoutLocationText()), [getProperty](missingpropertyexception#getProperty()), [getType](missingpropertyexception#getType())` |
| `class [GroovyRuntimeException](groovyruntimeexception)` | `[getLocationText](groovyruntimeexception#getLocationText()), [getMessage](groovyruntimeexception#getMessage()), [getMessageWithoutLocationText](groovyruntimeexception#getMessageWithoutLocationText()), [getModule](groovyruntimeexception#getModule()), [getNode](groovyruntimeexception#getNode()), [setModule](groovyruntimeexception#setModule(org.codehaus.groovy.ast.ModuleNode))` |
Constructor Detail
------------------
### public **ReadOnlyPropertyException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type)
### public **ReadOnlyPropertyException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") classname)
| programming_docs |
groovy [Java] Class DeprecationException [Java] Class DeprecationException
=================================
* groovy.lang.DeprecationException
```
public class DeprecationException
extends [RuntimeException](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html "RuntimeException")
```
Use this exception to mark a method implementation as being deprecated. Use the message to indicate the recommended way of calling the desired functionality. Make throwing this exception the only line in the method implementation, i.e. unlike the JavaDoc deprecated feature there is no relay to the new implementation but an early and deliberate halt of execution ("fail early"). This exception is supposed to be used in the SNAPSHOT releases only. Before release, all references to this exception should be resolved and the according methods removed.
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[DeprecationException](#DeprecationException(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message)` |
| `**[DeprecationException](#DeprecationException(java.lang.String,%20java.lang.Throwable))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message, [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") cause)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [RuntimeException](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html "RuntimeException")` | `[printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#printStackTrace() "printStackTrace"), [printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#printStackTrace(java.io.PrintStream) "printStackTrace"), [printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#printStackTrace(java.io.PrintWriter) "printStackTrace"), [fillInStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#fillInStackTrace() "fillInStackTrace"), [getCause](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getCause() "getCause"), [initCause](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#initCause(java.lang.Throwable) "initCause"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#toString() "toString"), [getMessage](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getMessage() "getMessage"), [getSuppressed](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getSuppressed() "getSuppressed"), [getLocalizedMessage](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getLocalizedMessage() "getLocalizedMessage"), [getStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getStackTrace() "getStackTrace"), [setStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#setStackTrace(%5BLjava.lang.StackTraceElement;) "setStackTrace"), [addSuppressed](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#addSuppressed(java.lang.Throwable) "addSuppressed"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#equals(java.lang.Object) "equals"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **DeprecationException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message)
### public **DeprecationException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message, [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") cause)
groovy [Java] Class MetaMethod [Java] Class MetaMethod
=======================
* groovy.lang.MetaMethod
All Implemented Interfaces and Traits: [Cloneable](https://docs.oracle.com/javase/8/docs/api/java/lang/Cloneable.html "Cloneable")
```
public abstract class MetaMethod
extends [ParameterTypes](../../org/codehaus/groovy/reflection/parametertypes)
implements [Cloneable](https://docs.oracle.com/javase/8/docs/api/java/lang/Cloneable.html "Cloneable")
```
Represents a Method on a Java object a little like [Method](https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html "Method") except without using reflection to invoke the method
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [MetaMethod](metamethod)[]**` | `[EMPTY\_ARRAY](#EMPTY_ARRAY)` | |
Inherited fields
| Fields inherited from class | Fields |
| **`class [ParameterTypes](../../org/codehaus/groovy/reflection/parametertypes)`** | `[isVargsMethod](../../org/codehaus/groovy/reflection/parametertypes#isVargsMethod), [nativeParamTypes](../../org/codehaus/groovy/reflection/parametertypes#nativeParamTypes), [parameterTypes](../../org/codehaus/groovy/reflection/parametertypes#parameterTypes)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[MetaMethod](#MetaMethod())**()`Constructor for a metamethod with an empty parameter list |
| `**[MetaMethod](#MetaMethod(java.lang.Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] pt)`Constructor wit a list of parameter classes |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[checkParameters](#checkParameters(java.lang.Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] arguments)`Checks that the given parameters are valid to call this method |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[clone](#clone())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[doMethodInvoke](#doMethodInvoke(java.lang.Object,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] argumentArray)`Invokes the method this object represents. |
| | `protected static boolean` | `**[equal](#equal(org.codehaus.groovy.reflection.CachedClass,%20java.lang.Class))**([CachedClass](../../org/codehaus/groovy/reflection/cachedclass)[] a, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] b)` |
| | `protected static boolean` | `**[equal](#equal(org.codehaus.groovy.reflection.CachedClass,%20org.codehaus.groovy.reflection.CachedClass))**([CachedClass](../../org/codehaus/groovy/reflection/cachedclass)[] a, [CachedClass](../../org/codehaus/groovy/reflection/cachedclass)[] b)` |
| | `public abstract [CachedClass](../../org/codehaus/groovy/reflection/cachedclass)` | `**[getDeclaringClass](#getDeclaringClass())**()`Gets the class where this method is declared |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getDescriptor](#getDescriptor())**()`Return a descriptor of this method based on the return type and parameters of this method. |
| | `public abstract int` | `**[getModifiers](#getModifiers())**()`Returns the modifiers for this method |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getMopName](#getMopName())**()` |
| | `public abstract [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getName](#getName())**()`Returns the name of the method represented by this class |
| | `public abstract [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[getReturnType](#getReturnType())**()`Access the return type for this method |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getSignature](#getSignature())**()`Returns the signature of this method |
| | `public abstract [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invoke](#invoke(java.lang.Object,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)`Invoke this method |
| | `public boolean` | `**[isAbstract](#isAbstract())**()`Returns whether or not this method is abstract. |
| | `public boolean` | `**[isCacheable](#isCacheable())**()`Returns whether this object is cacheable |
| | `public boolean` | `**[isDefault](#isDefault())**()`Returns whether or not this method is interface-default. |
| | `public boolean` | `**[isMethod](#isMethod(groovy.lang.MetaMethod))**([MetaMethod](metamethod) method)`Returns true if this this metamethod represents the same method as the argument. |
| | `public final boolean` | `**[isPrivate](#isPrivate())**()`Returns whether or not this method is private. |
| | `public final boolean` | `**[isProtected](#isProtected())**()`Returns whether or not this method is protected. |
| | `public final boolean` | `**[isPublic](#isPublic())**()`Returns whether or not this method is public. |
| | `public final boolean` | `**[isSame](#isSame(groovy.lang.MetaMethod))**([MetaMethod](metamethod) method)`
**Parameters:**
`method` - the method to compare against
|
| | `public boolean` | `**[isStatic](#isStatic())**()`Returns whether or not this method is static. |
| | `public final [RuntimeException](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html "RuntimeException")` | `**[processDoMethodInvokeException](#processDoMethodInvokeException(java.lang.Exception,%20java.lang.Object,%20java.lang.Object))**([Exception](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html "Exception") e, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] argumentArray)`This method is called when an exception occurs while invoking this method. |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()`Returns a string representation of this method |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [ParameterTypes](../../org/codehaus/groovy/reflection/parametertypes)` | `[coerceArgumentsToClasses](../../org/codehaus/groovy/reflection/parametertypes#coerceArgumentsToClasses(java.lang.Object)), [correctArguments](../../org/codehaus/groovy/reflection/parametertypes#correctArguments(java.lang.Object)), [getNativeParameterTypes](../../org/codehaus/groovy/reflection/parametertypes#getNativeParameterTypes()), [getPT](../../org/codehaus/groovy/reflection/parametertypes#getPT()), [getParameterTypes](../../org/codehaus/groovy/reflection/parametertypes#getParameterTypes()), [isValidExactMethod](../../org/codehaus/groovy/reflection/parametertypes#isValidExactMethod(java.lang.Object)), [isValidExactMethod](../../org/codehaus/groovy/reflection/parametertypes#isValidExactMethod(java.lang.Class)), [isValidMethod](../../org/codehaus/groovy/reflection/parametertypes#isValidMethod(java.lang.Class)), [isValidMethod](../../org/codehaus/groovy/reflection/parametertypes#isValidMethod(java.lang.Object)), [isVargsMethod](../../org/codehaus/groovy/reflection/parametertypes#isVargsMethod()), [isVargsMethod](../../org/codehaus/groovy/reflection/parametertypes#isVargsMethod(java.lang.Object)), [setParametersTypes](../../org/codehaus/groovy/reflection/parametertypes#setParametersTypes(org.codehaus.groovy.reflection.CachedClass))` |
Field Detail
------------
### public static final [MetaMethod](metamethod)[] **EMPTY\_ARRAY**
Constructor Detail
------------------
### public **MetaMethod**()
Constructor for a metamethod with an empty parameter list
### public **MetaMethod**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] pt)
Constructor wit a list of parameter classes
**Parameters:**
`pt` - A list of parameters types
Method Detail
-------------
### public void **checkParameters**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] arguments)
Checks that the given parameters are valid to call this method
**throws:**
IllegalArgumentException if the parameters are not valid
**Parameters:**
`arguments` - the arguments to check
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **clone**()
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **doMethodInvoke**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] argumentArray)
Invokes the method this object represents. This method is not final but it should be overloaded very carefully and only by generated methods there is no guarantee that it will be called
**Parameters:**
`object` - The object the method is to be called at.
`argumentArray` - Arguments for the method invocation.
**Returns:**
The return value of the invoked method.
### protected static boolean **equal**([CachedClass](../../org/codehaus/groovy/reflection/cachedclass)[] a, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] b)
### protected static boolean **equal**([CachedClass](../../org/codehaus/groovy/reflection/cachedclass)[] a, [CachedClass](../../org/codehaus/groovy/reflection/cachedclass)[] b)
### public abstract [CachedClass](../../org/codehaus/groovy/reflection/cachedclass) **getDeclaringClass**()
Gets the class where this method is declared
**Returns:**
class of this method
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getDescriptor**()
Return a descriptor of this method based on the return type and parameters of this method.
### public abstract int **getModifiers**()
Returns the modifiers for this method
**Returns:**
modifiers as an int.
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getMopName**()
### public abstract [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getName**()
Returns the name of the method represented by this class
**Returns:**
name of this method
### public abstract [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **getReturnType**()
Access the return type for this method
**Returns:**
the return type of this method
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getSignature**()
Returns the signature of this method
**Returns:**
The signature of this method
### public abstract [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invoke**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)
Invoke this method
**Parameters:**
`object` - The object this method should be invoked on
`arguments` - The arguments for the method if applicable
**Returns:**
The return value of the invocation
### public boolean **isAbstract**()
Returns whether or not this method is abstract.
**Returns:**
true if this method is abstract
### public boolean **isCacheable**()
Returns whether this object is cacheable
### public boolean **isDefault**()
Returns whether or not this method is interface-default.
**Returns:**
true if this method is default
### public boolean **isMethod**([MetaMethod](metamethod) method)
Returns true if this this metamethod represents the same method as the argument.
**Parameters:**
`method` - A metaMethod instance
**Returns:**
true if method is for the same method as this method, false otherwise.
### public final boolean **isPrivate**()
Returns whether or not this method is private.
**Returns:**
true if this method is private
### public final boolean **isProtected**()
Returns whether or not this method is protected.
**Returns:**
true if this method is protected
### public final boolean **isPublic**()
Returns whether or not this method is public.
**Returns:**
true if this method is public
### public final boolean **isSame**([MetaMethod](metamethod) method)
**Parameters:**
`method` - the method to compare against
**Returns:**
true if the given method has the same name, parameters, return type and modifiers but may be defined on another type
### public boolean **isStatic**()
Returns whether or not this method is static.
**Returns:**
true if this method is static
### public final [RuntimeException](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html "RuntimeException") **processDoMethodInvokeException**([Exception](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html "Exception") e, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] argumentArray)
This method is called when an exception occurs while invoking this method.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
Returns a string representation of this method
groovy [Java] Class SpreadListEvaluatingException [Java] Class SpreadListEvaluatingException
==========================================
* groovy.lang.SpreadListEvaluatingException
```
public class SpreadListEvaluatingException
extends [GroovyRuntimeException](groovyruntimeexception)
```
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[SpreadListEvaluatingException](#SpreadListEvaluatingException(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyRuntimeException](groovyruntimeexception)` | `[getLocationText](groovyruntimeexception#getLocationText()), [getMessage](groovyruntimeexception#getMessage()), [getMessageWithoutLocationText](groovyruntimeexception#getMessageWithoutLocationText()), [getModule](groovyruntimeexception#getModule()), [getNode](groovyruntimeexception#getNode()), [setModule](groovyruntimeexception#setModule(org.codehaus.groovy.ast.ModuleNode))` |
Constructor Detail
------------------
### public **SpreadListEvaluatingException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message)
| programming_docs |
groovy [Java] Class Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> [Java] Class Tuple8<T1, T2, T3, T4, T5, T6, T7, T8>
===================================================
* groovy.lang.Tuple8
```
public final class Tuple8<T1, T2, T3, T4, T5, T6, T7, T8>
extends [Tuple](tuple)
```
Represents a list of 8 typed Objects.
**Since:**
2.5.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Tuple8](#Tuple8(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8)` |
| `**[Tuple8](#Tuple8(Tuple8))**([Tuple8](tuple8 "Tuple8")<T1, T2, T3, T4, T5, T6, T7, T8> tuple)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Tuple8](tuple8 "Tuple8")<T1, T2, T3, T4, T5, T6, T7, T8>` | `**[clone](#clone())**()` |
| | `public [T8](../../t8)` | `**[getEighth](#getEighth())**()` |
| | `public [T5](../../t5)` | `**[getFifth](#getFifth())**()` |
| | `public [T1](../../t1)` | `**[getFirst](#getFirst())**()` |
| | `public [T4](../../t4)` | `**[getFourth](#getFourth())**()` |
| | `public [T2](../../t2)` | `**[getSecond](#getSecond())**()` |
| | `public [T7](../../t7)` | `**[getSeventh](#getSeventh())**()` |
| | `public [T6](../../t6)` | `**[getSixth](#getSixth())**()` |
| | `public [T3](../../t3)` | `**[getThird](#getThird())**()` |
| | `public [T1](../../t1)` | `**[getV1](#getV1())**()` |
| | `public [T2](../../t2)` | `**[getV2](#getV2())**()` |
| | `public [T3](../../t3)` | `**[getV3](#getV3())**()` |
| | `public [T4](../../t4)` | `**[getV4](#getV4())**()` |
| | `public [T5](../../t5)` | `**[getV5](#getV5())**()` |
| | `public [T6](../../t6)` | `**[getV6](#getV6())**()` |
| | `public [T7](../../t7)` | `**[getV7](#getV7())**()` |
| | `public [T8](../../t8)` | `**[getV8](#getV8())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Tuple](tuple)` | `[clone](tuple#clone()), [compareTo](tuple#compareTo(Tuple)), [equals](tuple#equals(java.lang.Object)), [get](tuple#get(int)), [hashCode](tuple#hashCode()), [size](tuple#size()), [subList](tuple#subList(int,%20int)), [subTuple](tuple#subTuple(int,%20int)), [toArray](tuple#toArray()), [tuple](tuple#tuple()), [tuple](tuple#tuple(T1)), [tuple](tuple#tuple(T1,%20T2)), [tuple](tuple#tuple(T1,%20T2,%20T3)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15,%20T16))` |
Constructor Detail
------------------
### public **Tuple8**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8)
### public **Tuple8**([Tuple8](tuple8 "Tuple8")<T1, T2, T3, T4, T5, T6, T7, T8> tuple)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Tuple8](tuple8 "Tuple8")<T1, T2, T3, T4, T5, T6, T7, T8> **clone**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T8](../../t8) **getEighth**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T5](../../t5) **getFifth**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T1](../../t1) **getFirst**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T4](../../t4) **getFourth**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T2](../../t2) **getSecond**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T7](../../t7) **getSeventh**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T6](../../t6) **getSixth**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T3](../../t3) **getThird**()
### public [T1](../../t1) **getV1**()
### public [T2](../../t2) **getV2**()
### public [T3](../../t3) **getV3**()
### public [T4](../../t4) **getV4**()
### public [T5](../../t5) **getV5**()
### public [T6](../../t6) **getV6**()
### public [T7](../../t7) **getV7**()
### public [T8](../../t8) **getV8**()
groovy [Java] Class EmptyRange<T extends Comparable> [Java] Class EmptyRange<T extends Comparable>
=============================================
* groovy.lang.EmptyRange
All Implemented Interfaces and Traits: [Range](range)
```
public class EmptyRange<T extends Comparable>
extends [AbstractList](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html "AbstractList")
implements [Range](range)
```
Constructing Ranges like 0..<0
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**protected T**` | `[at](#at)` | The value at which the range originates (may be `null`). |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[EmptyRange](#EmptyRange(T))**(T at)`Creates a new [EmptyRange](emptyrange "EmptyRange"). |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public boolean` | `**[add](#add(T))**(T o)`Always throws `UnsupportedOperationException` for an empty range. |
| | `public boolean` | `**[addAll](#addAll(int,%20Collection))**(int index, [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<? extends T> c)`Always throws `UnsupportedOperationException` for an empty range. |
| | `public boolean` | `**[addAll](#addAll(Collection))**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<? extends T> c)`Always throws `UnsupportedOperationException` for an empty range. |
| | `public boolean` | `**[containsWithinBounds](#containsWithinBounds(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)`Never true for an empty range. |
| | `public T` | `**[get](#get(int))**(int index)`Always throws `IndexOutOfBoundsException` for an empty range. |
| | `public T` | `**[getFrom](#getFrom())**()`{@inheritDoc} |
| | `public T` | `**[getTo](#getTo())**()`{@inheritDoc} |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[inspect](#inspect())**()`{@inheritDoc} |
| | `public boolean` | `**[isReverse](#isReverse())**()`Never true for an empty range. |
| | `public boolean` | `**[remove](#remove(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)`Always throws `UnsupportedOperationException` for an empty range. |
| | `public T` | `**[remove](#remove(int))**(int index)`Always throws `UnsupportedOperationException` for an empty range. |
| | `public boolean` | `**[removeAll](#removeAll(Collection))**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<?> c)`Always throws `UnsupportedOperationException` for an empty range. |
| | `public boolean` | `**[retainAll](#retainAll(Collection))**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<?> c)`Always throws `UnsupportedOperationException` for an empty range. |
| | `public T` | `**[set](#set(int,%20T))**(int index, T element)`Always throws `UnsupportedOperationException` for an empty range. |
| | `public int` | `**[size](#size())**()`Always 0 for an empty range. |
| | `public void` | `**[step](#step(int,%20groovy.lang.Closure))**(int step, [Closure](closure) closure)`Always does nothing for an empty range. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<T>` | `**[step](#step(int))**(int step)`Always returns an empty list for an empty range. |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()`{@inheritDoc} |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [AbstractList](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html "AbstractList")` | `[add](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#add(int,%20java.lang.Object) "add"), [add](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#add(java.lang.Object) "add"), [remove](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#remove(int) "remove"), [get](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#get(int) "get"), [equals](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#equals(java.lang.Object) "equals"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#hashCode() "hashCode"), [indexOf](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#indexOf(java.lang.Object) "indexOf"), [clear](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#clear() "clear"), [lastIndexOf](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#lastIndexOf(java.lang.Object) "lastIndexOf"), [subList](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#subList(int,%20int) "subList"), [iterator](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#iterator() "iterator"), [addAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#addAll(int,%20java.util.Collection) "addAll"), [set](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#set(int,%20java.lang.Object) "set"), [listIterator](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#listIterator() "listIterator"), [listIterator](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#listIterator(int) "listIterator"), [remove](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#remove(java.lang.Object) "remove"), [toString](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#toString() "toString"), [isEmpty](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#isEmpty() "isEmpty"), [size](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#size() "size"), [toArray](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#toArray() "toArray"), [toArray](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#toArray(%5BLjava.lang.Object;) "toArray"), [contains](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#contains(java.lang.Object) "contains"), [addAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#addAll(java.util.Collection) "addAll"), [removeAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#removeAll(java.util.Collection) "removeAll"), [retainAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#retainAll(java.util.Collection) "retainAll"), [containsAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#containsAll(java.util.Collection) "containsAll"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#wait(long) "wait"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#notifyAll() "notifyAll"), [toArray](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#toArray(java.util.function.IntFunction) "toArray"), [stream](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#stream() "stream"), [spliterator](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#spliterator() "spliterator"), [removeIf](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#removeIf(java.util.function.Predicate) "removeIf"), [parallelStream](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#parallelStream() "parallelStream"), [forEach](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#forEach(java.util.function.Consumer) "forEach"), [replaceAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#replaceAll(java.util.function.UnaryOperator) "replaceAll"), [sort](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#sort(java.util.Comparator) "sort")` |
Field Detail
------------
### protected T **at**
The value at which the range originates (may be `null`).
Constructor Detail
------------------
### public **EmptyRange**(T at)
Creates a new [EmptyRange](emptyrange "EmptyRange").
**Parameters:**
`at` - the value at which the range starts (may be `null`).
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **add**(T o)
Always throws `UnsupportedOperationException` for an empty range.
**throws:**
UnsupportedOperationException always
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **addAll**(int index, [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<? extends T> c)
Always throws `UnsupportedOperationException` for an empty range.
**throws:**
UnsupportedOperationException
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **addAll**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<? extends T> c)
Always throws `UnsupportedOperationException` for an empty range.
**throws:**
UnsupportedOperationException
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **containsWithinBounds**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)
Never true for an empty range.
**Returns:**
`false`
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public T **get**(int index)
Always throws `IndexOutOfBoundsException` for an empty range.
**throws:**
IndexOutOfBoundsException always
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public T **getFrom**()
{@inheritDoc}
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public T **getTo**()
{@inheritDoc}
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **inspect**()
{@inheritDoc}
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **isReverse**()
Never true for an empty range.
**Returns:**
`false`
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **remove**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)
Always throws `UnsupportedOperationException` for an empty range.
**throws:**
UnsupportedOperationException
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public T **remove**(int index)
Always throws `UnsupportedOperationException` for an empty range.
**throws:**
UnsupportedOperationException
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **removeAll**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<?> c)
Always throws `UnsupportedOperationException` for an empty range.
**throws:**
UnsupportedOperationException
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **retainAll**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<?> c)
Always throws `UnsupportedOperationException` for an empty range.
**throws:**
UnsupportedOperationException
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public T **set**(int index, T element)
Always throws `UnsupportedOperationException` for an empty range.
**throws:**
UnsupportedOperationException
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **size**()
Always 0 for an empty range.
**Returns:**
0
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **step**(int step, [Closure](closure) closure)
Always does nothing for an empty range.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<T> **step**(int step)
Always returns an empty list for an empty range.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
{@inheritDoc}
groovy [Java] Class SpreadMap [Java] Class SpreadMap
======================
* groovy.lang.SpreadMap
```
public class SpreadMap
extends [HashMap](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html "HashMap")
```
Helper to turn a list with an even number of elements into a Map.
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[SpreadMap](#SpreadMap(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] values)` |
| `**[SpreadMap](#SpreadMap(java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") map)` |
| `**[SpreadMap](#SpreadMap(java.util.List))**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") list)`
**Since:**
1.8.0
|
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public boolean` | `**[equals](#equals(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") that)` |
| | `public boolean` | `**[equals](#equals(groovy.lang.SpreadMap))**([SpreadMap](spreadmap) that)` |
| | `public int` | `**[hashCode](#hashCode())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[put](#put(java.lang.Object,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") key, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public void` | `**[putAll](#putAll(java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") t)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[remove](#remove(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") key)` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()`
**Returns:**
the string expression of `this`
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [HashMap](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html "HashMap")` | `[remove](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#remove(java.lang.Object,%20java.lang.Object) "remove"), [remove](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#remove(java.lang.Object) "remove"), [get](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#get(java.lang.Object) "get"), [put](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#put(java.lang.Object,%20java.lang.Object) "put"), [values](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#values() "values"), [clone](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#clone() "clone"), [clear](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#clear() "clear"), [isEmpty](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#isEmpty() "isEmpty"), [replace](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#replace(java.lang.Object,%20java.lang.Object) "replace"), [replace](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#replace(java.lang.Object,%20java.lang.Object,%20java.lang.Object) "replace"), [replaceAll](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#replaceAll(java.util.function.BiFunction) "replaceAll"), [size](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#size() "size"), [merge](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#merge(java.lang.Object,%20java.lang.Object,%20java.util.function.BiFunction) "merge"), [entrySet](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#entrySet() "entrySet"), [putAll](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#putAll(java.util.Map) "putAll"), [putIfAbsent](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#putIfAbsent(java.lang.Object,%20java.lang.Object) "putIfAbsent"), [compute](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#compute(java.lang.Object,%20java.util.function.BiFunction) "compute"), [forEach](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#forEach(java.util.function.BiConsumer) "forEach"), [containsKey](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#containsKey(java.lang.Object) "containsKey"), [computeIfAbsent](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#computeIfAbsent(java.lang.Object,%20java.util.function.Function) "computeIfAbsent"), [keySet](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#keySet() "keySet"), [containsValue](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#containsValue(java.lang.Object) "containsValue"), [getOrDefault](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#getOrDefault(java.lang.Object,%20java.lang.Object) "getOrDefault"), [computeIfPresent](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#computeIfPresent(java.lang.Object,%20java.util.function.BiFunction) "computeIfPresent"), [equals](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#hashCode() "hashCode"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#wait(long) "wait"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **SpreadMap**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] values)
### public **SpreadMap**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") map)
### public **SpreadMap**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") list)
**Since:**
1.8.0
**Parameters:**
`list` - the list to make spreadable
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **equals**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") that)
### public boolean **equals**([SpreadMap](spreadmap) that)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **hashCode**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **put**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") key, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **putAll**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") t)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **remove**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") key)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
**Returns:**
the string expression of `this`
| programming_docs |
groovy [Java] Class MetaArrayLengthProperty [Java] Class MetaArrayLengthProperty
====================================
* groovy.lang.MetaArrayLengthProperty
```
public class MetaArrayLengthProperty
extends [MetaProperty](metaproperty)
```
Represents the length property of an array
Inherited fields
| Fields inherited from class | Fields |
| **`class [MetaProperty](metaproperty)`** | `[PROPERTY\_SET\_PREFIX](metaproperty#PROPERTY_SET_PREFIX), [name](metaproperty#name), [type](metaproperty#type)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[MetaArrayLengthProperty](#MetaArrayLengthProperty())**()`Sole constructor setting name to "length" and type to int |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object)`Get this property from the given object. |
| | `public void` | `**[setProperty](#setProperty(java.lang.Object,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`Sets the property on the given object to the new value |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [MetaProperty](metaproperty)` | `[getGetterName](metaproperty#getGetterName(java.lang.String,%20java.lang.Class)), [getModifiers](metaproperty#getModifiers()), [getName](metaproperty#getName()), [getProperty](metaproperty#getProperty(java.lang.Object)), [getSetterName](metaproperty#getSetterName(java.lang.String)), [getType](metaproperty#getType()), [setProperty](metaproperty#setProperty(java.lang.Object,%20java.lang.Object))` |
Constructor Detail
------------------
### public **MetaArrayLengthProperty**()
Sole constructor setting name to "length" and type to int
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object)
Get this property from the given object.
**throws:**
IllegalArgumentException if object is not an array
**Parameters:**
`object` - an array
**Returns:**
the length of the array object
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setProperty**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
Sets the property on the given object to the new value
**throws:**
RuntimeException if the property could not be set
**Parameters:**
`object` - on which to set the property
`newValue` - the new value of the property
groovy [Java] Class ListWithDefault<T> [Java] Class ListWithDefault<T>
===============================
* groovy.lang.ListWithDefault
All Implemented Interfaces and Traits: [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")
```
public final class ListWithDefault<T>
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")
```
A wrapper for [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") which automatically grows the list when either [get(int)](#get(int)) or [getAt(int)](#getAt(int)) is called with an index greater than or equal to `size()`.
**Since:**
1.8.7
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public boolean` | `**[add](#add(T))**(T t)` |
| | `public void` | `**[add](#add(int,%20T))**(int i, T t)` |
| | `public boolean` | `**[addAll](#addAll(Collection))**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<? extends T> ts)` |
| | `public boolean` | `**[addAll](#addAll(int,%20Collection))**(int i, [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<? extends T> ts)` |
| | `public void` | `**[clear](#clear())**()` |
| | `public boolean` | `**[contains](#contains(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)` |
| | `public boolean` | `**[containsAll](#containsAll(Collection))**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<?> objects)` |
| | `public boolean` | `**[equals](#equals(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj)` |
| | `public T` | `**[get](#get(int))**(int index)`Returns the element at the given index but grows the list if needed. |
| | `public T` | `**[getAt](#getAt(int))**(int index)`Overwrites subscript operator handling by redirecting to [get(int)](#get(int)). |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<T>` | `**[getDelegate](#getDelegate())**()` |
| | `public [Closure](closure)` | `**[getInitClosure](#getInitClosure())**()` |
| | `public int` | `**[hashCode](#hashCode())**()` |
| | `public int` | `**[indexOf](#indexOf(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)` |
| | `public boolean` | `**[isEmpty](#isEmpty())**()` |
| | `public boolean` | `**[isLazyDefaultValues](#isLazyDefaultValues())**()` |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")<T>` | `**[iterator](#iterator())**()` |
| | `public int` | `**[lastIndexOf](#lastIndexOf(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)` |
| | `public [ListIterator](https://docs.oracle.com/javase/8/docs/api/java/util/ListIterator.html "ListIterator")<T>` | `**[listIterator](#listIterator())**()` |
| | `public [ListIterator](https://docs.oracle.com/javase/8/docs/api/java/util/ListIterator.html "ListIterator")<T>` | `**[listIterator](#listIterator(int))**(int i)` |
| `<T>` | `public static [ListWithDefault](listwithdefault "ListWithDefault")<T>` | `**[newInstance](#newInstance(List,%20boolean,%20groovy.lang.Closure))**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<T> items, boolean lazyDefaultValues, [Closure](closure) initClosure)` |
| | `public boolean` | `**[remove](#remove(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)` |
| | `public T` | `**[remove](#remove(int))**(int i)` |
| | `public boolean` | `**[removeAll](#removeAll(Collection))**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<?> objects)` |
| | `public boolean` | `**[retainAll](#retainAll(Collection))**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<?> objects)` |
| | `public T` | `**[set](#set(int,%20T))**(int i, T t)` |
| | `public int` | `**[size](#size())**()` |
| | `public [ListWithDefault](listwithdefault "ListWithDefault")<T>` | `**[subList](#subList(int,%20int))**(int fromIndex, int toIndex)`Returns a view of a portion of this list. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[]` | `**[toArray](#toArray())**()` |
| `<U>` | `public U[]` | `**[toArray](#toArray(U))**(U[] ts)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **add**(T t)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **add**(int i, T t)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **addAll**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<? extends T> ts)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **addAll**(int i, [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<? extends T> ts)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **clear**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **contains**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **containsAll**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<?> objects)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **equals**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public T **get**(int index)
Returns the element at the given index but grows the list if needed. If the requested `index` is greater than or equal to `size()`, the list will grow to the new size and a default value calculated using the `initClosure` will be used to populate the missing value and returned.
If `lazyDefaultValues` is `true` any gaps when growing the list are filled with nulls. Subsequent attempts to retrieve items from the list from those gap index values will, upon finding null, call the `initClosure` to populate the list for the given list value. Hence, when in this mode, nulls cannot be stored in this list. If `lazyDefaultValues` is `false` any gaps when growing the list are filled eagerly by calling the `initClosure` for all gap indexes during list growth. No calls to `initClosure` are made except during list growth and it is ok to store null values in the list when in this mode.
This implementation breaks the contract of [List.get](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#get(int) "List.get") as it a) possibly modifies the underlying list and b) does NOT throw an [IndexOutOfBoundsException](https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html "IndexOutOfBoundsException") when `index < 0 || index >= size()`.
**Parameters:**
`index` - an index (might be greater or equal to `size()`, or smaller than 0)
**Returns:**
the value at the given `index` or the default value
### public T **getAt**(int index)
Overwrites subscript operator handling by redirecting to [get(int)](#get(int)).
**Parameters:**
`index` - an index (might be greater or equal to `size()`, or smaller than 0)
**Returns:**
the value at the given `index` or the default value
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<T> **getDelegate**()
### public [Closure](closure) **getInitClosure**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **hashCode**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **indexOf**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **isEmpty**()
### public boolean **isLazyDefaultValues**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")<T> **iterator**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **lastIndexOf**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [ListIterator](https://docs.oracle.com/javase/8/docs/api/java/util/ListIterator.html "ListIterator")<T> **listIterator**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [ListIterator](https://docs.oracle.com/javase/8/docs/api/java/util/ListIterator.html "ListIterator")<T> **listIterator**(int i)
### <T> public static [ListWithDefault](listwithdefault "ListWithDefault")<T> **newInstance**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<T> items, boolean lazyDefaultValues, [Closure](closure) initClosure)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **remove**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public T **remove**(int i)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **removeAll**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<?> objects)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **retainAll**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<?> objects)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public T **set**(int i, T t)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **size**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [ListWithDefault](listwithdefault "ListWithDefault")<T> **subList**(int fromIndex, int toIndex)
Returns a view of a portion of this list. This method returns a list with the same lazy list settings as the original list.
**Parameters:**
`fromIndex` - low endpoint of the subList (inclusive)
`toIndex` - upper endpoint of the subList (exclusive)
**Returns:**
a view of a specified range within this list, keeping all lazy list settings
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] **toArray**()
### <U> @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public U[] **toArray**(U[] ts)
groovy [Java] Annotation Type Lazy [Java] Annotation Type Lazy
===========================
* groovy.lang.Lazy
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.FIELD})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.LazyASTTransformation")
public @interface Lazy
```
Field annotation to simplify lazy initialization.
Example usage without any special modifiers just defers initialization until the first call but is not thread-safe:
```
@Lazy T x
```
becomes
```
private T $x
T getX() {
if ($x != null)
return $x
else {
$x = new T()
return $x
}
}
```
If the field is declared volatile then initialization will be synchronized using the [double-checked locking](http://en.wikipedia.org/wiki/Double-checked_locking) pattern as shown here:
```
@Lazy volatile T x
```
becomes
```
private volatile T $x
T getX() {
T $x_local = $x
if ($x_local != null)
return $x_local
else {
synchronized(this) {
if ($x == null) {
$x = new T()
}
return $x
}
}
}
```
By default a field will be initialized by calling its default constructor. If the field has an initial value expression then this expression will be used instead of calling the default constructor. In particular, it is possible to use closure `{ ... } ()` syntax as follows:
```
@Lazy T x = { [1, 2, 3] } ()
```
becomes
```
private T $x
T getX() {
T $x_local = $x
if ($x_local != null)
return $x_local
else {
synchronized(this) {
if ($x == null) {
$x = { [1, 2, 3] } ()
}
return $x
}
}
}
```
`@Lazy(soft=true)` will use a soft reference instead of the field and use the above rules each time re-initialization is required.
If the `soft` flag for the annotation is not set but the field is static, then the [initialization on demand holder idiom](http://en.wikipedia.org/wiki/Initialization_on_demand_holder_idiom) is used as follows:
```
@Lazy static FieldType field
@Lazy static Date date1
@Lazy static Date date2 = { new Date().copyWith(year: 2000) }()
@Lazy static Date date3 = new GregorianCalendar(2009, Calendar.JANUARY, 1).time
```
becomes these methods and inners classes within the class containing the above definitions:
```
private static class FieldTypeHolder_field {
private static final FieldType INSTANCE = new FieldType()
}
private static class DateHolder_date1 {
private static final Date INSTANCE = new Date()
}
private static class DateHolder_date2 {
private static final Date INSTANCE = { new Date().copyWith(year: 2000) }()
}
private static class DateHolder_date3 {
private static final Date INSTANCE = new GregorianCalendar(2009, Calendar.JANUARY, 1).time
}
static FieldType getField() {
return FieldTypeHolder_field.INSTANCE
}
static Date getDate1() {
return DateHolder_date1.INSTANCE
}
static Date getDate2() {
return DateHolder_date2.INSTANCE
}
static Date getDate3() {
return DateHolder_date3.INSTANCE
}
```
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[soft](#soft)`
**Returns:**
if field should be soft referenced instead of hard referenced
**Default:**
false
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **soft**
**Returns:**
if field should be soft referenced instead of hard referenced
**Default:**
false
| programming_docs |
groovy [Java] Class IntRange [Java] Class IntRange
=====================
* groovy.lang.IntRange
All Implemented Interfaces and Traits:
[Range](range), [Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html "Serializable")
```
public class IntRange
extends [AbstractList](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html "AbstractList")
implements [Range](range), [Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html "Serializable")
```
Represents a list of Integer objects starting at and potentially including a specified `from` value up (or down) to and potentially including a given `to` value.
Instances of this class may be either inclusive aware or non-inclusive aware. See the relevant constructors for creating each type. Inclusive aware IntRange instances are suitable for use with Groovy's range indexing - in particular if the from or to values might be negative. This normally happens underneath the covers but is worth keeping in mind if creating these ranges yourself explicitly.
Note: the design of this class might seem a little strange at first. It contains Boolean flags, `inclusiveLeft` and `inclusiveRight`, which can be `true`, `false` or `null`. This design is for backwards compatibility reasons. Groovy uses this class under the covers to represent range indexing, e.g. `someList[x..y]` and `someString[x..<y]`. In early versions of Groovy the ranges in these expressions were represented under the covers by the `new IntRange(x, y)` and `new IntRange(x, y-1)`. This turns out to be a lossy abstraction when x and/or y are negative values. Now the latter case is represented by `new IntRange(false, x, y)`.
Note: This class is a copy of [ObjectRange](objectrange "ObjectRange") optimized for `int`. If you make any changes to this class, you might consider making parallel changes to [ObjectRange](objectrange "ObjectRange").
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[IntRange](#IntRange(int,%20int))**(int from, int to)`Creates a new non-inclusive aware `IntRange`. |
| `protected **[IntRange](#IntRange(int,%20int,%20boolean))**(int from, int to, boolean reverse)`Creates a new non-inclusive aware `IntRange`. |
| `**[IntRange](#IntRange(boolean,%20int,%20int))**(boolean inclusiveRight, int from, int to)`Creates a new inclusive aware `IntRange`. |
| `**[IntRange](#IntRange(boolean,%20boolean,%20int,%20int))**(boolean inclusiveLeft, boolean inclusiveRight, int from, int to)`Creates a new inclusive aware `IntRange` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| `<T extends Number & Comparable>` | `public [NumberRange](numberrange)` | `**[by](#by(T))**(T stepSize)`Creates a new NumberRange with the same `from` and `to` as this IntRange but with a step size of `stepSize`. |
| | `public boolean` | `**[contains](#contains(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public boolean` | `**[containsAll](#containsAll(java.util.Collection))**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") other)` |
| | `public boolean` | `**[containsWithinBounds](#containsWithinBounds(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)` |
| | `public boolean` | `**[equals](#equals(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") that)`Determines if this object is equal to another object. |
| | `public boolean` | `**[equals](#equals(groovy.lang.IntRange))**([IntRange](intrange) that)`Compares an [IntRange](intrange "IntRange") to another [IntRange](intrange "IntRange"). |
| | `public [Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer")` | `**[get](#get(int))**(int index)` |
| | `public [Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer")` | `**[getFrom](#getFrom())**()` |
| | `public int` | `**[getFromInt](#getFromInt())**()`Gets the 'from' value as a primitive integer. |
| | `public [Boolean](https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html "Boolean")` | `**[getInclusive](#getInclusive())**()`Returns the same as `getInclusiveRight`, kept here for backwards compatibility. |
| | `public [Boolean](https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html "Boolean")` | `**[getInclusiveLeft](#getInclusiveLeft())**()`Returns the inclusiveLeft flag. |
| | `public [Boolean](https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html "Boolean")` | `**[getInclusiveRight](#getInclusiveRight())**()`Returns the inclusiveRight flag. |
| | `public [Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer")` | `**[getTo](#getTo())**()` |
| | `public int` | `**[getToInt](#getToInt())**()`Gets the 'to' value as a primitive integer. |
| | `public int` | `**[hashCode](#hashCode())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[inspect](#inspect())**()` |
| | `public boolean` | `**[isReverse](#isReverse())**()` |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")<[Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer")>` | `**[iterator](#iterator())**()` |
| | `public int` | `**[size](#size())**()` |
| | `public void` | `**[step](#step(int,%20groovy.lang.Closure))**(int step, [Closure](closure) closure)` |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer")>` | `**[step](#step(int))**(int step)` |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer")>` | `**[subList](#subList(int,%20int))**(int fromIndex, int toIndex)` |
| | `public [RangeInfo](../../org/codehaus/groovy/runtime/rangeinfo)` | `**[subListBorders](#subListBorders(int))**(int size)`A method for determining from and to information when using this IntRange to index an aggregate object of the specified size. |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [AbstractList](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html "AbstractList")` | `[add](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#add(int,%20java.lang.Object) "add"), [add](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#add(java.lang.Object) "add"), [remove](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#remove(int) "remove"), [get](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#get(int) "get"), [equals](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#equals(java.lang.Object) "equals"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#hashCode() "hashCode"), [indexOf](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#indexOf(java.lang.Object) "indexOf"), [clear](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#clear() "clear"), [lastIndexOf](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#lastIndexOf(java.lang.Object) "lastIndexOf"), [subList](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#subList(int,%20int) "subList"), [iterator](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#iterator() "iterator"), [addAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#addAll(int,%20java.util.Collection) "addAll"), [set](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#set(int,%20java.lang.Object) "set"), [listIterator](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#listIterator() "listIterator"), [listIterator](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#listIterator(int) "listIterator"), [remove](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#remove(java.lang.Object) "remove"), [toString](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#toString() "toString"), [isEmpty](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#isEmpty() "isEmpty"), [size](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#size() "size"), [toArray](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#toArray() "toArray"), [toArray](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#toArray(%5BLjava.lang.Object;) "toArray"), [contains](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#contains(java.lang.Object) "contains"), [addAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#addAll(java.util.Collection) "addAll"), [removeAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#removeAll(java.util.Collection) "removeAll"), [retainAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#retainAll(java.util.Collection) "retainAll"), [containsAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#containsAll(java.util.Collection) "containsAll"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#wait(long) "wait"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#notifyAll() "notifyAll"), [toArray](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#toArray(java.util.function.IntFunction) "toArray"), [stream](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#stream() "stream"), [spliterator](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#spliterator() "spliterator"), [removeIf](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#removeIf(java.util.function.Predicate) "removeIf"), [parallelStream](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#parallelStream() "parallelStream"), [forEach](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#forEach(java.util.function.Consumer) "forEach"), [replaceAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#replaceAll(java.util.function.UnaryOperator) "replaceAll"), [sort](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#sort(java.util.Comparator) "sort")` |
Constructor Detail
------------------
### public **IntRange**(int from, int to)
Creates a new non-inclusive aware `IntRange`. If `from` is greater than `to`, a reverse range is created with `from` and `to` swapped.
**throws:**
IllegalArgumentException if the range would contain more than [Integer.MAX\_VALUE](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html#MAX_VALUE "Integer.MAX_VALUE") values.
**Parameters:**
`from` - the first number in the range.
`to` - the last number in the range.
### protected **IntRange**(int from, int to, boolean reverse)
Creates a new non-inclusive aware `IntRange`.
**throws:**
IllegalArgumentException if `from` is greater than `to`.
**Parameters:**
`from` - the first value in the range.
`to` - the last value in the range.
`reverse` - `true` if the range should count from `to` to `from`.
### public **IntRange**(boolean inclusiveRight, int from, int to)
Creates a new inclusive aware `IntRange`.
**Parameters:**
`from` - the first value in the range.
`to` - the last value in the range.
`inclusiveRight` - `true` if the to value is included in the range.
### public **IntRange**(boolean inclusiveLeft, boolean inclusiveRight, int from, int to)
Creates a new inclusive aware `IntRange`
**Parameters:**
`inclusiveLeft` - `true` if the from value is included in the range.
`inclusiveRight` - `true` if the to value is included in the range.
`from` - the first value in the range.
`to` - the last value in the range.
Method Detail
-------------
### <T extends Number & Comparable> public [NumberRange](numberrange) **by**(T stepSize)
Creates a new NumberRange with the same `from` and `to` as this IntRange but with a step size of `stepSize`.
**Parameters:**
`stepSize` - the desired step size
**Returns:**
a new NumberRange
**Since:**
2.5.0
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **contains**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **containsAll**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") other)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **containsWithinBounds**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **equals**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") that)
Determines if this object is equal to another object. Delegates to [AbstractList.equals](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#equals(java.lang.Object) "AbstractList.equals") if `that` is anything other than an [IntRange](intrange "IntRange").
It is not necessary to override `hashCode`, as [AbstractList.hashCode](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#hashCode() "AbstractList.hashCode") provides a suitable hash code.
Note that equals is generally handled by [DefaultGroovyMethods.equals](../../org/codehaus/groovy/runtime/defaultgroovymethods#equals(List,%20List) "DefaultGroovyMethods.equals") instead of this method.
**Parameters:**
`that` - the object to compare
**Returns:**
`true` if the objects are equal
### public boolean **equals**([IntRange](intrange) that)
Compares an [IntRange](intrange "IntRange") to another [IntRange](intrange "IntRange").
**Parameters:**
`that` - the object to compare for equality
**Returns:**
`true` if the ranges are equal
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") **get**(int index)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") **getFrom**()
### public int **getFromInt**()
Gets the 'from' value as a primitive integer.
**Returns:**
the 'from' value as a primitive integer.
### public [Boolean](https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html "Boolean") **getInclusive**()
Returns the same as `getInclusiveRight`, kept here for backwards compatibility.
### public [Boolean](https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html "Boolean") **getInclusiveLeft**()
Returns the inclusiveLeft flag. Null for non-inclusive aware ranges or non-null for inclusive aware ranges.
### public [Boolean](https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html "Boolean") **getInclusiveRight**()
Returns the inclusiveRight flag. Null for non-inclusive aware ranges or non-null for inclusive aware ranges.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") **getTo**()
### public int **getToInt**()
Gets the 'to' value as a primitive integer.
**Returns:**
the 'to' value as a primitive integer.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **hashCode**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **inspect**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **isReverse**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")<[Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer")> **iterator**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **size**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **step**(int step, [Closure](closure) closure)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer")> **step**(int step)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer")> **subList**(int fromIndex, int toIndex)
### public [RangeInfo](../../org/codehaus/groovy/runtime/rangeinfo) **subListBorders**(int size)
A method for determining from and to information when using this IntRange to index an aggregate object of the specified size. Normally only used internally within Groovy but useful if adding range indexing support for your own aggregates.
**Parameters:**
`size` - the size of the aggregate being indexed
**Returns:**
the calculated range information (with 1 added to the to value, ready for providing to subList
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
groovy [Java] Class TracingInterceptor [Java] Class TracingInterceptor
===============================
* groovy.lang.TracingInterceptor
All Implemented Interfaces and Traits: [Interceptor](interceptor)
```
public class TracingInterceptor
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [Interceptor](interceptor)
```
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**protected [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer")**` | `[writer](#writer)` | |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[afterInvoke](#afterInvoke(java.lang.Object,%20java.lang.String,%20java.lang.Object,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") result)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[beforeInvoke](#beforeInvoke(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)` |
| | `public boolean` | `**[doInvoke](#doInvoke())**()` |
| | `public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer")` | `**[getWriter](#getWriter())**()`Returns the writer associated with this interceptor. |
| | `public void` | `**[setWriter](#setWriter(java.io.Writer))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") writer)`Changes the writer associated with this interceptor. |
| | `protected void` | `**[write](#write(java.lang.Object,%20java.lang.String,%20java.lang.Object,%20java.lang.String))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") origin)` |
| | `protected void` | `**[writeInfo](#writeInfo(java.lang.Class,%20java.lang.String,%20java.lang.Object))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") aClass, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### protected [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") **writer**
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **afterInvoke**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") result)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **beforeInvoke**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **doInvoke**()
### public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") **getWriter**()
Returns the writer associated with this interceptor.
### public void **setWriter**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") writer)
Changes the writer associated with this interceptor.
### protected void **write**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") origin)
### protected void **writeInfo**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") aClass, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)
| programming_docs |
groovy [Java] Class MetaExpandoProperty [Java] Class MetaExpandoProperty
================================
* groovy.lang.MetaExpandoProperty
```
public class MetaExpandoProperty
extends [MetaProperty](metaproperty)
```
Represents a property in an Expando object
Inherited fields
| Fields inherited from class | Fields |
| **`class [MetaProperty](metaproperty)`** | `[PROPERTY\_SET\_PREFIX](metaproperty#PROPERTY_SET_PREFIX), [name](metaproperty#name), [type](metaproperty#type)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[MetaExpandoProperty](#MetaExpandoProperty(java.util.Map%24Entry))**([Map.Entry](https://docs.oracle.com/javase/8/docs/api/java/util/Map.Entry.html "Map.Entry") entry)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object)`
**Returns:**
the property of the given object
|
| | `public void` | `**[setProperty](#setProperty(java.lang.Object,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`Sets the property on the given object to the new value |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [MetaProperty](metaproperty)` | `[getGetterName](metaproperty#getGetterName(java.lang.String,%20java.lang.Class)), [getModifiers](metaproperty#getModifiers()), [getName](metaproperty#getName()), [getProperty](metaproperty#getProperty(java.lang.Object)), [getSetterName](metaproperty#getSetterName(java.lang.String)), [getType](metaproperty#getType()), [setProperty](metaproperty#setProperty(java.lang.Object,%20java.lang.Object))` |
Constructor Detail
------------------
### public **MetaExpandoProperty**([Map.Entry](https://docs.oracle.com/javase/8/docs/api/java/util/Map.Entry.html "Map.Entry") entry)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object)
**throws:**
Exception if the property could not be evaluated
**Returns:**
the property of the given object
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setProperty**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
Sets the property on the given object to the new value
**Parameters:**
`object` - on which to set the property
`newValue` - the new value of the property
groovy [Java] Class MetaClassRegistry.MetaClassCreationHandle [Java] Class MetaClassRegistry.MetaClassCreationHandle
======================================================
* groovy.lang.MetaClassRegistry.MetaClassCreationHandle
```
public class MetaClassRegistry.MetaClassCreationHandle
```
Class used as base for the creation of MetaClass implementations. The Class defaults to MetaClassImpl, if the class loading fails to find a special meta class. The name for such a meta class would be the class name it is created for with the prefix "groovy.runtime.metaclass." By replacing the handle in the registry you can have any control over the creation of what MetaClass is used for a class that you want to have. WARNING: experimental code, likely to change soon
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public final [MetaClass](metaclass)` | `**[create](#create(java.lang.Class,%20groovy.lang.MetaClassRegistry))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, [MetaClassRegistry](metaclassregistry) registry)`Creates a metaclass implementation for theClass. |
| | `protected [MetaClass](metaclass)` | `**[createNormalMetaClass](#createNormalMetaClass(java.lang.Class,%20groovy.lang.MetaClassRegistry))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, [MetaClassRegistry](metaclassregistry) registry)` |
| | `public boolean` | `**[isDisableCustomMetaClassLookup](#isDisableCustomMetaClassLookup())**()`Returns whether custom meta classes are disabled. |
| | `public void` | `**[setDisableCustomMetaClassLookup](#setDisableCustomMetaClassLookup(boolean))**(boolean disableCustomMetaClassLookup)`Set flag saying to disable lookup of custom meta classes It's enough to call this method only once in your application for handle which was set in to registry as every new handle will inherit this property |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### public final [MetaClass](metaclass) **create**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, [MetaClassRegistry](metaclassregistry) registry)
Creates a metaclass implementation for theClass.
**Parameters:**
`theClass` - The class to create a metaclass for
`registry` - The metaclass registry the metaclass we be registered in.
### protected [MetaClass](metaclass) **createNormalMetaClass**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, [MetaClassRegistry](metaclassregistry) registry)
### public boolean **isDisableCustomMetaClassLookup**()
Returns whether custom meta classes are disabled.
### public void **setDisableCustomMetaClassLookup**(boolean disableCustomMetaClassLookup)
Set flag saying to disable lookup of custom meta classes It's enough to call this method only once in your application for handle which was set in to registry as every new handle will inherit this property
**Parameters:**
`disableCustomMetaClassLookup` - flag saying to disable lookup of custom meta classes
groovy [Java] Class IncorrectClosureArgumentsException [Java] Class IncorrectClosureArgumentsException
===============================================
* groovy.lang.IncorrectClosureArgumentsException
```
public class IncorrectClosureArgumentsException
extends [GroovyRuntimeException](groovyruntimeexception)
```
An exception occurred when invoking a Closure with the wrong number and/or types of arguments
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[IncorrectClosureArgumentsException](#IncorrectClosureArgumentsException(groovy.lang.Closure,%20java.lang.Object,%20java.lang.Class))**([Closure](closure) closure, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") arguments, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] expected)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getArguments](#getArguments())**()` |
| | `public [Closure](closure)` | `**[getClosure](#getClosure())**()` |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[]` | `**[getExpected](#getExpected())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyRuntimeException](groovyruntimeexception)` | `[getLocationText](groovyruntimeexception#getLocationText()), [getMessage](groovyruntimeexception#getMessage()), [getMessageWithoutLocationText](groovyruntimeexception#getMessageWithoutLocationText()), [getModule](groovyruntimeexception#getModule()), [getNode](groovyruntimeexception#getNode()), [setModule](groovyruntimeexception#setModule(org.codehaus.groovy.ast.ModuleNode))` |
Constructor Detail
------------------
### public **IncorrectClosureArgumentsException**([Closure](closure) closure, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") arguments, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] expected)
Method Detail
-------------
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getArguments**()
### public [Closure](closure) **getClosure**()
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] **getExpected**()
groovy [Java] Interface ClosureInvokingMethod [Java] Interface ClosureInvokingMethod
======================================
```
public interface ClosureInvokingMethod
```
An interface for MetaMethods that invoke closures to implements. Used by ExpandoMetaClass
**See Also:**
[ExpandoMetaClass](expandometaclass "ExpandoMetaClass")
**Since:**
1.5
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Closure](closure)` | `**[getClosure](#getClosure())**()`Returns the original closure that this method invokes |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getName](#getName())**()`The method name |
| | `public boolean` | `**[isStatic](#isStatic())**()`Is it a static method? |
Method Detail
-------------
### public [Closure](closure) **getClosure**()
Returns the original closure that this method invokes
**Returns:**
The closure
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getName**()
The method name
**Returns:**
The method name
### public boolean **isStatic**()
Is it a static method?
**Returns:**
True if it is
groovy [Java] Interface GroovyCallable<V> [Java] Interface GroovyCallable<V>
==================================
* groovy.lang.ExpandoMetaClass.Callable
All Superinterfaces: [ExpandoMetaClass.Callable](expandometaclass.callable)
```
public interface GroovyCallable<V>
extends [ExpandoMetaClass.Callable](expandometaclass.callable)
```
A special "marker" style interface allowing Groovy classes to implement both Runnable and Callable yet give preference to Runnable (for backwards compatibility) for APIs having both Runnable and Callable methods. You should generally NOT use this method in your own code.
**See Also:**
[Callable](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Callable.html "Callable")
**Since:**
1.8.0
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `interface [ExpandoMetaClass.Callable](expandometaclass.callable)` | `[call](expandometaclass.callable#call())` |
groovy [Java] Interface AdaptingMetaClass [Java] Interface AdaptingMetaClass
==================================
* groovy.lang.MetaObjectProtocol
All Superinterfaces:
[MetaClass](metaclass), [MetaObjectProtocol](metaobjectprotocol)
```
public interface AdaptingMetaClass
extends [MetaClass](metaclass)
```
An interface for MetaClass instances that "adapt" other MetaClass instances such as a proxy or delegating MetaClass.
**Since:**
1.5
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [MetaClass](metaclass)` | `**[getAdaptee](#getAdaptee())**()`Returns the MetaClass that this adapter adapts |
| | `public void` | `**[setAdaptee](#setAdaptee(groovy.lang.MetaClass))**([MetaClass](metaclass) metaClass)`Sets the MetaClass adapted by this MetaClass |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `interface [MetaClass](metaclass)` | `[getAttribute](metaclass#getAttribute(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20boolean)), [getClassNode](metaclass#getClassNode()), [getMetaMethods](metaclass#getMetaMethods()), [getMethods](metaclass#getMethods()), [getProperties](metaclass#getProperties()), [getProperty](metaclass#getProperty(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20boolean,%20boolean)), [initialize](metaclass#initialize()), [invokeMethod](metaclass#invokeMethod(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20java.lang.Object,%20boolean,%20boolean)), [invokeMissingMethod](metaclass#invokeMissingMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [invokeMissingProperty](metaclass#invokeMissingProperty(java.lang.Object,%20java.lang.String,%20java.lang.Object,%20boolean)), [pickMethod](metaclass#pickMethod(java.lang.String,%20java.lang.Class)), [selectConstructorAndTransformArguments](metaclass#selectConstructorAndTransformArguments(int,%20java.lang.Object)), [setAttribute](metaclass#setAttribute(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20java.lang.Object,%20boolean,%20boolean)), [setProperty](metaclass#setProperty(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20java.lang.Object,%20boolean,%20boolean))` |
| `interface [MetaObjectProtocol](metaobjectprotocol)` | `[getAttribute](metaobjectprotocol#getAttribute(java.lang.Object,%20java.lang.String)), [getMetaMethod](metaobjectprotocol#getMetaMethod(java.lang.String,%20java.lang.Object)), [getMetaProperty](metaobjectprotocol#getMetaProperty(java.lang.String)), [getMethods](metaobjectprotocol#getMethods()), [getProperties](metaobjectprotocol#getProperties()), [getProperty](metaobjectprotocol#getProperty(java.lang.Object,%20java.lang.String)), [getStaticMetaMethod](metaobjectprotocol#getStaticMetaMethod(java.lang.String,%20java.lang.Object)), [getTheClass](metaobjectprotocol#getTheClass()), [hasProperty](metaobjectprotocol#hasProperty(java.lang.Object,%20java.lang.String)), [invokeConstructor](metaobjectprotocol#invokeConstructor(java.lang.Object)), [invokeMethod](metaobjectprotocol#invokeMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [invokeMethod](metaobjectprotocol#invokeMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [invokeStaticMethod](metaobjectprotocol#invokeStaticMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [respondsTo](metaobjectprotocol#respondsTo(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [respondsTo](metaobjectprotocol#respondsTo(java.lang.Object,%20java.lang.String)), [setAttribute](metaobjectprotocol#setAttribute(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [setProperty](metaobjectprotocol#setProperty(java.lang.Object,%20java.lang.String,%20java.lang.Object))` |
Method Detail
-------------
### public [MetaClass](metaclass) **getAdaptee**()
Returns the MetaClass that this adapter adapts
**Returns:**
The MetaClass instance
### public void **setAdaptee**([MetaClass](metaclass) metaClass)
Sets the MetaClass adapted by this MetaClass
**Parameters:**
`metaClass` - The MetaClass to adapt
groovy [Java] Interface GroovyResourceLoader [Java] Interface GroovyResourceLoader
=====================================
```
public interface GroovyResourceLoader
```
Allows frameworks that integrate with Groovy to determine how Groovy files are resolved.
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL")` | `**[loadGroovySource](#loadGroovySource(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") filename)`Loads a Groovy source file given its name. |
Method Detail
-------------
### public [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") **loadGroovySource**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") filename)
Loads a Groovy source file given its name.
**throws:**
java.net.MalformedURLException if the URL is invalid
**Parameters:**
`filename` - name of the file
**Returns:**
a URL
groovy [Java] Interface MutableMetaClass [Java] Interface MutableMetaClass
=================================
* groovy.lang.MetaObjectProtocol
All Superinterfaces:
[MetaClass](metaclass), [MetaObjectProtocol](metaobjectprotocol)
```
public interface MutableMetaClass
extends [MetaClass](metaclass)
```
An interface that defines methods that implementers of mutable Meta classes should specify. It provides operations to perform mutations on the MetaClass instance.
Whether a MetaClass allows mutation is up to the MetaClass itself and considerations of Thread safety need to be taken into account when making a MetaClass mutable
The default implementation allows mutation of MetaClass instances before initialisation (before the initialize() method is called) but not after, thus ensuring Thread safety once a MetaClass has been constructed and placed in the registry
**See Also:**
[MetaClassImpl](metaclassimpl "MetaClassImpl")
[MetaClass](metaclass "MetaClass")
**Since:**
1.5
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[addMetaBeanProperty](#addMetaBeanProperty(groovy.lang.MetaBeanProperty))**([MetaBeanProperty](metabeanproperty) metaBeanProperty)`Adds a new MetaBeanProperty to the MetaClass |
| | `public void` | `**[addMetaMethod](#addMetaMethod(groovy.lang.MetaMethod))**([MetaMethod](metamethod) metaMethod)`Adds a new MetaMethod to the MetaClass |
| | `public void` | `**[addNewInstanceMethod](#addNewInstanceMethod(java.lang.reflect.Method))**([Method](https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html "Method") method)`adds a new instance method to this MetaClass. |
| | `public void` | `**[addNewStaticMethod](#addNewStaticMethod(java.lang.reflect.Method))**([Method](https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html "Method") method)`adds a new static method to this MetaClass. |
| | `public boolean` | `**[isModified](#isModified())**()`Return whether the MetaClass has been modified or not |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `interface [MetaClass](metaclass)` | `[getAttribute](metaclass#getAttribute(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20boolean)), [getClassNode](metaclass#getClassNode()), [getMetaMethods](metaclass#getMetaMethods()), [getMethods](metaclass#getMethods()), [getProperties](metaclass#getProperties()), [getProperty](metaclass#getProperty(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20boolean,%20boolean)), [initialize](metaclass#initialize()), [invokeMethod](metaclass#invokeMethod(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20java.lang.Object,%20boolean,%20boolean)), [invokeMissingMethod](metaclass#invokeMissingMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [invokeMissingProperty](metaclass#invokeMissingProperty(java.lang.Object,%20java.lang.String,%20java.lang.Object,%20boolean)), [pickMethod](metaclass#pickMethod(java.lang.String,%20java.lang.Class)), [selectConstructorAndTransformArguments](metaclass#selectConstructorAndTransformArguments(int,%20java.lang.Object)), [setAttribute](metaclass#setAttribute(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20java.lang.Object,%20boolean,%20boolean)), [setProperty](metaclass#setProperty(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20java.lang.Object,%20boolean,%20boolean))` |
| `interface [MetaObjectProtocol](metaobjectprotocol)` | `[getAttribute](metaobjectprotocol#getAttribute(java.lang.Object,%20java.lang.String)), [getMetaMethod](metaobjectprotocol#getMetaMethod(java.lang.String,%20java.lang.Object)), [getMetaProperty](metaobjectprotocol#getMetaProperty(java.lang.String)), [getMethods](metaobjectprotocol#getMethods()), [getProperties](metaobjectprotocol#getProperties()), [getProperty](metaobjectprotocol#getProperty(java.lang.Object,%20java.lang.String)), [getStaticMetaMethod](metaobjectprotocol#getStaticMetaMethod(java.lang.String,%20java.lang.Object)), [getTheClass](metaobjectprotocol#getTheClass()), [hasProperty](metaobjectprotocol#hasProperty(java.lang.Object,%20java.lang.String)), [invokeConstructor](metaobjectprotocol#invokeConstructor(java.lang.Object)), [invokeMethod](metaobjectprotocol#invokeMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [invokeMethod](metaobjectprotocol#invokeMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [invokeStaticMethod](metaobjectprotocol#invokeStaticMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [respondsTo](metaobjectprotocol#respondsTo(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [respondsTo](metaobjectprotocol#respondsTo(java.lang.Object,%20java.lang.String)), [setAttribute](metaobjectprotocol#setAttribute(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [setProperty](metaobjectprotocol#setProperty(java.lang.Object,%20java.lang.String,%20java.lang.Object))` |
Method Detail
-------------
### public void **addMetaBeanProperty**([MetaBeanProperty](metabeanproperty) metaBeanProperty)
Adds a new MetaBeanProperty to the MetaClass
**Parameters:**
`metaBeanProperty` - The MetaBeanProperty instance
### public void **addMetaMethod**([MetaMethod](metamethod) metaMethod)
Adds a new MetaMethod to the MetaClass
**Parameters:**
`metaMethod` - The MetaMethod to add
### public void **addNewInstanceMethod**([Method](https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html "Method") method)
adds a new instance method to this MetaClass. Instance methods are able to overwrite the original methods of the class. Calling this method should not be done after initialise was called.
**Parameters:**
`method` - the method to be added
### public void **addNewStaticMethod**([Method](https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html "Method") method)
adds a new static method to this MetaClass. This is only possible as long as initialise was not called.
**Parameters:**
`method` - the method to be added
### public boolean **isModified**()
Return whether the MetaClass has been modified or not
**Returns:**
True if it has
| programming_docs |
groovy [Java] Interface Buildable [Java] Interface Buildable
==========================
```
public interface Buildable
```
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[build](#build(groovy.lang.GroovyObject))**([GroovyObject](groovyobject) builder)` |
Method Detail
-------------
### public void **build**([GroovyObject](groovyobject) builder)
groovy [Java] Class Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9> [Java] Class Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9>
=======================================================
* groovy.lang.Tuple9
```
public final class Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9>
extends [Tuple](tuple)
```
Represents a list of 9 typed Objects.
**Since:**
2.5.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Tuple9](#Tuple9(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9)` |
| `**[Tuple9](#Tuple9(Tuple9))**([Tuple9](tuple9 "Tuple9")<T1, T2, T3, T4, T5, T6, T7, T8, T9> tuple)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Tuple9](tuple9 "Tuple9")<T1, T2, T3, T4, T5, T6, T7, T8, T9>` | `**[clone](#clone())**()` |
| | `public [T8](../../t8)` | `**[getEighth](#getEighth())**()` |
| | `public [T5](../../t5)` | `**[getFifth](#getFifth())**()` |
| | `public [T1](../../t1)` | `**[getFirst](#getFirst())**()` |
| | `public [T4](../../t4)` | `**[getFourth](#getFourth())**()` |
| | `public [T9](../../t9)` | `**[getNinth](#getNinth())**()` |
| | `public [T2](../../t2)` | `**[getSecond](#getSecond())**()` |
| | `public [T7](../../t7)` | `**[getSeventh](#getSeventh())**()` |
| | `public [T6](../../t6)` | `**[getSixth](#getSixth())**()` |
| | `public [T3](../../t3)` | `**[getThird](#getThird())**()` |
| | `public [T1](../../t1)` | `**[getV1](#getV1())**()` |
| | `public [T2](../../t2)` | `**[getV2](#getV2())**()` |
| | `public [T3](../../t3)` | `**[getV3](#getV3())**()` |
| | `public [T4](../../t4)` | `**[getV4](#getV4())**()` |
| | `public [T5](../../t5)` | `**[getV5](#getV5())**()` |
| | `public [T6](../../t6)` | `**[getV6](#getV6())**()` |
| | `public [T7](../../t7)` | `**[getV7](#getV7())**()` |
| | `public [T8](../../t8)` | `**[getV8](#getV8())**()` |
| | `public [T9](../../t9)` | `**[getV9](#getV9())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Tuple](tuple)` | `[clone](tuple#clone()), [compareTo](tuple#compareTo(Tuple)), [equals](tuple#equals(java.lang.Object)), [get](tuple#get(int)), [hashCode](tuple#hashCode()), [size](tuple#size()), [subList](tuple#subList(int,%20int)), [subTuple](tuple#subTuple(int,%20int)), [toArray](tuple#toArray()), [tuple](tuple#tuple()), [tuple](tuple#tuple(T1)), [tuple](tuple#tuple(T1,%20T2)), [tuple](tuple#tuple(T1,%20T2,%20T3)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15,%20T16))` |
Constructor Detail
------------------
### public **Tuple9**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9)
### public **Tuple9**([Tuple9](tuple9 "Tuple9")<T1, T2, T3, T4, T5, T6, T7, T8, T9> tuple)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Tuple9](tuple9 "Tuple9")<T1, T2, T3, T4, T5, T6, T7, T8, T9> **clone**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T8](../../t8) **getEighth**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T5](../../t5) **getFifth**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T1](../../t1) **getFirst**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T4](../../t4) **getFourth**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T9](../../t9) **getNinth**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T2](../../t2) **getSecond**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T7](../../t7) **getSeventh**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T6](../../t6) **getSixth**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T3](../../t3) **getThird**()
### public [T1](../../t1) **getV1**()
### public [T2](../../t2) **getV2**()
### public [T3](../../t3) **getV3**()
### public [T4](../../t4) **getV4**()
### public [T5](../../t5) **getV5**()
### public [T6](../../t6) **getV6**()
### public [T7](../../t7) **getV7**()
### public [T8](../../t8) **getV8**()
### public [T9](../../t9) **getV9**()
groovy [Java] Interface GroovyObject [Java] Interface GroovyObject
=============================
```
public interface GroovyObject
```
The interface implemented by all Groovy objects.
Especially handy for using Groovy objects when in the Java world.
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [MetaClass](metaclass)` | `**[getMetaClass](#getMetaClass())**()`Returns the metaclass for a given class. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName)`Retrieves a property value. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)`Invokes the given method. |
| | `public void` | `**[setMetaClass](#setMetaClass(groovy.lang.MetaClass))**([MetaClass](metaclass) metaClass)`Allows the MetaClass to be replaced with a derived implementation. |
| | `public void` | `**[setProperty](#setProperty(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`Sets the given property to the new value. |
Method Detail
-------------
### public [MetaClass](metaclass) **getMetaClass**()
Returns the metaclass for a given class.
**Returns:**
the metaClass of this instance
### @[Internal](../transform/internal "Internal") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName)
Retrieves a property value.
**Parameters:**
`propertyName` - the name of the property of interest
**Returns:**
the given property
### @[Internal](../transform/internal "Internal") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
Invokes the given method.
**Parameters:**
`name` - the name of the method to call
`args` - the arguments to use for the method call
**Returns:**
the result of invoking the method
### public void **setMetaClass**([MetaClass](metaclass) metaClass)
Allows the MetaClass to be replaced with a derived implementation.
**Parameters:**
`metaClass` - the new metaclass
### @[Internal](../transform/internal "Internal") public void **setProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
Sets the given property to the new value.
**Parameters:**
`propertyName` - the name of the property of interest
`newValue` - the new value for the property
groovy [Java] Annotation Type GrabResolver [Java] Annotation Type GrabResolver
===================================
* groovy.lang.GrabResolver
```
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({
ElementType.CONSTRUCTOR,
ElementType.FIELD,
ElementType.LOCAL_VARIABLE,
ElementType.METHOD,
ElementType.PARAMETER,
ElementType.TYPE})
public @interface GrabResolver
```
Used to add a repository for resolving Grape dependencies.
For example:
```
@GrabResolver(name='restlet.org', root='http://maven.restlet.org')
@Grab(group='org.restlet', module='org.restlet', version='1.1.6')
class MyRestlet extends org.restlet.Restlet {
// ...
}
```
By default, the Grapes subsystem uses an Ivy chained resolver. Each resolver added using `@GrabResolver` is appended to the chain. By default, the grape subsystem is shared globally, so added resolvers will become available for any subsequent grab calls. Dependency resolution follows Ivy's artifact resolution which tries to resolve artifacts in the order specified in the chain of resolvers. Further information about customising grape behavior can be found on the Grape documentation page: <http://groovy-lang.org/grape.html>.
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[initClass](#initClass)`By default, when a `@GrabResolver` annotation is used, a `Grape.addResolver()` call is added to the static initializers of the class the annotatable node appears in. |
| `**boolean**` | `[m2Compatible](#m2Compatible)`Defaults to Maven2 compatibility. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[name](#name)`A meaningful name for a repo containing the grape/artifact. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[root](#root)`The URL for a repo containing the grape/artifact. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[value](#value)`Allows a shorthand form which sets the name and root to this value. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **initClass**
By default, when a `@GrabResolver` annotation is used, a `Grape.addResolver()` call is added to the static initializers of the class the annotatable node appears in. If you wish to disable this, add `initClass=false` to the annotation.
**Default:**
true
### public boolean **m2Compatible**
Defaults to Maven2 compatibility. Set false for Ivy only compatibility.
**Default:**
true
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **name**
A meaningful name for a repo containing the grape/artifact. A non-empty value is required unless value() is used.
**Default:**
""
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **root**
The URL for a repo containing the grape/artifact. A non-empty value is required unless value() is used.
**Default:**
""
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **value**
Allows a shorthand form which sets the name and root to this value. Must not be used if name() or root() is non-empty.
**Default:**
""
groovy [Java] Interface MetaObjectProtocol [Java] Interface MetaObjectProtocol
===================================
```
public interface MetaObjectProtocol
```
An interface that defines the API usable by clients of Groovy's Meta Object Protocol (MOP). These methods are implemented by the reference implementation of the [MetaClass](metaclass "MetaClass") interface.
**See Also:**
[MetaClassImpl](metaclassimpl "MetaClassImpl")
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getAttribute](#getAttribute(java.lang.Object,%20java.lang.String))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") attribute)`Retrieves an attribute of an instance of the class returned by the getTheClass() method. |
| | `public [MetaMethod](metamethod)` | `**[getMetaMethod](#getMetaMethod(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)`Retrieves an instance MetaMethod for the given name and argument values, using the types of the argument values to establish the chosen MetaMethod |
| | `public [MetaProperty](metaproperty)` | `**[getMetaProperty](#getMetaProperty(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)`Returns a MetaProperty for the given name or null if it doesn't exist |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaMethod](metamethod "MetaMethod")>` | `**[getMethods](#getMethods())**()`Obtain a list of all the meta methods available on this meta class |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaProperty](metaproperty "MetaProperty")>` | `**[getProperties](#getProperties())**()`Obtain a list of all meta properties available on this meta class |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.Object,%20java.lang.String))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)`Retrieves a property of an instance of the class returned by the getTheClass() method. |
| | `public [MetaMethod](metamethod)` | `**[getStaticMetaMethod](#getStaticMetaMethod(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)`Retrieves a static MetaMethod for the given name and argument values, using the types of the arguments to establish the chosen MetaMethod |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[getTheClass](#getTheClass())**()`Retrieves that Java Class that the attached Meta behaviours apply to |
| | `public [MetaProperty](metaproperty)` | `**[hasProperty](#hasProperty(java.lang.Object,%20java.lang.String))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeConstructor](#invokeConstructor(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)`Invokes a constructor for the given arguments. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)`Invokes a method on the given Object with the given name and arguments. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") arguments)`Invokes a method on the given object, with the given name and single argument. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeStaticMethod](#invokeStaticMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)`Invokes a static method on the given Object with the given name and arguments. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaMethod](metamethod "MetaMethod")>` | `**[respondsTo](#respondsTo(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] argTypes)` |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaMethod](metamethod "MetaMethod")>` | `**[respondsTo](#respondsTo(java.lang.Object,%20java.lang.String))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)` |
| | `public void` | `**[setAttribute](#setAttribute(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") attribute, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`Sets an attribute of an instance of the class returned by the getTheClass() method. |
| | `public void` | `**[setProperty](#setProperty(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`Sets a property of an instance of the class returned by the getTheClass() method. |
Method Detail
-------------
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getAttribute**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") attribute)
Retrieves an attribute of an instance of the class returned by the getTheClass() method.
What this means is largely down to the MetaClass implementation, however the default case would result in attempt to read a field of the instance.
**See Also:**
[MetaClassImpl](metaclassimpl "MetaClassImpl")
**Parameters:**
`object` - An instance of the class returned by the getTheClass() method
`attribute` - The name of the attribute to retrieve the value for
**Returns:**
The attribute value
### public [MetaMethod](metamethod) **getMetaMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)
Retrieves an instance MetaMethod for the given name and argument values, using the types of the argument values to establish the chosen MetaMethod
**Parameters:**
`name` - The name of the MetaMethod
`args` - Array containing - 1) the argument values (using which their types are then inferred), or 2) the corresponding argument types
**Returns:**
A MetaMethod or null if it doesn't exist
### public [MetaProperty](metaproperty) **getMetaProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
Returns a MetaProperty for the given name or null if it doesn't exist
**Parameters:**
`name` - The name of the MetaProperty
**Returns:**
A MetaProperty or null
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaMethod](metamethod "MetaMethod")> **getMethods**()
Obtain a list of all the meta methods available on this meta class
**See Also:**
[MetaMethod](metamethod "MetaMethod")
**Returns:**
A list of MetaMethod instances
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaProperty](metaproperty "MetaProperty")> **getProperties**()
Obtain a list of all meta properties available on this meta class
**See Also:**
[MetaProperty](metaproperty "MetaProperty")
**Returns:**
A list of MetaProperty instances
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)
Retrieves a property of an instance of the class returned by the getTheClass() method.
What this means is largely down to the MetaClass implementation, however the default case would result in an attempt to invoke a JavaBean getter, or if no such getter exists a public field of the instance.
**See Also:**
[MetaClassImpl](metaclassimpl "MetaClassImpl")
**Parameters:**
`object` - An instance of the class returned by the getTheClass() method
`property` - The name of the property to retrieve the value for
**Returns:**
The properties value
### public [MetaMethod](metamethod) **getStaticMetaMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)
Retrieves a static MetaMethod for the given name and argument values, using the types of the arguments to establish the chosen MetaMethod
**Parameters:**
`name` - The name of the MetaMethod
`args` - The argument types
**Returns:**
A MetaMethod or null if it doesn't exist
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **getTheClass**()
Retrieves that Java Class that the attached Meta behaviours apply to
**Returns:**
The java.lang.Class instance
### public [MetaProperty](metaproperty) **hasProperty**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
Returns true of the implementing MetaClass has a property of the given name
Note that this method will only return true for realised properties and does not take into account implementation of getProperty or propertyMissing
**Parameters:**
`obj` - The object to inspect
`name` - The name of the property
**Returns:**
The MetaProperty or null if it doesn't exist
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeConstructor**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)
Invokes a constructor for the given arguments. The MetaClass will attempt to pick the best argument which matches the types of the objects passed within the arguments array
**Parameters:**
`arguments` - The arguments to the constructor
**Returns:**
An instance of the java.lang.Class that this MetaObjectProtocol object applies to
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)
Invokes a method on the given Object with the given name and arguments. The MetaClass will attempt to pick the best method for the given name and arguments. If a method cannot be invoked a MissingMethodException will be thrown.
**See Also:**
[MissingMethodException](missingmethodexception "MissingMethodException")
**Parameters:**
`object` - The instance which the method is invoked on
`methodName` - The name of the method
`arguments` - The arguments to the method
**Returns:**
The return value of the method which is null if the return type is void
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") arguments)
Invokes a method on the given object, with the given name and single argument.
**See Also:**
[invokeMethod(Object, String, Object[])](#invokeMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object))
**Parameters:**
`object` - The Object to invoke the method on
`methodName` - The name of the method
`arguments` - The argument to the method
**Returns:**
The return value of the method which is null if the return type is void
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeStaticMethod**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)
Invokes a static method on the given Object with the given name and arguments.
The Object can either be an instance of the class that this MetaObjectProtocol instance applies to or the java.lang.Class instance itself. If a method cannot be invoked a MissingMethodException is will be thrown
**See Also:**
[MissingMethodException](missingmethodexception "MissingMethodException")
**Parameters:**
`object` - An instance of the class returned by the getTheClass() method or the class itself
`methodName` - The name of the method
`arguments` - The arguments to the method
**Returns:**
The return value of the method which is null if the return type is void
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaMethod](metamethod "MetaMethod")> **respondsTo**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] argTypes)
Returns an object satisfying Groovy truth if the implementing MetaClass responds to a method with the given name and arguments types.
Note that this method's return value is based on realised methods and does not take into account objects or classes that implement invokeMethod or methodMissing
This method is "safe" in that it will always return a value and never throw an exception
**Parameters:**
`obj` - The object to inspect
`name` - The name of the method of interest
`argTypes` - The argument types to match against
**Returns:**
A List of MetaMethods matching the argument types which will be empty if no matching methods exist
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaMethod](metamethod "MetaMethod")> **respondsTo**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
Returns an object satisfying Groovy truth if the implementing MetaClass responds to a method with the given name regardless of arguments. In other words this method will return for foo() and foo(String).
Note that this method's return value is based on realised methods and does not take into account objects or classes that implement invokeMethod or methodMissing
This method is "safe" in that it will always return a value and never throw an exception
**Parameters:**
`obj` - The object to inspect
`name` - The name of the method of interest
**Returns:**
A List of MetaMethods which will be empty if no methods with the given name exist
### public void **setAttribute**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") attribute, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
Sets an attribute of an instance of the class returned by the getTheClass() method.
What this means is largely down to the MetaClass implementation, however the default case would result in an attempt to set a field of the instance.
**See Also:**
[MetaClassImpl](metaclassimpl "MetaClassImpl")
**Parameters:**
`object` - An instance of the class returned by the getTheClass() method
`attribute` - The name of the attribute to set
`newValue` - The new value of the attribute
### public void **setProperty**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
Sets a property of an instance of the class returned by the getTheClass() method.
What this means is largely down to the MetaClass implementation, however the default case would result in an attempt to invoke a JavaBean setter, or if no such setter exists to set a public field of the instance.
**See Also:**
[MetaClassImpl](metaclassimpl "MetaClassImpl")
**Parameters:**
`object` - An instance of the class returned by the getTheClass() method
`property` - The name of the property to set
`newValue` - The new value of the property
| programming_docs |
groovy [Java] Interface Range<T extends Comparable> [Java] Interface Range<T extends Comparable>
============================================
```
public interface Range<T extends Comparable>
extends [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")
```
A Range represents the list of discrete items between some starting (or `from`) value and *working up* towards some ending (or `to`) value. For a reverse range, the list is obtained by starting at the `to` value and *working down* towards the `from` value. The concept of *working up* and *working down* is dependent on the range implementation. In the general case, working up involves successive calls to the first item's `next()` method while working down involves calling the `previous()` method. Optimized numerical ranges may apply numeric addition or subtraction of some numerical step size. Particular range implementations may also support the notion of inclusivity and exclusivity with respect to the ending value in the range. E.g. `1..3 == [1, 2, 3]`; but `1..<3 == [1, 2]`. In general, the second boundary may not be contained in the range, and `a..b` may produce a different set of elements than `(b..a).reversed()`. E.g. `1..2.5 == [1, 2]`; but `2.5..1 == [2.5, 1.5]`. Implementations can be memory efficient by storing just the `from` and `to` boundary values rather than eagerly creating all discrete items in the conceptual list. The actual discrete items can be lazily calculated on an as needed basis (e.g. when calling methods from the `java.util.List` interface or the additional `step` methods in the `Range` interface). In addition to the methods related to a Range's "discrete items" abstraction, there is a method, `containsWithinBounds` which, for numerical ranges, allows checking within the continuous interval between the Range's boundary values.
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public boolean` | `**[containsWithinBounds](#containsWithinBounds(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)`Indicates whether an object is greater than or equal to the `from` value for the range and less than or equal to the `to` value. |
| | `public T` | `**[getFrom](#getFrom())**()`The lower value in the range. |
| | `public T` | `**[getTo](#getTo())**()`The upper value in the range. |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[inspect](#inspect())**()`
**Returns:**
the verbose [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") representation of this [Range](range "Range") as would be typed into a console to create the [Range](range "Range") instance
|
| | `public boolean` | `**[isReverse](#isReverse())**()`Indicates whether this is a reverse range which iterates backwards starting from the to value and ending on the from value |
| | `public void` | `**[step](#step(int,%20groovy.lang.Closure))**(int step, [Closure](closure) closure)`Steps through the range, calling a closure for each item. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<T>` | `**[step](#step(int))**(int step)`Forms a list by stepping through the range by the indicated interval. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `interface [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")` | `[add](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#add(int,%20java.lang.Object) "add"), [add](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#add(java.lang.Object) "add"), [remove](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#remove(java.lang.Object) "remove"), [remove](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#remove(int) "remove"), [get](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#get(int) "get"), [equals](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#equals(java.lang.Object) "equals"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#hashCode() "hashCode"), [copyOf](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#copyOf(java.util.Collection) "copyOf"), [indexOf](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#indexOf(java.lang.Object) "indexOf"), [clear](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#clear() "clear"), [lastIndexOf](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#lastIndexOf(java.lang.Object) "lastIndexOf"), [isEmpty](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#isEmpty() "isEmpty"), [replaceAll](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#replaceAll(java.util.function.UnaryOperator) "replaceAll"), [size](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#size() "size"), [subList](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#subList(int,%20int) "subList"), [toArray](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#toArray() "toArray"), [toArray](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#toArray(%5BLjava.lang.Object;) "toArray"), [iterator](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#iterator() "iterator"), [of](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#of(java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object) "of"), [of](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#of(java.lang.Object,%20java.lang.Object,%20java.lang.Object) "of"), [of](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#of(java.lang.Object,%20java.lang.Object) "of"), [of](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#of(java.lang.Object) "of"), [of](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#of() "of"), [of](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#of(java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object) "of"), [of](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#of(java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object) "of"), [of](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#of(java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object) "of"), [of](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#of(java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object) "of"), [of](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#of(java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object) "of"), [of](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#of(java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object) "of"), [of](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#of(%5BLjava.lang.Object;) "of"), [contains](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#contains(java.lang.Object) "contains"), [spliterator](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#spliterator() "spliterator"), [addAll](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#addAll(int,%20java.util.Collection) "addAll"), [addAll](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#addAll(java.util.Collection) "addAll"), [set](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#set(int,%20java.lang.Object) "set"), [sort](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#sort(java.util.Comparator) "sort"), [removeAll](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#removeAll(java.util.Collection) "removeAll"), [retainAll](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#retainAll(java.util.Collection) "retainAll"), [listIterator](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#listIterator(int) "listIterator"), [listIterator](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#listIterator() "listIterator"), [containsAll](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#containsAll(java.util.Collection) "containsAll"), [toArray](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#toArray(java.util.function.IntFunction) "toArray"), [stream](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#stream() "stream"), [removeIf](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#removeIf(java.util.function.Predicate) "removeIf"), [parallelStream](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#parallelStream() "parallelStream"), [forEach](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#forEach(java.util.function.Consumer) "forEach")` |
Method Detail
-------------
### public boolean **containsWithinBounds**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)
Indicates whether an object is greater than or equal to the `from` value for the range and less than or equal to the `to` value.
This may be true even for values not contained in the range. Example: from = 1.5, to = 3, next() increments by 1 containsWithinBounds(2) == true contains(2) == false
**Parameters:**
`o` - the object to check against the boundaries of the range
**Returns:**
`true` if the object is between the from and to values
### public T **getFrom**()
The lower value in the range.
**Returns:**
the lower value in the range.
### public T **getTo**()
The upper value in the range.
**Returns:**
the upper value in the range
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **inspect**()
**Returns:**
the verbose [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") representation of this [Range](range "Range") as would be typed into a console to create the [Range](range "Range") instance
### public boolean **isReverse**()
Indicates whether this is a reverse range which iterates backwards starting from the to value and ending on the from value
**Returns:**
`true` if this is a reverse range
### public void **step**(int step, [Closure](closure) closure)
Steps through the range, calling a closure for each item.
**Parameters:**
`step` - the amount by which to step. If negative, steps through the range backwards.
`closure` - the [Closure](closure "Closure") to call
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<T> **step**(int step)
Forms a list by stepping through the range by the indicated interval.
**Parameters:**
`step` - the amount by which to step. If negative, steps through the range backwards.
**Returns:**
the list formed by stepping through the range by the indicated interval.
groovy [Java] Annotation Type DelegatesTo.Target [Java] Annotation Type DelegatesTo.Target
=========================================
* groovy.lang.DelegatesTo.Target
```
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
@[Target](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Target.html "Target")({ElementType.PARAMETER})
public @interface DelegatesTo.Target
```
Parameter annotation used to specify the delegate for a `@DelegatesTo` annotated parameter of the same method.
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[value](#value)`An identifier that should be used to disambiguate targets when there are multiple `@DelegatesTo.Target` annotated parameters. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **value**
An identifier that should be used to disambiguate targets when there are multiple `@DelegatesTo.Target` annotated parameters.
**Default:**
""
groovy [Java] Class Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> [Java] Class Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>
============================================================================
* groovy.lang.Tuple13
```
public final class Tuple13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>
extends [Tuple](tuple)
```
Represents a list of 13 typed Objects.
**Since:**
3.0.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Tuple13](#Tuple13(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11, [T12](../../t12) v12, [T13](../../t13) v13)` |
| `**[Tuple13](#Tuple13(Tuple13))**([Tuple13](tuple13 "Tuple13")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> tuple)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Tuple13](tuple13 "Tuple13")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>` | `**[clone](#clone())**()` |
| | `public [T1](../../t1)` | `**[getV1](#getV1())**()` |
| | `public [T10](../../t10)` | `**[getV10](#getV10())**()` |
| | `public [T11](../../t11)` | `**[getV11](#getV11())**()` |
| | `public [T12](../../t12)` | `**[getV12](#getV12())**()` |
| | `public [T13](../../t13)` | `**[getV13](#getV13())**()` |
| | `public [T2](../../t2)` | `**[getV2](#getV2())**()` |
| | `public [T3](../../t3)` | `**[getV3](#getV3())**()` |
| | `public [T4](../../t4)` | `**[getV4](#getV4())**()` |
| | `public [T5](../../t5)` | `**[getV5](#getV5())**()` |
| | `public [T6](../../t6)` | `**[getV6](#getV6())**()` |
| | `public [T7](../../t7)` | `**[getV7](#getV7())**()` |
| | `public [T8](../../t8)` | `**[getV8](#getV8())**()` |
| | `public [T9](../../t9)` | `**[getV9](#getV9())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Tuple](tuple)` | `[clone](tuple#clone()), [compareTo](tuple#compareTo(Tuple)), [equals](tuple#equals(java.lang.Object)), [get](tuple#get(int)), [hashCode](tuple#hashCode()), [size](tuple#size()), [subList](tuple#subList(int,%20int)), [subTuple](tuple#subTuple(int,%20int)), [toArray](tuple#toArray()), [tuple](tuple#tuple()), [tuple](tuple#tuple(T1)), [tuple](tuple#tuple(T1,%20T2)), [tuple](tuple#tuple(T1,%20T2,%20T3)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15,%20T16))` |
Constructor Detail
------------------
### public **Tuple13**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11, [T12](../../t12) v12, [T13](../../t13) v13)
### public **Tuple13**([Tuple13](tuple13 "Tuple13")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> tuple)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Tuple13](tuple13 "Tuple13")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> **clone**()
### public [T1](../../t1) **getV1**()
### public [T10](../../t10) **getV10**()
### public [T11](../../t11) **getV11**()
### public [T12](../../t12) **getV12**()
### public [T13](../../t13) **getV13**()
### public [T2](../../t2) **getV2**()
### public [T3](../../t3) **getV3**()
### public [T4](../../t4) **getV4**()
### public [T5](../../t5) **getV5**()
### public [T6](../../t6) **getV6**()
### public [T7](../../t7) **getV7**()
### public [T8](../../t8) **getV8**()
### public [T9](../../t9) **getV9**()
groovy [Java] Class Tuple5<T1, T2, T3, T4, T5> [Java] Class Tuple5<T1, T2, T3, T4, T5>
=======================================
* groovy.lang.Tuple5
```
public final class Tuple5<T1, T2, T3, T4, T5>
extends [Tuple](tuple)
```
Represents a list of 5 typed Objects.
**Since:**
2.5.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Tuple5](#Tuple5(T1,%20T2,%20T3,%20T4,%20T5))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5)` |
| `**[Tuple5](#Tuple5(Tuple5))**([Tuple5](tuple5 "Tuple5")<T1, T2, T3, T4, T5> tuple)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Tuple5](tuple5 "Tuple5")<T1, T2, T3, T4, T5>` | `**[clone](#clone())**()` |
| | `public [T5](../../t5)` | `**[getFifth](#getFifth())**()` |
| | `public [T1](../../t1)` | `**[getFirst](#getFirst())**()` |
| | `public [T4](../../t4)` | `**[getFourth](#getFourth())**()` |
| | `public [T2](../../t2)` | `**[getSecond](#getSecond())**()` |
| | `public [T3](../../t3)` | `**[getThird](#getThird())**()` |
| | `public [T1](../../t1)` | `**[getV1](#getV1())**()` |
| | `public [T2](../../t2)` | `**[getV2](#getV2())**()` |
| | `public [T3](../../t3)` | `**[getV3](#getV3())**()` |
| | `public [T4](../../t4)` | `**[getV4](#getV4())**()` |
| | `public [T5](../../t5)` | `**[getV5](#getV5())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Tuple](tuple)` | `[clone](tuple#clone()), [compareTo](tuple#compareTo(Tuple)), [equals](tuple#equals(java.lang.Object)), [get](tuple#get(int)), [hashCode](tuple#hashCode()), [size](tuple#size()), [subList](tuple#subList(int,%20int)), [subTuple](tuple#subTuple(int,%20int)), [toArray](tuple#toArray()), [tuple](tuple#tuple()), [tuple](tuple#tuple(T1)), [tuple](tuple#tuple(T1,%20T2)), [tuple](tuple#tuple(T1,%20T2,%20T3)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15,%20T16))` |
Constructor Detail
------------------
### public **Tuple5**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5)
### public **Tuple5**([Tuple5](tuple5 "Tuple5")<T1, T2, T3, T4, T5> tuple)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Tuple5](tuple5 "Tuple5")<T1, T2, T3, T4, T5> **clone**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T5](../../t5) **getFifth**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T1](../../t1) **getFirst**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T4](../../t4) **getFourth**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T2](../../t2) **getSecond**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T3](../../t3) **getThird**()
### public [T1](../../t1) **getV1**()
### public [T2](../../t2) **getV2**()
### public [T3](../../t3) **getV3**()
### public [T4](../../t4) **getV4**()
### public [T5](../../t5) **getV5**()
| programming_docs |
groovy [Java] Class MOPIter.Index [Java] Class MOPIter.Index
==========================
* groovy.lang.MOPIter.Index
```
@[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated")
public static class MOPIter.Index
extends [SingleKeyHashMap](../../org/codehaus/groovy/util/singlekeyhashmap)
```
**deprecated:**
use [LinkedHashMap](https://docs.oracle.com/javase/8/docs/api/java/util/LinkedHashMap.html "LinkedHashMap") instead
Inherited fields
| Fields inherited from class | Fields |
| **`class [ComplexKeyHashMap](../../org/codehaus/groovy/util/complexkeyhashmap)`** | `[DEFAULT\_CAPACITY](../../org/codehaus/groovy/util/complexkeyhashmap#DEFAULT_CAPACITY), [MAXIMUM\_CAPACITY](../../org/codehaus/groovy/util/complexkeyhashmap#MAXIMUM_CAPACITY), [MINIMUM\_CAPACITY](../../org/codehaus/groovy/util/complexkeyhashmap#MINIMUM_CAPACITY), [size](../../org/codehaus/groovy/util/complexkeyhashmap#size), [table](../../org/codehaus/groovy/util/complexkeyhashmap#table), [threshold](../../org/codehaus/groovy/util/complexkeyhashmap#threshold)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Index](#Index(int))**(int size)` |
| `**[Index](#Index())**()` |
| `**[Index](#Index(boolean))**(boolean size)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public boolean` | `**[checkEquals](#checkEquals(org.codehaus.groovy.util.ComplexKeyHashMap.Entry,%20java.lang.Object))**([Entry](../../org/codehaus/groovy/util/complexkeyhashmap.entry) e, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") key)` |
| | `public [SingleKeyHashMap](../../org/codehaus/groovy/util/singlekeyhashmap)` | `**[getNotNull](#getNotNull(org.codehaus.groovy.reflection.CachedClass))**([CachedClass](../../org/codehaus/groovy/reflection/cachedclass) key)` |
| | `public [SingleKeyHashMap](../../org/codehaus/groovy/util/singlekeyhashmap)` | `**[getNullable](#getNullable(org.codehaus.groovy.reflection.CachedClass))**([CachedClass](../../org/codehaus/groovy/reflection/cachedclass) clazz)` |
| | `public void` | `**[put](#put(org.codehaus.groovy.reflection.CachedClass,%20org.codehaus.groovy.util.SingleKeyHashMap))**([CachedClass](../../org/codehaus/groovy/reflection/cachedclass) key, [SingleKeyHashMap](../../org/codehaus/groovy/util/singlekeyhashmap) value)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [SingleKeyHashMap](../../org/codehaus/groovy/util/singlekeyhashmap)` | `[containsKey](../../org/codehaus/groovy/util/singlekeyhashmap#containsKey(java.lang.String)), [copy](../../org/codehaus/groovy/util/singlekeyhashmap#copy(org.codehaus.groovy.util.SingleKeyHashMap,%20org.codehaus.groovy.util.SingleKeyHashMap,%20org.codehaus.groovy.util.SingleKeyHashMap.Copier)), [get](../../org/codehaus/groovy/util/singlekeyhashmap#get(java.lang.Object)), [getOrPut](../../org/codehaus/groovy/util/singlekeyhashmap#getOrPut(java.lang.Object)), [getOrPutEntry](../../org/codehaus/groovy/util/singlekeyhashmap#getOrPutEntry(java.util.Map%24Entry)), [put](../../org/codehaus/groovy/util/singlekeyhashmap#put(java.lang.Object,%20java.lang.Object)), [putCopyOfUnexisting](../../org/codehaus/groovy/util/singlekeyhashmap#putCopyOfUnexisting(java.util.Map%24Entry)), [remove](../../org/codehaus/groovy/util/singlekeyhashmap#remove(java.lang.Object))` |
| `class [ComplexKeyHashMap](../../org/codehaus/groovy/util/complexkeyhashmap)` | `[clear](../../org/codehaus/groovy/util/complexkeyhashmap#clear()), [getEntrySetIterator](../../org/codehaus/groovy/util/complexkeyhashmap#getEntrySetIterator()), [getTable](../../org/codehaus/groovy/util/complexkeyhashmap#getTable()), [hasNext](../../org/codehaus/groovy/util/complexkeyhashmap#hasNext()), [hash](../../org/codehaus/groovy/util/complexkeyhashmap#hash(int)), [init](../../org/codehaus/groovy/util/complexkeyhashmap#init(int)), [isEmpty](../../org/codehaus/groovy/util/complexkeyhashmap#isEmpty()), [next](../../org/codehaus/groovy/util/complexkeyhashmap#next()), [resize](../../org/codehaus/groovy/util/complexkeyhashmap#resize(int)), [size](../../org/codehaus/groovy/util/complexkeyhashmap#size())` |
Constructor Detail
------------------
### public **Index**(int size)
### public **Index**()
### public **Index**(boolean size)
Method Detail
-------------
### public boolean **checkEquals**([Entry](../../org/codehaus/groovy/util/complexkeyhashmap.entry) e, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") key)
### public [SingleKeyHashMap](../../org/codehaus/groovy/util/singlekeyhashmap) **getNotNull**([CachedClass](../../org/codehaus/groovy/reflection/cachedclass) key)
### public [SingleKeyHashMap](../../org/codehaus/groovy/util/singlekeyhashmap) **getNullable**([CachedClass](../../org/codehaus/groovy/reflection/cachedclass) clazz)
### public void **put**([CachedClass](../../org/codehaus/groovy/reflection/cachedclass) key, [SingleKeyHashMap](../../org/codehaus/groovy/util/singlekeyhashmap) value)
groovy [Java] Class GString [Java] Class GString
====================
* groovy.lang.GString
All Implemented Interfaces and Traits:
[Buildable](buildable), [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable"), [CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence"), [Writable](writable), [Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html "Serializable")
```
public abstract class GString
extends [GroovyObjectSupport](groovyobjectsupport)
implements [Buildable](buildable), [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable"), [CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence"), [Writable](writable), [Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html "Serializable")
```
Represents a String which contains embedded values such as "hello there ${user} how are you?" which can be evaluated lazily. Advanced users can iterate over the text and values to perform special processing, such as for performing SQL operations, the values can be substituted for ? and the actual value objects can be bound to a JDBC statement.
James Strachan: The lovely name of this class was suggested by Jules Gosnell and was such a good idea, I couldn't resist :)
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [GString](gstring)**` | `[EMPTY](#EMPTY)` | A GString containing a single empty String and no values. |
| `**static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[]**` | `[EMPTY\_OBJECT\_ARRAY](#EMPTY_OBJECT_ARRAY)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[EMPTY\_STRING\_ARRAY](#EMPTY_STRING_ARRAY)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[GString](#GString(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") values)` |
| `**[GString](#GString(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] values)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[build](#build(groovy.lang.GroovyObject))**([GroovyObject](groovyobject) builder)` |
| | `protected int` | `**[calcInitialCapacity](#calcInitialCapacity())**()` |
| | `public char` | `**[charAt](#charAt(int))**(int index)` |
| | `public int` | `**[compareTo](#compareTo(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") that)` |
| | `public boolean` | `**[equals](#equals(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") that)` |
| | `public boolean` | `**[equals](#equals(groovy.lang.GString))**([GString](gstring) that)` |
| | `public byte[]` | `**[getBytes](#getBytes())**()` |
| | `public byte[]` | `**[getBytes](#getBytes(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]` | `**[getStrings](#getStrings())**()` |
| | `public abstract [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]` | `**[getStrings](#getStrings())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getValue](#getValue(int))**(int idx)` |
| | `public int` | `**[getValueCount](#getValueCount())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[]` | `**[getValues](#getValues())**()` |
| | `public int` | `**[hashCode](#hashCode())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)`Overloaded to implement duck typing for Strings so that any method that can't be evaluated on this object will be forwarded to the toString() object instead. |
| | `public int` | `**[length](#length())**()` |
| | `public [Pattern](https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html "Pattern")` | `**[negate](#negate())**()`Turns a String into a regular expression pattern |
| | `public [GString](gstring)` | `**[plus](#plus(groovy.lang.GString))**([GString](gstring) that)` |
| | `public [GString](gstring)` | `**[plus](#plus(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") that)` |
| | `public [CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence")` | `**[subSequence](#subSequence(int,%20int))**(int start, int end)` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()` |
| | `public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer")` | `**[writeTo](#writeTo(java.io.Writer))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyObjectSupport](groovyobjectsupport)` | `[getMetaClass](groovyobjectsupport#getMetaClass()), [setMetaClass](groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Field Detail
------------
### public static final [GString](gstring) **EMPTY**
A GString containing a single empty String and no values.
### public static final [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] **EMPTY\_OBJECT\_ARRAY**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **EMPTY\_STRING\_ARRAY**
Constructor Detail
------------------
### public **GString**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") values)
### public **GString**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] values)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **build**([GroovyObject](groovyobject) builder)
### protected int **calcInitialCapacity**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public char **charAt**(int index)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **compareTo**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") that)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **equals**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") that)
### public boolean **equals**([GString](gstring) that)
### public byte[] **getBytes**()
### public byte[] **getBytes**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **getStrings**()
### public abstract [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **getStrings**()
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getValue**(int idx)
### public int **getValueCount**()
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] **getValues**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **hashCode**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
Overloaded to implement duck typing for Strings so that any method that can't be evaluated on this object will be forwarded to the toString() object instead.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **length**()
### public [Pattern](https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html "Pattern") **negate**()
Turns a String into a regular expression pattern
**Returns:**
the regular expression pattern
### public [GString](gstring) **plus**([GString](gstring) that)
### public [GString](gstring) **plus**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") that)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence") **subSequence**(int start, int end)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") **writeTo**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out)
groovy [Java] Class DelegatingMetaClass [Java] Class DelegatingMetaClass
================================
* groovy.lang.DelegatingMetaClass
All Implemented Interfaces and Traits:
[GroovyObject](groovyobject), [MetaClass](metaclass), [MutableMetaClass](mutablemetaclass)
```
public class DelegatingMetaClass
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [GroovyObject](groovyobject), [MetaClass](metaclass), [MutableMetaClass](mutablemetaclass)
```
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**protected [MetaClass](metaclass)**` | `[delegate](#delegate)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[DelegatingMetaClass](#DelegatingMetaClass(groovy.lang.MetaClass))**([MetaClass](metaclass) delegate)` |
| `**[DelegatingMetaClass](#DelegatingMetaClass(java.lang.Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[addMetaBeanProperty](#addMetaBeanProperty(groovy.lang.MetaBeanProperty))**([MetaBeanProperty](metabeanproperty) metaBeanProperty)` |
| | `public void` | `**[addMetaMethod](#addMetaMethod(groovy.lang.MetaMethod))**([MetaMethod](metamethod) metaMethod)` |
| | `public void` | `**[addNewInstanceMethod](#addNewInstanceMethod(java.lang.reflect.Method))**([Method](https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html "Method") method)` |
| | `public void` | `**[addNewStaticMethod](#addNewStaticMethod(java.lang.reflect.Method))**([Method](https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html "Method") method)` |
| | `public boolean` | `**[equals](#equals(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj)` |
| | `public [MetaClass](metaclass)` | `**[getAdaptee](#getAdaptee())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getAttribute](#getAttribute(java.lang.Object,%20java.lang.String))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") attribute)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getAttribute](#getAttribute(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20boolean))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") receiver, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") messageName, boolean useSuper)` |
| | `public [ClassNode](../../org/codehaus/groovy/ast/classnode)` | `**[getClassNode](#getClassNode())**()` |
| | `public [MetaClass](metaclass)` | `**[getMetaClass](#getMetaClass())**()` |
| | `public [MetaMethod](metamethod)` | `**[getMetaMethod](#getMetaMethod(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)` |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaMethod](metamethod "MetaMethod")>` | `**[getMetaMethods](#getMetaMethods())**()` |
| | `public [MetaProperty](metaproperty)` | `**[getMetaProperty](#getMetaProperty(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)` |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaMethod](metamethod "MetaMethod")>` | `**[getMethods](#getMethods())**()` |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaProperty](metaproperty "MetaProperty")>` | `**[getProperties](#getProperties())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.Object,%20java.lang.String))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20boolean,%20boolean))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") receiver, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") messageName, boolean useSuper, boolean fromInsideClass)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)` |
| | `public [MetaMethod](metamethod)` | `**[getStaticMetaMethod](#getStaticMetaMethod(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)` |
| | `public [MetaMethod](metamethod)` | `**[getStaticMetaMethod](#getStaticMetaMethod(java.lang.String,%20java.lang.Class))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] argTypes)` |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[getTheClass](#getTheClass())**()` |
| | `public [MetaProperty](metaproperty)` | `**[hasProperty](#hasProperty(java.lang.Object,%20java.lang.String))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)` |
| | `public int` | `**[hashCode](#hashCode())**()` |
| | `public void` | `**[initialize](#initialize())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeConstructor](#invokeConstructor(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") arguments)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20java.lang.Object,%20boolean,%20boolean))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") receiver, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments, boolean isCallToSuper, boolean fromInsideClass)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMissingMethod](#invokeMissingMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") instance, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMissingProperty](#invokeMissingProperty(java.lang.Object,%20java.lang.String,%20java.lang.Object,%20boolean))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") instance, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") optionalValue, boolean isGetter)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeStaticMethod](#invokeStaticMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)` |
| | `public boolean` | `**[isGroovyObject](#isGroovyObject())**()` |
| | `public boolean` | `**[isModified](#isModified())**()` |
| | `public [MetaMethod](metamethod)` | `**[pickMethod](#pickMethod(java.lang.String,%20java.lang.Class))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] arguments)`@deprecated |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaMethod](metamethod "MetaMethod")>` | `**[respondsTo](#respondsTo(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] argTypes)` |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaMethod](metamethod "MetaMethod")>` | `**[respondsTo](#respondsTo(java.lang.Object,%20java.lang.String))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)` |
| | `public int` | `**[selectConstructorAndTransformArguments](#selectConstructorAndTransformArguments(int,%20java.lang.Object))**(int numberOfConstructors, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)` |
| | `public void` | `**[setAdaptee](#setAdaptee(groovy.lang.MetaClass))**([MetaClass](metaclass) adaptee)` |
| | `public void` | `**[setAttribute](#setAttribute(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") attribute, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)` |
| | `public void` | `**[setAttribute](#setAttribute(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20java.lang.Object,%20boolean,%20boolean))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") receiver, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") messageName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") messageValue, boolean useSuper, boolean fromInsideClass)` |
| | `public void` | `**[setMetaClass](#setMetaClass(groovy.lang.MetaClass))**([MetaClass](metaclass) metaClass)` |
| | `public void` | `**[setProperty](#setProperty(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)` |
| | `public void` | `**[setProperty](#setProperty(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20java.lang.Object,%20boolean,%20boolean))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") receiver, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") messageName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") messageValue, boolean useSuper, boolean fromInsideClass)` |
| | `public void` | `**[setProperty](#setProperty(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### protected [MetaClass](metaclass) **delegate**
Constructor Detail
------------------
### public **DelegatingMetaClass**([MetaClass](metaclass) delegate)
### public **DelegatingMetaClass**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **addMetaBeanProperty**([MetaBeanProperty](metabeanproperty) metaBeanProperty)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **addMetaMethod**([MetaMethod](metamethod) metaMethod)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **addNewInstanceMethod**([Method](https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html "Method") method)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **addNewStaticMethod**([Method](https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html "Method") method)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **equals**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj)
### public [MetaClass](metaclass) **getAdaptee**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getAttribute**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") attribute)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getAttribute**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") receiver, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") messageName, boolean useSuper)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [ClassNode](../../org/codehaus/groovy/ast/classnode) **getClassNode**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [MetaClass](metaclass) **getMetaClass**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [MetaMethod](metamethod) **getMetaMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaMethod](metamethod "MetaMethod")> **getMetaMethods**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [MetaProperty](metaproperty) **getMetaProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaMethod](metamethod "MetaMethod")> **getMethods**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaProperty](metaproperty "MetaProperty")> **getProperties**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") receiver, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") messageName, boolean useSuper, boolean fromInsideClass)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [MetaMethod](metamethod) **getStaticMetaMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)
### public [MetaMethod](metamethod) **getStaticMetaMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] argTypes)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **getTheClass**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [MetaProperty](metaproperty) **hasProperty**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **hashCode**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **initialize**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeConstructor**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") arguments)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") receiver, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments, boolean isCallToSuper, boolean fromInsideClass)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMissingMethod**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") instance, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMissingProperty**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") instance, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") optionalValue, boolean isGetter)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeStaticMethod**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)
### public boolean **isGroovyObject**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **isModified**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [MetaMethod](metamethod) **pickMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] arguments)
**deprecated:**
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaMethod](metamethod "MetaMethod")> **respondsTo**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] argTypes)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[MetaMethod](metamethod "MetaMethod")> **respondsTo**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **selectConstructorAndTransformArguments**(int numberOfConstructors, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)
### public void **setAdaptee**([MetaClass](metaclass) adaptee)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setAttribute**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") attribute, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setAttribute**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") receiver, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") messageName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") messageValue, boolean useSuper, boolean fromInsideClass)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setMetaClass**([MetaClass](metaclass) metaClass)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setProperty**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setProperty**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") receiver, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") messageName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") messageValue, boolean useSuper, boolean fromInsideClass)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
| programming_docs |
groovy [Java] Class Tuple2<T1, T2> [Java] Class Tuple2<T1, T2>
===========================
* groovy.lang.Tuple2
```
public final class Tuple2<T1, T2>
extends [Tuple](tuple)
```
Represents a list of 2 typed Objects.
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Tuple2](#Tuple2(T1,%20T2))**([T1](../../t1) v1, [T2](../../t2) v2)` |
| `**[Tuple2](#Tuple2(Tuple2))**([Tuple2](tuple2 "Tuple2")<T1, T2> tuple)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Tuple2](tuple2 "Tuple2")<T1, T2>` | `**[clone](#clone())**()` |
| | `public [T1](../../t1)` | `**[getFirst](#getFirst())**()` |
| | `public [T2](../../t2)` | `**[getSecond](#getSecond())**()` |
| | `public [T1](../../t1)` | `**[getV1](#getV1())**()` |
| | `public [T2](../../t2)` | `**[getV2](#getV2())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Tuple](tuple)` | `[clone](tuple#clone()), [compareTo](tuple#compareTo(Tuple)), [equals](tuple#equals(java.lang.Object)), [get](tuple#get(int)), [hashCode](tuple#hashCode()), [size](tuple#size()), [subList](tuple#subList(int,%20int)), [subTuple](tuple#subTuple(int,%20int)), [toArray](tuple#toArray()), [tuple](tuple#tuple()), [tuple](tuple#tuple(T1)), [tuple](tuple#tuple(T1,%20T2)), [tuple](tuple#tuple(T1,%20T2,%20T3)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15,%20T16))` |
Constructor Detail
------------------
### public **Tuple2**([T1](../../t1) v1, [T2](../../t2) v2)
### public **Tuple2**([Tuple2](tuple2 "Tuple2")<T1, T2> tuple)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Tuple2](tuple2 "Tuple2")<T1, T2> **clone**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T1](../../t1) **getFirst**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T2](../../t2) **getSecond**()
### public [T1](../../t1) **getV1**()
### public [T2](../../t2) **getV2**()
groovy [Java] Annotation Type Grapes [Java] Annotation Type Grapes
=============================
* groovy.lang.Grapes
```
public @interface Grapes
```
Sometimes we will need more than one grab per class, but we can only add one annotation type per annotatable node. This class allows for multiple grabs to be added.
For example:
```
@Grapes([@Grab(module='m1'), @Grab(module='m2')])
class AnnotatedClass { ... }
```
You can override an implicit transitive dependency by providing an explicit one. E.g. htmlunit 2.6 normally uses xerces 2.9.1 but you can get 2.9.0 as follows:
```
@Grapes([
@Grab('net.sourceforge.htmlunit:htmlunit:2.6'),
@Grab('xerces#xercesImpl;2.9.0')
])
```
Obviously, only do this if you understand the consequences. You can also remove transitive dependencies altogether (provided you know you don't need them) using `@GrabExclude`. For example, here is how we would not grab the `logkit` and `avalon-framework` transitive dependencies for Apache POI:
```
@Grapes([
@Grab("org.apache.poi#poi;3.5-beta6"),
@GrabExclude("logkit:logkit"),
@GrabExclude("avalon-framework#avalon-framework")
])
import org.apache.poi.hssf.util.CellReference
assert new CellReference(0, 0, false, false).formatAsString() == 'A1'
assert new CellReference(1, 3).formatAsString() == '$D$2'
```
It is also sometimes also useful to use `@GrabConfig` to further adjust how dependencies are grabbed. See `@GrabConfig` for further information. Element Summary
---------------
Required Element Summary
| Type | Name and Description |
| `**[Grab](grab)[]**` | `[value](#value)` |
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[initClass](#initClass)`This will be pushed into the child grab annotations if the value is not set in the child annotation already. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **initClass**
This will be pushed into the child grab annotations if the value is not set in the child annotation already.
This results in an effective change in the default value, which each @Grab can still override
**Default:**
true
### public [Grab](grab)[] **value**
groovy [Java] Class ProxyMetaClass [Java] Class ProxyMetaClass
===========================
* groovy.lang.ProxyMetaClass
All Implemented Interfaces and Traits: [AdaptingMetaClass](adaptingmetaclass)
```
public class ProxyMetaClass
extends [MetaClassImpl](metaclassimpl)
implements [AdaptingMetaClass](adaptingmetaclass)
```
As subclass of MetaClass, ProxyMetaClass manages calls from Groovy Objects to POJOs. It enriches MetaClass with the feature of making method invocations interceptable by an Interceptor. To this end, it acts as a decorator (decorator pattern) allowing to add or withdraw this feature at runtime. See groovy/lang/InterceptorTest.groovy for details.
WARNING: This implementation of ProxyMetaClass is NOT thread-safe and hence should only be used for as a per-instance MetaClass running in a single thread. Do not place this MetaClass in the MetaClassRegistry as it will result in unpredictable behaviour
**See Also:**
[MetaClassRegistry](metaclassregistry "MetaClassRegistry")
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**protected [MetaClass](metaclass)**` | `[adaptee](#adaptee)` | |
| `**protected [Interceptor](interceptor)**` | `[interceptor](#interceptor)` | |
Inherited fields
| Fields inherited from class | Fields |
| **`class [MetaClassImpl](metaclassimpl)`** | `[EMPTY\_ARGUMENTS](metaclassimpl#EMPTY_ARGUMENTS), [INVOKE\_METHOD\_METHOD](metaclassimpl#INVOKE_METHOD_METHOD), [METHOD\_MISSING](metaclassimpl#METHOD_MISSING), [PROPERTY\_MISSING](metaclassimpl#PROPERTY_MISSING), [STATIC\_METHOD\_MISSING](metaclassimpl#STATIC_METHOD_MISSING), [STATIC\_PROPERTY\_MISSING](metaclassimpl#STATIC_PROPERTY_MISSING), [getPropertyMethod](metaclassimpl#getPropertyMethod), [invokeMethodMethod](metaclassimpl#invokeMethodMethod), [isGroovyObject](metaclassimpl#isGroovyObject), [isMap](metaclassimpl#isMap), [metaMethodIndex](metaclassimpl#metaMethodIndex), [registry](metaclassimpl#registry), [setPropertyMethod](metaclassimpl#setPropertyMethod), [theCachedClass](metaclassimpl#theCachedClass), [theClass](metaclassimpl#theClass)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[ProxyMetaClass](#ProxyMetaClass(groovy.lang.MetaClassRegistry,%20java.lang.Class,%20groovy.lang.MetaClass))**([MetaClassRegistry](metaclassregistry) registry, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, [MetaClass](metaclass) adaptee)`
**Parameters:**
`adaptee` - the MetaClass to decorate with interceptability
|
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [MetaClass](metaclass)` | `**[getAdaptee](#getAdaptee())**()` |
| | `public static [ProxyMetaClass](proxymetaclass)` | `**[getInstance](#getInstance(java.lang.Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass)`convenience factory method for the most usual case. |
| | `public [Interceptor](interceptor)` | `**[getInterceptor](#getInterceptor())**()`
**Returns:**
the interceptor in use or null if no interceptor is used
|
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20boolean,%20boolean))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") aClass, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, boolean useSuper, boolean fromInsideClass)`Interceptors the call to getProperty if a PropertyAccessInterceptor is available |
| | `public void` | `**[initialize](#initialize())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeConstructor](#invokeConstructor(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)`Call invokeConstructor on adaptee with logic like in MetaClass unless we have an Interceptor. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)`Call invokeMethod on adaptee with logic like in MetaClass unless we have an Interceptor. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20java.lang.Object,%20boolean,%20boolean))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments, boolean isCallToSuper, boolean fromInsideClass)`Call invokeMethod on adaptee with logic like in MetaClass unless we have an Interceptor. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeStaticMethod](#invokeStaticMethod(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)`Call invokeStaticMethod on adaptee with logic like in MetaClass unless we have an Interceptor. |
| | `public void` | `**[setAdaptee](#setAdaptee(groovy.lang.MetaClass))**([MetaClass](metaclass) metaClass)` |
| | `public void` | `**[setInterceptor](#setInterceptor(groovy.lang.Interceptor))**([Interceptor](interceptor) interceptor)`
**Parameters:**
`interceptor` - may be null to reset any interception
|
| | `public void` | `**[setProperty](#setProperty(java.lang.Class,%20java.lang.Object,%20java.lang.String,%20java.lang.Object,%20boolean,%20boolean))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") aClass, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue, boolean useSuper, boolean fromInsideClass)`Interceptors the call to a property setter if a PropertyAccessInterceptor is available |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[use](#use(groovy.lang.Closure))**([Closure](closure) closure)`Use the ProxyMetaClass for the given Closure. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[use](#use(groovy.lang.GroovyObject,%20groovy.lang.Closure))**([GroovyObject](groovyobject) object, [Closure](closure) closure)`Use the ProxyMetaClass for the given Closure. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [MetaClassImpl](metaclassimpl)` | `[getMetaMethod](metaclassimpl#getMetaMethod(java.lang.String,%20java.lang.Object)), [getMetaProperty](metaclassimpl#getMetaProperty(java.lang.String)), [getRegistry](metaclassimpl#getRegistry()), [getStaticMetaMethod](metaclassimpl#getStaticMetaMethod(java.lang.String,%20java.lang.Object)), [getSuperClasses](metaclassimpl#getSuperClasses()), [getTheCachedClass](metaclassimpl#getTheCachedClass()), [getTheClass](metaclassimpl#getTheClass()), [hasProperty](metaclassimpl#hasProperty(java.lang.Object,%20java.lang.String)), [isGroovyObject](metaclassimpl#isGroovyObject()), [methodNameAction](metaclassimpl#methodNameAction(Class,%20org.codehaus.groovy.runtime.metaclass.MetaMethodIndex.Entry)), [respondsTo](metaclassimpl#respondsTo(java.lang.Object,%20java.lang.String,%20java.lang.Object)), [respondsTo](metaclassimpl#respondsTo(java.lang.Object,%20java.lang.String)), [skipClass](metaclassimpl#skipClass(Class))` |
Field Detail
------------
### protected [MetaClass](metaclass) **adaptee**
### protected [Interceptor](interceptor) **interceptor**
Constructor Detail
------------------
### public **ProxyMetaClass**([MetaClassRegistry](metaclassregistry) registry, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, [MetaClass](metaclass) adaptee)
**Parameters:**
`adaptee` - the MetaClass to decorate with interceptability
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [MetaClass](metaclass) **getAdaptee**()
### public static [ProxyMetaClass](proxymetaclass) **getInstance**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass)
convenience factory method for the most usual case.
### public [Interceptor](interceptor) **getInterceptor**()
**Returns:**
the interceptor in use or null if no interceptor is used
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") aClass, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, boolean useSuper, boolean fromInsideClass)
Interceptors the call to getProperty if a PropertyAccessInterceptor is available
**Parameters:**
`object` - the object to invoke the getter on
`property` - the property name
**Returns:**
the value of the property
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **initialize**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeConstructor**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)
Call invokeConstructor on adaptee with logic like in MetaClass unless we have an Interceptor. With Interceptor the call is nested in its beforeInvoke and afterInvoke methods. The method call is suppressed if Interceptor.doInvoke() returns false. See Interceptor for details.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)
Call invokeMethod on adaptee with logic like in MetaClass unless we have an Interceptor. With Interceptor the call is nested in its beforeInvoke and afterInvoke methods. The method call is suppressed if Interceptor.doInvoke() returns false. See Interceptor for details.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") sender, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments, boolean isCallToSuper, boolean fromInsideClass)
Call invokeMethod on adaptee with logic like in MetaClass unless we have an Interceptor. With Interceptor the call is nested in its beforeInvoke and afterInvoke methods. The method call is suppressed if Interceptor.doInvoke() returns false. See Interceptor for details.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeStaticMethod**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") methodName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] arguments)
Call invokeStaticMethod on adaptee with logic like in MetaClass unless we have an Interceptor. With Interceptor the call is nested in its beforeInvoke and afterInvoke methods. The method call is suppressed if Interceptor.doInvoke() returns false. See Interceptor for details.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setAdaptee**([MetaClass](metaclass) metaClass)
### public void **setInterceptor**([Interceptor](interceptor) interceptor)
**Parameters:**
`interceptor` - may be null to reset any interception
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setProperty**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") aClass, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue, boolean useSuper, boolean fromInsideClass)
Interceptors the call to a property setter if a PropertyAccessInterceptor is available
**Parameters:**
`object` - The object to invoke the setter on
`property` - The property name to set
`newValue` - The new value of the property
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **use**([Closure](closure) closure)
Use the ProxyMetaClass for the given Closure. Cares for balanced register/unregister.
**Parameters:**
`closure` - piece of code to be executed with registered ProxyMetaClass
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **use**([GroovyObject](groovyobject) object, [Closure](closure) closure)
Use the ProxyMetaClass for the given Closure. Cares for balanced setting/unsetting ProxyMetaClass.
**Parameters:**
`closure` - piece of code to be executed with ProxyMetaClass
| programming_docs |
groovy [Java] Class GroovySystem [Java] Class GroovySystem
=========================
* groovy.lang.GroovySystem
```
public final class GroovySystem
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [GroovyRunner](../../org/apache/groovy/plugin/groovyrunner "GroovyRunner")>**` | `[RUNNER\_REGISTRY](#RUNNER_REGISTRY)` | Reference to the Runtime Registry to be used by the Groovy run-time system to find classes capable of running scripts |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public static [MetaClassRegistry](metaclassregistry)` | `**[getMetaClassRegistry](#getMetaClassRegistry())**()` |
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getShortVersion](#getShortVersion())**()`Returns the major and minor part of the groovy version excluding the point/patch part of the version. |
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getVersion](#getVersion())**()`Returns the groovy version |
| | `public static boolean` | `**[isKeepJavaMetaClasses](#isKeepJavaMetaClasses())**()` |
| | `public static boolean` | `**[isUseReflection](#isUseReflection())**()` |
| | `public static void` | `**[setKeepJavaMetaClasses](#setKeepJavaMetaClasses(boolean))**(boolean keepJavaMetaClasses)` |
| | `public static void` | `**[stopThreadedReferenceManager](#stopThreadedReferenceManager())**()`This method can be used to ensure that no threaded created by a reference manager will be active. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public static final [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [GroovyRunner](../../org/apache/groovy/plugin/groovyrunner "GroovyRunner")> **RUNNER\_REGISTRY**
Reference to the Runtime Registry to be used by the Groovy run-time system to find classes capable of running scripts
**deprecated:**
use [GroovyRunnerRegistry](../../org/apache/groovy/plugin/groovyrunnerregistry "GroovyRunnerRegistry")
Method Detail
-------------
### public static [MetaClassRegistry](metaclassregistry) **getMetaClassRegistry**()
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getShortVersion**()
Returns the major and minor part of the groovy version excluding the point/patch part of the version. E.g. 3.0.0, 3.0.0-SNAPSHOT, 3.0.0-rc-1 all have 3.0 as the short version.
**Since:**
3.0.1
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getVersion**()
Returns the groovy version
### public static boolean **isKeepJavaMetaClasses**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public static boolean **isUseReflection**()
### public static void **setKeepJavaMetaClasses**(boolean keepJavaMetaClasses)
### public static void **stopThreadedReferenceManager**()
This method can be used to ensure that no threaded created by a reference manager will be active. This is useful if the Groovy runtime itself is loaded through a class loader which should be disposed off. Without calling this method and if a threaded reference manager is active the class loader cannot be unloaded! Per default no threaded manager will be used.
**Since:**
1.6
groovy [Java] Class Script [Java] Class Script
===================
* groovy.lang.Script
```
public abstract class Script
extends [GroovyObjectSupport](groovyobjectsupport)
```
This object represents a Groovy script
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `protected **[Script](#Script())**()` |
| `protected **[Script](#Script(groovy.lang.Binding))**([Binding](binding) binding)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[evaluate](#evaluate(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") expression)`A helper method to allow the dynamic evaluation of groovy expressions using this scripts binding as the variable scope |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[evaluate](#evaluate(java.io.File))**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file)`A helper method to allow the dynamic evaluation of groovy expressions using this scripts binding as the variable scope |
| | `public [Binding](binding)` | `**[getBinding](#getBinding())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)`Invoke a method (or closure in the binding) defined. |
| | `public void` | `**[print](#print(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)`Prints the value to the current 'out' variable which should be a PrintWriter or at least have a print() method defined on it. |
| | `public void` | `**[printf](#printf(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") format, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)`Prints a formatted string using the specified format string and argument. |
| | `public void` | `**[printf](#printf(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") format, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] values)`Prints a formatted string using the specified format string and arguments. |
| | `public void` | `**[println](#println())**()`Prints a newline to the current 'out' variable which should be a PrintWriter or at least have a println() method defined on it. |
| | `public void` | `**[println](#println(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)`Prints the value and a newline to the current 'out' variable which should be a PrintWriter or at least have a println() method defined on it. |
| | `public abstract [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[run](#run())**()`The main instance method of a script which has variables in scope as defined by the current [Binding](binding "Binding") instance. |
| | `public void` | `**[run](#run(java.io.File,%20java.lang.String))**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] arguments)`A helper method to allow scripts to be run taking command line arguments |
| | `public void` | `**[setBinding](#setBinding(groovy.lang.Binding))**([Binding](binding) binding)` |
| | `public void` | `**[setProperty](#setProperty(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyObjectSupport](groovyobjectsupport)` | `[getMetaClass](groovyobjectsupport#getMetaClass()), [setMetaClass](groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
### protected **Script**()
### protected **Script**([Binding](binding) binding)
Method Detail
-------------
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **evaluate**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") expression)
A helper method to allow the dynamic evaluation of groovy expressions using this scripts binding as the variable scope
**Parameters:**
`expression` - is the Groovy script expression to evaluate
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **evaluate**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file)
A helper method to allow the dynamic evaluation of groovy expressions using this scripts binding as the variable scope
**Parameters:**
`file` - is the Groovy script to evaluate
### public [Binding](binding) **getBinding**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
Invoke a method (or closure in the binding) defined.
**Parameters:**
`name` - method to call
`args` - arguments to pass to the method
**Returns:**
value
### public void **print**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
Prints the value to the current 'out' variable which should be a PrintWriter or at least have a print() method defined on it. If there is no 'out' property then print to standard out.
### public void **printf**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") format, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
Prints a formatted string using the specified format string and argument.
**Parameters:**
`format` - the format to follow
`value` - the value to be formatted
### public void **printf**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") format, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] values)
Prints a formatted string using the specified format string and arguments.
**Parameters:**
`format` - the format to follow
`values` - an array of values to be formatted
### public void **println**()
Prints a newline to the current 'out' variable which should be a PrintWriter or at least have a println() method defined on it. If there is no 'out' property then print to standard out.
### public void **println**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
Prints the value and a newline to the current 'out' variable which should be a PrintWriter or at least have a println() method defined on it. If there is no 'out' property then print to standard out.
### public abstract [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **run**()
The main instance method of a script which has variables in scope as defined by the current [Binding](binding "Binding") instance.
### public void **run**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] arguments)
A helper method to allow scripts to be run taking command line arguments
### public void **setBinding**([Binding](binding) binding)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
groovy [Java] Class Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> [Java] Class Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>
=================================================================================
* groovy.lang.Tuple14
```
public final class Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>
extends [Tuple](tuple)
```
Represents a list of 14 typed Objects.
**Since:**
3.0.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Tuple14](#Tuple14(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11, [T12](../../t12) v12, [T13](../../t13) v13, [T14](../../t14) v14)` |
| `**[Tuple14](#Tuple14(Tuple14))**([Tuple14](tuple14 "Tuple14")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> tuple)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Tuple14](tuple14 "Tuple14")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>` | `**[clone](#clone())**()` |
| | `public [T1](../../t1)` | `**[getV1](#getV1())**()` |
| | `public [T10](../../t10)` | `**[getV10](#getV10())**()` |
| | `public [T11](../../t11)` | `**[getV11](#getV11())**()` |
| | `public [T12](../../t12)` | `**[getV12](#getV12())**()` |
| | `public [T13](../../t13)` | `**[getV13](#getV13())**()` |
| | `public [T14](../../t14)` | `**[getV14](#getV14())**()` |
| | `public [T2](../../t2)` | `**[getV2](#getV2())**()` |
| | `public [T3](../../t3)` | `**[getV3](#getV3())**()` |
| | `public [T4](../../t4)` | `**[getV4](#getV4())**()` |
| | `public [T5](../../t5)` | `**[getV5](#getV5())**()` |
| | `public [T6](../../t6)` | `**[getV6](#getV6())**()` |
| | `public [T7](../../t7)` | `**[getV7](#getV7())**()` |
| | `public [T8](../../t8)` | `**[getV8](#getV8())**()` |
| | `public [T9](../../t9)` | `**[getV9](#getV9())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Tuple](tuple)` | `[clone](tuple#clone()), [compareTo](tuple#compareTo(Tuple)), [equals](tuple#equals(java.lang.Object)), [get](tuple#get(int)), [hashCode](tuple#hashCode()), [size](tuple#size()), [subList](tuple#subList(int,%20int)), [subTuple](tuple#subTuple(int,%20int)), [toArray](tuple#toArray()), [tuple](tuple#tuple()), [tuple](tuple#tuple(T1)), [tuple](tuple#tuple(T1,%20T2)), [tuple](tuple#tuple(T1,%20T2,%20T3)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15,%20T16))` |
Constructor Detail
------------------
### public **Tuple14**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11, [T12](../../t12) v12, [T13](../../t13) v13, [T14](../../t14) v14)
### public **Tuple14**([Tuple14](tuple14 "Tuple14")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> tuple)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Tuple14](tuple14 "Tuple14")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> **clone**()
### public [T1](../../t1) **getV1**()
### public [T10](../../t10) **getV10**()
### public [T11](../../t11) **getV11**()
### public [T12](../../t12) **getV12**()
### public [T13](../../t13) **getV13**()
### public [T14](../../t14) **getV14**()
### public [T2](../../t2) **getV2**()
### public [T3](../../t3) **getV3**()
### public [T4](../../t4) **getV4**()
### public [T5](../../t5) **getV5**()
### public [T6](../../t6) **getV6**()
### public [T7](../../t7) **getV7**()
### public [T8](../../t8) **getV8**()
### public [T9](../../t9) **getV9**()
groovy [Java] Class Binding [Java] Class Binding
====================
* groovy.lang.Binding
```
public class Binding
extends [GroovyObjectSupport](groovyobjectsupport)
```
Represents the variable bindings of a script which can be altered from outside the script object or created outside of a script and passed into it.
Binding instances are not supposed to be used in a multi-threaded context.
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Binding](#Binding())**()` |
| `**[Binding](#Binding(java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") variables)` |
| `**[Binding](#Binding(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)`A helper constructor used in main(String[]) method calls |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)`Overloaded to make variables appear as bean properties or via the subscript operator |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getVariable](#getVariable(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)`
**Parameters:**
`name` - the name of the variable to lookup
|
| | `public [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")` | `**[getVariables](#getVariables())**()` |
| | `public boolean` | `**[hasVariable](#hasVariable(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)`Simple check for whether the binding contains a particular variable or not. |
| | `public void` | `**[removeVariable](#removeVariable(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)`remove the variable with the specified name |
| | `public void` | `**[setProperty](#setProperty(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`Overloaded to make variables appear as bean properties or via the subscript operator |
| | `public void` | `**[setVariable](#setVariable(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)`Sets the value of the given variable |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyObjectSupport](groovyobjectsupport)` | `[getMetaClass](groovyobjectsupport#getMetaClass()), [setMetaClass](groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
### public **Binding**()
### public **Binding**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") variables)
### public **Binding**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)
A helper constructor used in main(String[]) method calls
**Parameters:**
`args` - are the command line arguments from a main()
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)
Overloaded to make variables appear as bean properties or via the subscript operator
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getVariable**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
**Parameters:**
`name` - the name of the variable to lookup
**Returns:**
the variable value
### public [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") **getVariables**()
### public boolean **hasVariable**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
Simple check for whether the binding contains a particular variable or not.
**Parameters:**
`name` - the name of the variable to check for
### public void **removeVariable**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
remove the variable with the specified name
**Parameters:**
`name` - the name of the variable to remove
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
Overloaded to make variables appear as bean properties or via the subscript operator
### public void **setVariable**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
Sets the value of the given variable
**Parameters:**
`name` - the name of the variable to set
`value` - the new value for the given variable
| programming_docs |
groovy [Java] Class GroovyRuntimeException [Java] Class GroovyRuntimeException
===================================
* groovy.lang.GroovyRuntimeException
```
public class GroovyRuntimeException
extends [RuntimeException](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html "RuntimeException")
```
An exception thrown by the interpreter
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[GroovyRuntimeException](#GroovyRuntimeException())**()` |
| `**[GroovyRuntimeException](#GroovyRuntimeException(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message)` |
| `**[GroovyRuntimeException](#GroovyRuntimeException(java.lang.String,%20org.codehaus.groovy.ast.ASTNode))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message, [ASTNode](../../org/codehaus/groovy/ast/astnode) node)` |
| `**[GroovyRuntimeException](#GroovyRuntimeException(java.lang.String,%20java.lang.Throwable))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message, [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") cause)` |
| `**[GroovyRuntimeException](#GroovyRuntimeException(java.lang.Throwable))**([Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") t)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `protected [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getLocationText](#getLocationText())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getMessage](#getMessage())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getMessageWithoutLocationText](#getMessageWithoutLocationText())**()` |
| | `public [ModuleNode](../../org/codehaus/groovy/ast/modulenode)` | `**[getModule](#getModule())**()` |
| | `public [ASTNode](../../org/codehaus/groovy/ast/astnode)` | `**[getNode](#getNode())**()` |
| | `public void` | `**[setModule](#setModule(org.codehaus.groovy.ast.ModuleNode))**([ModuleNode](../../org/codehaus/groovy/ast/modulenode) module)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [RuntimeException](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html "RuntimeException")` | `[printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#printStackTrace() "printStackTrace"), [printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#printStackTrace(java.io.PrintStream) "printStackTrace"), [printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#printStackTrace(java.io.PrintWriter) "printStackTrace"), [fillInStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#fillInStackTrace() "fillInStackTrace"), [getCause](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getCause() "getCause"), [initCause](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#initCause(java.lang.Throwable) "initCause"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#toString() "toString"), [getMessage](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getMessage() "getMessage"), [getSuppressed](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getSuppressed() "getSuppressed"), [getLocalizedMessage](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getLocalizedMessage() "getLocalizedMessage"), [getStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getStackTrace() "getStackTrace"), [setStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#setStackTrace(%5BLjava.lang.StackTraceElement;) "setStackTrace"), [addSuppressed](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#addSuppressed(java.lang.Throwable) "addSuppressed"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#equals(java.lang.Object) "equals"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **GroovyRuntimeException**()
### public **GroovyRuntimeException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message)
### public **GroovyRuntimeException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message, [ASTNode](../../org/codehaus/groovy/ast/astnode) node)
### public **GroovyRuntimeException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message, [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") cause)
### public **GroovyRuntimeException**([Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") t)
Method Detail
-------------
### protected [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getLocationText**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getMessage**()
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getMessageWithoutLocationText**()
### public [ModuleNode](../../org/codehaus/groovy/ast/modulenode) **getModule**()
### public [ASTNode](../../org/codehaus/groovy/ast/astnode) **getNode**()
### public void **setModule**([ModuleNode](../../org/codehaus/groovy/ast/modulenode) module)
groovy [Java] Class MetaClassRegistryChangeEvent [Java] Class MetaClassRegistryChangeEvent
=========================================
* groovy.lang.MetaClassRegistryChangeEvent
```
public class MetaClassRegistryChangeEvent
extends [EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject")
```
An event used to propagate meta class updates
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[MetaClassRegistryChangeEvent](#MetaClassRegistryChangeEvent(java.lang.Object,%20java.lang.Object,%20java.lang.Class,%20groovy.lang.MetaClass,%20groovy.lang.MetaClass))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") source, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") instance, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") clazz, [MetaClass](metaclass) oldMetaClass, [MetaClass](metaclass) newMetaClass)`Constructs a new MetaClassRegistryChangeEvent Object |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[getClassToUpdate](#getClassToUpdate())**()`Get the class that is updated. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getInstance](#getInstance())**()`Returns the instance this event is for. |
| | `public [MetaClass](metaclass)` | `**[getNewMetaClass](#getNewMetaClass())**()`Get the new MetaClass |
| | `public [MetaClass](metaclass)` | `**[getOldMetaClass](#getOldMetaClass())**()`Get the old MetaClass |
| | `public [MetaClassRegistry](metaclassregistry)` | `**[getRegistry](#getRegistry())**()`Get the MetaClassRegistry that originates this change |
| | `public boolean` | `**[isPerInstanceMetaClassChange](#isPerInstanceMetaClassChange())**()`Determines if this event is for a change for a single instance or all instances of the Class. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject")` | `[toString](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html#toString() "toString"), [getSource](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html#getSource() "getSource"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html#equals(java.lang.Object) "equals"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **MetaClassRegistryChangeEvent**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") source, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") instance, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") clazz, [MetaClass](metaclass) oldMetaClass, [MetaClass](metaclass) newMetaClass)
Constructs a new MetaClassRegistryChangeEvent Object
**Parameters:**
`source` - The object the event originates at.
`instance` - Object instance the MetaClass change is on.
`clazz` - The class that is affected by the registry change
`oldMetaClass` - The old MetaClass
`newMetaClass` - The new MetaClass
Method Detail
-------------
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **getClassToUpdate**()
Get the class that is updated.
**Returns:**
The updated class
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getInstance**()
Returns the instance this event is for.
**Returns:**
the instance or null if this event is for a change for all instances of a class
### public [MetaClass](metaclass) **getNewMetaClass**()
Get the new MetaClass
**Returns:**
The new MetaClass
### public [MetaClass](metaclass) **getOldMetaClass**()
Get the old MetaClass
**Returns:**
The old MetaClass
### public [MetaClassRegistry](metaclassregistry) **getRegistry**()
Get the MetaClassRegistry that originates this change
**Returns:**
the source MetaClassRegistry
### public boolean **isPerInstanceMetaClassChange**()
Determines if this event is for a change for a single instance or all instances of the Class.
**Returns:**
whether this event is for a single instance
groovy [Java] Class IllegalPropertyAccessException [Java] Class IllegalPropertyAccessException
===========================================
* groovy.lang.IllegalPropertyAccessException
```
public class IllegalPropertyAccessException
extends [MissingPropertyException](missingpropertyexception)
```
An exception occurred if a dynamic property dispatch fails with a field not accessible.
Inherited fields
| Fields inherited from class | Fields |
| **`class [MissingPropertyException](missingpropertyexception)`** | `[MPE](missingpropertyexception#MPE)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[IllegalPropertyAccessException](#IllegalPropertyAccessException(java.lang.String,%20java.lang.Class,%20int))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") clazz, int modifiers)` |
| `**[IllegalPropertyAccessException](#IllegalPropertyAccessException(groovy.transform.Field,%20java.lang.Class))**([Field](../transform/field) field, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") clazz)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [MissingPropertyException](missingpropertyexception)` | `[getMessageWithoutLocationText](missingpropertyexception#getMessageWithoutLocationText()), [getProperty](missingpropertyexception#getProperty()), [getType](missingpropertyexception#getType())` |
| `class [GroovyRuntimeException](groovyruntimeexception)` | `[getLocationText](groovyruntimeexception#getLocationText()), [getMessage](groovyruntimeexception#getMessage()), [getMessageWithoutLocationText](groovyruntimeexception#getMessageWithoutLocationText()), [getModule](groovyruntimeexception#getModule()), [getNode](groovyruntimeexception#getNode()), [setModule](groovyruntimeexception#setModule(org.codehaus.groovy.ast.ModuleNode))` |
Constructor Detail
------------------
### public **IllegalPropertyAccessException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") clazz, int modifiers)
### public **IllegalPropertyAccessException**([Field](../transform/field) field, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") clazz)
groovy [Java] Class ExpandoMetaClass.ExpandoMetaProperty [Java] Class ExpandoMetaClass.ExpandoMetaProperty
=================================================
* groovy.lang.ExpandoMetaClass.ExpandoMetaProperty
```
protected class ExpandoMetaClass.ExpandoMetaProperty
extends [GroovyObjectSupport](groovyobjectsupport)
```
Instances of this class are returned when using the `<<` left shift operator.
Example:
metaClass.myMethod `<<` { String args `->` }
This allows callbacks to the ExpandoMetaClass for registering appending methods
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**protected boolean**` | `[isStatic](#isStatic)` | |
| `**protected [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[propertyName](#propertyName)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `protected **[ExpandoMetaProperty](#ExpandoMetaProperty(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)` |
| `protected **[ExpandoMetaProperty](#ExpandoMetaProperty(java.lang.String,%20boolean))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, boolean isStatic)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getPropertyName](#getPropertyName())**()` |
| | `public boolean` | `**[isStatic](#isStatic())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[leftShift](#leftShift(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") arg)` |
| | `public void` | `**[setProperty](#setProperty(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyObjectSupport](groovyobjectsupport)` | `[getMetaClass](groovyobjectsupport#getMetaClass()), [setMetaClass](groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Field Detail
------------
### protected boolean **isStatic**
### protected [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **propertyName**
Constructor Detail
------------------
### protected **ExpandoMetaProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
### protected **ExpandoMetaProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, boolean isStatic)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getPropertyName**()
### public boolean **isStatic**()
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **leftShift**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") arg)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
groovy [Java] Interface MetaClassRegistry [Java] Interface MetaClassRegistry
==================================
```
public interface MetaClassRegistry
```
A MetaClassRegistry is an object that is responsible for managing the a cache of MetaClass instances. Each java.lang.Class instance has an associated MetaClass and client code can query this interface for the MetaClass for a given associated java.lang.Class
**See Also:**
[MetaClass](metaclass "MetaClass")
Nested Class Summary
--------------------
Nested classes
| Modifiers | Name | Description |
| `**class**` | `[MetaClassRegistry.MetaClassCreationHandle](metaclassregistry.metaclasscreationhandle)` | Class used as base for the creation of MetaClass implementations. |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[addMetaClassRegistryChangeEventListener](#addMetaClassRegistryChangeEventListener(groovy.lang.MetaClassRegistryChangeEventListener))**([MetaClassRegistryChangeEventListener](metaclassregistrychangeeventlistener) listener)`Adds a meta class change listener for constant meta classes |
| | `public void` | `**[addNonRemovableMetaClassRegistryChangeEventListener](#addNonRemovableMetaClassRegistryChangeEventListener(groovy.lang.MetaClassRegistryChangeEventListener))**([MetaClassRegistryChangeEventListener](metaclassregistrychangeeventlistener) listener)`Adds a meta class change listener for constant meta classes. |
| | `public [MetaClass](metaclass)` | `**[getMetaClass](#getMetaClass(java.lang.Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass)`The main function of the registry If a meta class exists then return it otherwise create one, put it in the registry and return it |
| | `public [MetaClassCreationHandle](metaclassregistry.metaclasscreationhandle)` | `**[getMetaClassCreationHandler](#getMetaClassCreationHandler())**()`Retrieves the MetaClassCreationHandle that is responsible for constructing MetaClass instances |
| | `public [MetaClassRegistryChangeEventListener](metaclassregistrychangeeventlistener)[]` | `**[getMetaClassRegistryChangeEventListeners](#getMetaClassRegistryChangeEventListeners())**()`Returns all registered class change listener for constant meta classes. |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")` | `**[iterator](#iterator())**()`Gets a snapshot of the current constant meta classes and returns it as Iterator. |
| | `public void` | `**[removeMetaClass](#removeMetaClass(java.lang.Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass)`Removes a cached MetaClass from the registry |
| | `public void` | `**[removeMetaClassRegistryChangeEventListener](#removeMetaClassRegistryChangeEventListener(groovy.lang.MetaClassRegistryChangeEventListener))**([MetaClassRegistryChangeEventListener](metaclassregistrychangeeventlistener) listener)`Removes a meta class change listener for constant meta classes |
| | `public void` | `**[setMetaClass](#setMetaClass(java.lang.Class,%20groovy.lang.MetaClass))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, [MetaClass](metaclass) theMetaClass)`Adds a metaclass to the registry for the given class |
| | `public void` | `**[setMetaClassCreationHandle](#setMetaClassCreationHandle(groovy.lang.MetaClassRegistry.MetaClassCreationHandle))**([MetaClassCreationHandle](metaclassregistry.metaclasscreationhandle) handle)`Sets the MetaClassCreationHandle instance that is responsible for constructing instances |
Method Detail
-------------
### public void **addMetaClassRegistryChangeEventListener**([MetaClassRegistryChangeEventListener](metaclassregistrychangeeventlistener) listener)
Adds a meta class change listener for constant meta classes
**Parameters:**
`listener` - - the update listener
### public void **addNonRemovableMetaClassRegistryChangeEventListener**([MetaClassRegistryChangeEventListener](metaclassregistrychangeeventlistener) listener)
Adds a meta class change listener for constant meta classes. This listener cannot be removed!
**Parameters:**
`listener` - - the update listener
### public [MetaClass](metaclass) **getMetaClass**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass)
The main function of the registry If a meta class exists then return it otherwise create one, put it in the registry and return it
### public [MetaClassCreationHandle](metaclassregistry.metaclasscreationhandle) **getMetaClassCreationHandler**()
Retrieves the MetaClassCreationHandle that is responsible for constructing MetaClass instances
**Returns:**
The MetaClassCreationHandle instance
### public [MetaClassRegistryChangeEventListener](metaclassregistrychangeeventlistener)[] **getMetaClassRegistryChangeEventListeners**()
Returns all registered class change listener for constant meta classes.
**Returns:**
an array containing all change listener
### public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator") **iterator**()
Gets a snapshot of the current constant meta classes and returns it as Iterator. Modifications done using this Iterator will not cause a ConcurrentModificationException. If a MetaClass is removed using this Iterator, then the MetaClass will only be removed if the MetaClass was not replaced by another MetaClass in the meantime. If a MetaClass is added while using this Iterator, then it will be part of the Iteration. If a MetaClass replaces another constant meta class, then the Iteration might show two meta classes for the same class.
Note: This Iterator may not used with multiple threads.
**Returns:**
Iterator for the constant meta classes
### public void **removeMetaClass**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass)
Removes a cached MetaClass from the registry
**Parameters:**
`theClass` - The Java class of the MetaClass to remove
### public void **removeMetaClassRegistryChangeEventListener**([MetaClassRegistryChangeEventListener](metaclassregistrychangeeventlistener) listener)
Removes a meta class change listener for constant meta classes
**Parameters:**
`listener` - - the update listener
### public void **setMetaClass**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") theClass, [MetaClass](metaclass) theMetaClass)
Adds a metaclass to the registry for the given class
**Parameters:**
`theClass` - The class
`theMetaClass` - The MetaClass for theClass
### public void **setMetaClassCreationHandle**([MetaClassCreationHandle](metaclassregistry.metaclasscreationhandle) handle)
Sets the MetaClassCreationHandle instance that is responsible for constructing instances
**Parameters:**
`handle` - The handle instance
| programming_docs |
groovy [Java] Class Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> [Java] Class Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>
======================================================================================
* groovy.lang.Tuple15
```
public final class Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>
extends [Tuple](tuple)
```
Represents a list of 15 typed Objects.
**Since:**
3.0.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Tuple15](#Tuple15(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11, [T12](../../t12) v12, [T13](../../t13) v13, [T14](../../t14) v14, [T15](../../t15) v15)` |
| `**[Tuple15](#Tuple15(Tuple15))**([Tuple15](tuple15 "Tuple15")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> tuple)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Tuple15](tuple15 "Tuple15")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>` | `**[clone](#clone())**()` |
| | `public [T1](../../t1)` | `**[getV1](#getV1())**()` |
| | `public [T10](../../t10)` | `**[getV10](#getV10())**()` |
| | `public [T11](../../t11)` | `**[getV11](#getV11())**()` |
| | `public [T12](../../t12)` | `**[getV12](#getV12())**()` |
| | `public [T13](../../t13)` | `**[getV13](#getV13())**()` |
| | `public [T14](../../t14)` | `**[getV14](#getV14())**()` |
| | `public [T15](../../t15)` | `**[getV15](#getV15())**()` |
| | `public [T2](../../t2)` | `**[getV2](#getV2())**()` |
| | `public [T3](../../t3)` | `**[getV3](#getV3())**()` |
| | `public [T4](../../t4)` | `**[getV4](#getV4())**()` |
| | `public [T5](../../t5)` | `**[getV5](#getV5())**()` |
| | `public [T6](../../t6)` | `**[getV6](#getV6())**()` |
| | `public [T7](../../t7)` | `**[getV7](#getV7())**()` |
| | `public [T8](../../t8)` | `**[getV8](#getV8())**()` |
| | `public [T9](../../t9)` | `**[getV9](#getV9())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Tuple](tuple)` | `[clone](tuple#clone()), [compareTo](tuple#compareTo(Tuple)), [equals](tuple#equals(java.lang.Object)), [get](tuple#get(int)), [hashCode](tuple#hashCode()), [size](tuple#size()), [subList](tuple#subList(int,%20int)), [subTuple](tuple#subTuple(int,%20int)), [toArray](tuple#toArray()), [tuple](tuple#tuple()), [tuple](tuple#tuple(T1)), [tuple](tuple#tuple(T1,%20T2)), [tuple](tuple#tuple(T1,%20T2,%20T3)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15,%20T16))` |
Constructor Detail
------------------
### public **Tuple15**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3, [T4](../../t4) v4, [T5](../../t5) v5, [T6](../../t6) v6, [T7](../../t7) v7, [T8](../../t8) v8, [T9](../../t9) v9, [T10](../../t10) v10, [T11](../../t11) v11, [T12](../../t12) v12, [T13](../../t13) v13, [T14](../../t14) v14, [T15](../../t15) v15)
### public **Tuple15**([Tuple15](tuple15 "Tuple15")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> tuple)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Tuple15](tuple15 "Tuple15")<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> **clone**()
### public [T1](../../t1) **getV1**()
### public [T10](../../t10) **getV10**()
### public [T11](../../t11) **getV11**()
### public [T12](../../t12) **getV12**()
### public [T13](../../t13) **getV13**()
### public [T14](../../t14) **getV14**()
### public [T15](../../t15) **getV15**()
### public [T2](../../t2) **getV2**()
### public [T3](../../t3) **getV3**()
### public [T4](../../t4) **getV4**()
### public [T5](../../t5) **getV5**()
### public [T6](../../t6) **getV6**()
### public [T7](../../t7) **getV7**()
### public [T8](../../t8) **getV8**()
### public [T9](../../t9) **getV9**()
groovy [Java] Class NumberRange [Java] Class NumberRange
========================
* groovy.lang.NumberRange
All Implemented Interfaces and Traits:
[Range](range), [Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html "Serializable")
```
public class NumberRange
extends [AbstractList](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html "AbstractList")
implements [Range](range), [Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html "Serializable")
```
Represents an immutable list of Numbers from a value to a value with a particular step size. In general, it isn't recommended using a NumberRange as a key to a map. The range 0..3 is deemed to be equal to 0.0..3.0 but they have different hashCode values, so storing a value using one of these ranges couldn't be retrieved using the other.
**Since:**
2.5.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[NumberRange](#NumberRange(T,%20U))**(T from, U to)`Creates an inclusive [NumberRange](numberrange "NumberRange") with step size 1. |
| `**[NumberRange](#NumberRange(T,%20U,%20boolean))**(T from, U to, boolean inclusive)`Creates a new [NumberRange](numberrange "NumberRange") with step size 1. |
| `**[NumberRange](#NumberRange(T,%20U,%20V))**(T from, U to, V stepSize)`Creates an inclusive [NumberRange](numberrange "NumberRange"). |
| `**[NumberRange](#NumberRange(T,%20U,%20V,%20boolean))**(T from, U to, V stepSize, boolean inclusive)`Creates a [NumberRange](numberrange "NumberRange"). |
| `**[NumberRange](#NumberRange(T,%20U,%20boolean,%20boolean))**(T from, U to, boolean inclusiveLeft, boolean inclusiveRight)`Creates a [NumberRange](numberrange "NumberRange"). |
| `**[NumberRange](#NumberRange(T,%20U,%20V,%20boolean,%20boolean))**(T from, U to, V stepSize, boolean inclusiveLeft, boolean inclusiveRight)`Creates a [NumberRange](numberrange "NumberRange"). |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| `<T extends Number & Comparable>` | `public [NumberRange](numberrange)` | `**[by](#by(T))**(T stepSize)`For a NumberRange with step size 1, creates a new NumberRange with the same `from` and `to` as this NumberRange but with a step size of `stepSize`. |
| | `public boolean` | `**[contains](#contains(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)`iterates over all values and returns true if one value matches. |
| | `public boolean` | `**[containsWithinBounds](#containsWithinBounds(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)`Checks whether a value is between the from and to values of a Range |
| | `public boolean` | `**[equals](#equals(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") that)`An object is deemed equal to this NumberRange if it represents a List of items and those items equal the list of discrete items represented by this NumberRange. |
| | `public boolean` | `**[fastEquals](#fastEquals(groovy.lang.NumberRange))**([NumberRange](numberrange) that)`Compares a [NumberRange](numberrange "NumberRange") to another [NumberRange](numberrange "NumberRange") using only a strict comparison of the NumberRange properties. |
| | `public [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")` | `**[get](#get(int))**(int index)` |
| | `public [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")` | `**[getFrom](#getFrom())**()` |
| | `public [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")` | `**[getStepSize](#getStepSize())**()` |
| | `public [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")` | `**[getTo](#getTo())**()` |
| | `public int` | `**[hashCode](#hashCode())**()`A NumberRange's hashCode is based on hashCode values of the discrete items it represents. |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[inspect](#inspect())**()` |
| | `public boolean` | `**[isReverse](#isReverse())**()` |
| | `public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")<[Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")>` | `**[iterator](#iterator())**()`{@inheritDoc} |
| | `public int` | `**[size](#size())**()` |
| | `public void` | `**[step](#step(int,%20groovy.lang.Closure))**(int numSteps, [Closure](closure) closure)`{@inheritDoc} |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")>` | `**[step](#step(int))**(int numSteps)` |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")>` | `**[subList](#subList(int,%20int))**(int fromIndex, int toIndex)` |
| | `public [RangeInfo](../../org/codehaus/groovy/runtime/rangeinfo)` | `**[subListBorders](#subListBorders(int))**(int size)`A method for determining from and to information when using this IntRange to index an aggregate object of the specified size. |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [AbstractList](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html "AbstractList")` | `[add](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#add(int,%20java.lang.Object) "add"), [add](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#add(java.lang.Object) "add"), [remove](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#remove(int) "remove"), [get](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#get(int) "get"), [equals](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#equals(java.lang.Object) "equals"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#hashCode() "hashCode"), [indexOf](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#indexOf(java.lang.Object) "indexOf"), [clear](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#clear() "clear"), [lastIndexOf](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#lastIndexOf(java.lang.Object) "lastIndexOf"), [subList](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#subList(int,%20int) "subList"), [iterator](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#iterator() "iterator"), [addAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#addAll(int,%20java.util.Collection) "addAll"), [set](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#set(int,%20java.lang.Object) "set"), [listIterator](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#listIterator() "listIterator"), [listIterator](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#listIterator(int) "listIterator"), [remove](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#remove(java.lang.Object) "remove"), [toString](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#toString() "toString"), [isEmpty](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#isEmpty() "isEmpty"), [size](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#size() "size"), [toArray](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#toArray() "toArray"), [toArray](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#toArray(%5BLjava.lang.Object;) "toArray"), [contains](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#contains(java.lang.Object) "contains"), [addAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#addAll(java.util.Collection) "addAll"), [removeAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#removeAll(java.util.Collection) "removeAll"), [retainAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#retainAll(java.util.Collection) "retainAll"), [containsAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#containsAll(java.util.Collection) "containsAll"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#wait(long) "wait"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#notifyAll() "notifyAll"), [toArray](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#toArray(java.util.function.IntFunction) "toArray"), [stream](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#stream() "stream"), [spliterator](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#spliterator() "spliterator"), [removeIf](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#removeIf(java.util.function.Predicate) "removeIf"), [parallelStream](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#parallelStream() "parallelStream"), [forEach](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#forEach(java.util.function.Consumer) "forEach"), [replaceAll](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#replaceAll(java.util.function.UnaryOperator) "replaceAll"), [sort](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractList.html#sort(java.util.Comparator) "sort")` |
Constructor Detail
------------------
### public **NumberRange**(T from, U to)
Creates an inclusive [NumberRange](numberrange "NumberRange") with step size 1. Creates a reversed range if `from` < `to`.
**Parameters:**
`from` - the first value in the range
`to` - the last value in the range
### public **NumberRange**(T from, U to, boolean inclusive)
Creates a new [NumberRange](numberrange "NumberRange") with step size 1. Creates a reversed range if `from` < `to`.
**Parameters:**
`from` - start of the range
`to` - end of the range
`inclusive` - whether the range is inclusive
### public **NumberRange**(T from, U to, V stepSize)
Creates an inclusive [NumberRange](numberrange "NumberRange"). Creates a reversed range if `from` < `to`.
**Parameters:**
`from` - start of the range
`to` - end of the range
`stepSize` - the gap between discrete elements in the range
### public **NumberRange**(T from, U to, V stepSize, boolean inclusive)
Creates a [NumberRange](numberrange "NumberRange"). Creates a reversed range if `from` < `to`.
**Parameters:**
`from` - start of the range
`to` - end of the range
`stepSize` - the gap between discrete elements in the range
`inclusive` - whether the range is inclusive (upper bound)
### public **NumberRange**(T from, U to, boolean inclusiveLeft, boolean inclusiveRight)
Creates a [NumberRange](numberrange "NumberRange"). Creates a reversed range if `from` < `to`.
**Parameters:**
`from` - start of the range
`to` - end of the range
`inclusiveLeft` - whether the range is includes the lower bound
`inclusiveRight` - whether the range is includes the upper bound
### public **NumberRange**(T from, U to, V stepSize, boolean inclusiveLeft, boolean inclusiveRight)
Creates a [NumberRange](numberrange "NumberRange"). Creates a reversed range if `from` < `to`.
**Parameters:**
`from` - start of the range
`to` - end of the range
`stepSize` - the gap between discrete elements in the range
`inclusiveLeft` - whether the range is includes the lower bound
`inclusiveRight` - whether the range is includes the upper bound
Method Detail
-------------
### <T extends Number & Comparable> public [NumberRange](numberrange) **by**(T stepSize)
For a NumberRange with step size 1, creates a new NumberRange with the same `from` and `to` as this NumberRange but with a step size of `stepSize`.
**Parameters:**
`stepSize` - the desired step size
**Returns:**
a new NumberRange
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **contains**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
iterates over all values and returns true if one value matches. Also see containsWithinBounds.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **containsWithinBounds**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
Checks whether a value is between the from and to values of a Range
**Parameters:**
`value` - the value of interest
**Returns:**
true if the value is within the bounds
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **equals**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") that)
An object is deemed equal to this NumberRange if it represents a List of items and those items equal the list of discrete items represented by this NumberRange.
**Parameters:**
`that` - the object to be compared for equality with this NumberRange
**Returns:**
`true` if the specified object is equal to this NumberRange
**See Also:**
[fastEquals(NumberRange)](#fastEquals(groovy.lang.NumberRange))
### public boolean **fastEquals**([NumberRange](numberrange) that)
Compares a [NumberRange](numberrange "NumberRange") to another [NumberRange](numberrange "NumberRange") using only a strict comparison of the NumberRange properties. This won't return true for some ranges which represent the same discrete items, use equals instead for that but will be much faster for large lists.
**Parameters:**
`that` - the NumberRange to check equality with
**Returns:**
`true` if the ranges are equal
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable") **get**(int index)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable") **getFrom**()
### public [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable") **getStepSize**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable") **getTo**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **hashCode**()
A NumberRange's hashCode is based on hashCode values of the discrete items it represents.
**Returns:**
the hashCode value
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **inspect**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **isReverse**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")<[Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")> **iterator**()
{@inheritDoc}
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **size**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **step**(int numSteps, [Closure](closure) closure)
{@inheritDoc}
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")> **step**(int numSteps)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Comparable](https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html "Comparable")> **subList**(int fromIndex, int toIndex)
### public [RangeInfo](../../org/codehaus/groovy/runtime/rangeinfo) **subListBorders**(int size)
A method for determining from and to information when using this IntRange to index an aggregate object of the specified size. Normally only used internally within Groovy but useful if adding range indexing support for your own aggregates.
**Parameters:**
`size` - the size of the aggregate being indexed
**Returns:**
the calculated range information (with 1 added to the to value, ready for providing to subList
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
| programming_docs |
groovy [Java] Class Tuple3<T1, T2, T3> [Java] Class Tuple3<T1, T2, T3>
===============================
* groovy.lang.Tuple3
```
public final class Tuple3<T1, T2, T3>
extends [Tuple](tuple)
```
Represents a list of 3 typed Objects.
**Since:**
2.5.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Tuple3](#Tuple3(T1,%20T2,%20T3))**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3)` |
| `**[Tuple3](#Tuple3(Tuple3))**([Tuple3](tuple3 "Tuple3")<T1, T2, T3> tuple)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Tuple3](tuple3 "Tuple3")<T1, T2, T3>` | `**[clone](#clone())**()` |
| | `public [T1](../../t1)` | `**[getFirst](#getFirst())**()` |
| | `public [T2](../../t2)` | `**[getSecond](#getSecond())**()` |
| | `public [T3](../../t3)` | `**[getThird](#getThird())**()` |
| | `public [T1](../../t1)` | `**[getV1](#getV1())**()` |
| | `public [T2](../../t2)` | `**[getV2](#getV2())**()` |
| | `public [T3](../../t3)` | `**[getV3](#getV3())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Tuple](tuple)` | `[clone](tuple#clone()), [compareTo](tuple#compareTo(Tuple)), [equals](tuple#equals(java.lang.Object)), [get](tuple#get(int)), [hashCode](tuple#hashCode()), [size](tuple#size()), [subList](tuple#subList(int,%20int)), [subTuple](tuple#subTuple(int,%20int)), [toArray](tuple#toArray()), [tuple](tuple#tuple()), [tuple](tuple#tuple(T1)), [tuple](tuple#tuple(T1,%20T2)), [tuple](tuple#tuple(T1,%20T2,%20T3)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15)), [tuple](tuple#tuple(T1,%20T2,%20T3,%20T4,%20T5,%20T6,%20T7,%20T8,%20T9,%20T10,%20T11,%20T12,%20T13,%20T14,%20T15,%20T16))` |
Constructor Detail
------------------
### public **Tuple3**([T1](../../t1) v1, [T2](../../t2) v2, [T3](../../t3) v3)
### public **Tuple3**([Tuple3](tuple3 "Tuple3")<T1, T2, T3> tuple)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Tuple3](tuple3 "Tuple3")<T1, T2, T3> **clone**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T1](../../t1) **getFirst**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T2](../../t2) **getSecond**()
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [T3](../../t3) **getThird**()
### public [T1](../../t1) **getV1**()
### public [T2](../../t2) **getV2**()
### public [T3](../../t3) **getV3**()
groovy [Java] Class NonEmptySequence [Java] Class NonEmptySequence
=============================
* groovy.lang.NonEmptySequence
```
public class NonEmptySequence
extends [Sequence](sequence)
```
Represents a sequence of one or more objects of a given type. The type can be omitted in which case any type of object can be added.
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[NonEmptySequence](#NonEmptySequence())**()` |
| `**[NonEmptySequence](#NonEmptySequence(java.lang.Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type)` |
| `**[NonEmptySequence](#NonEmptySequence(java.lang.Class,%20java.util.List))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") content)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public int` | `**[minimumSize](#minimumSize())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Sequence](sequence)` | `[add](sequence#add(int,%20java.lang.Object)), [add](sequence#add(java.lang.Object)), [addAll](sequence#addAll(java.util.Collection)), [addAll](sequence#addAll(int,%20java.util.Collection)), [checkCollectionType](sequence#checkCollectionType(java.util.Collection)), [checkType](sequence#checkType(java.lang.Object)), [clear](sequence#clear()), [equals](sequence#equals(java.lang.Object)), [equals](sequence#equals(groovy.lang.Sequence)), [getMetaClass](sequence#getMetaClass()), [getProperty](sequence#getProperty(java.lang.String)), [hashCode](sequence#hashCode()), [invokeMethod](sequence#invokeMethod(java.lang.String,%20java.lang.Object)), [minimumSize](sequence#minimumSize()), [remove](sequence#remove(int)), [removeRange](sequence#removeRange(int,%20int)), [set](sequence#set(java.util.Collection)), [set](sequence#set(int,%20java.lang.Object)), [setMetaClass](sequence#setMetaClass(groovy.lang.MetaClass)), [setProperty](sequence#setProperty(java.lang.String,%20java.lang.Object)), [type](sequence#type())` |
Constructor Detail
------------------
### public **NonEmptySequence**()
### public **NonEmptySequence**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type)
### public **NonEmptySequence**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") content)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **minimumSize**()
groovy [Java] Class GroovyClassLoader.InnerLoader [Java] Class GroovyClassLoader.InnerLoader
==========================================
* groovy.lang.GroovyClassLoader.InnerLoader
```
public static class GroovyClassLoader.InnerLoader
extends [GroovyClassLoader](groovyclassloader "GroovyClassLoader")
```
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[InnerLoader](#InnerLoader(groovy.lang.GroovyClassLoader))**([GroovyClassLoader](groovyclassloader) delegate)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[addClasspath](#addClasspath(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") path)` |
| | `public void` | `**[addURL](#addURL(java.net.URL))**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url)` |
| | `public void` | `**[clearAssertionStatus](#clearAssertionStatus())**()` |
| | `public void` | `**[clearCache](#clearCache())**()` |
| | `public void` | `**[close](#close())**()` |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[defineClass](#defineClass(org.codehaus.groovy.ast.ClassNode,%20java.lang.String,%20java.lang.String))**([ClassNode](../../org/codehaus/groovy/ast/classnode) classNode, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") file, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") newCodeBase)` |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[defineClass](#defineClass(java.lang.String,%20byte%5B%5D))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, byte[] b)` |
| | `public [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL")` | `**[findResource](#findResource(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)` |
| | `public [Enumeration](https://docs.oracle.com/javase/8/docs/api/java/util/Enumeration.html "Enumeration")<[URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL")>` | `**[findResources](#findResources(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[generateScriptName](#generateScriptName())**()` |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[]` | `**[getLoadedClasses](#getLoadedClasses())**()` |
| | `public [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL")` | `**[getResource](#getResource(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)` |
| | `public [InputStream](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html "InputStream")` | `**[getResourceAsStream](#getResourceAsStream(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)` |
| | `public [GroovyResourceLoader](groovyresourceloader)` | `**[getResourceLoader](#getResourceLoader())**()` |
| | `public [Enumeration](https://docs.oracle.com/javase/8/docs/api/java/util/Enumeration.html "Enumeration")<[URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL")>` | `**[getResources](#getResources(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)` |
| | `public long` | `**[getTimeStamp](#getTimeStamp())**()` |
| | `public [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL")[]` | `**[getURLs](#getURLs())**()` |
| | `public [Boolean](https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html "Boolean")` | `**[isShouldRecompile](#isShouldRecompile())**()` |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[loadClass](#loadClass(java.lang.String,%20boolean,%20boolean,%20boolean))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, boolean lookupScriptFiles, boolean preferClassOverScript, boolean resolve)` |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[loadClass](#loadClass(java.lang.String,%20boolean,%20boolean))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, boolean lookupScriptFiles, boolean preferClassOverScript)` |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?>` | `**[loadClass](#loadClass(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)` |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[parseClass](#parseClass(groovy.lang.GroovyCodeSource,%20boolean))**([GroovyCodeSource](groovycodesource) codeSource, boolean shouldCache)` |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[parseClass](#parseClass(java.io.File))**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file)` |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[parseClass](#parseClass(java.lang.String,%20java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") fileName)` |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[parseClass](#parseClass(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text)` |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[parseClass](#parseClass(java.io.Reader,%20java.lang.String))**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") fileName)` |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[parseClass](#parseClass(groovy.lang.GroovyCodeSource))**([GroovyCodeSource](groovycodesource) codeSource)` |
| | `public void` | `**[setClassAssertionStatus](#setClassAssertionStatus(java.lang.String,%20boolean))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") className, boolean enabled)` |
| | `public void` | `**[setDefaultAssertionStatus](#setDefaultAssertionStatus(boolean))**(boolean enabled)` |
| | `public void` | `**[setPackageAssertionStatus](#setPackageAssertionStatus(java.lang.String,%20boolean))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") packageName, boolean enabled)` |
| | `public void` | `**[setResourceLoader](#setResourceLoader(groovy.lang.GroovyResourceLoader))**([GroovyResourceLoader](groovyresourceloader) resourceLoader)` |
| | `public void` | `**[setShouldRecompile](#setShouldRecompile(java.lang.Boolean))**([Boolean](https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html "Boolean") mode)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyClassLoader](groovyclassloader "GroovyClassLoader")` | `[loadClass](groovyclassloader#loadClass(java.lang.String,%20boolean,%20boolean) "loadClass"), [loadClass](groovyclassloader#loadClass(java.lang.String) "loadClass"), [loadClass](groovyclassloader#loadClass(java.lang.String,%20boolean,%20boolean,%20boolean) "loadClass"), [defineClass](groovyclassloader#defineClass(java.lang.String,%20%5BB) "defineClass"), [defineClass](groovyclassloader#defineClass(org.codehaus.groovy.ast.ClassNode,%20java.lang.String,%20java.lang.String) "defineClass"), [close](groovyclassloader#close() "close"), [addURL](groovyclassloader#addURL(java.net.URL) "addURL"), [clearCache](groovyclassloader#clearCache() "clearCache"), [hasCompatibleConfiguration](groovyclassloader#hasCompatibleConfiguration(org.codehaus.groovy.control.CompilerConfiguration) "hasCompatibleConfiguration"), [setResourceLoader](groovyclassloader#setResourceLoader(groovy.lang.GroovyResourceLoader) "setResourceLoader"), [parseClass](groovyclassloader#parseClass(groovy.lang.GroovyCodeSource) "parseClass"), [parseClass](groovyclassloader#parseClass(java.io.Reader,%20java.lang.String) "parseClass"), [parseClass](groovyclassloader#parseClass(java.lang.String) "parseClass"), [parseClass](groovyclassloader#parseClass(groovy.lang.GroovyCodeSource,%20boolean) "parseClass"), [parseClass](groovyclassloader#parseClass(java.io.File) "parseClass"), [parseClass](groovyclassloader#parseClass(java.lang.String,%20java.lang.String) "parseClass"), [isShouldRecompile](groovyclassloader#isShouldRecompile() "isShouldRecompile"), [setShouldRecompile](groovyclassloader#setShouldRecompile(java.lang.Boolean) "setShouldRecompile"), [addClasspath](groovyclassloader#addClasspath(java.lang.String) "addClasspath"), [getResourceLoader](groovyclassloader#getResourceLoader() "getResourceLoader"), [generateScriptName](groovyclassloader#generateScriptName() "generateScriptName"), [getLoadedClasses](groovyclassloader#getLoadedClasses() "getLoadedClasses"), [newInstance](groovyclassloader#newInstance(%5BLjava.net.URL;,%20java.lang.ClassLoader) "newInstance"), [newInstance](groovyclassloader#newInstance(%5BLjava.net.URL;) "newInstance"), [findResource](groovyclassloader#findResource(java.lang.String) "findResource"), [getResourceAsStream](groovyclassloader#getResourceAsStream(java.lang.String) "getResourceAsStream"), [findResources](groovyclassloader#findResources(java.lang.String) "findResources"), [getURLs](groovyclassloader#getURLs() "getURLs"), [getName](groovyclassloader#getName() "getName"), [getPlatformClassLoader](groovyclassloader#getPlatformClassLoader() "getPlatformClassLoader"), [getSystemClassLoader](groovyclassloader#getSystemClassLoader() "getSystemClassLoader"), [getSystemResourceAsStream](groovyclassloader#getSystemResourceAsStream(java.lang.String) "getSystemResourceAsStream"), [getSystemResource](groovyclassloader#getSystemResource(java.lang.String) "getSystemResource"), [getResource](groovyclassloader#getResource(java.lang.String) "getResource"), [getResources](groovyclassloader#getResources(java.lang.String) "getResources"), [getDefinedPackage](groovyclassloader#getDefinedPackage(java.lang.String) "getDefinedPackage"), [resources](groovyclassloader#resources(java.lang.String) "resources"), [isRegisteredAsParallelCapable](groovyclassloader#isRegisteredAsParallelCapable() "isRegisteredAsParallelCapable"), [getSystemResources](groovyclassloader#getSystemResources(java.lang.String) "getSystemResources"), [getParent](groovyclassloader#getParent() "getParent"), [getUnnamedModule](groovyclassloader#getUnnamedModule() "getUnnamedModule"), [getDefinedPackages](groovyclassloader#getDefinedPackages() "getDefinedPackages"), [setDefaultAssertionStatus](groovyclassloader#setDefaultAssertionStatus(boolean) "setDefaultAssertionStatus"), [setPackageAssertionStatus](groovyclassloader#setPackageAssertionStatus(java.lang.String,%20boolean) "setPackageAssertionStatus"), [setClassAssertionStatus](groovyclassloader#setClassAssertionStatus(java.lang.String,%20boolean) "setClassAssertionStatus"), [clearAssertionStatus](groovyclassloader#clearAssertionStatus() "clearAssertionStatus"), [wait](groovyclassloader#wait(long,%20int) "wait"), [wait](groovyclassloader#wait() "wait"), [wait](groovyclassloader#wait(long) "wait"), [equals](groovyclassloader#equals(java.lang.Object) "equals"), [toString](groovyclassloader#toString() "toString"), [hashCode](groovyclassloader#hashCode() "hashCode"), [getClass](groovyclassloader#getClass() "getClass"), [notify](groovyclassloader#notify() "notify"), [notifyAll](groovyclassloader#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **InnerLoader**([GroovyClassLoader](groovyclassloader) delegate)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **addClasspath**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") path)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **addURL**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **clearAssertionStatus**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **clearCache**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **close**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **defineClass**([ClassNode](../../org/codehaus/groovy/ast/classnode) classNode, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") file, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") newCodeBase)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **defineClass**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, byte[] b)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") **findResource**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Enumeration](https://docs.oracle.com/javase/8/docs/api/java/util/Enumeration.html "Enumeration")<[URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL")> **findResources**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **generateScriptName**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] **getLoadedClasses**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") **getResource**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [InputStream](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html "InputStream") **getResourceAsStream**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [GroovyResourceLoader](groovyresourceloader) **getResourceLoader**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Enumeration](https://docs.oracle.com/javase/8/docs/api/java/util/Enumeration.html "Enumeration")<[URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL")> **getResources**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
### public long **getTimeStamp**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL")[] **getURLs**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Boolean](https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html "Boolean") **isShouldRecompile**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **loadClass**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, boolean lookupScriptFiles, boolean preferClassOverScript, boolean resolve)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **loadClass**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, boolean lookupScriptFiles, boolean preferClassOverScript)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> **loadClass**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **parseClass**([GroovyCodeSource](groovycodesource) codeSource, boolean shouldCache)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **parseClass**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **parseClass**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") fileName)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **parseClass**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **parseClass**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") fileName)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **parseClass**([GroovyCodeSource](groovycodesource) codeSource)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setClassAssertionStatus**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") className, boolean enabled)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setDefaultAssertionStatus**(boolean enabled)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setPackageAssertionStatus**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") packageName, boolean enabled)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setResourceLoader**([GroovyResourceLoader](groovyresourceloader) resourceLoader)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setShouldRecompile**([Boolean](https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html "Boolean") mode)
| programming_docs |
groovy [Java] Class MapWithDefault<K, V> [Java] Class MapWithDefault<K, V>
=================================
* groovy.lang.MapWithDefault
All Implemented Interfaces and Traits: [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")
```
public final class MapWithDefault<K, V>
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")
```
A wrapper for Map which allows a default value to be specified.
**Since:**
1.7.1
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[clear](#clear())**()` |
| | `public boolean` | `**[containsKey](#containsKey(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") key)` |
| | `public boolean` | `**[containsValue](#containsValue(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<Map.Entry<K, V>>` | `**[entrySet](#entrySet())**()` |
| | `public boolean` | `**[equals](#equals(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj)` |
| | `public V` | `**[get](#get(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") key)` |
| | `public int` | `**[hashCode](#hashCode())**()` |
| | `public boolean` | `**[isEmpty](#isEmpty())**()` |
| | `public [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<K>` | `**[keySet](#keySet())**()` |
| `<K, V>` | `public static [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<K, V>` | `**[newInstance](#newInstance(Map,%20groovy.lang.Closure))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<K, V> m, [Closure](closure) initClosure)` |
| | `public V` | `**[put](#put(K,%20V))**(K key, V value)` |
| | `public void` | `**[putAll](#putAll(Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<? extends K, ? extends V> m)` |
| | `public V` | `**[remove](#remove(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") key)` |
| | `public int` | `**[size](#size())**()` |
| | `public [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<V>` | `**[values](#values())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **clear**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **containsKey**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") key)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **containsValue**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<Map.Entry<K, V>> **entrySet**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **equals**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public V **get**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") key)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **hashCode**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **isEmpty**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<K> **keySet**()
### <K, V> public static [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<K, V> **newInstance**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<K, V> m, [Closure](closure) initClosure)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public V **put**(K key, V value)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **putAll**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<? extends K, ? extends V> m)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public V **remove**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") key)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **size**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<V> **values**()
groovy [Java] Annotation Type Grab [Java] Annotation Type Grab
===========================
* groovy.lang.Grab
```
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({
ElementType.CONSTRUCTOR,
ElementType.FIELD,
ElementType.LOCAL_VARIABLE,
ElementType.METHOD,
ElementType.PARAMETER,
ElementType.TYPE})
public @interface Grab
```
Used to grab the referenced artifact and its dependencies and make it available on the Classpath.
Some examples:
```
@Grab(group='commons-lang', module='commons-lang', version='2.4')
import org.apache.commons.lang.WordUtils
println "Hello ${WordUtils.capitalize('world')}"
```
Or using the compact Gradle-inspired syntax:
```
@Grab('commons-lang:commons-lang:2.4')
import org.apache.commons.lang.WordUtils
println "Hello ${WordUtils.capitalize('world')}"
```
or the same thing again using the Ivy-inspired syntax variant:
```
@Grab('commons-lang#commons-lang;2.4')
import org.apache.commons.lang.WordUtils
println "Hello ${WordUtils.capitalize('world')}"
```
Further information such as where artifacts are downloaded to, how to add additional resolvers, how to customise artifact resolution etc., can be found on the Grape documentation page: <http://groovy-lang.org/grape.html>. Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[changing](#changing)`Defaults to `false` but set to `true` if the dependency artifacts may change without a corresponding revision change. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[classifier](#classifier)`The classifier if in use, e.g.: "jdk14"
**Default:**
""
|
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[conf](#conf)`The configuration if in use (normally only used by internal ivy repositories). |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[ext](#ext)`The extension of the artifact (normally safe to leave at default value of "jar" but other values like "zip" are sometimes useful). |
| `**boolean**` | `[force](#force)`Defaults to `false` but set to `true` to indicate to the underlying Ivy conflict manager that this dependency should be forced to the given revision. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[group](#group)`The organisation or group, e.g.: "org.apache.ant". |
| `**boolean**` | `[initClass](#initClass)`By default, when a `@Grab` annotation is used, a `Grape.grab()` call is added to the static initializers of the class the annotatable node appears in. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[module](#module)`The module or artifact, e.g.: "ant-junit". |
| `**boolean**` | `[transitive](#transitive)`Defaults to `true` but set to `false` if you don't want transitive dependencies also to be downloaded. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[type](#type)`The type of the artifact (normally safe to leave at default value of "jar" but other values like "sources" and "javadoc" are sometimes useful). |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[value](#value)`Allows a more compact convenience form in one of two formats with optional appended attributes. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[version](#version)`The revision or version, e.g.: "1.7.1". |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **changing**
Defaults to `false` but set to `true` if the dependency artifacts may change without a corresponding revision change. Not normally recommended but may be useful for certain kinds of snapshot artifacts. May reduce the amount of underlying Ivy caching. Proper behavior may be dependent on the resolver in use.
**Default:**
false
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **classifier**
The classifier if in use, e.g.: "jdk14"
**Default:**
""
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **conf**
The configuration if in use (normally only used by internal ivy repositories). One or more comma separated values with or without square brackets, e.g. for hibernate you might have "default,proxool,oscache" or "[default,dbcp,swarmcache]". This last hibernate example assumes you have set up such configurations in your local Ivy repo and have changed your grape config (using grapeConfig.xml) or the `@GrabConfig` annotation to point to that repo.
**Default:**
""
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **ext**
The extension of the artifact (normally safe to leave at default value of "jar" but other values like "zip" are sometimes useful).
**Default:**
""
### public boolean **force**
Defaults to `false` but set to `true` to indicate to the underlying Ivy conflict manager that this dependency should be forced to the given revision. Otherwise, depending on the conflict manager in play, a later compatible version might be used instead.
**Default:**
false
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **group**
The organisation or group, e.g.: "org.apache.ant". A non-empty value is required unless value() is used.
**Default:**
""
### public boolean **initClass**
By default, when a `@Grab` annotation is used, a `Grape.grab()` call is added to the static initializers of the class the annotatable node appears in. If you wish to disable this, add `initClass=false` to the annotation.
**Default:**
true
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **module**
The module or artifact, e.g.: "ant-junit". A non-empty value is required unless value() is used.
**Default:**
""
### public boolean **transitive**
Defaults to `true` but set to `false` if you don't want transitive dependencies also to be downloaded. You may then need additional `@Grab` statements for any required dependencies.
**Default:**
true
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **type**
The type of the artifact (normally safe to leave at default value of "jar" but other values like "sources" and "javadoc" are sometimes useful). But see also the "classifier" attribute which is also sometimes used for "sources" and "javadoc".
**Default:**
""
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **value**
Allows a more compact convenience form in one of two formats with optional appended attributes. Must not be used if group(), module() or version() are used.
You can choose either format but not mix-n-match:
`group:module:version:classifier@ext` (where only group and module are required)
`group#module;version[confs]` (where only group and module are required and confs, if used, is one or more comma separated configuration names)
In addition, you can add any valid Ivy attributes at the end of your string value using semi-colon separated name = value pairs, e.g.:
`@Grab('junit:junit:*;transitive=false')`
`@Grab('group=junit;module=junit;version=4.8.2;classifier=javadoc')`
**Default:**
""
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **version**
The revision or version, e.g.: "1.7.1". A non-empty value is required unless value() is used.
**Default:**
""
groovy [Java] Class GroovyClassLoader.ClassCollector [Java] Class GroovyClassLoader.ClassCollector
=============================================
* groovy.lang.GroovyClassLoader.ClassCollector
All Implemented Interfaces and Traits: [CompilationUnitClassgenCallback](../../compilationunitclassgencallback)
```
public static class GroovyClassLoader.ClassCollector
```
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `protected **[ClassCollector](#ClassCollector(InnerLoader,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.control.SourceUnit))**([InnerLoader](../../innerloader) cl, [CompilationUnit](../../org/codehaus/groovy/control/compilationunit) unit, [SourceUnit](../../org/codehaus/groovy/control/sourceunit) su)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[call](#call(org.objectweb.asm.ClassVisitor,%20org.codehaus.groovy.ast.ClassNode))**(org.objectweb.asm.ClassVisitor classWriter, [ClassNode](../../org/codehaus/groovy/ast/classnode) classNode)` |
| | `protected [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[createClass](#createClass(byte%5B%5D,%20org.codehaus.groovy.ast.ClassNode))**(byte[] code, [ClassNode](../../org/codehaus/groovy/ast/classnode) classNode)` |
| | `public [GroovyClassLoader](groovyclassloader)` | `**[getDefiningClassLoader](#getDefiningClassLoader())**()` |
| | `public [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")` | `**[getLoadedClasses](#getLoadedClasses())**()` |
| | `protected [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[onClassNode](#onClassNode(org.objectweb.asm.ClassWriter,%20org.codehaus.groovy.ast.ClassNode))**(org.objectweb.asm.ClassWriter classWriter, [ClassNode](../../org/codehaus/groovy/ast/classnode) classNode)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### protected **ClassCollector**([InnerLoader](../../innerloader) cl, [CompilationUnit](../../org/codehaus/groovy/control/compilationunit) unit, [SourceUnit](../../org/codehaus/groovy/control/sourceunit) su)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **call**(org.objectweb.asm.ClassVisitor classWriter, [ClassNode](../../org/codehaus/groovy/ast/classnode) classNode)
### protected [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **createClass**(byte[] code, [ClassNode](../../org/codehaus/groovy/ast/classnode) classNode)
### public [GroovyClassLoader](groovyclassloader) **getDefiningClassLoader**()
### public [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") **getLoadedClasses**()
### protected [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **onClassNode**(org.objectweb.asm.ClassWriter classWriter, [ClassNode](../../org/codehaus/groovy/ast/classnode) classNode)
groovy [Java] Class GroovydocTag [Java] Class GroovydocTag
=========================
* groovy.lang.groovydoc.GroovydocTag
```
public class GroovydocTag
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
TODO parse groovydoc to get tag content
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[GroovydocTag](#GroovydocTag(java.lang.String,%20java.lang.String,%20groovy.lang.groovydoc.Groovydoc))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") content, [Groovydoc](groovydoc) groovydoc)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public boolean` | `**[equals](#equals(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getContent](#getContent())**()` |
| | `public [Groovydoc](groovydoc)` | `**[getGroovydoc](#getGroovydoc())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getName](#getName())**()` |
| | `public int` | `**[hashCode](#hashCode())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **GroovydocTag**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") content, [Groovydoc](groovydoc) groovydoc)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **equals**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getContent**()
### public [Groovydoc](groovydoc) **getGroovydoc**()
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getName**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **hashCode**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
| programming_docs |
groovy [Java] Class Groovydoc [Java] Class Groovydoc
======================
* groovy.lang.groovydoc.Groovydoc
```
public class Groovydoc
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Represents groovydoc
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [Groovydoc](groovydoc)**` | `[EMPTY\_GROOVYDOC](#EMPTY_GROOVYDOC)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Groovydoc](#Groovydoc(java.lang.String,%20groovy.lang.groovydoc.GroovydocHolder))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") content, [GroovydocHolder](groovydocholder) groovydocHolder)` |
| `**[Groovydoc](#Groovydoc(java.lang.String,%20java.lang.reflect.AnnotatedElement))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") content, [AnnotatedElement](https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/AnnotatedElement.html "AnnotatedElement") annotatedElement)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public boolean` | `**[equals](#equals(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getContent](#getContent())**()`Get the content of groovydoc |
| | `public [Groovydoc](groovydoc)` | `**[getGroovydoc](#getGroovydoc())**()` |
| | `public [GroovydocHolder](groovydocholder)` | `**[getHolder](#getHolder())**()`Get the holder of the groovydoc |
| | `public [AnnotatedElement](https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/AnnotatedElement.html "AnnotatedElement")` | `**[getInstance](#getInstance())**()` |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovydocTag](groovydoctag "GroovydocTag")>` | `**[getTagList](#getTagList())**()` |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovydocTag](groovydoctag "GroovydocTag")>` | `**[getTagList](#getTagList())**()`TODO Get list of groovydoc tags |
| | `public int` | `**[hashCode](#hashCode())**()` |
| | `public boolean` | `**[isPresent](#isPresent())**()`Tests if groovydoc is present |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### public static final [Groovydoc](groovydoc) **EMPTY\_GROOVYDOC**
Constructor Detail
------------------
### public **Groovydoc**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") content, [GroovydocHolder](groovydocholder) groovydocHolder)
### public **Groovydoc**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") content, [AnnotatedElement](https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/AnnotatedElement.html "AnnotatedElement") annotatedElement)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **equals**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getContent**()
Get the content of groovydoc
**Returns:**
the text content
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Groovydoc](groovydoc) **getGroovydoc**()
### public [GroovydocHolder](groovydocholder) **getHolder**()
Get the holder of the groovydoc
**Returns:**
the groovydoc holder
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [AnnotatedElement](https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/AnnotatedElement.html "AnnotatedElement") **getInstance**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovydocTag](groovydoctag "GroovydocTag")> **getTagList**()
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovydocTag](groovydoctag "GroovydocTag")> **getTagList**()
TODO Get list of groovydoc tags
**Returns:**
a list of tags
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **hashCode**()
### public boolean **isPresent**()
Tests if groovydoc is present
**Returns:**
`true` if groovydoc is present
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
groovy [Java] Interface GroovydocHolder<T> [Java] Interface GroovydocHolder<T>
===================================
```
public interface GroovydocHolder<T>
```
Represents Groovydoc Holder
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Groovydoc](groovydoc)` | `**[getGroovydoc](#getGroovydoc())**()`Get the groovydoc |
| | `public T` | `**[getInstance](#getInstance())**()`Get GroovydocHolder instance |
Method Detail
-------------
### public [Groovydoc](groovydoc) **getGroovydoc**()
Get the groovydoc
**Returns:**
the groovydoc
### public T **getInstance**()
Get GroovydocHolder instance
**Returns:**
GroovydocHolder instance
groovy [Groovy] Class GroovyJUnitRunnerHelper [Groovy] Class GroovyJUnitRunnerHelper
======================================
* groovy.junit5.plugin.GroovyJUnitRunnerHelper
```
class GroovyJUnitRunnerHelper
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[GroovyJUnitRunnerHelper](#GroovyJUnitRunnerHelper())**()` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `static [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable")` | `**[execute](#execute(java.lang.Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") testClass)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
###
**GroovyJUnitRunnerHelper**()
Method Detail
-------------
### static [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") **execute**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") testClass)
groovy [Java] Class JUnit5Runner [Java] Class JUnit5Runner
=========================
* groovy.junit5.plugin.JUnit5Runner
All Implemented Interfaces and Traits: [GroovyRunner](../../../org/apache/groovy/plugin/groovyrunner)
```
public class JUnit5Runner
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [GroovyRunner](../../../org/apache/groovy/plugin/groovyrunner)
```
Integration code for running JUnit5 tests in Groovy.
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public boolean` | `**[canRun](#canRun(Class,%20groovy.lang.GroovyClassLoader))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> scriptClass, [GroovyClassLoader](../../lang/groovyclassloader) loader)`Utility method to check via reflection if the parsed class appears to be a JUnit5 test, i.e. checks whether it appears to be using the relevant annotations. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[run](#run(Class,%20groovy.lang.GroovyClassLoader))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> scriptClass, [GroovyClassLoader](../../lang/groovyclassloader) loader)`Utility method to run a JUnit 5 test. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **canRun**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> scriptClass, [GroovyClassLoader](../../lang/groovyclassloader) loader)
Utility method to check via reflection if the parsed class appears to be a JUnit5 test, i.e. checks whether it appears to be using the relevant annotations.
**Parameters:**
`scriptClass` - the class we want to check
`loader` - the GroovyClassLoader to use to find classes
**Returns:**
true if the class appears to be a compatible test
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **run**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> scriptClass, [GroovyClassLoader](../../lang/groovyclassloader) loader)
Utility method to run a JUnit 5 test.
**Parameters:**
`scriptClass` - the class we want to run as a test
`loader` - the class loader to use
**Returns:**
the result of running the test
groovy [Java] Class JsonBuilder [Java] Class JsonBuilder
========================
* groovy.json.JsonBuilder
All Implemented Interfaces and Traits: [Writable](../lang/writable)
```
public class JsonBuilder
extends [GroovyObjectSupport](../lang/groovyobjectsupport)
implements [Writable](../lang/writable)
```
A builder for creating JSON payloads.
This builder supports the usual builder syntax made of nested method calls and closures, but also some specific aspects of JSON data structures, such as list of values, etc. Please make sure to have a look at the various methods provided by this builder to be able to learn about the various possibilities of usage.
Example:
```
def builder = new groovy.json.JsonBuilder()
def root = builder.people {
person {
firstName 'Guillame'
lastName 'Laforge'
// Named arguments are valid values for objects too
address(
city: 'Paris',
country: 'France',
zip: 12345,
)
married true
// a list of values
conferences 'JavaOne', 'Gr8conf'
}
}
// creates a data structure made of maps (Json object) and lists (Json array)
assert root instanceof Map
assert builder.toString() == '{"people":{"person":{"firstName":"Guillame","lastName":"Laforge","address":{"city":"Paris","country":"France","zip":12345},"married":true,"conferences":["JavaOne","Gr8conf"]}}}'
```
**Since:**
1.8.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[JsonBuilder](#JsonBuilder())**()`Instantiates a JSON builder. |
| `**[JsonBuilder](#JsonBuilder(groovy.json.JsonGenerator))**([JsonGenerator](jsongenerator) generator)`Instantiates a JSON builder with a configured generator. |
| `**[JsonBuilder](#JsonBuilder(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") content)`Instantiates a JSON builder with some existing data structure. |
| `**[JsonBuilder](#JsonBuilder(java.lang.Object,%20groovy.json.JsonGenerator))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") content, [JsonGenerator](jsongenerator) generator)`Instantiates a JSON builder with some existing data structure and a configured generator. |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[call](#call(java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") m)`Named arguments can be passed to the JSON builder instance to create a root JSON object |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[call](#call(java.util.List))**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") l)`A list of elements as arguments to the JSON builder creates a root JSON array |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[call](#call(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)`Varargs elements as arguments to the JSON builder create a root JSON array |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[call](#call(java.lang.Iterable,%20groovy.lang.Closure))**([Iterable](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html "Iterable") coll, [Closure](../lang/closure) c)`A collection and closure passed to a JSON builder will create a root JSON array applying the closure to each object in the collection |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[call](#call(java.util.Collection,%20groovy.lang.Closure))**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") coll, [Closure](../lang/closure) c)`Delegates to [call(Iterable, Closure)](#call(java.lang.Iterable,%20groovy.lang.Closure)) |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[call](#call(groovy.lang.Closure))**([Closure](../lang/closure) c)`A closure passed to a JSON builder will create a root JSON object |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getContent](#getContent())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)`A method call on the JSON builder instance will create a root object with only one key whose name is the name of the method being called. |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toPrettyString](#toPrettyString())**()`Pretty-prints and formats the JSON payload. |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()`Serializes the internal data structure built with the builder to a conformant JSON payload string |
| | `public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer")` | `**[writeTo](#writeTo(java.io.Writer))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out)`The JSON builder implements the `Writable` interface, so that you can have the builder serialize itself the JSON payload to a writer. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyObjectSupport](../lang/groovyobjectsupport)` | `[getMetaClass](../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
### public **JsonBuilder**()
Instantiates a JSON builder.
### public **JsonBuilder**([JsonGenerator](jsongenerator) generator)
Instantiates a JSON builder with a configured generator.
**Parameters:**
`generator` - used to generate the output
**Since:**
2.5.0
### public **JsonBuilder**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") content)
Instantiates a JSON builder with some existing data structure.
**Parameters:**
`content` - a pre-existing data structure
### public **JsonBuilder**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") content, [JsonGenerator](jsongenerator) generator)
Instantiates a JSON builder with some existing data structure and a configured generator.
**Parameters:**
`content` - a pre-existing data structure
`generator` - used to generate the output
**Since:**
2.5.0
Method Detail
-------------
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **call**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") m)
Named arguments can be passed to the JSON builder instance to create a root JSON object
Example:
```
def json = new groovy.json.JsonBuilder()
json name: "Guillaume", age: 33
assert json.toString() == '{"name":"Guillaume","age":33}'
```
**Parameters:**
`m` - a map of key / value pairs
**Returns:**
a map of key / value pairs
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **call**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") l)
A list of elements as arguments to the JSON builder creates a root JSON array
Example:
```
def json = new groovy.json.JsonBuilder()
def result = json([1, 2, 3])
assert result instanceof List
assert json.toString() == "[1,2,3]"
```
**Parameters:**
`l` - a list of values
**Returns:**
a list of values
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **call**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
Varargs elements as arguments to the JSON builder create a root JSON array
Example:
```
def json = new groovy.json.JsonBuilder()
def result = json 1, 2, 3
assert result instanceof List
assert json.toString() == "[1,2,3]"
```
**Parameters:**
`args` - an array of values
**Returns:**
a list of values
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **call**([Iterable](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html "Iterable") coll, [Closure](../lang/closure) c)
A collection and closure passed to a JSON builder will create a root JSON array applying the closure to each object in the collection
Example:
```
class Author {
String name
}
def authors = [new Author (name: "Guillaume"), new Author (name: "Jochen"), new Author (name: "Paul")]
def json = new groovy.json.JsonBuilder()
json authors, { Author author `->`
name author.name
}
assert json.toString() == '[{"name":"Guillaume"},{"name":"Jochen"},{"name":"Paul"}]'
```
**Parameters:**
`coll` - a collection
`c` - a closure used to convert the objects of coll
**Returns:**
a list of values
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **call**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") coll, [Closure](../lang/closure) c)
Delegates to [call(Iterable, Closure)](#call(java.lang.Iterable,%20groovy.lang.Closure))
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **call**([Closure](../lang/closure) c)
A closure passed to a JSON builder will create a root JSON object
Example:
```
def json = new groovy.json.JsonBuilder()
def result = json {
name "Guillaume"
age 33
}
assert result instanceof Map
assert json.toString() == '{"name":"Guillaume","age":33}'
```
**Parameters:**
`c` - a closure whose method call statements represent key / values of a JSON object
**Returns:**
a map of key / value pairs
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getContent**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
A method call on the JSON builder instance will create a root object with only one key whose name is the name of the method being called. This method takes as arguments:
* a closure
* a map (ie. named arguments)
* a map and a closure
* or no argument at all
Example with a classical builder-style:
```
def json = new groovy.json.JsonBuilder()
def result = json.person {
name "Guillaume"
age 33
}
assert result instanceof Map
assert json.toString() == '{"person":{"name":"Guillaume","age":33}}'
```
Or alternatively with a method call taking named arguments:
```
def json = new groovy.json.JsonBuilder()
json.person name: "Guillaume", age: 33
assert json.toString() == '{"person":{"name":"Guillaume","age":33}}'
```
If you use named arguments and a closure as last argument, the key/value pairs of the map (as named arguments) and the key/value pairs represented in the closure will be merged together — the closure properties overriding the map key/values in case the same key is used.
```
def json = new groovy.json.JsonBuilder()
json.person(name: "Guillaume", age: 33) { town "Paris" }
assert json.toString() == '{"person":{"name":"Guillaume","age":33,"town":"Paris"}}'
```
The empty args call will create a key whose value will be an empty JSON object:
```
def json = new groovy.json.JsonBuilder()
json.person()
assert json.toString() == '{"person":{}}'
```
**Parameters:**
`name` - the single key
`args` - the value associated with the key
**Returns:**
a map with a single key
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toPrettyString**()
Pretty-prints and formats the JSON payload.
This method calls the JsonLexer to parser the output of the builder, so this may not be an optimal method to call, and should be used mainly for debugging purpose for a human-readable output of the JSON content.
**Returns:**
a pretty printed JSON output
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
Serializes the internal data structure built with the builder to a conformant JSON payload string
Example:
```
def json = new groovy.json.JsonBuilder()
json { temperature 37 }
assert json.toString() == '{"temperature":37}'
```
**Returns:**
a JSON output
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") **writeTo**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out)
The JSON builder implements the `Writable` interface, so that you can have the builder serialize itself the JSON payload to a writer.
Example:
```
def json = new groovy.json.JsonBuilder()
json { temperature 37 }
def out = new StringWriter()
out `<<` json
assert out.toString() == '{"temperature":37}'
```
**Parameters:**
`out` - a writer on which to serialize the JSON payload
**Returns:**
the writer
| programming_docs |
groovy [Java] Class JsonException [Java] Class JsonException
==========================
* groovy.json.JsonException
```
public class JsonException
extends [RuntimeException](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html "RuntimeException")
```
`JsonException` is the exception thrown by the JSON builder and slurper classes, whenever a problem occurs when creating or parsing JSON data structures.
**Since:**
1.8.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[JsonException](#JsonException())**()` |
| `**[JsonException](#JsonException(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") s)` |
| `**[JsonException](#JsonException(java.lang.String,%20java.lang.Throwable))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") s, [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") throwable)` |
| `**[JsonException](#JsonException(java.lang.Throwable))**([Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") throwable)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [RuntimeException](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html "RuntimeException")` | `[printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#printStackTrace() "printStackTrace"), [printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#printStackTrace(java.io.PrintStream) "printStackTrace"), [printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#printStackTrace(java.io.PrintWriter) "printStackTrace"), [fillInStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#fillInStackTrace() "fillInStackTrace"), [getCause](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getCause() "getCause"), [initCause](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#initCause(java.lang.Throwable) "initCause"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#toString() "toString"), [getMessage](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getMessage() "getMessage"), [getSuppressed](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getSuppressed() "getSuppressed"), [getLocalizedMessage](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getLocalizedMessage() "getLocalizedMessage"), [getStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getStackTrace() "getStackTrace"), [setStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#setStackTrace(%5BLjava.lang.StackTraceElement;) "setStackTrace"), [addSuppressed](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#addSuppressed(java.lang.Throwable) "addSuppressed"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#equals(java.lang.Object) "equals"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **JsonException**()
### public **JsonException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") s)
### public **JsonException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") s, [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") throwable)
### public **JsonException**([Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") throwable)
groovy [Java] Class DefaultJsonGenerator [Java] Class DefaultJsonGenerator
=================================
* groovy.json.DefaultJsonGenerator
All Implemented Interfaces and Traits: [JsonGenerator](jsongenerator)
```
public class DefaultJsonGenerator
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [JsonGenerator](jsongenerator)
```
A JsonGenerator that can be configured with various JsonGenerator.Options. If the default options are sufficient consider using the static `JsonOutput.toJson` methods.
**See Also:**
JsonGenerator.Options#build()
**Since:**
2.5.0
Nested Class Summary
--------------------
Nested classes
| Modifiers | Name | Description |
| `**protected static class**` | `[DefaultJsonGenerator.ClosureConverter](defaultjsongenerator.closureconverter)` | A converter that handles converting a given type using a closure. |
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**protected [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<Converter>**` | `[converters](#converters)` | |
| `**protected [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[dateFormat](#dateFormat)` | |
| `**protected [Locale](https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html "Locale")**` | `[dateLocale](#dateLocale)` | |
| `**protected boolean**` | `[disableUnicodeEscaping](#disableUnicodeEscaping)` | |
| `**protected boolean**` | `[excludeNulls](#excludeNulls)` | |
| `**protected [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>**` | `[excludedFieldNames](#excludedFieldNames)` | |
| `**protected [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?>>**` | `[excludedFieldTypes](#excludedFieldTypes)` | |
| `**protected [TimeZone](https://docs.oracle.com/javase/8/docs/api/java/util/TimeZone.html "TimeZone")**` | `[timezone](#timezone)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `protected **[DefaultJsonGenerator](#DefaultJsonGenerator(org.apache.commons.cli.Options))**([Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options") options)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `protected [Converter](../../converter)` | `**[findConverter](#findConverter(Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> type)`Finds a converter that can handle the given type. |
| | `protected [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<?, ?>` | `**[getObjectProperties](#getObjectProperties(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object)` |
| | `public boolean` | `**[isExcludingFieldsNamed](#isExcludingFieldsNamed(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)`{@inheritDoc} |
| | `public boolean` | `**[isExcludingValues](#isExcludingValues(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)`{@inheritDoc} |
| | `protected boolean` | `**[shouldExcludeType](#shouldExcludeType(Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> type)`Indicates whether the given type should be excluded from the generated output. |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toJson](#toJson(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object)`{@inheritDoc} |
| | `protected void` | `**[writeArray](#writeArray(Class,%20java.lang.Object,%20org.apache.groovy.json.internal.CharBuf))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> arrayClass, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") array, [CharBuf](../../org/apache/groovy/json/internal/charbuf) buffer)`Serializes array and writes it into specified buffer. |
| | `protected void` | `**[writeCharSequence](#writeCharSequence(java.lang.CharSequence,%20org.apache.groovy.json.internal.CharBuf))**([CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence") seq, [CharBuf](../../org/apache/groovy/json/internal/charbuf) buffer)`Serializes any char sequence and writes it into specified buffer. |
| | `protected void` | `**[writeDate](#writeDate(java.util.Date,%20org.apache.groovy.json.internal.CharBuf))**([Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") date, [CharBuf](../../org/apache/groovy/json/internal/charbuf) buffer)`Serializes date and writes it into specified buffer. |
| | `protected void` | `**[writeIterator](#writeIterator(Iterator,%20org.apache.groovy.json.internal.CharBuf))**([Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")<?> iterator, [CharBuf](../../org/apache/groovy/json/internal/charbuf) buffer)`Serializes iterator and writes it into specified buffer. |
| | `protected void` | `**[writeMap](#writeMap(Map,%20org.apache.groovy.json.internal.CharBuf))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<?, ?> map, [CharBuf](../../org/apache/groovy/json/internal/charbuf) buffer)`Serializes map and writes it into specified buffer. |
| | `protected void` | `**[writeMapEntry](#writeMapEntry(java.lang.String,%20java.lang.Object,%20org.apache.groovy.json.internal.CharBuf))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") key, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value, [CharBuf](../../org/apache/groovy/json/internal/charbuf) buffer)`Serializes a map entry and writes it into specified buffer. |
| | `protected void` | `**[writeNumber](#writeNumber(Class,%20java.lang.Number,%20org.apache.groovy.json.internal.CharBuf))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> numberClass, [Number](https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html "Number") value, [CharBuf](../../org/apache/groovy/json/internal/charbuf) buffer)`Serializes Number value and writes it into specified buffer. |
| | `protected void` | `**[writeObject](#writeObject(java.lang.Object,%20org.apache.groovy.json.internal.CharBuf))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [CharBuf](../../org/apache/groovy/json/internal/charbuf) buffer)` |
| | `protected void` | `**[writeObject](#writeObject(java.lang.String,%20java.lang.Object,%20org.apache.groovy.json.internal.CharBuf))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") key, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [CharBuf](../../org/apache/groovy/json/internal/charbuf) buffer)`Serializes object and writes it into specified buffer. |
| | `protected void` | `**[writeRaw](#writeRaw(java.lang.CharSequence,%20org.apache.groovy.json.internal.CharBuf))**([CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence") seq, [CharBuf](../../org/apache/groovy/json/internal/charbuf) buffer)`Serializes any char sequence and writes it into specified buffer without performing any manipulation of the given text. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### protected final [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<Converter> **converters**
### protected final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **dateFormat**
### protected final [Locale](https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html "Locale") **dateLocale**
### protected final boolean **disableUnicodeEscaping**
### protected final boolean **excludeNulls**
### protected final [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> **excludedFieldNames**
### protected final [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?>> **excludedFieldTypes**
### protected final [TimeZone](https://docs.oracle.com/javase/8/docs/api/java/util/TimeZone.html "TimeZone") **timezone**
Constructor Detail
------------------
### protected **DefaultJsonGenerator**([Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options") options)
Method Detail
-------------
### protected [Converter](../../converter) **findConverter**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> type)
Finds a converter that can handle the given type. The first converter that reports it can handle the type is returned, based on the order in which the converters were specified. A `null` value will be returned if no suitable converter can be found for the given type.
**Parameters:**
`type` - that this converter can handle
**Returns:**
first converter that can handle the given type; else `null` if no compatible converters are found for the given type.
### protected [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<?, ?> **getObjectProperties**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **isExcludingFieldsNamed**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
{@inheritDoc}
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **isExcludingValues**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
{@inheritDoc}
### protected boolean **shouldExcludeType**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> type)
Indicates whether the given type should be excluded from the generated output.
**Parameters:**
`type` - the type to check
**Returns:**
`true` if the given type should not be output, else `false`
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toJson**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object)
{@inheritDoc}
### protected void **writeArray**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> arrayClass, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") array, [CharBuf](../../org/apache/groovy/json/internal/charbuf) buffer)
Serializes array and writes it into specified buffer.
### protected void **writeCharSequence**([CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence") seq, [CharBuf](../../org/apache/groovy/json/internal/charbuf) buffer)
Serializes any char sequence and writes it into specified buffer.
### protected void **writeDate**([Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") date, [CharBuf](../../org/apache/groovy/json/internal/charbuf) buffer)
Serializes date and writes it into specified buffer.
### protected void **writeIterator**([Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")<?> iterator, [CharBuf](../../org/apache/groovy/json/internal/charbuf) buffer)
Serializes iterator and writes it into specified buffer.
### protected void **writeMap**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<?, ?> map, [CharBuf](../../org/apache/groovy/json/internal/charbuf) buffer)
Serializes map and writes it into specified buffer.
### protected void **writeMapEntry**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") key, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value, [CharBuf](../../org/apache/groovy/json/internal/charbuf) buffer)
Serializes a map entry and writes it into specified buffer.
### protected void **writeNumber**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> numberClass, [Number](https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html "Number") value, [CharBuf](../../org/apache/groovy/json/internal/charbuf) buffer)
Serializes Number value and writes it into specified buffer.
### protected void **writeObject**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [CharBuf](../../org/apache/groovy/json/internal/charbuf) buffer)
### protected void **writeObject**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") key, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [CharBuf](../../org/apache/groovy/json/internal/charbuf) buffer)
Serializes object and writes it into specified buffer.
### protected void **writeRaw**([CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence") seq, [CharBuf](../../org/apache/groovy/json/internal/charbuf) buffer)
Serializes any char sequence and writes it into specified buffer without performing any manipulation of the given text.
groovy [Java] Class JsonLexer [Java] Class JsonLexer
======================
* groovy.json.JsonLexer
All Implemented Interfaces and Traits: [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")
```
public class JsonLexer
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html "Iterator")
```
The lexer reads JSON tokens in a streaming fashion from the underlying reader.
**Since:**
1.8.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[JsonLexer](#JsonLexer(java.io.Reader))**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader)`Instantiates a lexer with a reader from which to read JSON tokens. |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [LineColumnReader](../io/linecolumnreader)` | `**[getReader](#getReader())**()`Underlying reader from which to read the JSON tokens. |
| | `public boolean` | `**[hasNext](#hasNext())**()`Iterator method to know if another token follows, or if we've reached the end of the stream. |
| | `public [JsonToken](jsontoken)` | `**[next](#next())**()`Iterator method to get the next token of the stream. |
| | `public [JsonToken](jsontoken)` | `**[nextToken](#nextToken())**()`
**Returns:**
the next token from the stream
|
| | `public void` | `**[remove](#remove())**()`Method not implemented. |
| | `public int` | `**[skipWhitespace](#skipWhitespace())**()`Skips all the whitespace characters and moves the cursor to the next non-space character. |
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[unescape](#unescape(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") input)`Replace unicode escape and other control characters with real characters |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **JsonLexer**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader)
Instantiates a lexer with a reader from which to read JSON tokens. Under the hood, the reader is wrapped in a `LineColumnReader`, for line and column information, unless it's already an instance of that class.
**Parameters:**
`reader` - underlying reader
Method Detail
-------------
### public [LineColumnReader](../io/linecolumnreader) **getReader**()
Underlying reader from which to read the JSON tokens. This reader is an instance of `LineColumnReader`, to keep track of line and column positions.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **hasNext**()
Iterator method to know if another token follows, or if we've reached the end of the stream.
**Returns:**
true if there are more tokens
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [JsonToken](jsontoken) **next**()
Iterator method to get the next token of the stream.
**Returns:**
the next token
### public [JsonToken](jsontoken) **nextToken**()
**Returns:**
the next token from the stream
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **remove**()
Method not implemented.
**throws:**
UnsupportedOperationException
### public int **skipWhitespace**()
Skips all the whitespace characters and moves the cursor to the next non-space character.
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **unescape**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") input)
Replace unicode escape and other control characters with real characters
**Parameters:**
`input` - text
**Returns:**
input text without the escaping
| programming_docs |
groovy [Java] Class StreamingJsonBuilder [Java] Class StreamingJsonBuilder
=================================
* groovy.json.StreamingJsonBuilder
```
public class StreamingJsonBuilder
extends [GroovyObjectSupport](../lang/groovyobjectsupport)
```
A builder for creating JSON payloads.
This builder supports the usual builder syntax made of nested method calls and closures, but also some specific aspects of JSON data structures, such as list of values, etc. Please make sure to have a look at the various methods provided by this builder to be able to learn about the various possibilities of usage.
Unlike the JsonBuilder class which creates a data structure in memory, which is handy in those situations where you want to alter the structure programatically before output, the StreamingJsonBuilder streams to a writer directly without any memory data structure. So if you don't need to modify the structure, and want a more memory-efficient approach, please use the StreamingJsonBuilder.
Example:
```
new StringWriter().with { w ->
def builder = new groovy.json.StreamingJsonBuilder(w)
builder.people {
person {
firstName 'Tim'
lastName 'Yates'
// Named arguments are valid values for objects too
address(
city: 'Manchester',
country: 'UK',
zip: 'M1 2AB',
)
living true
eyes 'left', 'right'
}
}
assert w.toString() == '{"people":{"person":{"firstName":"Tim","lastName":"Yates","address":{"city":"Manchester","country":"UK","zip":"M1 2AB"},"living":true,"eyes":["left","right"]}}}'
}
```
**Since:**
1.8.1
Nested Class Summary
--------------------
Nested classes
| Modifiers | Name | Description |
| `**static class**` | `[StreamingJsonBuilder.StreamingJsonDelegate](streamingjsonbuilder.streamingjsondelegate)` | The delegate used when invoking closures |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[StreamingJsonBuilder](#StreamingJsonBuilder(java.io.Writer))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") writer)`Instantiates a JSON builder. |
| `**[StreamingJsonBuilder](#StreamingJsonBuilder(java.io.Writer,%20groovy.json.JsonGenerator))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") writer, [JsonGenerator](jsongenerator) generator)`Instantiates a JSON builder with the given generator. |
| `**[StreamingJsonBuilder](#StreamingJsonBuilder(java.io.Writer,%20java.lang.Object))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") writer, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") content)`Instantiates a JSON builder, possibly with some existing data structure. |
| `**[StreamingJsonBuilder](#StreamingJsonBuilder(java.io.Writer,%20java.lang.Object,%20groovy.json.JsonGenerator))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") writer, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") content, [JsonGenerator](jsongenerator) generator)`Instantiates a JSON builder, possibly with some existing data structure and the given generator. |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[call](#call(java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") m)`Named arguments can be passed to the JSON builder instance to create a root JSON object |
| | `public void` | `**[call](#call(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)`The empty args call will create a key whose value will be an empty JSON object:
```
new StringWriter().with { w ->
def json = new groovy.json.StreamingJsonBuilder(w)
json.person()
```
|
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[call](#call(java.util.List))**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") l)`A list of elements as arguments to the JSON builder creates a root JSON array |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[call](#call(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)`Varargs elements as arguments to the JSON builder create a root JSON array |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[call](#call(java.lang.Iterable,%20groovy.lang.Closure))**([Iterable](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html "Iterable") coll, [Closure](../lang/closure) c)`A collection and closure passed to a JSON builder will create a root JSON array applying the closure to each object in the collection |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[call](#call(java.util.Collection,%20groovy.lang.Closure))**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") coll, [Closure](../lang/closure) c)`Delegates to [call(Iterable, Closure)](#call(java.lang.Iterable,%20groovy.lang.Closure)) |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[call](#call(groovy.lang.Closure))**([Closure](../lang/closure) c)`A closure passed to a JSON builder will create a root JSON object |
| | `public void` | `**[call](#call(java.lang.String,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Closure](../lang/closure) c)`A name and a closure passed to a JSON builder will create a key with a JSON object |
| | `public void` | `**[call](#call(java.lang.String,%20java.lang.Iterable,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Iterable](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html "Iterable") coll, [Closure](../lang/closure) c)`A name, a collection and closure passed to a JSON builder will create a root JSON array applying the closure to each object in the collection |
| | `public void` | `**[call](#call(java.lang.String,%20java.util.Collection,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") coll, [Closure](../lang/closure) c)`Delegates to [call(String, Iterable, Closure)](#call(java.lang.String,%20java.lang.Iterable,%20groovy.lang.Closure)) |
| | `public void` | `**[call](#call(java.lang.String,%20java.util.Map,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") map, [Closure](../lang/closure) callable)`If you use named arguments and a closure as last argument, the key/value pairs of the map (as named arguments) and the key/value pairs represented in the closure will be merged together — the closure properties overriding the map key/values in case the same key is used. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)`A method call on the JSON builder instance will create a root object with only one key whose name is the name of the method being called. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyObjectSupport](../lang/groovyobjectsupport)` | `[getMetaClass](../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
### public **StreamingJsonBuilder**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") writer)
Instantiates a JSON builder.
**Parameters:**
`writer` - A writer to which Json will be written
### public **StreamingJsonBuilder**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") writer, [JsonGenerator](jsongenerator) generator)
Instantiates a JSON builder with the given generator.
**Parameters:**
`writer` - A writer to which Json will be written
`generator` - used to generate the output
**Since:**
2.5.0
### public **StreamingJsonBuilder**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") writer, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") content)
Instantiates a JSON builder, possibly with some existing data structure.
**throws:**
IOException
**Parameters:**
`writer` - A writer to which Json will be written
`content` - a pre-existing data structure, default to null
### public **StreamingJsonBuilder**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") writer, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") content, [JsonGenerator](jsongenerator) generator)
Instantiates a JSON builder, possibly with some existing data structure and the given generator.
**throws:**
IOException
**Parameters:**
`writer` - A writer to which Json will be written
`content` - a pre-existing data structure, default to null
`generator` - used to generate the output
**Since:**
2.5.0
Method Detail
-------------
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **call**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") m)
Named arguments can be passed to the JSON builder instance to create a root JSON object
Example:
```
new StringWriter().with { w ->
def json = new groovy.json.StreamingJsonBuilder(w)
json name: "Tim", age: 31
assert w.toString() == '{"name":"Tim","age":31}'
}
```
**Parameters:**
`m` - a map of key / value pairs
**Returns:**
a map of key / value pairs
### public void **call**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
The empty args call will create a key whose value will be an empty JSON object:
```
new StringWriter().with { w ->
def json = new groovy.json.StreamingJsonBuilder(w)
json.person()
assert w.toString() == '{"person":{}}'
}
```
**throws:**
IOException
**Parameters:**
`name` - The name of the empty object to create
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **call**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") l)
A list of elements as arguments to the JSON builder creates a root JSON array
Example:
```
new StringWriter().with { w ->
def json = new groovy.json.StreamingJsonBuilder(w)
def result = json([1, 2, 3])
assert result == [ 1, 2, 3 ]
assert w.toString() == "[1,2,3]"
}
```
**Parameters:**
`l` - a list of values
**Returns:**
a list of values
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **call**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
Varargs elements as arguments to the JSON builder create a root JSON array
Example:
```
new StringWriter().with { w ->
def json = new groovy.json.StreamingJsonBuilder(w)
def result = json 1, 2, 3
assert result instanceof List
assert w.toString() == "[1,2,3]"
}
```
**Parameters:**
`args` - an array of values
**Returns:**
a list of values
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **call**([Iterable](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html "Iterable") coll, @[DelegatesTo](../lang/delegatesto "DelegatesTo")(value = StreamingJsonDelegate.class, strategy = Closure.DELEGATE\_FIRST) [Closure](../lang/closure) c)
A collection and closure passed to a JSON builder will create a root JSON array applying the closure to each object in the collection
Example:
```
class Author {
String name
}
def authors = [new Author (name: "Guillaume"), new Author (name: "Jochen"), new Author (name: "Paul")]
new StringWriter().with { w ->
def json = new groovy.json.StreamingJsonBuilder(w)
json authors, { Author author ->
name author.name
}
assert w.toString() == '[{"name":"Guillaume"},{"name":"Jochen"},{"name":"Paul"}]'
}
```
**Parameters:**
`coll` - a collection
`c` - a closure used to convert the objects of coll
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **call**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") coll, @[DelegatesTo](../lang/delegatesto "DelegatesTo")(value = StreamingJsonDelegate.class, strategy = Closure.DELEGATE\_FIRST) [Closure](../lang/closure) c)
Delegates to [call(Iterable, Closure)](#call(java.lang.Iterable,%20groovy.lang.Closure))
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **call**(@[DelegatesTo](../lang/delegatesto "DelegatesTo")(value = StreamingJsonDelegate.class, strategy = Closure.DELEGATE\_FIRST) [Closure](../lang/closure) c)
A closure passed to a JSON builder will create a root JSON object
Example:
```
new StringWriter().with { w ->
def json = new groovy.json.StreamingJsonBuilder(w)
json {
name "Tim"
age 39
}
assert w.toString() == '{"name":"Tim","age":39}'
}
```
**Parameters:**
`c` - a closure whose method call statements represent key / values of a JSON object
### public void **call**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, @[DelegatesTo](../lang/delegatesto "DelegatesTo")(value = StreamingJsonDelegate.class, strategy = Closure.DELEGATE\_FIRST) [Closure](../lang/closure) c)
A name and a closure passed to a JSON builder will create a key with a JSON object
Example:
```
new StringWriter().with { w ->
def json = new groovy.json.StreamingJsonBuilder(w)
json.person {
name "Tim"
age 39
}
assert w.toString() == '{"person":{"name":"Tim","age":39}}'
}
```
**Parameters:**
`name` - The key for the JSON object
`c` - a closure whose method call statements represent key / values of a JSON object
### public void **call**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Iterable](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html "Iterable") coll, @[DelegatesTo](../lang/delegatesto "DelegatesTo")(value = StreamingJsonDelegate.class, strategy = Closure.DELEGATE\_FIRST) [Closure](../lang/closure) c)
A name, a collection and closure passed to a JSON builder will create a root JSON array applying the closure to each object in the collection
Example:
```
class Author {
String name
}
def authors = [new Author (name: "Guillaume"), new Author (name: "Jochen"), new Author (name: "Paul")]
new StringWriter().with { w ->
def json = new groovy.json.StreamingJsonBuilder(w)
json.people authors, { Author author ->
name author.name
}
assert w.toString() == '{"people":[{"name":"Guillaume"},{"name":"Jochen"},{"name":"Paul"}]}'
}
```
**Parameters:**
`coll` - a collection
`c` - a closure used to convert the objects of coll
### public void **call**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") coll, @[DelegatesTo](../lang/delegatesto "DelegatesTo")(value = StreamingJsonDelegate.class, strategy = Closure.DELEGATE\_FIRST) [Closure](../lang/closure) c)
Delegates to [call(String, Iterable, Closure)](#call(java.lang.String,%20java.lang.Iterable,%20groovy.lang.Closure))
### public void **call**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") map, @[DelegatesTo](../lang/delegatesto "DelegatesTo")(value = StreamingJsonDelegate.class, strategy = Closure.DELEGATE\_FIRST) [Closure](../lang/closure) callable)
If you use named arguments and a closure as last argument, the key/value pairs of the map (as named arguments) and the key/value pairs represented in the closure will be merged together — the closure properties overriding the map key/values in case the same key is used.
```
new StringWriter().with { w ->
def json = new groovy.json.StreamingJsonBuilder(w)
json.person(name: "Tim", age: 35) { town "Manchester" }
assert w.toString() == '{"person":{"name":"Tim","age":35,"town":"Manchester"}}'
}
```
**throws:**
IOException
**Parameters:**
`name` - The name of the JSON object
`map` - The attributes of the JSON object
`callable` - Additional attributes of the JSON object represented by the closure
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
A method call on the JSON builder instance will create a root object with only one key whose name is the name of the method being called. This method takes as arguments:
* a closure
* a map (ie. named arguments)
* a map and a closure
* or no argument at all
Example with a classical builder-style:
```
new StringWriter().with { w ->
def json = new groovy.json.StreamingJsonBuilder(w)
json.person {
name "Tim"
age 28
}
assert w.toString() == '{"person":{"name":"Tim","age":28}}'
}
```
Or alternatively with a method call taking named arguments:
```
new StringWriter().with { w ->
def json = new groovy.json.StreamingJsonBuilder(w)
json.person name: "Tim", age: 32
assert w.toString() == '{"person":{"name":"Tim","age":32}}'
}
```
If you use named arguments and a closure as last argument, the key/value pairs of the map (as named arguments) and the key/value pairs represented in the closure will be merged together — the closure properties overriding the map key/values in case the same key is used.
```
new StringWriter().with { w ->
def json = new groovy.json.StreamingJsonBuilder(w)
json.person(name: "Tim", age: 35) { town "Manchester" }
assert w.toString() == '{"person":{"name":"Tim","age":35,"town":"Manchester"}}'
}
```
The empty args call will create a key whose value will be an empty JSON object:
```
new StringWriter().with { w ->
def json = new groovy.json.StreamingJsonBuilder(w)
json.person()
assert w.toString() == '{"person":{}}'
}
```
**Parameters:**
`name` - the single key
`args` - the value associated with the key
groovy [Java] Enum JsonTokenType [Java] Enum JsonTokenType
=========================
* groovy.json.JsonTokenType
```
public enum JsonTokenType
extends [Enum](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html "Enum")
```
The original slurper and lexer use this class. This is kept around in case someone needs its exact behavior. Enum listing all the possible JSON tokens that should be recognized by the lexer.
**Since:**
1.8.0
Enum Constants Summary
----------------------
Enum constants classes
| Enum constant | Description |
| `**[CLOSE\_BRACKET](#CLOSE_BRACKET)**` | |
| `**[CLOSE\_CURLY](#CLOSE_CURLY)**` | |
| `**[COLON](#COLON)**` | |
| `**[COMMA](#COMMA)**` | |
| `**[FALSE](#FALSE)**` | |
| `**[NULL](#NULL)**` | |
| `**[NUMBER](#NUMBER)**` | |
| `**[OPEN\_BRACKET](#OPEN_BRACKET)**` | |
| `**[OPEN\_CURLY](#OPEN_CURLY)**` | |
| `**[STRING](#STRING)**` | Original pattern throws the StackOverflowError for long strings with backslashes. |
| `**[TRUE](#TRUE)**` | |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public boolean` | `**[doCall](#doCall(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") it)` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getLabel](#getLabel())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getValidator](#getValidator())**()` |
| | `public boolean` | `**[matching](#matching(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") input)`Tells if an input string matches a token. |
| | `public static [JsonTokenType](jsontokentype)` | `**[startingWith](#startingWith(char))**(char c)`Find which JSON value might be starting with a given character |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Enum](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html "Enum")` | `[name](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#name() "name"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#hashCode() "hashCode"), [compareTo](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo(java.lang.Object) "compareTo"), [compareTo](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo(java.lang.Enum) "compareTo"), [valueOf](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#valueOf(java.lang.Class,%20java.lang.String) "valueOf"), [describeConstable](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#describeConstable() "describeConstable"), [getDeclaringClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getDeclaringClass() "getDeclaringClass"), [ordinal](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#ordinal() "ordinal"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait(long) "wait"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#notifyAll() "notifyAll")` |
Enum Constant Detail
--------------------
### public [JsonTokenType](jsontokentype) **CLOSE\_BRACKET**
### public [JsonTokenType](jsontokentype) **CLOSE\_CURLY**
### public [JsonTokenType](jsontokentype) **COLON**
### public [JsonTokenType](jsontokentype) **COMMA**
### public [JsonTokenType](jsontokentype) **FALSE**
### public [JsonTokenType](jsontokentype) **NULL**
### public [JsonTokenType](jsontokentype) **NUMBER**
### public [JsonTokenType](jsontokentype) **OPEN\_BRACKET**
### public [JsonTokenType](jsontokentype) **OPEN\_CURLY**
### public [JsonTokenType](jsontokentype) **STRING**
Original pattern throws the StackOverflowError for long strings with backslashes. So it is replaced by a 2-step approach inspired from json2.js sources: https://github.com/douglascrockford/JSON-js/blob/master/json2.js#L462 See JsonTokenTypeTest#testMatchingLongStringWithBackslashes() for details.
### public [JsonTokenType](jsontokentype) **TRUE**
Method Detail
-------------
### public boolean **doCall**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") it)
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getLabel**()
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getValidator**()
### public boolean **matching**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") input)
Tells if an input string matches a token.
**Parameters:**
`input` - the input string to match
**Returns:**
a `Matching` enum value: `YES` if this is an exact match, `POSSIBLE` if more characters could turn the input string into a valid token, or `NO` if the string cannot possibly match the pattern even with more characters to read.
### public static [JsonTokenType](jsontokentype) **startingWith**(char c)
Find which JSON value might be starting with a given character
**Parameters:**
`c` - the character
**Returns:**
the possible token type found
| programming_docs |
groovy [Java] Class StringEscapeUtils [Java] Class StringEscapeUtils
==============================
* groovy.json.StringEscapeUtils
```
public class StringEscapeUtils
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Escapes and unescapes `String`s for Java, Java Script, HTML, XML, and SQL.
#ThreadSafe#
**Note that this version is a stripped down version from Commons Lang 2.6 with only necessary methods for JSON builder**
**Authors:**
Apache Software Foundation
Apache Jakarta Turbine
Purple Technology
[Alexander Day Chaffee](mailto:[email protected])
Antony Riley
Helge Tesgaard
[Sean Brown]([email protected])
[Gary Gregory](mailto:[email protected])
Phil Steitz
Pete Gieser
**Since:**
2.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[StringEscapeUtils](#StringEscapeUtils())**()` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[escapeJava](#escapeJava(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str)`Escapes the characters in a `String` using Java String rules. |
| | `public static void` | `**[escapeJava](#escapeJava(java.io.Writer,%20java.lang.String))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str)`Escapes the characters in a `String` using Java String rules to a `Writer`. |
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[escapeJavaScript](#escapeJavaScript(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str)`Escapes the characters in a `String` using JavaScript String rules. |
| | `public static void` | `**[escapeJavaScript](#escapeJavaScript(java.io.Writer,%20java.lang.String))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str)`Escapes the characters in a `String` using JavaScript String rules to a `Writer`. |
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[unescapeJava](#unescapeJava(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str)`Unescapes any Java literals found in the `String`. |
| | `public static void` | `**[unescapeJava](#unescapeJava(java.io.Writer,%20java.lang.String))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str)` |
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[unescapeJavaScript](#unescapeJavaScript(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str)`Unescapes any JavaScript literals found in the `String`. |
| | `public static void` | `**[unescapeJavaScript](#unescapeJavaScript(java.io.Writer,%20java.lang.String))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str)`Unescapes any JavaScript literals found in the `String` to a `Writer`. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **StringEscapeUtils**()
`StringEscapeUtils` instances should NOT be constructed in standard programming.
Instead, the class should be used as:
```
StringEscapeUtils.escapeJava("foo");
```
This constructor is public to permit tools that require a JavaBean instance to operate.
Method Detail
-------------
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **escapeJava**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str)
Escapes the characters in a `String` using Java String rules.
Deals correctly with quotes and control-chars (tab, backslash, cr, ff, etc.)
So a tab becomes the characters `'\\'` and `'t'`.
The only difference between Java strings and JavaScript strings is that in JavaScript, a single quote must be escaped.
Example:
```
input string: They didn't say, "Stop!"
output string: They didn't say, \"Stop!\"
```
**Parameters:**
`str` - String to escape values in, may be null
**Returns:**
String with escaped values, `null` if null string input
### public static void **escapeJava**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str)
Escapes the characters in a `String` using Java String rules to a `Writer`.
A `null` string input has no effect.
**throws:**
IllegalArgumentException if the Writer is `null`
**throws:**
IOException if error occurs on underlying Writer
**See Also:**
[escapeJava(java.lang.String)](#escapeJava(java.lang.String))
**Parameters:**
`out` - Writer to write escaped string into
`str` - String to escape values in, may be null
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **escapeJavaScript**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str)
Escapes the characters in a `String` using JavaScript String rules.
Escapes any values it finds into their JavaScript String form. Deals correctly with quotes and control-chars (tab, backslash, cr, ff, etc.)
So a tab becomes the characters `'\\'` and `'t'`.
The only difference between Java strings and JavaScript strings is that in JavaScript, a single quote must be escaped.
Example:
```
input string: They didn't say, "Stop!"
output string: They didn\'t say, \"Stop!\"
```
**Parameters:**
`str` - String to escape values in, may be null
**Returns:**
String with escaped values, `null` if null string input
### public static void **escapeJavaScript**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str)
Escapes the characters in a `String` using JavaScript String rules to a `Writer`.
A `null` string input has no effect.
**throws:**
IllegalArgumentException if the Writer is `null`
**throws:**
IOException if error occurs on underlying Writer
**See Also:**
[escapeJavaScript(java.lang.String)](#escapeJavaScript(java.lang.String))
**Parameters:**
`out` - Writer to write escaped string into
`str` - String to escape values in, may be null
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **unescapeJava**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str)
Unescapes any Java literals found in the `String`. For example, it will turn a sequence of `'\'` and `'n'` into a newline character, unless the `'\'` is preceded by another `'\'`.
**Parameters:**
`str` - the `String` to unescape, may be null
**Returns:**
a new unescaped `String`, `null` if null string input
### public static void **unescapeJava**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str)
Unescapes any Java literals found in the `String` to a `Writer`.
For example, it will turn a sequence of `'\'` and `'n'` into a newline character, unless the `'\'` is preceded by another `'\'`.
A `null` string input has no effect.
**throws:**
IllegalArgumentException if the Writer is `null`
**throws:**
IOException if error occurs on underlying Writer
**Parameters:**
`out` - the `Writer` used to output unescaped characters
`str` - the `String` to unescape, may be null
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **unescapeJavaScript**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str)
Unescapes any JavaScript literals found in the `String`.
For example, it will turn a sequence of `'\'` and `'n'` into a newline character, unless the `'\'` is preceded by another `'\'`.
**See Also:**
[unescapeJava(String)](#unescapeJava(java.lang.String))
**Parameters:**
`str` - the `String` to unescape, may be null
**Returns:**
A new unescaped `String`, `null` if null string input
### public static void **unescapeJavaScript**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str)
Unescapes any JavaScript literals found in the `String` to a `Writer`.
For example, it will turn a sequence of `'\'` and `'n'` into a newline character, unless the `'\'` is preceded by another `'\'`.
A `null` string input has no effect.
**throws:**
IllegalArgumentException if the Writer is `null`
**throws:**
IOException if error occurs on underlying Writer
**See Also:**
[unescapeJava(Writer,String)](#unescapeJava(java.io.Writer,%20java.lang.String))
**Parameters:**
`out` - the `Writer` used to output unescaped characters
`str` - the `String` to unescape, may be null
groovy [Java] Class JsonToken [Java] Class JsonToken
======================
* groovy.json.JsonToken
```
public class JsonToken
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
A JSON token, with a type, line / column information, and the text of that token.
**Since:**
1.8.0
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public long` | `**[getEndColumn](#getEndColumn())**()` |
| | `public long` | `**[getEndLine](#getEndLine())**()` |
| | `public long` | `**[getStartColumn](#getStartColumn())**()` |
| | `public long` | `**[getStartLine](#getStartLine())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getText](#getText())**()` |
| | `public [JsonTokenType](jsontokentype)` | `**[getType](#getType())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getValue](#getValue())**()`Return the value represented by this token (ie. a number, a string, a boolean or null). |
| | `public void` | `**[setEndColumn](#setEndColumn(long))**(long endColumn)` |
| | `public void` | `**[setEndLine](#setEndLine(long))**(long endLine)` |
| | `public void` | `**[setStartColumn](#setStartColumn(long))**(long startColumn)` |
| | `public void` | `**[setStartLine](#setStartLine(long))**(long startLine)` |
| | `public void` | `**[setText](#setText(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text)` |
| | `public void` | `**[setType](#setType(groovy.json.JsonTokenType))**([JsonTokenType](jsontokentype) type)` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### public long **getEndColumn**()
### public long **getEndLine**()
### public long **getStartColumn**()
### public long **getStartLine**()
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getText**()
### public [JsonTokenType](jsontokentype) **getType**()
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getValue**()
Return the value represented by this token (ie. a number, a string, a boolean or null). For numbers, BigDecimal is returned for decimals and Integer, Long or BigInteger for integral numbers.
**Returns:**
the represented value
### public void **setEndColumn**(long endColumn)
### public void **setEndLine**(long endLine)
### public void **setStartColumn**(long startColumn)
### public void **setStartLine**(long startLine)
### public void **setText**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text)
### public void **setType**([JsonTokenType](jsontokentype) type)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
groovy [Java] Class JsonOutput [Java] Class JsonOutput
=======================
* groovy.json.JsonOutput
```
public class JsonOutput
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Class responsible for the actual String serialization of the possible values of a JSON structure. This class can also be used as a category, so as to add `toJson()` methods to various types.
This class does not provide the ability to customize the resulting output. A [JsonGenerator](jsongenerator "JsonGenerator") can be used if the ability to alter the resulting output is required.
**See Also:**
[JsonGenerator](jsongenerator "JsonGenerator")
**Since:**
1.8.0
Nested Class Summary
--------------------
Nested classes
| Modifiers | Name | Description |
| `**static class**` | `[JsonOutput.JsonUnescaped](jsonoutput.jsonunescaped)` | Represents unescaped JSON |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[prettyPrint](#prettyPrint(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") jsonPayload)`Pretty print a JSON payload. |
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toJson](#toJson(java.lang.Boolean))**([Boolean](https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html "Boolean") bool)`
**Returns:**
"true" or "false" for a boolean value
|
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toJson](#toJson(java.lang.Number))**([Number](https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html "Number") n)`
**Returns:**
a string representation for a number
|
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toJson](#toJson(java.lang.Character))**([Character](https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html "Character") c)`
**Returns:**
a JSON string representation of the character
|
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toJson](#toJson(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") s)`
**Returns:**
a properly encoded string with escape sequences
|
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toJson](#toJson(java.util.Date))**([Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") date)`Format a date that is parseable from JavaScript, according to ISO-8601. |
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toJson](#toJson(java.util.Calendar))**([Calendar](https://docs.oracle.com/javase/8/docs/api/java/util/Calendar.html "Calendar") cal)`Format a calendar instance that is parseable from JavaScript, according to ISO-8601. |
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toJson](#toJson(java.util.UUID))**([UUID](https://docs.oracle.com/javase/8/docs/api/java/util/UUID.html "UUID") uuid)`
**Returns:**
the string representation of an uuid
|
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toJson](#toJson(java.net.URL))**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url)`
**Returns:**
the string representation of the URL
|
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toJson](#toJson(groovy.lang.Closure))**([Closure](../lang/closure) closure)`
**Returns:**
an object representation of a closure
|
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toJson](#toJson(groovy.util.Expando))**([Expando](../util/expando) expando)`
**Returns:**
an object representation of an Expando
|
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toJson](#toJson(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object)`
**Returns:**
"null" for a null value, or a JSON array representation for a collection, array, iterator or enumeration, or representation for other object.
|
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toJson](#toJson(java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") m)`
**Returns:**
a JSON object representation for a map
|
| | `public static [JsonOutput.JsonUnescaped](jsonoutput.jsonunescaped)` | `**[unescaped](#unescaped(java.lang.CharSequence))**([CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence") text)`Obtains JSON unescaped text for the given text |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **prettyPrint**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") jsonPayload)
Pretty print a JSON payload.
**Parameters:**
jsonPayload
**Returns:**
a pretty representation of JSON payload.
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toJson**([Boolean](https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html "Boolean") bool)
**Returns:**
"true" or "false" for a boolean value
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toJson**([Number](https://docs.oracle.com/javase/8/docs/api/java/lang/Number.html "Number") n)
**throws:**
JsonException if the number is infinite or not a number.
**Returns:**
a string representation for a number
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toJson**([Character](https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html "Character") c)
**Returns:**
a JSON string representation of the character
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toJson**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") s)
**Returns:**
a properly encoded string with escape sequences
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toJson**([Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html "Date") date)
Format a date that is parseable from JavaScript, according to ISO-8601.
**Parameters:**
`date` - the date to format to a JSON string
**Returns:**
a formatted date in the form of a string
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toJson**([Calendar](https://docs.oracle.com/javase/8/docs/api/java/util/Calendar.html "Calendar") cal)
Format a calendar instance that is parseable from JavaScript, according to ISO-8601.
**Parameters:**
`cal` - the calendar to format to a JSON string
**Returns:**
a formatted date in the form of a string
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toJson**([UUID](https://docs.oracle.com/javase/8/docs/api/java/util/UUID.html "UUID") uuid)
**Returns:**
the string representation of an uuid
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toJson**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url)
**Returns:**
the string representation of the URL
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toJson**([Closure](../lang/closure) closure)
**Returns:**
an object representation of a closure
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toJson**([Expando](../util/expando) expando)
**Returns:**
an object representation of an Expando
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toJson**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object)
**Returns:**
"null" for a null value, or a JSON array representation for a collection, array, iterator or enumeration, or representation for other object.
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toJson**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") m)
**Returns:**
a JSON object representation for a map
### public static [JsonOutput.JsonUnescaped](jsonoutput.jsonunescaped) **unescaped**([CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence") text)
Obtains JSON unescaped text for the given text
**Parameters:**
`text` - The text
**Returns:**
The unescaped text
| programming_docs |
groovy [Java] Class JsonOutput.JsonUnescaped [Java] Class JsonOutput.JsonUnescaped
=====================================
* groovy.json.JsonOutput.JsonUnescaped
```
public static class JsonOutput.JsonUnescaped
```
Represents unescaped JSON
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[JsonUnescaped](#JsonUnescaped(java.lang.CharSequence))**([CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence") text)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence")` | `**[getText](#getText())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **JsonUnescaped**([CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence") text)
Method Detail
-------------
### public [CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence") **getText**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
groovy [Java] Class JsonSlurperClassic [Java] Class JsonSlurperClassic
===============================
* groovy.json.JsonSlurperClassic
```
public class JsonSlurperClassic
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
This is the original slurper included in case someone relies on its exact behavior. JSON slurper which parses text or reader content into a data structure of lists and maps.
Example usage: ````
def slurper = new groovy.json.JsonSlurperClassic()
def result = slurper.parseText('{"person":{"name":"Guillaume","age":33,"pets":["dog","cat"]}}')
assert result.person.name == "Guillaume"
assert result.person.age == 33
assert result.person.pets.size() == 2
assert result.person.pets[0] == "dog"
assert result.person.pets[1] == "cat"
````
**Since:**
1.8.0
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.io.Reader))**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader)`Parse a JSON data structure from content from a reader |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.io.File))**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file)`Parse a JSON data structure from content within a given File. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.io.File,%20java.lang.String))**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)`Parse a JSON data structure from content within a given File. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.net.URL))**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url)`Parse a JSON data structure from content at a given URL. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.net.URL,%20java.util.Map))**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params)`Parse a JSON data structure from content at a given URL. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.util.Map,%20java.net.URL))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url)`Parse a JSON data structure from content at a given URL. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.net.URL,%20java.lang.String))**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)`Parse a JSON data structure from content at a given URL. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.net.URL,%20java.util.Map,%20java.lang.String))**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)`Parse a JSON data structure from content at a given URL. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.util.Map,%20java.net.URL,%20java.lang.String))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)`Parse a JSON data structure from content at a given URL. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parseText](#parseText(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text)`Parse a text representation of a JSON data structure |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader)
Parse a JSON data structure from content from a reader
**Parameters:**
`reader` - reader over a JSON content
**Returns:**
a data structure of lists and maps
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file)
Parse a JSON data structure from content within a given File.
**Parameters:**
`file` - File containing JSON content
**Returns:**
a data structure of lists and maps
**Since:**
2.2.0
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)
Parse a JSON data structure from content within a given File.
**Parameters:**
`file` - File containing JSON content
`charset` - the charset for this File
**Returns:**
a data structure of lists and maps
**Since:**
2.2.0
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url)
Parse a JSON data structure from content at a given URL.
**Parameters:**
`url` - URL containing JSON content
**Returns:**
a data structure of lists and maps
**Since:**
2.2.0
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params)
Parse a JSON data structure from content at a given URL.
**Parameters:**
`url` - URL containing JSON content
`params` - connection parameters
**Returns:**
a data structure of lists and maps
**Since:**
2.2.0
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url)
Parse a JSON data structure from content at a given URL. Convenience variant when using Groovy named parameters for the connection params.
**Parameters:**
`params` - connection parameters
`url` - URL containing JSON content
**Returns:**
a data structure of lists and maps
**Since:**
2.2.0
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)
Parse a JSON data structure from content at a given URL.
**Parameters:**
`url` - URL containing JSON content
`charset` - the charset for this File
**Returns:**
a data structure of lists and maps
**Since:**
2.2.0
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)
Parse a JSON data structure from content at a given URL.
**Parameters:**
`url` - URL containing JSON content
`params` - connection parameters
`charset` - the charset for this File
**Returns:**
a data structure of lists and maps
**Since:**
2.2.0
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)
Parse a JSON data structure from content at a given URL. Convenience variant when using Groovy named parameters for the connection params.
**Parameters:**
`params` - connection parameters
`url` - URL containing JSON content
`charset` - the charset for this File
**Returns:**
a data structure of lists and maps
**Since:**
2.2.0
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parseText**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text)
Parse a text representation of a JSON data structure
**Parameters:**
`text` - JSON text to parse
**Returns:**
a data structure of lists and maps
groovy [Java] Interface JsonGenerator.Converter [Java] Interface JsonGenerator.Converter
========================================
```
public interface JsonGenerator.Converter
```
Handles converting a given type.
**Since:**
2.5.0
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[convert](#convert(java.lang.Object,%20java.lang.String))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") key)`Converts a given object. |
| | `public boolean` | `**[handles](#handles(Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> type)`Returns `true` if this converter can handle conversions of the given type. |
Method Detail
-------------
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **convert**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") key)
Converts a given object.
**Parameters:**
`value` - the object to convert
`key` - the key name for the value, may be `null`
**Returns:**
the converted object
### public boolean **handles**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> type)
Returns `true` if this converter can handle conversions of the given type.
**Parameters:**
`type` - the type of the object to convert
**Returns:**
`true` if this converter can successfully convert values of the given type, else `false`
groovy [Java] Interface JsonGenerator [Java] Interface JsonGenerator
==============================
```
public interface JsonGenerator
```
Generates JSON from objects. The Options builder can be used to configure an instance of a JsonGenerator.
**See Also:**
Options#build()#build()
**Since:**
2.5.0
Nested Class Summary
--------------------
Nested classes
| Modifiers | Name | Description |
| `**interface**` | `[JsonGenerator.Converter](jsongenerator.converter)` | Handles converting a given type. |
| `**class**` | `[JsonGenerator.Options](jsongenerator.options)` | A builder used to construct a [JsonGenerator](jsongenerator "JsonGenerator") instance that allows control over the serialized JSON output. |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public boolean` | `**[isExcludingFieldsNamed](#isExcludingFieldsNamed(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)`Indicates whether this JsonGenerator is configured to exclude fields by the given name. |
| | `public boolean` | `**[isExcludingValues](#isExcludingValues(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)`Indicates whether this JsonGenerator is configured to exclude values of the given object (may be `null`). |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toJson](#toJson(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object)`Converts an object to its JSON representation. |
Method Detail
-------------
### public boolean **isExcludingFieldsNamed**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
Indicates whether this JsonGenerator is configured to exclude fields by the given name.
**Parameters:**
`name` - of the field
**Returns:**
true if that field is being excluded, else false
### public boolean **isExcludingValues**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
Indicates whether this JsonGenerator is configured to exclude values of the given object (may be `null`).
**Parameters:**
`value` - an instance of an object
**Returns:**
true if values like this are being excluded, else false
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toJson**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object)
Converts an object to its JSON representation.
**Parameters:**
`object` - to convert to JSON
**Returns:**
JSON
groovy [Java] Class DefaultJsonGenerator.ClosureConverter [Java] Class DefaultJsonGenerator.ClosureConverter
==================================================
* groovy.json.DefaultJsonGenerator.ClosureConverter
All Implemented Interfaces and Traits: [Converter](../../converter)
```
protected static class DefaultJsonGenerator.ClosureConverter
```
A converter that handles converting a given type using a closure.
**Since:**
2.5.0
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**protected [Closure](../lang/closure "Closure")<?>**` | `[closure](#closure)` | |
| `**protected int**` | `[paramCount](#paramCount)` | |
| `**protected [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?>**` | `[type](#type)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `protected **[ClosureConverter](#ClosureConverter(Class,%20Closure))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> type, [Closure](../lang/closure "Closure")<?> closure)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[convert](#convert(java.lang.Object,%20java.lang.String))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") key)`Converts a given value. |
| | `public boolean` | `**[equals](#equals(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)`Any two Converter instances registered for the same type are considered to be equal. |
| | `public boolean` | `**[handles](#handles(Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> type)`Returns `true` if this converter can handle conversions of the given type. |
| | `public int` | `**[hashCode](#hashCode())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### protected final [Closure](../lang/closure "Closure")<?> **closure**
### protected final int **paramCount**
### protected final [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> **type**
Constructor Detail
------------------
### protected **ClosureConverter**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> type, [Closure](../lang/closure "Closure")<?> closure)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **convert**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") key)
Converts a given value.
**Parameters:**
`value` - the object to convert
`key` - the key name for the value, may be `null`
**Returns:**
the converted object
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **equals**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)
Any two Converter instances registered for the same type are considered to be equal. This comparison makes managing instances in a Set easier; since there is no chaining of Converters it makes sense to only allow one per type.
**Parameters:**
`o` - the object with which to compare.
**Returns:**
`true` if this object contains the same class; `false` otherwise.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **handles**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> type)
Returns `true` if this converter can handle conversions of the given type.
**Parameters:**
`type` - the type of the object to convert
**Returns:**
true if this converter can successfully convert values of the given type
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **hashCode**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
| programming_docs |
groovy [Java] Class JsonDelegate [Java] Class JsonDelegate
=========================
* groovy.json.JsonDelegate
```
public class JsonDelegate
extends [GroovyObjectSupport](../lang/groovyobjectsupport)
```
Utility class used as delegate of closures representing JSON objects.
**Since:**
1.8.0
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public static [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")>` | `**[cloneDelegateAndGetContent](#cloneDelegateAndGetContent(Closure))**([Closure](../lang/closure "Closure")<?> c)`Factory method for creating `JsonDelegate`s from closures. |
| | `public static [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")>` | `**[curryDelegateAndGetContent](#curryDelegateAndGetContent(Closure,%20java.lang.Object))**([Closure](../lang/closure "Closure")<?> c, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)`Factory method for creating `JsonDelegate`s from closures currying an object argument. |
| | `public [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")>` | `**[getContent](#getContent())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)`Intercepts calls for setting a key and value for a JSON object |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyObjectSupport](../lang/groovyobjectsupport)` | `[getMetaClass](../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Method Detail
-------------
### public static [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> **cloneDelegateAndGetContent**([Closure](../lang/closure "Closure")<?> c)
Factory method for creating `JsonDelegate`s from closures.
**Parameters:**
`c` - closure representing JSON objects
**Returns:**
an instance of `JsonDelegate`
### public static [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> **curryDelegateAndGetContent**([Closure](../lang/closure "Closure")<?> c, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)
Factory method for creating `JsonDelegate`s from closures currying an object argument.
**Parameters:**
`c` - closure representing JSON objects
`o` - an object curried to the closure
**Returns:**
an instance of `JsonDelegate`
### public [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> **getContent**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
Intercepts calls for setting a key and value for a JSON object
**Parameters:**
`name` - the key name
`args` - the value associated with the key
groovy [Java] Class JsonGenerator.Options [Java] Class JsonGenerator.Options
==================================
* groovy.json.JsonGenerator.Options
```
public class JsonGenerator.Options
```
A builder used to construct a [JsonGenerator](jsongenerator "JsonGenerator") instance that allows control over the serialized JSON output. If you do not need to customize the output it is recommended to use the static `JsonOutput.toJson` methods.
Example:
```
def generator = new groovy.json.JsonGenerator.Options()
.excludeNulls()
.dateFormat('yyyy')
.excludeFieldsByName('bar', 'baz')
.excludeFieldsByType(java.sql.Date)
.build()
def input = [foo: null, lastUpdated: Date.parse('yyyy-MM-dd', '2014-10-24'),
bar: 'foo', baz: 'foo', systemDate: new java.sql.Date(new Date().getTime())]
assert generator.toJson(input) == '{"lastUpdated":"2014"}'
```
**Since:**
2.5.0
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**protected static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[DEFAULT\_TIMEZONE](#DEFAULT_TIMEZONE)` | |
| `**protected static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[JSON\_DATE\_FORMAT](#JSON_DATE_FORMAT)` | |
| `**protected static [Locale](https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html "Locale")**` | `[JSON\_DATE\_FORMAT\_LOCALE](#JSON_DATE_FORMAT_LOCALE)` | |
| `**protected [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<Converter>**` | `[converters](#converters)` | |
| `**protected [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[dateFormat](#dateFormat)` | |
| `**protected [Locale](https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html "Locale")**` | `[dateLocale](#dateLocale)` | |
| `**protected boolean**` | `[disableUnicodeEscaping](#disableUnicodeEscaping)` | |
| `**protected boolean**` | `[excludeNulls](#excludeNulls)` | |
| `**protected [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>**` | `[excludedFieldNames](#excludedFieldNames)` | |
| `**protected [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?>>**` | `[excludedFieldTypes](#excludedFieldTypes)` | |
| `**protected [TimeZone](https://docs.oracle.com/javase/8/docs/api/java/util/TimeZone.html "TimeZone")**` | `[timezone](#timezone)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Options](#Options())**()` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options")` | `**[addConverter](#addConverter(Converter))**([Converter](../../converter) converter)`Registers a converter that will be called when a type it handles is encountered. |
| `<T>` | `public [Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options")` | `**[addConverter](#addConverter(Class,%20Closure))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<T> type, [Closure](../lang/closure "Closure")<?> closure)`Registers a closure that will be called when the specified type or subtype is serialized. |
| | `public [JsonGenerator](jsongenerator)` | `**[build](#build())**()`Creates a [JsonGenerator](jsongenerator "JsonGenerator") that is based on the current options. |
| | `public [Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options")` | `**[dateFormat](#dateFormat(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") format)`Sets the date format that will be used to serialize `Date` objects. |
| | `public [Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options")` | `**[dateFormat](#dateFormat(java.lang.String,%20java.util.Locale))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") format, [Locale](https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html "Locale") locale)`Sets the date format that will be used to serialize `Date` objects. |
| | `public [Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options")` | `**[disableUnicodeEscaping](#disableUnicodeEscaping())**()`Disables the escaping of Unicode characters in JSON String values. |
| | `public [Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options")` | `**[excludeFieldsByName](#excludeFieldsByName(java.lang.CharSequence))**([CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence") fieldNames)`Excludes from the output any fields that match the specified names. |
| | `public [Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options")` | `**[excludeFieldsByName](#excludeFieldsByName(Iterable))**([Iterable](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html "Iterable")<? extends [CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence")> fieldNames)`Excludes from the output any fields that match the specified names. |
| | `public [Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options")` | `**[excludeFieldsByType](#excludeFieldsByType(Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> types)`Excludes from the output any fields whose type is the same or is assignable to any of the given types. |
| | `public [Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options")` | `**[excludeFieldsByType](#excludeFieldsByType(Iterable))**([Iterable](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html "Iterable")<[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?>> types)`Excludes from the output any fields whose type is the same or is assignable to any of the given types. |
| | `public [Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options")` | `**[excludeNulls](#excludeNulls())**()`Do not serialize `null` values. |
| | `public [Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options")` | `**[timezone](#timezone(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") timezone)`Sets the time zone that will be used to serialize dates. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### protected static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **DEFAULT\_TIMEZONE**
### protected static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **JSON\_DATE\_FORMAT**
### protected static final [Locale](https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html "Locale") **JSON\_DATE\_FORMAT\_LOCALE**
### protected final [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<Converter> **converters**
### protected [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **dateFormat**
### protected [Locale](https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html "Locale") **dateLocale**
### protected boolean **disableUnicodeEscaping**
### protected boolean **excludeNulls**
### protected final [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> **excludedFieldNames**
### protected final [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?>> **excludedFieldTypes**
### protected [TimeZone](https://docs.oracle.com/javase/8/docs/api/java/util/TimeZone.html "TimeZone") **timezone**
Constructor Detail
------------------
### public **Options**()
Method Detail
-------------
### public [Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options") **addConverter**([Converter](../../converter) converter)
Registers a converter that will be called when a type it handles is encountered.
**Parameters:**
`converter` - to register
**Returns:**
a reference to this `Options` instance
### <T> public [Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options") **addConverter**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<T> type, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=FromString.class, options={"T","T,String"}) [Closure](../lang/closure "Closure")<?> closure)
Registers a closure that will be called when the specified type or subtype is serialized.
The closure must accept either 1 or 2 parameters. The first parameter is required and will be instance of the `type` for which the closure is registered. The second optional parameter should be of type `String` and, if available, will be passed the name of the key associated with this value if serializing a JSON Object. This parameter will be `null` when serializing a JSON Array or when there is no way to determine the name of the key.
Example:
```
def generator = new groovy.json.JsonGenerator.Options()
.addConverter(URL) { URL u `->`
u.getHost()
}
.build()
def input = [domain: new URL('http://groovy-lang.org/json.html#_parser_variants')]
assert generator.toJson(input) == '{"domain":"groovy-lang.org"}'
```
If two or more closures are registered for the exact same type the last closure based on the order they were specified will be used. When serializing an object its type is compared to the list of registered types in the order the were given and the closure for the first suitable type will be called. Therefore, it is important to register more specific types first.
**Parameters:**
`type` - the type to convert
`closure` - called when the registered type or any type assignable to the given type is encountered
**Type Parameters:**
`T` - the type this converter is registered to handle
**Returns:**
a reference to this `Options` instance
**Throws:**
NullPointerException if the given type or closure is null
IllegalArgumentException if the given closure does not accept a parameter of the given type
### public [JsonGenerator](jsongenerator) **build**()
Creates a [JsonGenerator](jsongenerator "JsonGenerator") that is based on the current options.
**Returns:**
a fully configured [JsonGenerator](jsongenerator "JsonGenerator")
### public [Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options") **dateFormat**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") format)
Sets the date format that will be used to serialize `Date` objects. This must be a valid pattern for [SimpleDateFormat](https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html "SimpleDateFormat") and the date formatter will be constructed with the default locale of [Locale.US](https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html#US "Locale.US").
**Parameters:**
`format` - date format pattern used to serialize dates
**Returns:**
a reference to this `Options` instance
**Throws:**
NullPointerException if the given pattern is null
IllegalArgumentException if the given pattern is invalid
### public [Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options") **dateFormat**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") format, [Locale](https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html "Locale") locale)
Sets the date format that will be used to serialize `Date` objects. This must be a valid pattern for [SimpleDateFormat](https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html "SimpleDateFormat").
**Parameters:**
`format` - date format pattern used to serialize dates
`locale` - the locale whose date format symbols will be used
**Returns:**
a reference to this `Options` instance
**Throws:**
IllegalArgumentException if the given pattern is invalid
### public [Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options") **disableUnicodeEscaping**()
Disables the escaping of Unicode characters in JSON String values.
**Returns:**
a reference to this `Options` instance
### public [Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options") **excludeFieldsByName**([CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence") fieldNames)
Excludes from the output any fields that match the specified names.
**Parameters:**
`fieldNames` - name of the field to exclude from the output
**Returns:**
a reference to this `Options` instance
### public [Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options") **excludeFieldsByName**([Iterable](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html "Iterable")<? extends [CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence")> fieldNames)
Excludes from the output any fields that match the specified names.
**Parameters:**
`fieldNames` - collection of names to exclude from the output
**Returns:**
a reference to this `Options` instance
### public [Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options") **excludeFieldsByType**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> types)
Excludes from the output any fields whose type is the same or is assignable to any of the given types.
**Parameters:**
`types` - excluded from the output
**Returns:**
a reference to this `Options` instance
### public [Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options") **excludeFieldsByType**([Iterable](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html "Iterable")<[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?>> types)
Excludes from the output any fields whose type is the same or is assignable to any of the given types.
**Parameters:**
`types` - collection of types to exclude from the output
**Returns:**
a reference to this `Options` instance
### public [Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options") **excludeNulls**()
Do not serialize `null` values.
**Returns:**
a reference to this `Options` instance
### public [Options](https://commons.apache.org/proper/commons-cli/javadocs/api-release/org/apache/commons/cli/Options.html "Options") **timezone**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") timezone)
Sets the time zone that will be used to serialize dates.
**Parameters:**
`timezone` - used to serialize dates
**Returns:**
a reference to this `Options` instance
**Throws:**
NullPointerException if the given timezone is null
| programming_docs |
groovy [Java] Interface JsonParser [Java] Interface JsonParser
===========================
```
public interface JsonParser
```
This is the parser interface that backs the new JsonSlurper. It was derived from the Boon JSON parser.
**Since:**
2.3.0
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") jsonString)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(byte%5B%5D))**(byte[] bytes)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(byte%5B%5D,%20java.lang.String))**(byte[] bytes, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.lang.CharSequence))**([CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence") charSequence)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(char%5B%5D))**(char[] chars)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.io.Reader))**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.io.InputStream))**([InputStream](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html "InputStream") input)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.io.InputStream,%20java.lang.String))**([InputStream](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html "InputStream") input, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.io.File,%20java.lang.String))**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)` |
Method Detail
-------------
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") jsonString)
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**(byte[] bytes)
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**(byte[] bytes, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence") charSequence)
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**(char[] chars)
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader)
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([InputStream](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html "InputStream") input)
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([InputStream](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html "InputStream") input, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)
groovy [Java] Class StreamingJsonBuilder.StreamingJsonDelegate [Java] Class StreamingJsonBuilder.StreamingJsonDelegate
=======================================================
* groovy.json.StreamingJsonBuilder.StreamingJsonDelegate
```
public static class StreamingJsonBuilder.StreamingJsonDelegate
extends [GroovyObjectSupport](../lang/groovyobjectsupport)
```
The delegate used when invoking closures
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**protected boolean**` | `[first](#first)` | |
| `**protected [StreamingJsonBuilder.StreamingJsonDelegate.State](streamingjsonbuilder/streamingjsondelegate.state)**` | `[state](#state)` | |
| `**protected [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer")**` | `[writer](#writer)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[StreamingJsonDelegate](#StreamingJsonDelegate(java.io.Writer,%20boolean))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") w, boolean first)` |
| `**[StreamingJsonDelegate](#StreamingJsonDelegate(java.io.Writer,%20boolean,%20groovy.json.JsonGenerator))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") w, boolean first, [JsonGenerator](jsongenerator) generator)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[call](#call(java.lang.String,%20List))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> list)`Writes the name and a JSON array |
| | `public void` | `**[call](#call(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") array)`Writes the name and a JSON array |
| | `public void` | `**[call](#call(java.lang.String,%20java.lang.Iterable,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Iterable](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html "Iterable") coll, [Closure](../lang/closure) c)`A collection and closure passed to a JSON builder will create a root JSON array applying the closure to each object in the collection |
| | `public void` | `**[call](#call(java.lang.String,%20java.util.Collection,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") coll, [Closure](../lang/closure) c)`Delegates to [call(String, Iterable, Closure)](#call(java.lang.String,%20java.lang.Iterable,%20groovy.lang.Closure)) |
| | `public void` | `**[call](#call(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)`Writes the name and value of a JSON attribute |
| | `public void` | `**[call](#call(java.lang.String,%20java.lang.Object,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value, [Closure](../lang/closure) callable)`Writes the name and value of a JSON attribute |
| | `public void` | `**[call](#call(java.lang.String,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Closure](../lang/closure) value)`Writes the name and another JSON object |
| | `public void` | `**[call](#call(java.lang.String,%20groovy.json.JsonOutput.JsonUnescaped))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [JsonUnescaped](jsonoutput.jsonunescaped) json)`Writes an unescaped value. |
| | `public void` | `**[call](#call(java.lang.String,%20groovy.lang.Writable))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Writable](../lang/writable) json)`Writes the given Writable as the value of the given attribute name |
| | `public static void` | `**[cloneDelegateAndGetContent](#cloneDelegateAndGetContent(java.io.Writer,%20groovy.lang.Closure))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") w, [Closure](../lang/closure) c)` |
| | `public static void` | `**[cloneDelegateAndGetContent](#cloneDelegateAndGetContent(java.io.Writer,%20groovy.lang.Closure,%20boolean))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") w, [Closure](../lang/closure) c, boolean first)` |
| | `public static void` | `**[curryDelegateAndGetContent](#curryDelegateAndGetContent(java.io.Writer,%20groovy.lang.Closure,%20java.lang.Object))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") w, [Closure](../lang/closure) c, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)` |
| | `public static void` | `**[curryDelegateAndGetContent](#curryDelegateAndGetContent(java.io.Writer,%20groovy.lang.Closure,%20java.lang.Object,%20boolean))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") w, [Closure](../lang/closure) c, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o, boolean first)` |
| | `public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer")` | `**[getWriter](#getWriter())**()`
**Returns:**
Obtains the current writer
|
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)` |
| | `public static boolean` | `**[isCollectionWithClosure](#isCollectionWithClosure(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)` |
| | `protected void` | `**[verifyValue](#verifyValue())**()` |
| | `protected void` | `**[writeArray](#writeArray(List))**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> list)` |
| | `public static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[writeCollectionWithClosure](#writeCollectionWithClosure(java.io.Writer,%20java.util.Collection,%20groovy.lang.Closure))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") writer, [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") coll, [Closure](../lang/closure) closure)` |
| | `protected void` | `**[writeName](#writeName(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)` |
| | `protected void` | `**[writeValue](#writeValue(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyObjectSupport](../lang/groovyobjectsupport)` | `[getMetaClass](../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Field Detail
------------
### protected boolean **first**
### protected [StreamingJsonBuilder.StreamingJsonDelegate.State](streamingjsonbuilder/streamingjsondelegate.state) **state**
### protected final [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") **writer**
Constructor Detail
------------------
### public **StreamingJsonDelegate**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") w, boolean first)
### public **StreamingJsonDelegate**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") w, boolean first, [JsonGenerator](jsongenerator) generator)
Method Detail
-------------
### public void **call**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> list)
Writes the name and a JSON array
**throws:**
IOException
**Parameters:**
`name` - The name of the JSON attribute
`list` - The list representing the array
### public void **call**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") array)
Writes the name and a JSON array
**throws:**
IOException
**Parameters:**
`name` - The name of the JSON attribute
`array` - The list representing the array
### public void **call**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Iterable](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html "Iterable") coll, @[DelegatesTo](../lang/delegatesto "DelegatesTo")(value = StreamingJsonDelegate.class, strategy = Closure.DELEGATE\_FIRST) [Closure](../lang/closure) c)
A collection and closure passed to a JSON builder will create a root JSON array applying the closure to each object in the collection
Example:
```
class Author {
String name
}
def authorList = [new Author (name: "Guillaume"), new Author (name: "Jochen"), new Author (name: "Paul")]
new StringWriter().with { w ->
def json = new groovy.json.StreamingJsonBuilder(w)
json.book {
authors authorList, { Author author ->
name author.name
}
}
assert w.toString() == '{"book":{"authors":[{"name":"Guillaume"},{"name":"Jochen"},{"name":"Paul"}]}}'
}
```
**Parameters:**
`coll` - a collection
`c` - a closure used to convert the objects of coll
### public void **call**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") coll, @[DelegatesTo](../lang/delegatesto "DelegatesTo")(value = StreamingJsonDelegate.class, strategy = Closure.DELEGATE\_FIRST) [Closure](../lang/closure) c)
Delegates to [call(String, Iterable, Closure)](#call(java.lang.String,%20java.lang.Iterable,%20groovy.lang.Closure))
### public void **call**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
Writes the name and value of a JSON attribute
**throws:**
IOException
**Parameters:**
`name` - The attribute name
`value` - The value
### public void **call**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value, @[DelegatesTo](../lang/delegatesto "DelegatesTo")(value = StreamingJsonDelegate.class, strategy = Closure.DELEGATE\_FIRST) [Closure](../lang/closure) callable)
Writes the name and value of a JSON attribute
**throws:**
IOException
**Parameters:**
`name` - The attribute name
`value` - The value
### public void **call**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, @[DelegatesTo](../lang/delegatesto "DelegatesTo")(value = StreamingJsonDelegate.class, strategy = Closure.DELEGATE\_FIRST) [Closure](../lang/closure) value)
Writes the name and another JSON object
**throws:**
IOException
**Parameters:**
`name` - The attribute name
`value` - The value
### public void **call**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [JsonUnescaped](jsonoutput.jsonunescaped) json)
Writes an unescaped value. Note: can cause invalid JSON if passed JSON is invalid
**throws:**
IOException
**Parameters:**
`name` - The attribute name
`json` - The value
### public void **call**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Writable](../lang/writable) json)
Writes the given Writable as the value of the given attribute name
**throws:**
IOException
**Parameters:**
`name` - The attribute name
`json` - The writable value
### public static void **cloneDelegateAndGetContent**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") w, @[DelegatesTo](../lang/delegatesto "DelegatesTo")(value = StreamingJsonDelegate.class, strategy = Closure.DELEGATE\_FIRST) [Closure](../lang/closure) c)
### public static void **cloneDelegateAndGetContent**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") w, @[DelegatesTo](../lang/delegatesto "DelegatesTo")(value = StreamingJsonDelegate.class, strategy = Closure.DELEGATE\_FIRST) [Closure](../lang/closure) c, boolean first)
### public static void **curryDelegateAndGetContent**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") w, @[DelegatesTo](../lang/delegatesto "DelegatesTo")(value = StreamingJsonDelegate.class, strategy = Closure.DELEGATE\_FIRST) [Closure](../lang/closure) c, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)
### public static void **curryDelegateAndGetContent**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") w, @[DelegatesTo](../lang/delegatesto "DelegatesTo")(value = StreamingJsonDelegate.class, strategy = Closure.DELEGATE\_FIRST) [Closure](../lang/closure) c, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o, boolean first)
### public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") **getWriter**()
**Returns:**
Obtains the current writer
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
### public static boolean **isCollectionWithClosure**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)
### protected void **verifyValue**()
### protected void **writeArray**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> list)
### public static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **writeCollectionWithClosure**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") writer, [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") coll, @[DelegatesTo](../lang/delegatesto "DelegatesTo")(value = StreamingJsonDelegate.class, strategy = Closure.DELEGATE\_FIRST) [Closure](../lang/closure) closure)
### protected void **writeName**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
### protected void **writeValue**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
| programming_docs |
groovy [Java] Enum JsonParserType [Java] Enum JsonParserType
==========================
* groovy.json.JsonParserType
```
public enum JsonParserType
extends [Enum](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html "Enum")
```
Allows selection of parser type for new new JsonSlurper.
To enable the INDEX\_OVERLAY parser do this: ````
parser = new JsonSlurper().setType(JsonParserType.INDEX_OVERLAY);
```` INDEX\_OVERLAY should be your parser of choice. CHAR\_BUFFER is the parser of choice due to element of least surprise and need to mimic existing Slurper behavior as much as possible. Use CHARACTER\_SOURCE for large file parsing. Use LAX if you want to enable relaxed JSON parsing, i.e., allow comments, no quote strings, etc. Use CHAR\_BUFFER for a non-fancy but super fast parser. Parser speed in order: INDEX\_OVERLAY, LAX, CHAR\_BUFFER, CHARACTER\_SOURCE.
Use Cases: Use LAX for config files as it allows comments. Use INDEX\_OVERLAY for REST calls, WebSocket messages, AJAX, inter process communication, etc. Use CHAR\_BUFFER if eager parsing of ints, dates, longs, are appealing. Use CHARACTER\_SOURCE if you are dealing with large JSON files over 2MB. INDEX\_OVERLAY is highly tuned for object deserialization from JSON.
**Since:**
2.3.0
Enum Constants Summary
----------------------
Enum constants classes
| Enum constant | Description |
| `**[CHARACTER\_SOURCE](#CHARACTER_SOURCE)**` | Parser uses an abstraction that allows it to handle any size file by using a char [] windowing, built on top or Reader. |
| `**[CHAR\_BUFFER](#CHAR_BUFFER)**` | This is a basic parser with no index overlay. |
| `**[INDEX\_OVERLAY](#INDEX_OVERLAY)**` | Fastest parser, but has pointers (indexes really) to original char buffer. |
| `**[LAX](#LAX)**` | LAX mode allows keys with no quotes, keys with single quotes, strings elements in JSON with no quotes or single quotes. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Enum](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html "Enum")` | `[name](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#name() "name"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#hashCode() "hashCode"), [compareTo](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo(java.lang.Object) "compareTo"), [compareTo](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo(java.lang.Enum) "compareTo"), [valueOf](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#valueOf(java.lang.Class,%20java.lang.String) "valueOf"), [describeConstable](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#describeConstable() "describeConstable"), [getDeclaringClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getDeclaringClass() "getDeclaringClass"), [ordinal](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#ordinal() "ordinal"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait(long) "wait"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#notifyAll() "notifyAll")` |
Enum Constant Detail
--------------------
### public [JsonParserType](jsonparsertype) **CHARACTER\_SOURCE**
Parser uses an abstraction that allows it to handle any size file by using a char [] windowing, built on top or Reader. This parser is slower than INDEX\_OVERLAY and CHAR\_BUFFER, but can handle really large files without OOM exceptions. Although slower than other groovy parsers it is as fast as many common JSON parsers. Recommendation is to use this for JSON buffers over 2MB.
### public [JsonParserType](jsonparsertype) **CHAR\_BUFFER**
This is a basic parser with no index overlay. It is wicked fast, but not as fast at the INDEX\_OVERLAY. It should be on average the fastest known JSON parser on the JVM circa Jan 2014. But not as fast as INDEX\_OVERLAY.
### public [JsonParserType](jsonparsertype) **INDEX\_OVERLAY**
Fastest parser, but has pointers (indexes really) to original char buffer. Care must be used if putting parse maps into a long term cache as members of map maybe index overlay objects pointing to original buffer. You can mitigate these risks by using chop and lazy chop. Chop eagerly dices up the buffer so each Value element points to a small copy of the original buffer. Lazy Chop dices up the buffer when a list get or map get is called so if an GPath expression or such is applied. You do not need chop or lazy chop if you are not putting the map into a long term cache. You do not need chop or lazy chop if you are doing object de-serialization. Recommendation is to use this for JSON buffers under 2MB.
### public [JsonParserType](jsonparsertype) **LAX**
LAX mode allows keys with no quotes, keys with single quotes, strings elements in JSON with no quotes or single quotes. It also allows comments //, # and even multi-line /\* comments. LAX is an INDEX\_OVERLAY parser. Its speed is comparable to INDEX\_OVERLAY. It is slightly slower than INDEX\_OVERLAY, but faster than the other options.
groovy [Java] Class JsonSlurper [Java] Class JsonSlurper
========================
* groovy.json.JsonSlurper
```
public class JsonSlurper
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
This has the same interface as the original JsonSlurper written for version 1.8.0, but its implementation has completely changed. It is now up to 20x faster than before, and its speed competes and often substantially exceeds popular common JSON parsers circa Jan, 2014.
JSON slurper parses text or reader content into a data structure of lists and maps. Example usage: ````
def slurper = new groovy.json.JsonSlurper()
def result = slurper.parseText('{"person":{"name":"Guillaume","age":33,"pets":["dog","cat"]}}')
assert result.person.name == "Guillaume"
assert result.person.age == 33
assert result.person.pets.size() == 2
assert result.person.pets[0] == "dog"
assert result.person.pets[1] == "cat"
```` JsonSlurper can use several types of JSON parsers. Please read the documentation for JsonParserType. There are relaxed mode parsers, large file parser, and index overlay parsers. Don't worry, it is all groovy. JsonSlurper will just work, but understanding the different parser types may allow you to drastically improve the performance of your JSON parsing.
Index overlay parsers (INDEX\_OVERLAY and LAX) are the fastest JSON parsers. However they are not the default for a good reason. Index overlay parsers has pointers (indexes really) to original char buffer. Care must be used if putting parsed maps into a long term cache as members of map maybe index overlay objects pointing to original buffer. You can mitigate these risks by using chop and lazy chop properties. Chop eagerly dices up the buffer so each Value element points to a small copy of the original buffer. Lazy Chop dices up the buffer when a list get or map get is called so if an GPath expression or such is applied. You do not need chop or lazy chop if you are NOT putting the map into a long term cache. You do not need chop or lazy chop if you are doing object de-serialization. Recommendation is to use INDEX\_OVERLAY for JSON buffers under 2MB. The maxSizeForInMemory is set to 2MB and any file over 2MB will use a parser designed for large files, which is slower than the INDEX\_OVERLAY, LAX, and CHAR\_BUFFER parsers, but faster than most commonly used JSON parsers on the JVM for most use cases circa January 2014. To enable the INDEX\_OVERLAY parser do this: ````
parser = new JsonSlurper().setType(JsonParserType.INDEX_OVERLAY);
````
**See Also:**
[JsonParserType](jsonparsertype "JsonParserType")
**Since:**
1.8.0
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public int` | `**[getMaxSizeForInMemory](#getMaxSizeForInMemory())**()`Max size before Slurper starts to use windowing buffer parser. |
| | `public [JsonParserType](jsonparsertype)` | `**[getType](#getType())**()`Parser type. |
| | `public boolean` | `**[isCheckDates](#isCheckDates())**()`Determine if slurper will automatically parse strings it recognizes as dates. |
| | `public boolean` | `**[isChop](#isChop())**()`Turns on buffer chopping for index overlay. |
| | `public boolean` | `**[isLazyChop](#isLazyChop())**()`Turns on buffer lazy chopping for index overlay. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.io.Reader))**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader)`Parse a JSON data structure from content from a reader |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.io.InputStream))**([InputStream](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html "InputStream") inputStream)`Parse a JSON data structure from content from an inputStream |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.io.InputStream,%20java.lang.String))**([InputStream](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html "InputStream") inputStream, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)`Parse a JSON data structure from content from an inputStream |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(byte%5B%5D,%20java.lang.String))**(byte[] bytes, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)`Parse a JSON data structure from content from a byte array. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(byte%5B%5D))**(byte[] bytes)`Parse a JSON data structure from content from a byte array. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(char%5B%5D))**(char[] chars)`Parse a JSON data structure from content from a char array. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.nio.file.Path))**([Path](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html "Path") path)`Parse a JSON data structure from content within a given Path. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.nio.file.Path,%20java.lang.String))**([Path](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html "Path") path, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)`Parse a JSON data structure from content within a given Path. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.io.File))**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file)`Parse a JSON data structure from content within a given File. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.io.File,%20java.lang.String))**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)`Parse a JSON data structure from content within a given File. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.net.URL))**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url)`Parse a JSON data structure from content at a given URL. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.net.URL,%20java.util.Map))**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params)`Parse a JSON data structure from content at a given URL. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(Map,%20java.net.URL))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), ?> params, [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url)`Parse a JSON data structure from content at a given URL. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.net.URL,%20java.lang.String))**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)`Parse a JSON data structure from content at a given URL. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.net.URL,%20java.util.Map,%20java.lang.String))**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)`Parse a JSON data structure from content at a given URL. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.util.Map,%20java.net.URL,%20java.lang.String))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)`Parse a JSON data structure from content at a given URL. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parseText](#parseText(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text)`Parse a text representation of a JSON data structure |
| | `public [JsonSlurper](jsonslurper)` | `**[setCheckDates](#setCheckDates(boolean))**(boolean checkDates)`Determine if slurper will automatically parse strings it recognizes as dates. |
| | `public [JsonSlurper](jsonslurper)` | `**[setChop](#setChop(boolean))**(boolean chop)`Turns on buffer chopping for index overlay. |
| | `public [JsonSlurper](jsonslurper)` | `**[setLazyChop](#setLazyChop(boolean))**(boolean lazyChop)`Turns on buffer lazy chopping for index overlay. |
| | `public [JsonSlurper](jsonslurper)` | `**[setMaxSizeForInMemory](#setMaxSizeForInMemory(int))**(int maxSizeForInMemory)`Max size before Slurper starts to use windowing buffer parser. |
| | `public [JsonSlurper](jsonslurper)` | `**[setType](#setType(groovy.json.JsonParserType))**([JsonParserType](jsonparsertype) type)`Parser type. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### public int **getMaxSizeForInMemory**()
Max size before Slurper starts to use windowing buffer parser.
**Returns:**
size of file/buffer
**Since:**
2.3
### public [JsonParserType](jsonparsertype) **getType**()
Parser type.
**Since:**
2.3
**See Also:**
[JsonParserType](jsonparsertype "JsonParserType")
**Returns:**
type
### public boolean **isCheckDates**()
Determine if slurper will automatically parse strings it recognizes as dates. Index overlay only.
**Returns:**
on or off
**Since:**
2.3
### public boolean **isChop**()
Turns on buffer chopping for index overlay.
**Since:**
2.3
**See Also:**
[JsonParserType](jsonparsertype "JsonParserType")
**Returns:**
chop on or off
### public boolean **isLazyChop**()
Turns on buffer lazy chopping for index overlay.
**See Also:**
[JsonParserType](jsonparsertype "JsonParserType")
**Returns:**
on or off
**Since:**
2.3
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader)
Parse a JSON data structure from content from a reader
**Parameters:**
`reader` - reader over a JSON content
**Returns:**
a data structure of lists and maps
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([InputStream](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html "InputStream") inputStream)
Parse a JSON data structure from content from an inputStream
**Parameters:**
`inputStream` - stream over a JSON content
**Returns:**
a data structure of lists and maps
**Since:**
2.3
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([InputStream](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html "InputStream") inputStream, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)
Parse a JSON data structure from content from an inputStream
**Parameters:**
`inputStream` - stream over a JSON content
`charset` - charset
**Returns:**
a data structure of lists and maps
**Since:**
2.3
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**(byte[] bytes, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)
Parse a JSON data structure from content from a byte array.
**Parameters:**
`bytes` - buffer of JSON content
`charset` - charset
**Returns:**
a data structure of lists and maps
**Since:**
2.3
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**(byte[] bytes)
Parse a JSON data structure from content from a byte array.
**Parameters:**
`bytes` - buffer of JSON content
**Returns:**
a data structure of lists and maps
**Since:**
2.3
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**(char[] chars)
Parse a JSON data structure from content from a char array.
**Parameters:**
`chars` - buffer of JSON content
**Returns:**
a data structure of lists and maps
**Since:**
2.3
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([Path](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html "Path") path)
Parse a JSON data structure from content within a given Path.
**Parameters:**
`path` - [Path](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html "Path") containing JSON content
**Returns:**
a data structure of lists and maps
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([Path](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html "Path") path, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)
Parse a JSON data structure from content within a given Path.
**Parameters:**
`path` - [Path](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html "Path") containing JSON content
`charset` - the charset for this File
**Returns:**
a data structure of lists and maps
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file)
Parse a JSON data structure from content within a given File.
**Parameters:**
`file` - File containing JSON content
**Returns:**
a data structure of lists and maps
**Since:**
2.2.0
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)
Parse a JSON data structure from content within a given File.
**Parameters:**
`file` - File containing JSON content
`charset` - the charset for this File
**Returns:**
a data structure of lists and maps
**Since:**
2.2.0
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url)
Parse a JSON data structure from content at a given URL.
**Parameters:**
`url` - URL containing JSON content
**Returns:**
a data structure of lists and maps
**Since:**
2.2.0
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params)
Parse a JSON data structure from content at a given URL.
**Parameters:**
`url` - URL containing JSON content
`params` - connection parameters
**Returns:**
a data structure of lists and maps
**Since:**
2.2.0
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**(@[NamedParam](../transform/namedparam "NamedParam")(value = "connectTimeout", type = Integer.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "readTimeout", type = Integer.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "useCaches", type = Boolean.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "allowUserInteraction", type = Boolean.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "requestProperties", type = Map.class) [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), ?> params, [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url)
Parse a JSON data structure from content at a given URL. Convenience variant when using Groovy named parameters for the connection params.
**Parameters:**
`params` - connection parameters
`url` - URL containing JSON content
**Returns:**
a data structure of lists and maps
**Since:**
2.2.0
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)
Parse a JSON data structure from content at a given URL.
**Parameters:**
`url` - URL containing JSON content
`charset` - the charset for this File
**Returns:**
a data structure of lists and maps
**Since:**
2.2.0
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)
Parse a JSON data structure from content at a given URL.
**Parameters:**
`url` - URL containing JSON content
`params` - connection parameters
`charset` - the charset for this File
**Returns:**
a data structure of lists and maps
**Since:**
2.2.0
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") charset)
Parse a JSON data structure from content at a given URL. Convenience variant when using Groovy named parameters for the connection params.
**Parameters:**
`params` - connection parameters
`url` - URL containing JSON content
`charset` - the charset for this File
**Returns:**
a data structure of lists and maps
**Since:**
2.2.0
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parseText**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text)
Parse a text representation of a JSON data structure
**Parameters:**
`text` - JSON text to parse
**Returns:**
a data structure of lists and maps
### public [JsonSlurper](jsonslurper) **setCheckDates**(boolean checkDates)
Determine if slurper will automatically parse strings it recognizes as dates. Index overlay only.
**Returns:**
on or off
**Since:**
2.3
### public [JsonSlurper](jsonslurper) **setChop**(boolean chop)
Turns on buffer chopping for index overlay.
**Since:**
2.3
**See Also:**
[JsonParserType](jsonparsertype "JsonParserType")
**Returns:**
JsonSlurper
### public [JsonSlurper](jsonslurper) **setLazyChop**(boolean lazyChop)
Turns on buffer lazy chopping for index overlay.
**See Also:**
[JsonParserType](jsonparsertype "JsonParserType")
**Returns:**
JsonSlurper
**Since:**
2.3
### public [JsonSlurper](jsonslurper) **setMaxSizeForInMemory**(int maxSizeForInMemory)
Max size before Slurper starts to use windowing buffer parser.
**Since:**
2.3
**Returns:**
JsonSlurper
### public [JsonSlurper](jsonslurper) **setType**([JsonParserType](jsonparsertype) type)
Parser type.
**Since:**
2.3
**See Also:**
[JsonParserType](jsonparsertype "JsonParserType")
**Returns:**
JsonSlurper
| programming_docs |
groovy [Java] Class DefaultPropertyWriter [Java] Class DefaultPropertyWriter
==================================
* groovy.beans.DefaultPropertyWriter
All Implemented Interfaces and Traits: [PropertyWriter](propertywriter)
```
public class DefaultPropertyWriter
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [PropertyWriter](propertywriter)
```
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [PropertyWriter](propertywriter)**` | `[INSTANCE](#INSTANCE)` | |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[write](#write(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") owner, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### public static final [PropertyWriter](propertywriter) **INSTANCE**
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **write**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") owner, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
groovy [Java] Class DefaultPropertyReader [Java] Class DefaultPropertyReader
==================================
* groovy.beans.DefaultPropertyReader
All Implemented Interfaces and Traits: [PropertyReader](propertyreader)
```
public class DefaultPropertyReader
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [PropertyReader](propertyreader)
```
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [PropertyReader](propertyreader)**` | `[INSTANCE](#INSTANCE)` | |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[read](#read(java.lang.Object,%20java.lang.String))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") owner, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### public static final [PropertyReader](propertyreader) **INSTANCE**
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **read**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") owner, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName)
groovy [Groovy] Annotation Type ListenerList [Groovy] Annotation Type ListenerList
=====================================
* groovy.beans.ListenerList
All Implemented Interfaces and Traits: [Annotation](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html "Annotation")
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(value: RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")(value: ElementType.FIELD)
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")(value: groovy.beans.ListenerListASTTransformation)
@interface ListenerList
```
This annotation adds Java-style listener support to a class based on an annotated Collection-property.
For any given Collection property, several methods will be written into the enclosing class during the compile phase. These changes are visible from Java or other languages. The List is intended to hold listeners of some sort, and the methods addListener, removeListener, and getListeners are all added to the class. The actual methods names depend on the generic type of the collection.
Given the following example:
```
class MyClass {
@groovy.beans.ListenerList
List<java.awt.event.ActionListener> listeners
}
```
The following code is generated:
```
public class MyClass extends java.lang.Object {
@groovy.beans.ListenerList
private java.util.List<java.awt.event.ActionListener> listeners
public void addActionListener(java.awt.event.ActionListener listener) {
if ( listener == null) {
return null
}
if ( listeners == null) {
listeners = []
}
listeners.add(listener)
}
public void removeActionListener(java.awt.event.ActionListener listener) {
if ( listener == null) {
return null
}
if ( listeners == null) {
listeners = []
}
listeners.remove(listener)
}
public java.awt.event.ActionListener[] getActionListeners() {
java.lang.Object __result = []
if ( listeners != null) {
__result.addAll(listeners)
}
return (( __result ) as java.awt.event.ActionListener[])
}
public void fireActionPerformed(java.awt.event.ActionEvent param0) {
if ( listeners != null) {
def __list = new java.util.ArrayList(listeners)
for (java.lang.Object listener : __list ) {
listener.actionPerformed(param0)
}
}
}
}
```
A fire method is created for each public method in the target class. In this case, ActionListener only has one method. For a four method interface, four fire methods would be created. The annotation can take the following parameters:
```
name = a suffix for creating the add, remove, and get methods.
Default: Name of the listener type
In the above example, if name is set to MyListener, then the class will have an addMyListener,
removeMyListener, and getMyListeners methods.
synchronize = Whether or not the methods created should be synchronized at the method level.
Default: false
```
**Compilation Errors** - Using this annotation incorrectly results in compilation errors rather than runtime errors. A list of potential problems includes:
* This annotation can only be applied to a field of type Collection
* The annotated Collection field must have a generic type
* The annotated Collection field must not have a generic wildcard declared
* The generated methods must not already exist
**See Also:**
[ListenerListASTTransformation](listenerlistasttransformation "ListenerListASTTransformation")
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `abstract [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[name](#name())**()`A suffix for creating the add, remove, and get methods defaulting to the name of the listener type, e.g. if name is set to MyListener, then the class will have addMyListener, removeMyListener, and getMyListeners methods. |
| | `abstract boolean` | `**[synchronize](#synchronize())**()`Whether or not the methods created should be synchronized at the method level. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### abstract [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **name**()
A suffix for creating the add, remove, and get methods defaulting to the name of the listener type, e.g. if name is set to MyListener, then the class will have addMyListener, removeMyListener, and getMyListeners methods.
### abstract boolean **synchronize**()
Whether or not the methods created should be synchronized at the method level.
groovy [Java] Annotation Type Vetoable [Java] Annotation Type Vetoable
===============================
* groovy.beans.Vetoable
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.FIELD, ElementType.TYPE})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("groovy.beans.VetoableASTTransformation")
public @interface Vetoable
```
Annotates a groovy property or a class.
When annotating a property it indicates that the property should be a constrained property according to the JavaBeans spec, subject to listeners vetoing the property change.
When annotating a class it indicates that all groovy properties in that class should be bound as though each property had the annotation (even if it already has it explicitly).
It is a compilation error to place this annotation on a field (that is not a property, i.e. has scope visibility modifiers).
If a property with a user defined setter method is annotated the code block is wrapped with the needed code to fire off the event.
Here is a simple example of how to annotate a class with Vetoable:
```
@groovy.beans.Vetoable
class Person {
String firstName
def zipCode
}
```
This code is transformed by the compiler into something resembling the following snippet. Notice the difference between a String and a def/Object property:
```
public class Person implements groovy.lang.GroovyObject {
private java.lang.String firstName
private java.lang.Object zipCode
final private java.beans.VetoableChangeSupport this$vetoableChangeSupport
public Person() {
this$vetoableChangeSupport = new java.beans.VetoableChangeSupport(this)
}
public void addVetoableChangeListener(java.beans.VetoableChangeListener listener) {
this$vetoableChangeSupport.addVetoableChangeListener(listener)
}
public void addVetoableChangeListener(java.lang.String name, java.beans.VetoableChangeListener listener) {
this$vetoableChangeSupport.addVetoableChangeListener(name, listener)
}
public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener) {
this$vetoableChangeSupport.removeVetoableChangeListener(listener)
}
public void removeVetoableChangeListener(java.lang.String name, java.beans.VetoableChangeListener listener) {
this$vetoableChangeSupport.removeVetoableChangeListener(name, listener)
}
public void fireVetoableChange(java.lang.String name, java.lang.Object oldValue, java.lang.Object newValue) throws java.beans.PropertyVetoException {
this$vetoableChangeSupport.fireVetoableChange(name, oldValue, newValue)
}
public java.beans.VetoableChangeListener[] getVetoableChangeListeners() {
return this$vetoableChangeSupport.getVetoableChangeListeners()
}
public java.beans.VetoableChangeListener[] getVetoableChangeListeners(java.lang.String name) {
return this$vetoableChangeSupport.getVetoableChangeListeners(name)
}
public void setFirstName(java.lang.String value) throws java.beans.PropertyVetoException {
this.fireVetoableChange('firstName', firstName, value)
firstName = value
}
public void setZipCode(java.lang.Object value) throws java.beans.PropertyVetoException {
this.fireVetoableChange('zipCode', zipCode, value)
zipCode = value
}
}
```
**See Also:**
[VetoableASTTransformation](vetoableasttransformation "VetoableASTTransformation")
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
groovy [Java] Interface PropertyAccessor [Java] Interface PropertyAccessor
=================================
* groovy.beans.PropertyWriter
All Superinterfaces:
[PropertyReader](propertyreader), [PropertyWriter](propertywriter)
```
public interface PropertyAccessor
extends [PropertyReader](propertyreader), [PropertyWriter](propertywriter)
```
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `interface [PropertyReader](propertyreader)` | `[read](propertyreader#read(java.lang.Object,%20java.lang.String))` |
| `interface [PropertyWriter](propertywriter)` | `[write](propertywriter#write(java.lang.Object,%20java.lang.String,%20java.lang.Object))` |
groovy [Java] Interface PropertyReader [Java] Interface PropertyReader
===============================
```
public interface PropertyReader
```
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[read](#read(java.lang.Object,%20java.lang.String))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") owner, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName)` |
Method Detail
-------------
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **read**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") owner, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName)
groovy [Java] Interface PropertyWriter [Java] Interface PropertyWriter
===============================
```
public interface PropertyWriter
```
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[write](#write(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") owner, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
Method Detail
-------------
### public void **write**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") owner, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
groovy [Java] Annotation Type Bindable [Java] Annotation Type Bindable
===============================
* groovy.beans.Bindable
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.FIELD, ElementType.TYPE})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("groovy.beans.BindableASTTransformation")
public @interface Bindable
```
Annotates a groovy property or a class. When annotating a property it indicates that the property should be a bound property according to the JavaBeans spec, announcing to listeners that the value has changed.
When annotating a class it indicates that all groovy properties in that class should be bound as though each property had the annotation (even if it already has it explicitly).
It is a compilation error to place this annotation on a field (that is not a property, i.e. has scope visibility modifiers).
If a property with a user defined setter method is annotated the code block is wrapped with the needed code to fire off the event.
The following example shows how you can use this annotation on fields of a class:
```
class Person {
@groovy.beans.Bindable
String firstName
@groovy.beans.Bindable
def zipCode
}
```
The above example will generate code that is similar to the next snippet. Notice the difference between a String property and a def/Object property:
```
public class Person {
@groovy.beans.Bindable
private java.lang.String firstName
@groovy.beans.Bindable
private java.lang.Object zipCode
final private java.beans.PropertyChangeSupport this$propertyChangeSupport
public Person() {
this$propertyChangeSupport = new java.beans.PropertyChangeSupport(this)
}
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener) {
this$propertyChangeSupport.addPropertyChangeListener(listener)
}
public void addPropertyChangeListener(java.lang.String name, java.beans.PropertyChangeListener listener) {
this$propertyChangeSupport.addPropertyChangeListener(name, listener)
}
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener) {
this$propertyChangeSupport.removePropertyChangeListener(listener)
}
public void removePropertyChangeListener(java.lang.String name, java.beans.PropertyChangeListener listener) {
this$propertyChangeSupport.removePropertyChangeListener(name, listener)
}
public void firePropertyChange(java.lang.String name, java.lang.Object oldValue, java.lang.Object newValue) {
this$propertyChangeSupport.firePropertyChange(name, oldValue, newValue)
}
public java.beans.PropertyChangeListener[] getPropertyChangeListeners() {
return this$propertyChangeSupport.getPropertyChangeListeners()
}
public java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String name) {
return this$propertyChangeSupport.getPropertyChangeListeners(name)
}
public void setFirstName(java.lang.String value) {
this.firePropertyChange('firstName', firstName, firstName = value )
}
public void setZipCode(java.lang.Object value) {
this.firePropertyChange('zipCode', zipCode, zipCode = value )
}
}
```
**See Also:**
[BindableASTTransformation](bindableasttransformation "BindableASTTransformation")
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
| programming_docs |
groovy [Java] Class BindableASTTransformation [Java] Class BindableASTTransformation
======================================
* groovy.beans.BindableASTTransformation
All Implemented Interfaces and Traits:
[ASTTransformation](../../org/codehaus/groovy/transform/asttransformation), org.objectweb.asm.Opcodes
```
@[GroovyASTTransformation](../../org/codehaus/groovy/transform/groovyasttransformation "GroovyASTTransformation")(phase = CompilePhase.CANONICALIZATION)
public class BindableASTTransformation
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [ASTTransformation](../../org/codehaus/groovy/transform/asttransformation), org.objectweb.asm.Opcodes
```
Handles generation of code for the `@Bindable` annotation when `@Vetoable` is not present.
Generally, it adds (if needed) a PropertyChangeSupport field and the needed add/removePropertyChangeListener methods to support the listeners.
It also generates the setter and wires the setter through the PropertyChangeSupport.
If a [Vetoable](vetoable "Vetoable") annotation is detected it does nothing and lets the [VetoableASTTransformation](vetoableasttransformation "VetoableASTTransformation") handle all the changes.
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**protected static [ClassNode](../../org/codehaus/groovy/ast/classnode)**` | `[boundClassNode](#boundClassNode)` | |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `protected void` | `**[addPropertyChangeSupport](#addPropertyChangeSupport(org.codehaus.groovy.ast.ClassNode))**([ClassNode](../../org/codehaus/groovy/ast/classnode) declaringClass)`Adds the necessary field and methods to support property change support. |
| | `protected [Statement](../../org/codehaus/groovy/ast/stmt/statement)` | `**[createBindableStatement](#createBindableStatement(org.codehaus.groovy.ast.PropertyNode,%20org.codehaus.groovy.ast.expr.Expression))**([PropertyNode](../../org/codehaus/groovy/ast/propertynode) propertyNode, [Expression](../../org/codehaus/groovy/ast/expr/expression) fieldExpression)`Creates a statement body similar to: `this.firePropertyChange("field", field, field = value)` |
| | `protected void` | `**[createSetterMethod](#createSetterMethod(org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.PropertyNode,%20java.lang.String,%20org.codehaus.groovy.ast.stmt.Statement))**([ClassNode](../../org/codehaus/groovy/ast/classnode) declaringClass, [PropertyNode](../../org/codehaus/groovy/ast/propertynode) propertyNode, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") setterName, [Statement](../../org/codehaus/groovy/ast/stmt/statement) setterBlock)`Creates a setter method with the given body. |
| | `public static boolean` | `**[hasBindableAnnotation](#hasBindableAnnotation(org.codehaus.groovy.ast.AnnotatedNode))**([AnnotatedNode](../../org/codehaus/groovy/ast/annotatednode) node)`Convenience method to see if an annotated node is `@Bindable`. |
| | `protected boolean` | `**[needsPropertyChangeSupport](#needsPropertyChangeSupport(org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.control.SourceUnit))**([ClassNode](../../org/codehaus/groovy/ast/classnode) declaringClass, [SourceUnit](../../org/codehaus/groovy/control/sourceunit) sourceUnit)`Snoops through the declaring class and all parents looking for methods `void addPropertyChangeListener(PropertyChangeListener)`, `void removePropertyChangeListener(PropertyChangeListener)`, and `void firePropertyChange(String, Object, Object)`. |
| | `public void` | `**[visit](#visit(org.codehaus.groovy.ast.ASTNode,%20org.codehaus.groovy.control.SourceUnit))**([ASTNode](../../org/codehaus/groovy/ast/astnode)[] nodes, [SourceUnit](../../org/codehaus/groovy/control/sourceunit) source)`Handles the bulk of the processing, mostly delegating to other methods. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### protected static final [ClassNode](../../org/codehaus/groovy/ast/classnode) **boundClassNode**
Method Detail
-------------
### protected void **addPropertyChangeSupport**([ClassNode](../../org/codehaus/groovy/ast/classnode) declaringClass)
Adds the necessary field and methods to support property change support.
Adds a new field:
```
protected final java.beans.PropertyChangeSupport this$PropertyChangeSupport = new java.beans.PropertyChangeSupport(this)"
```
Also adds support methods:
```
public void addPropertyChangeListener(java.beans.PropertyChangeListener)
public void addPropertyChangeListener(String, java.beans.PropertyChangeListener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(String, java.beans.PropertyChangeListener)
public java.beans.PropertyChangeListener[] getPropertyChangeListeners()
```
**Parameters:**
`declaringClass` - the class to which we add the support field and methods
### protected [Statement](../../org/codehaus/groovy/ast/stmt/statement) **createBindableStatement**([PropertyNode](../../org/codehaus/groovy/ast/propertynode) propertyNode, [Expression](../../org/codehaus/groovy/ast/expr/expression) fieldExpression)
Creates a statement body similar to: `this.firePropertyChange("field", field, field = value)`
**Parameters:**
`propertyNode` - the field node for the property
`fieldExpression` - a field expression for setting the property value
**Returns:**
the created statement
### protected void **createSetterMethod**([ClassNode](../../org/codehaus/groovy/ast/classnode) declaringClass, [PropertyNode](../../org/codehaus/groovy/ast/propertynode) propertyNode, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") setterName, [Statement](../../org/codehaus/groovy/ast/stmt/statement) setterBlock)
Creates a setter method with the given body.
**Parameters:**
`declaringClass` - the class to which we will add the setter
`propertyNode` - the field to back the setter
`setterName` - the name of the setter
`setterBlock` - the statement representing the setter block
### public static boolean **hasBindableAnnotation**([AnnotatedNode](../../org/codehaus/groovy/ast/annotatednode) node)
Convenience method to see if an annotated node is `@Bindable`.
**Parameters:**
`node` - the node to check
**Returns:**
true if the node is bindable
### protected boolean **needsPropertyChangeSupport**([ClassNode](../../org/codehaus/groovy/ast/classnode) declaringClass, [SourceUnit](../../org/codehaus/groovy/control/sourceunit) sourceUnit)
Snoops through the declaring class and all parents looking for methods `void addPropertyChangeListener(PropertyChangeListener)`, `void removePropertyChangeListener(PropertyChangeListener)`, and `void firePropertyChange(String, Object, Object)`. If any are defined all must be defined or a compilation error results.
**Parameters:**
`declaringClass` - the class to search
`sourceUnit` - the source unit, for error reporting. `@NotNull`.
**Returns:**
true if property change support should be added
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **visit**([ASTNode](../../org/codehaus/groovy/ast/astnode)[] nodes, [SourceUnit](../../org/codehaus/groovy/control/sourceunit) source)
Handles the bulk of the processing, mostly delegating to other methods.
**Parameters:**
`nodes` - the ast nodes
`source` - the source unit for the nodes
groovy [Java] Class VetoableASTTransformation [Java] Class VetoableASTTransformation
======================================
* groovy.beans.VetoableASTTransformation
```
@[GroovyASTTransformation](../../org/codehaus/groovy/transform/groovyasttransformation "GroovyASTTransformation")(phase = CompilePhase.CANONICALIZATION)
public class VetoableASTTransformation
extends [BindableASTTransformation](bindableasttransformation)
```
Handles generation of code for the `@Vetoable` annotation, and `@Bindable` if also present.
Generally, it adds (if needed) a VetoableChangeSupport field and the needed add/removeVetoableChangeListener methods to support the listeners.
It also generates the setter and wires the setter through the VetoableChangeSupport.
If a [Bindable](bindable "Bindable") annotation is detected it also adds support similar to what [BindableASTTransformation](bindableasttransformation "BindableASTTransformation") would do.
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**protected static [ClassNode](../../org/codehaus/groovy/ast/classnode)**` | `[constrainedClassNode](#constrainedClassNode)` | |
Inherited fields
| Fields inherited from class | Fields |
| **`class [BindableASTTransformation](bindableasttransformation)`** | `[boundClassNode](bindableasttransformation#boundClassNode)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `protected void` | `**[addVetoableChangeSupport](#addVetoableChangeSupport(org.codehaus.groovy.ast.ClassNode))**([ClassNode](../../org/codehaus/groovy/ast/classnode) declaringClass)`Adds the necessary field and methods to support vetoable change support. |
| | `protected [Statement](../../org/codehaus/groovy/ast/stmt/statement)` | `**[createConstrainedStatement](#createConstrainedStatement(org.codehaus.groovy.ast.PropertyNode,%20org.codehaus.groovy.ast.expr.Expression))**([PropertyNode](../../org/codehaus/groovy/ast/propertynode) propertyNode, [Expression](../../org/codehaus/groovy/ast/expr/expression) fieldExpression)`Creates a statement body similar to: `this.fireVetoableChange("field", field, field = value)` |
| | `protected [Statement](../../org/codehaus/groovy/ast/stmt/statement)` | `**[createSetStatement](#createSetStatement(org.codehaus.groovy.ast.expr.Expression))**([Expression](../../org/codehaus/groovy/ast/expr/expression) fieldExpression)`Creates a statement body similar to: `field = value`. |
| | `protected void` | `**[createSetterMethod](#createSetterMethod(org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.PropertyNode,%20java.lang.String,%20org.codehaus.groovy.ast.stmt.Statement))**([ClassNode](../../org/codehaus/groovy/ast/classnode) declaringClass, [PropertyNode](../../org/codehaus/groovy/ast/propertynode) propertyNode, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") setterName, [Statement](../../org/codehaus/groovy/ast/stmt/statement) setterBlock)`Creates a setter method with the given body. |
| | `public static boolean` | `**[hasVetoableAnnotation](#hasVetoableAnnotation(org.codehaus.groovy.ast.AnnotatedNode))**([AnnotatedNode](../../org/codehaus/groovy/ast/annotatednode) node)`Convenience method to see if an annotated node is `@Vetoable`. |
| | `protected boolean` | `**[needsVetoableChangeSupport](#needsVetoableChangeSupport(org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.control.SourceUnit))**([ClassNode](../../org/codehaus/groovy/ast/classnode) declaringClass, [SourceUnit](../../org/codehaus/groovy/control/sourceunit) sourceUnit)`Snoops through the declaring class and all parents looking for a field of type VetoableChangeSupport. |
| | `public void` | `**[visit](#visit(org.codehaus.groovy.ast.ASTNode,%20org.codehaus.groovy.control.SourceUnit))**([ASTNode](../../org/codehaus/groovy/ast/astnode)[] nodes, [SourceUnit](../../org/codehaus/groovy/control/sourceunit) source)`Handles the bulk of the processing, mostly delegating to other methods. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [BindableASTTransformation](bindableasttransformation)` | `[addPropertyChangeSupport](bindableasttransformation#addPropertyChangeSupport(org.codehaus.groovy.ast.ClassNode)), [createBindableStatement](bindableasttransformation#createBindableStatement(org.codehaus.groovy.ast.PropertyNode,%20org.codehaus.groovy.ast.expr.Expression)), [createSetterMethod](bindableasttransformation#createSetterMethod(org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.PropertyNode,%20java.lang.String,%20org.codehaus.groovy.ast.stmt.Statement)), [hasBindableAnnotation](bindableasttransformation#hasBindableAnnotation(org.codehaus.groovy.ast.AnnotatedNode)), [needsPropertyChangeSupport](bindableasttransformation#needsPropertyChangeSupport(org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.control.SourceUnit)), [visit](bindableasttransformation#visit(org.codehaus.groovy.ast.ASTNode,%20org.codehaus.groovy.control.SourceUnit))` |
Field Detail
------------
### protected static final [ClassNode](../../org/codehaus/groovy/ast/classnode) **constrainedClassNode**
Method Detail
-------------
### protected void **addVetoableChangeSupport**([ClassNode](../../org/codehaus/groovy/ast/classnode) declaringClass)
Adds the necessary field and methods to support vetoable change support.
Adds a new field: `"protected final java.beans.VetoableChangeSupport this$vetoableChangeSupport = new java.beans.VetoableChangeSupport(this)"`
Also adds support methods: `public void addVetoableChangeListener(java.beans.VetoableChangeListener)` `public void addVetoableChangeListener(String, java.beans.VetoableChangeListener)` `public void removeVetoableChangeListener(java.beans.VetoableChangeListener)` `public void removeVetoableChangeListener(String, java.beans.VetoableChangeListener)` `public java.beans.VetoableChangeListener[] getVetoableChangeListeners()`
**Parameters:**
`declaringClass` - the class to which we add the support field and methods
### protected [Statement](../../org/codehaus/groovy/ast/stmt/statement) **createConstrainedStatement**([PropertyNode](../../org/codehaus/groovy/ast/propertynode) propertyNode, [Expression](../../org/codehaus/groovy/ast/expr/expression) fieldExpression)
Creates a statement body similar to: `this.fireVetoableChange("field", field, field = value)`
**Parameters:**
`propertyNode` - the field node for the property
`fieldExpression` - a field expression for setting the property value
**Returns:**
the created statement
### protected [Statement](../../org/codehaus/groovy/ast/stmt/statement) **createSetStatement**([Expression](../../org/codehaus/groovy/ast/expr/expression) fieldExpression)
Creates a statement body similar to: `field = value`.
Used when the field is not also `@Bindable`.
**Parameters:**
`fieldExpression` - a field expression for setting the property value
**Returns:**
the created statement
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **createSetterMethod**([ClassNode](../../org/codehaus/groovy/ast/classnode) declaringClass, [PropertyNode](../../org/codehaus/groovy/ast/propertynode) propertyNode, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") setterName, [Statement](../../org/codehaus/groovy/ast/stmt/statement) setterBlock)
Creates a setter method with the given body.
This differs from normal setters in that we need to add a declared exception java.beans.PropertyVetoException
**Parameters:**
`declaringClass` - the class to which we will add the setter
`propertyNode` - the field to back the setter
`setterName` - the name of the setter
`setterBlock` - the statement representing the setter block
### public static boolean **hasVetoableAnnotation**([AnnotatedNode](../../org/codehaus/groovy/ast/annotatednode) node)
Convenience method to see if an annotated node is `@Vetoable`.
**Parameters:**
`node` - the node to check
**Returns:**
true if the node is constrained
### protected boolean **needsVetoableChangeSupport**([ClassNode](../../org/codehaus/groovy/ast/classnode) declaringClass, [SourceUnit](../../org/codehaus/groovy/control/sourceunit) sourceUnit)
Snoops through the declaring class and all parents looking for a field of type VetoableChangeSupport. Remembers the field and returns false if found otherwise returns true to indicate that such support should be added.
**Parameters:**
`declaringClass` - the class to search
**Returns:**
true if vetoable change support should be added
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **visit**([ASTNode](../../org/codehaus/groovy/ast/astnode)[] nodes, [SourceUnit](../../org/codehaus/groovy/control/sourceunit) source)
Handles the bulk of the processing, mostly delegating to other methods.
**Parameters:**
`nodes` - the AST nodes
`source` - the source unit for the nodes
groovy [Groovy] Class ListenerListASTTransformation [Groovy] Class ListenerListASTTransformation
============================================
* groovy.beans.ListenerListASTTransformation
All Implemented Interfaces and Traits:
[ASTTransformation](../../org/codehaus/groovy/transform/asttransformation), org.objectweb.asm.Opcodes
```
@[GroovyASTTransformation](../../org/codehaus/groovy/transform/groovyasttransformation "GroovyASTTransformation")(phase: CompilePhase.CANONICALIZATION)
@[SuppressWarnings](https://docs.oracle.com/javase/8/docs/api/java/lang/SuppressWarnings.html "SuppressWarnings")(value: ParameterCount)
class ListenerListASTTransformation
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [ASTTransformation](../../org/codehaus/groovy/transform/asttransformation), org.objectweb.asm.Opcodes
```
Handles generation of code for the `@ListenerList` annotation.
Generally, it adds the needed add<Listener>, remove<Listener> and get<Listener>s methods to support the Java Beans API.
Additionally it adds corresponding fire<Event> methods.
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[ListenerListASTTransformation](#ListenerListASTTransformation())**()` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `void` | `**[addAddListener](#addAddListener(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.ast.AnnotationNode,%20org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.FieldNode,%20org.codehaus.groovy.ast.ClassNode,%20java.lang.String,%20java.lang.Object))**([SourceUnit](../../org/codehaus/groovy/control/sourceunit) source, [AnnotationNode](../../org/codehaus/groovy/ast/annotationnode) node, [ClassNode](../../org/codehaus/groovy/ast/classnode) declaringClass, [FieldNode](../../org/codehaus/groovy/ast/fieldnode) field, [ClassNode](../../org/codehaus/groovy/ast/classnode) listener, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") synchronize)`Adds the add<Listener> method like:
```
synchronized void add${name.capitalize}(${listener.name} listener) {
if (listener == null)
return
if (${field.name} == null)
${field.name} = []
${field.name}.add(listener)
}
```
|
| | `void` | `**[addFireMethods](#addFireMethods(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.ast.AnnotationNode,%20org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.FieldNode,%20org.codehaus.groovy.ast.GenericsType,%20boolean,%20org.codehaus.groovy.ast.MethodNode))**([SourceUnit](../../org/codehaus/groovy/control/sourceunit) source, [AnnotationNode](../../org/codehaus/groovy/ast/annotationnode) node, [ClassNode](../../org/codehaus/groovy/ast/classnode) declaringClass, [FieldNode](../../org/codehaus/groovy/ast/fieldnode) field, [GenericsType](../../org/codehaus/groovy/ast/genericstype)[] types, boolean synchronize, [MethodNode](../../org/codehaus/groovy/ast/methodnode) method)`Adds the fire<Event> methods like:
```
void fire${fireMethod.capitalize()}(${parameterList.join(', ')}) {
if (${field.name} !
```
|
| | `void` | `**[addGetListeners](#addGetListeners(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.ast.AnnotationNode,%20org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.FieldNode,%20org.codehaus.groovy.ast.ClassNode,%20java.lang.String,%20java.lang.Object))**([SourceUnit](../../org/codehaus/groovy/control/sourceunit) source, [AnnotationNode](../../org/codehaus/groovy/ast/annotationnode) node, [ClassNode](../../org/codehaus/groovy/ast/classnode) declaringClass, [FieldNode](../../org/codehaus/groovy/ast/fieldnode) field, [ClassNode](../../org/codehaus/groovy/ast/classnode) listener, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") synchronize)`Adds the get<Listener>s method like:
```
synchronized ${name.capitalize}[] get${name.capitalize}s() {
def __result = []
if (${field.name} !
```
|
| | `void` | `**[addRemoveListener](#addRemoveListener(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.ast.AnnotationNode,%20org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.FieldNode,%20org.codehaus.groovy.ast.ClassNode,%20java.lang.String,%20java.lang.Object))**([SourceUnit](../../org/codehaus/groovy/control/sourceunit) source, [AnnotationNode](../../org/codehaus/groovy/ast/annotationnode) node, [ClassNode](../../org/codehaus/groovy/ast/classnode) declaringClass, [FieldNode](../../org/codehaus/groovy/ast/fieldnode) field, [ClassNode](../../org/codehaus/groovy/ast/classnode) listener, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") synchronize)`Adds the remove<Listener> method like:
```
synchronized void remove${name.capitalize}(${listener.name} listener) {
if (listener == null)
return
if (${field.name} == null)
${field.name} = []
${field.name}.remove(listener)
}
```
|
| | `void` | `**[visit](#visit(org.codehaus.groovy.ast.ASTNode,%20org.codehaus.groovy.control.SourceUnit))**([ASTNode](../../org/codehaus/groovy/ast/astnode)[] nodes, [SourceUnit](../../org/codehaus/groovy/control/sourceunit) source)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
###
**ListenerListASTTransformation**()
Method Detail
-------------
### void **addAddListener**([SourceUnit](../../org/codehaus/groovy/control/sourceunit) source, [AnnotationNode](../../org/codehaus/groovy/ast/annotationnode) node, [ClassNode](../../org/codehaus/groovy/ast/classnode) declaringClass, [FieldNode](../../org/codehaus/groovy/ast/fieldnode) field, [ClassNode](../../org/codehaus/groovy/ast/classnode) listener, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") synchronize)
Adds the add<Listener> method like:
```
synchronized void add${name.capitalize}(${listener.name} listener) {
if (listener == null)
return
if (${field.name} == null)
${field.name} = []
${field.name}.add(listener)
}
```
### void **addFireMethods**([SourceUnit](../../org/codehaus/groovy/control/sourceunit) source, [AnnotationNode](../../org/codehaus/groovy/ast/annotationnode) node, [ClassNode](../../org/codehaus/groovy/ast/classnode) declaringClass, [FieldNode](../../org/codehaus/groovy/ast/fieldnode) field, [GenericsType](../../org/codehaus/groovy/ast/genericstype)[] types, boolean synchronize, [MethodNode](../../org/codehaus/groovy/ast/methodnode) method)
Adds the fire<Event> methods like:
```
void fire${fireMethod.capitalize()}(${parameterList.join(', ')}) {
if (${field.name} != null) {
def __list = new ArrayList(${field.name})
for (listener in __list) {
listener.$eventMethod(${evt})
}
}
}
```
### void **addGetListeners**([SourceUnit](../../org/codehaus/groovy/control/sourceunit) source, [AnnotationNode](../../org/codehaus/groovy/ast/annotationnode) node, [ClassNode](../../org/codehaus/groovy/ast/classnode) declaringClass, [FieldNode](../../org/codehaus/groovy/ast/fieldnode) field, [ClassNode](../../org/codehaus/groovy/ast/classnode) listener, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") synchronize)
Adds the get<Listener>s method like:
```
synchronized ${name.capitalize}[] get${name.capitalize}s() {
def __result = []
if (${field.name} != null)
__result.addAll(${field.name})
return __result as ${name.capitalize}[]
}
```
### void **addRemoveListener**([SourceUnit](../../org/codehaus/groovy/control/sourceunit) source, [AnnotationNode](../../org/codehaus/groovy/ast/annotationnode) node, [ClassNode](../../org/codehaus/groovy/ast/classnode) declaringClass, [FieldNode](../../org/codehaus/groovy/ast/fieldnode) field, [ClassNode](../../org/codehaus/groovy/ast/classnode) listener, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") synchronize)
Adds the remove<Listener> method like:
```
synchronized void remove${name.capitalize}(${listener.name} listener) {
if (listener == null)
return
if (${field.name} == null)
${field.name} = []
${field.name}.remove(listener)
}
```
### @[SuppressWarnings](https://docs.oracle.com/javase/8/docs/api/java/lang/SuppressWarnings.html "SuppressWarnings")(value: Instanceof) void **visit**([ASTNode](../../org/codehaus/groovy/ast/astnode)[] nodes, [SourceUnit](../../org/codehaus/groovy/control/sourceunit) source)
| programming_docs |
groovy [Java] Class DefaultPropertyAccessor [Java] Class DefaultPropertyAccessor
====================================
* groovy.beans.DefaultPropertyAccessor
All Implemented Interfaces and Traits: [PropertyAccessor](propertyaccessor)
```
public class DefaultPropertyAccessor
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [PropertyAccessor](propertyaccessor)
```
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [PropertyAccessor](propertyaccessor)**` | `[INSTANCE](#INSTANCE)` | |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[read](#read(java.lang.Object,%20java.lang.String))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") owner, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName)` |
| | `public void` | `**[write](#write(java.lang.Object,%20java.lang.String,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") owner, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### public static final [PropertyAccessor](propertyaccessor) **INSTANCE**
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **read**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") owner, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **write**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") owner, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") propertyName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
groovy [Java] Class YamlRuntimeException [Java] Class YamlRuntimeException
=================================
* groovy.yaml.YamlRuntimeException
```
public class YamlRuntimeException
extends [GroovyRuntimeException](../lang/groovyruntimeexception)
```
Represents runtime exception occurred when parsing or building YAML
**Since:**
3.0.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[YamlRuntimeException](#YamlRuntimeException(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") msg)` |
| `**[YamlRuntimeException](#YamlRuntimeException(java.lang.Throwable))**([Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") cause)` |
| `**[YamlRuntimeException](#YamlRuntimeException(java.lang.String,%20java.lang.Throwable))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") msg, [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") cause)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyRuntimeException](../lang/groovyruntimeexception)` | `[getLocationText](../lang/groovyruntimeexception#getLocationText()), [getMessage](../lang/groovyruntimeexception#getMessage()), [getMessageWithoutLocationText](../lang/groovyruntimeexception#getMessageWithoutLocationText()), [getModule](../lang/groovyruntimeexception#getModule()), [getNode](../lang/groovyruntimeexception#getNode()), [setModule](../lang/groovyruntimeexception#setModule(org.codehaus.groovy.ast.ModuleNode))` |
Constructor Detail
------------------
### public **YamlRuntimeException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") msg)
### public **YamlRuntimeException**([Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") cause)
### public **YamlRuntimeException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") msg, [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") cause)
groovy [Java] Class YamlSlurper [Java] Class YamlSlurper
========================
* groovy.yaml.YamlSlurper
```
public class YamlSlurper
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Represents a YAML parser
**Since:**
3.0.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[YamlSlurper](#YamlSlurper())**()` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.io.Reader))**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader)`Parse the content of the specified reader into a tree of Nodes. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.io.InputStream))**([InputStream](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html "InputStream") stream)`Parse the content of the specified reader into a tree of Nodes. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.io.File))**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file)`Parse the content of the specified file into a tree of Nodes. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parse](#parse(java.nio.file.Path))**([Path](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html "Path") path)`Parse the content of the specified path into a tree of Nodes. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[parseText](#parseText(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") yaml)`Parse the content of the specified yaml into a tree of Nodes. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **YamlSlurper**()
Method Detail
-------------
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader)
Parse the content of the specified reader into a tree of Nodes.
**Parameters:**
`reader` - the reader of yaml
**Returns:**
the root node of the parsed tree of Nodes
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([InputStream](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html "InputStream") stream)
Parse the content of the specified reader into a tree of Nodes.
**Parameters:**
`stream` - the reader of yaml
**Returns:**
the root node of the parsed tree of Nodes
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file)
Parse the content of the specified file into a tree of Nodes.
**Parameters:**
`file` - the reader of yaml
**Returns:**
the root node of the parsed tree of Nodes
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parse**([Path](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html "Path") path)
Parse the content of the specified path into a tree of Nodes.
**Parameters:**
`path` - the reader of yaml
**Returns:**
the root node of the parsed tree of Nodes
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **parseText**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") yaml)
Parse the content of the specified yaml into a tree of Nodes.
**Parameters:**
`yaml` - the content of yaml
**Returns:**
the root node of the parsed tree of Nodes
groovy [Java] Class YamlBuilder [Java] Class YamlBuilder
========================
* groovy.yaml.YamlBuilder
All Implemented Interfaces and Traits: [Writable](../lang/writable)
```
public class YamlBuilder
extends [GroovyObjectSupport](../lang/groovyobjectsupport)
implements [Writable](../lang/writable)
```
A builder for creating YAML payloads.
**Since:**
3.0.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[YamlBuilder](#YamlBuilder())**()` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[call](#call(java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") m)`Named arguments can be passed to the YAML builder instance to create a root YAML object |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[call](#call(java.util.List))**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") l)`A list of elements as arguments to the YAML builder creates a root YAML array |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[call](#call(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)`Varargs elements as arguments to the YAML builder create a root YAML array |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[call](#call(java.lang.Iterable,%20groovy.lang.Closure))**([Iterable](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html "Iterable") coll, [Closure](../lang/closure) c)`A collection and closure passed to a YAML builder will create a root YAML array applying the closure to each object in the collection |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[call](#call(java.util.Collection,%20groovy.lang.Closure))**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") coll, [Closure](../lang/closure) c)`Delegates to [call(Iterable, Closure)](#call(java.lang.Iterable,%20groovy.lang.Closure)) |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[call](#call(groovy.lang.Closure))**([Closure](../lang/closure) c)`A closure passed to a YAML builder will create a root YAML object |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getContent](#getContent())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)`A method call on the YAML builder instance will create a root object with only one key whose name is the name of the method being called. |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()`Serializes the internal data structure built with the builder to a conformant YAML payload string |
| | `public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer")` | `**[writeTo](#writeTo(java.io.Writer))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out)`The YAML builder implements the `Writable` interface, so that you can have the builder serialize itself the YAML payload to a writer. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyObjectSupport](../lang/groovyobjectsupport)` | `[getMetaClass](../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
### public **YamlBuilder**()
Method Detail
-------------
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **call**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") m)
Named arguments can be passed to the YAML builder instance to create a root YAML object
Example:
```
def yaml = new groovy.yaml.YamlBuilder()
yaml name: "Guillaume", age: 33
assert yaml.toString() == '''---
name: "Guillaume"
age: 33
'''
```
**Parameters:**
`m` - a map of key / value pairs
**Returns:**
a map of key / value pairs
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **call**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") l)
A list of elements as arguments to the YAML builder creates a root YAML array
Example:
```
def yaml = new groovy.yaml.YamlBuilder()
def result = yaml([1, 2, 3])
assert result instanceof List
assert yaml.toString() == '''---
- 1
- 2
- 3
'''
```
**Parameters:**
`l` - a list of values
**Returns:**
a list of values
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **call**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
Varargs elements as arguments to the YAML builder create a root YAML array
Example:
```
def yaml = new groovy.yaml.YamlBuilder()
def result = yaml 1, 2, 3
assert result instanceof List
assert yaml.toString() == '''---
- 1
- 2
- 3
'''
```
**Parameters:**
`args` - an array of values
**Returns:**
a list of values
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **call**([Iterable](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html "Iterable") coll, [Closure](../lang/closure) c)
A collection and closure passed to a YAML builder will create a root YAML array applying the closure to each object in the collection
Example:
```
class Author {
String name
}
def authors = [new Author (name: "Guillaume"), new Author (name: "Jochen"), new Author (name: "Paul")]
def yaml = new groovy.yaml.YamlBuilder()
yaml authors, { Author author `->`
name author.name
}
assert yaml.toString() == '''---
- name: "Guillaume"
- name: "Jochen"
- name: "Paul"
'''
```
**Parameters:**
`coll` - a collection
`c` - a closure used to convert the objects of coll
**Returns:**
a list of values
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **call**([Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection") coll, [Closure](../lang/closure) c)
Delegates to [call(Iterable, Closure)](#call(java.lang.Iterable,%20groovy.lang.Closure))
**Parameters:**
coll
c
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **call**([Closure](../lang/closure) c)
A closure passed to a YAML builder will create a root YAML object
Example:
```
def yaml = new groovy.yaml.YamlBuilder()
def result = yaml {
name "Guillaume"
age 33
}
assert result instanceof Map
assert yaml.toString() == '''---
name: "Guillaume"
age: 33
'''
```
**Parameters:**
`c` - a closure whose method call statements represent key / values of a YAML object
**Returns:**
a map of key / value pairs
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getContent**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
A method call on the YAML builder instance will create a root object with only one key whose name is the name of the method being called. This method takes as arguments:
* a closure
* a map (ie. named arguments)
* a map and a closure
* or no argument at all
Example with a classical builder-style:
```
def yaml = new groovy.yaml.YamlBuilder()
def result = yaml.person {
name "Guillaume"
age 33
}
assert result instanceof Map
assert yaml.toString() == '''---
person:
name: "Guillaume"
age: 33
'''
```
Or alternatively with a method call taking named arguments:
```
def yaml = new groovy.yaml.YamlBuilder()
yaml.person name: "Guillaume", age: 33
assert yaml.toString() == '''---
person:
name: "Guillaume"
age: 33
'''
```
If you use named arguments and a closure as last argument, the key/value pairs of the map (as named arguments) and the key/value pairs represented in the closure will be merged together — the closure properties overriding the map key/values in case the same key is used.
```
def yaml = new groovy.yaml.YamlBuilder()
yaml.person(name: "Guillaume", age: 33) { town "Paris" }
assert yaml.toString() == '''---
person:
name: "Guillaume"
age: 33
town: "Paris"
'''
```
The empty args call will create a key whose value will be an empty YAML object:
```
def yaml = new groovy.yaml.YamlBuilder()
yaml.person()
assert yaml.toString() == '''---
person: {}
'''
```
**Parameters:**
`name` - the single key
`args` - the value associated with the key
**Returns:**
a map with a single key
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
Serializes the internal data structure built with the builder to a conformant YAML payload string
Example:
```
def yaml = new groovy.yaml.YamlBuilder()
yaml { temperature 37 }
assert yaml.toString() == '''---
temperature: 37
'''
```
**Returns:**
a YAML output
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") **writeTo**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out)
The YAML builder implements the `Writable` interface, so that you can have the builder serialize itself the YAML payload to a writer.
Example:
```
def yaml = new groovy.yaml.YamlBuilder()
yaml { temperature 37 }
def out = new StringWriter()
out `<<` yaml
assert out.toString() == '''---
temperature: 37
'''
```
**Parameters:**
`out` - a writer on which to serialize the YAML payload
**Returns:**
the writer
| programming_docs |
groovy [Java] Class TemplateEngine [Java] Class TemplateEngine
===========================
* groovy.text.TemplateEngine
```
public abstract class TemplateEngine
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
A template engine is a factory for creating a Template instance for a given text input.
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public abstract [Template](template)` | `**[createTemplate](#createTemplate(java.io.Reader))**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader)`Creates a template by reading content from the Reader. |
| | `public [Template](template)` | `**[createTemplate](#createTemplate(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templateText)`Creates a template from the String contents. |
| | `public [Template](template)` | `**[createTemplate](#createTemplate(java.io.File))**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file)`Creates a template from the File contents. |
| | `public [Template](template)` | `**[createTemplate](#createTemplate(java.io.File,%20java.nio.charset.Charset))**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file, [Charset](https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html "Charset") cs)`Creates a template from the File contents using the given charset encoding. |
| | `public [Template](template)` | `**[createTemplate](#createTemplate(java.net.URL))**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url)`Creates a template from the content found at the URL using the default encoding. |
| | `public [Template](template)` | `**[createTemplate](#createTemplate(java.net.URL,%20java.nio.charset.Charset))**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url, [Charset](https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html "Charset") cs)`Creates a template from the content found at the URL using the given charset encoding. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### public abstract [Template](template) **createTemplate**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader)
Creates a template by reading content from the Reader.
### public [Template](template) **createTemplate**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templateText)
Creates a template from the String contents.
### public [Template](template) **createTemplate**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file)
Creates a template from the File contents. If the encoding for the file can be determined, that encoding will be used, otherwise the default encoding will be used. Consider using [createTemplate(File, Charset)](#createTemplate(java.io.File,%20java.nio.charset.Charset)) if you need to explicitly set the encoding.
### public [Template](template) **createTemplate**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file, [Charset](https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html "Charset") cs)
Creates a template from the File contents using the given charset encoding.
### @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value = "DM\_DEFAULT\_ENCODING", justification = "left for legacy reasons but users expected to heed warning") public [Template](template) **createTemplate**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url)
Creates a template from the content found at the URL using the default encoding. Please consider using [createTemplate(URL, Charset)](#createTemplate(java.net.URL,%20java.nio.charset.Charset)).
### public [Template](template) **createTemplate**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") url, [Charset](https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html "Charset") cs)
Creates a template from the content found at the URL using the given charset encoding.
groovy [Java] Class TemplateExecutionException [Java] Class TemplateExecutionException
=======================================
* groovy.text.TemplateExecutionException
```
public class TemplateExecutionException
extends [Exception](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html "Exception")
```
A custom exception class to flag template execution errors
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[TemplateExecutionException](#TemplateExecutionException(int))**(int lineNumber)` |
| `**[TemplateExecutionException](#TemplateExecutionException(int,%20java.lang.String))**(int lineNumber, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message)` |
| `**[TemplateExecutionException](#TemplateExecutionException(int,%20java.lang.String,%20java.lang.Throwable))**(int lineNumber, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message, [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") cause)` |
| `**[TemplateExecutionException](#TemplateExecutionException(int,%20java.lang.Throwable))**(int lineNumber, [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") cause)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public int` | `**[getLineNumber](#getLineNumber())**()`Returns the line number in the template source where the error occurred |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Exception](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html "Exception")` | `[printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html#printStackTrace() "printStackTrace"), [printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html#printStackTrace(java.io.PrintStream) "printStackTrace"), [printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html#printStackTrace(java.io.PrintWriter) "printStackTrace"), [fillInStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html#fillInStackTrace() "fillInStackTrace"), [getCause](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html#getCause() "getCause"), [initCause](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html#initCause(java.lang.Throwable) "initCause"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html#toString() "toString"), [getMessage](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html#getMessage() "getMessage"), [getSuppressed](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html#getSuppressed() "getSuppressed"), [getLocalizedMessage](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html#getLocalizedMessage() "getLocalizedMessage"), [getStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html#getStackTrace() "getStackTrace"), [setStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html#setStackTrace(%5BLjava.lang.StackTraceElement;) "setStackTrace"), [addSuppressed](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html#addSuppressed(java.lang.Throwable) "addSuppressed"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html#equals(java.lang.Object) "equals"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **TemplateExecutionException**(int lineNumber)
### public **TemplateExecutionException**(int lineNumber, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message)
### public **TemplateExecutionException**(int lineNumber, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message, [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") cause)
### public **TemplateExecutionException**(int lineNumber, [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") cause)
Method Detail
-------------
### public int **getLineNumber**()
Returns the line number in the template source where the error occurred
**Returns:**
the one-based line number of the template parsing error.
groovy [Java] Class TemplateParseException [Java] Class TemplateParseException
===================================
* groovy.text.TemplateParseException
```
public class TemplateParseException
extends [RuntimeException](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html "RuntimeException")
```
A custom exception class to flag template parsing errors
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[TemplateParseException](#TemplateParseException(int,%20int))**(int lineNumber, int column)` |
| `**[TemplateParseException](#TemplateParseException(java.lang.String,%20int,%20int))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message, int lineNumber, int column)` |
| `**[TemplateParseException](#TemplateParseException(java.lang.String,%20java.lang.Throwable,%20int,%20int))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message, [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") cause, int lineNumber, int column)` |
| `**[TemplateParseException](#TemplateParseException(java.lang.Throwable,%20int,%20int))**([Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") t, int lineNumber, int column)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public int` | `**[getColumn](#getColumn())**()` |
| | `public int` | `**[getLineNumber](#getLineNumber())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [RuntimeException](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html "RuntimeException")` | `[printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#printStackTrace() "printStackTrace"), [printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#printStackTrace(java.io.PrintStream) "printStackTrace"), [printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#printStackTrace(java.io.PrintWriter) "printStackTrace"), [fillInStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#fillInStackTrace() "fillInStackTrace"), [getCause](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getCause() "getCause"), [initCause](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#initCause(java.lang.Throwable) "initCause"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#toString() "toString"), [getMessage](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getMessage() "getMessage"), [getSuppressed](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getSuppressed() "getSuppressed"), [getLocalizedMessage](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getLocalizedMessage() "getLocalizedMessage"), [getStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getStackTrace() "getStackTrace"), [setStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#setStackTrace(%5BLjava.lang.StackTraceElement;) "setStackTrace"), [addSuppressed](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#addSuppressed(java.lang.Throwable) "addSuppressed"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#equals(java.lang.Object) "equals"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **TemplateParseException**(int lineNumber, int column)
### public **TemplateParseException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message, int lineNumber, int column)
### public **TemplateParseException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message, [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") cause, int lineNumber, int column)
### public **TemplateParseException**([Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") t, int lineNumber, int column)
Method Detail
-------------
### public int **getColumn**()
### public int **getLineNumber**()
groovy [Java] Class XmlTemplateEngine [Java] Class XmlTemplateEngine
==============================
* groovy.text.XmlTemplateEngine
```
public class XmlTemplateEngine
extends [TemplateEngine](templateengine)
```
Template engine for use in templating scenarios where both the template source and the expected output are intended to be XML.
Templates may use the normal '${expression}' and '$variable' notations to insert an arbitrary expression into the template. In addition, support is also provided for special tags: <gsp:scriptlet> (for inserting code fragments) and <gsp:expression> (for code fragments which produce output).
Comments and processing instructions will be removed as part of processing and special XML characters such as <, >, " and ' will be escaped using the respective XML notation. The output will also be indented using standard XML pretty printing.
The xmlns namespace definition for `gsp:` tags will be removed but other namespace definitions will be preserved (but may change to an equivalent position within the XML tree).
Normally, the template source will be in a file but here is a simple example providing the XML template as a string:
```
def binding = [firstname:"Jochen", lastname:"Theodorou",
nickname:"blackdrag", salutation:"Dear"]
def engine = new groovy.text.XmlTemplateEngine()
def text = '''\
<?xml version="1.0" encoding="UTF-8"?>
<document xmlns:gsp='http://groovy.codehaus.org/2005/gsp' xmlns:foo='baz' type='letter'>
<gsp:scriptlet>def greeting = "${salutation}est"</gsp:scriptlet>
<gsp:expression>greeting</gsp:expression>
<foo:to>$firstname "$nickname" $lastname</foo:to>
How are you today?
</document>
'''
def template = engine.createTemplate(text).make(binding)
println template.toString()
```
This example will produce this output:
```
<document type='letter'>
Dearest
<foo:to xmlns:foo='baz'>
Jochen "blackdrag" Theodorou
</foo:to>
How are you today?
</document>
```
The XML template engine can also be used as the engine for [TemplateServlet](../servlet/templateservlet "TemplateServlet") by placing the following in your web.xml file (plus a corresponding servlet-mapping element):
```
<servlet>
<servlet-name>XmlTemplate</servlet-name>
<servlet-class>groovy.servlet.TemplateServlet</servlet-class>
<init-param>
<param-name>template.engine</param-name>
<param-value>groovy.text.XmlTemplateEngine</param-value>
</init-param>
</servlet>
```
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[DEFAULT\_INDENTATION](#DEFAULT_INDENTATION)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[XmlTemplateEngine](#XmlTemplateEngine())**()` |
| `**[XmlTemplateEngine](#XmlTemplateEngine(java.lang.String,%20boolean))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") indentation, boolean validating)` |
| `**[XmlTemplateEngine](#XmlTemplateEngine(groovy.xml.XmlParser,%20java.lang.ClassLoader))**([XmlParser](../xml/xmlparser) xmlParser, [ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parentLoader)` |
| `**[XmlTemplateEngine](#XmlTemplateEngine(groovy.xml.XmlParser,%20groovy.lang.GroovyShell))**([XmlParser](../xml/xmlparser) xmlParser, [GroovyShell](../lang/groovyshell) groovyShell)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Template](template)` | `**[createTemplate](#createTemplate(java.io.Reader))**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader)` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getIndentation](#getIndentation())**()` |
| | `public void` | `**[setIndentation](#setIndentation(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") indentation)` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [TemplateEngine](templateengine)` | `[createTemplate](templateengine#createTemplate(java.io.Reader)), [createTemplate](templateengine#createTemplate(java.lang.String)), [createTemplate](templateengine#createTemplate(java.io.File)), [createTemplate](templateengine#createTemplate(java.io.File,%20java.nio.charset.Charset)), [createTemplate](templateengine#createTemplate(java.net.URL)), [createTemplate](templateengine#createTemplate(java.net.URL,%20java.nio.charset.Charset))` |
Field Detail
------------
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **DEFAULT\_INDENTATION**
Constructor Detail
------------------
### public **XmlTemplateEngine**()
### public **XmlTemplateEngine**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") indentation, boolean validating)
### public **XmlTemplateEngine**([XmlParser](../xml/xmlparser) xmlParser, [ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parentLoader)
### public **XmlTemplateEngine**([XmlParser](../xml/xmlparser) xmlParser, [GroovyShell](../lang/groovyshell) groovyShell)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Template](template) **createTemplate**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader)
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getIndentation**()
### public void **setIndentation**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") indentation)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
| programming_docs |
groovy [Java] Class SimpleTemplateEngine [Java] Class SimpleTemplateEngine
=================================
* groovy.text.SimpleTemplateEngine
```
public class SimpleTemplateEngine
extends [TemplateEngine](templateengine)
```
Processes template source files substituting variables and expressions into placeholders in a template source text to produce the desired output.
The template engine uses JSP style <% %> script and <%= %> expression syntax or GString style expressions. The variable '`out`' is bound to the writer that the template is being written to.
Frequently, the template source will be in a file but here is a simple example providing the template as a string:
```
def binding = [
firstname : "Grace",
lastname : "Hopper",
accepted : true,
title : 'Groovy for COBOL programmers'
]
def engine = new groovy.text.SimpleTemplateEngine()
def text = '''\
Dear <%= firstname %> $lastname,
We <% if (accepted) print 'are pleased' else print 'regret' %> \
to inform you that your paper entitled
'$title' was ${ accepted ? 'accepted' : 'rejected' }.
The conference committee.
'''
def template = engine.createTemplate(text).make(binding)
println template.toString()
```
This example uses a mix of the JSP style and GString style placeholders but you can typically use just one style if you wish. Running this example will produce this output:
```
Dear Grace Hopper,
We are pleased to inform you that your paper entitled
'Groovy for COBOL programmers' was accepted.
The conference committee.
```
The template engine can also be used as the engine for [TemplateServlet](../servlet/templateservlet "TemplateServlet") by placing the following in your `web.xml` file (plus a corresponding servlet-mapping element):
```
<servlet>
<servlet-name>SimpleTemplate</servlet-name>
<servlet-class>groovy.servlet.TemplateServlet</servlet-class>
<init-param>
<param-name>template.engine</param-name>
<param-value>groovy.text.SimpleTemplateEngine</param-value>
</init-param>
</servlet>
```
In this case, your template source file should be HTML with the appropriate embedded placeholders. Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[SimpleTemplateEngine](#SimpleTemplateEngine())**()` |
| `**[SimpleTemplateEngine](#SimpleTemplateEngine(boolean))**(boolean verbose)` |
| `**[SimpleTemplateEngine](#SimpleTemplateEngine(java.lang.ClassLoader))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parentLoader)` |
| `**[SimpleTemplateEngine](#SimpleTemplateEngine(groovy.lang.GroovyShell))**([GroovyShell](../lang/groovyshell) groovyShell)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Template](template)` | `**[createTemplate](#createTemplate(java.io.Reader))**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader)` |
| | `public boolean` | `**[isEscapeBackslash](#isEscapeBackslash())**()` |
| | `public boolean` | `**[isVerbose](#isVerbose())**()` |
| | `public void` | `**[setEscapeBackslash](#setEscapeBackslash(boolean))**(boolean escapeBackslash)` |
| | `public void` | `**[setVerbose](#setVerbose(boolean))**(boolean verbose)`
**Parameters:**
`verbose` - true if you want the engine to display the template source file for debugging purposes
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [TemplateEngine](templateengine)` | `[createTemplate](templateengine#createTemplate(java.io.Reader)), [createTemplate](templateengine#createTemplate(java.lang.String)), [createTemplate](templateengine#createTemplate(java.io.File)), [createTemplate](templateengine#createTemplate(java.io.File,%20java.nio.charset.Charset)), [createTemplate](templateengine#createTemplate(java.net.URL)), [createTemplate](templateengine#createTemplate(java.net.URL,%20java.nio.charset.Charset))` |
Constructor Detail
------------------
### public **SimpleTemplateEngine**()
### public **SimpleTemplateEngine**(boolean verbose)
### public **SimpleTemplateEngine**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parentLoader)
### public **SimpleTemplateEngine**([GroovyShell](../lang/groovyshell) groovyShell)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Template](template) **createTemplate**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader)
### public boolean **isEscapeBackslash**()
### public boolean **isVerbose**()
### public void **setEscapeBackslash**(boolean escapeBackslash)
### public void **setVerbose**(boolean verbose)
**Parameters:**
`verbose` - true if you want the engine to display the template source file for debugging purposes
groovy [Java] Class GStringTemplateEngine [Java] Class GStringTemplateEngine
==================================
* groovy.text.GStringTemplateEngine
```
public class GStringTemplateEngine
extends [TemplateEngine](templateengine)
```
Processes template source files substituting variables and expressions into placeholders in a template source text to produce the desired output using a streaming approach. This engine has equivalent functionality to the [SimpleTemplateEngine](simpletemplateengine "SimpleTemplateEngine") but creates the template using writable closures making it potentially more scalable for large templates or in streaming scenarios.
The template engine uses JSP style <% %> script and <%= %> expression syntax or GString style expressions. The variable '`out`' is bound to the writer that the template is being written to.
Frequently, the template source will be in a file but here is a simple example providing the template as a string:
```
def binding = [
firstname : "Grace",
lastname : "Hopper",
accepted : true,
title : 'Groovy for COBOL programmers'
]
def engine = new groovy.text.GStringTemplateEngine()
def text = '''\
Dear <%= firstname %> $lastname,
We <% if (accepted) print 'are pleased' else print 'regret' %> \
to inform you that your paper entitled
'$title' was ${ accepted ? 'accepted' : 'rejected' }.
The conference committee.
'''
def template = engine.createTemplate(text).make(binding)
println template.toString()
```
This example uses a mix of the JSP style and GString style placeholders but you can typically use just one style if you wish. Running this example will produce this output:
```
Dear Grace Hopper,
We are pleased to inform you that your paper entitled
'Groovy for COBOL programmers' was accepted.
The conference committee.
```
The template engine can also be used as the engine for [TemplateServlet](../servlet/templateservlet "TemplateServlet") by placing the following in your `web.xml` file (plus a corresponding servlet-mapping element):
```
<servlet>
<servlet-name>GStringTemplate</servlet-name>
<servlet-class>groovy.servlet.TemplateServlet</servlet-class>
<init-param>
<param-name>template.engine</param-name>
<param-value>groovy.text.GStringTemplateEngine</param-value>
</init-param>
</servlet>
```
In this case, your template source file should be HTML with the appropriate embedded placeholders. Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[GStringTemplateEngine](#GStringTemplateEngine())**()` |
| `**[GStringTemplateEngine](#GStringTemplateEngine(java.lang.ClassLoader))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parentLoader)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Template](template)` | `**[createTemplate](#createTemplate(java.io.Reader))**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [TemplateEngine](templateengine)` | `[createTemplate](templateengine#createTemplate(java.io.Reader)), [createTemplate](templateengine#createTemplate(java.lang.String)), [createTemplate](templateengine#createTemplate(java.io.File)), [createTemplate](templateengine#createTemplate(java.io.File,%20java.nio.charset.Charset)), [createTemplate](templateengine#createTemplate(java.net.URL)), [createTemplate](templateengine#createTemplate(java.net.URL,%20java.nio.charset.Charset))` |
Constructor Detail
------------------
### public **GStringTemplateEngine**()
### public **GStringTemplateEngine**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parentLoader)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Template](template) **createTemplate**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader)
groovy [Java] Class StreamingTemplateEngine [Java] Class StreamingTemplateEngine
====================================
* groovy.text.StreamingTemplateEngine
```
public class StreamingTemplateEngine
extends [TemplateEngine](templateengine)
```
Processes template source files substituting variables and expressions into placeholders in a template source text to produce the desired output using a closure based approach. This engine has equivalent functionality to the [SimpleTemplateEngine](simpletemplateengine "SimpleTemplateEngine") but creates the template using writable closures making it more scalable for large templates.
Specifically this template engine can handle strings larger than 64k which still causes problems for the other groovy template engines.
The template engine uses JSP style <% %> script and <%= %> expression syntax or GString style expressions. The variable '`out`' is bound to the writer that the template is being written to.
Frequently, the template source will be in a file but here is a simple example providing the template as a string:
```
def binding = [
firstname : "Grace",
lastname : "Hopper",
accepted : true,
title : 'Groovy for COBOL programmers'
]
def text = '''\
Dear <% out.print firstname %> ${lastname},
We <% if (accepted) out.print 'are pleased' else out.print 'regret' %> \
to inform you that your paper entitled
'$title' was ${ accepted ? 'accepted' : 'rejected' }.
The conference committee.
'''
def template = new groovy.text.StreamingTemplateEngine().createTemplate(text)
print template.make(binding)
```
This example uses a mix of the JSP style and GString style placeholders but you can typically use just one style if you wish. Running this example will produce this output:
```
Dear Grace Hopper,
We are pleased to inform you that your paper entitled
'Groovy for COBOL programmers' was accepted.
The conference committee.
```
StreamingTemplateEngine as a servlet engine
-------------------------------------------
The template engine can also be used as the engine for [TemplateServlet](../servlet/templateservlet "TemplateServlet") by placing the following in your `web.xml` file (plus a corresponding servlet-mapping element):
```
<servlet>
<servlet-name>StreamingTemplate</servlet-name>
<servlet-class>groovy.servlet.TemplateServlet</servlet-class>
<init-param>
<param-name>template.engine</param-name>
<param-value>groovy.text.StreamingTemplateEngine</param-value>
</init-param>
</servlet>
```
In this case, your template source file should be HTML with the appropriate embedded placeholders. Debugging Template Code
-----------------------
The template engine makes an effort to throw descriptive exceptions with context lines, ie:
```
groovy.text.TemplateExecutionException: Template parse error at line 4:
3: We <% if (accepted) out.print 'are pleased' else out.print 'regret' %> to inform you that your paper entitled
--> 4: '$txitle' was ${ accepted ? 'accepted' : 'rejected' }.
5:
at test.run(test.groovy:18)
Caused by: groovy.lang.MissingPropertyException: No such property: txitle for class: groovy.tmp.templates.StreamingTemplateScript1
... 1 more
```
and sanitize the exceptions to make things readable. When the exceptions are not enough, it might sometimes be useful to view the actual script source generated by the template engine. This would conceptually be equivalent to viewing the .java file generated for a jsp page. The source is not currently very readable and until we get a built in groovy code pretty printer, we will probably continue to opt for compactness rather than readability.
With that being said, viewing the source might still have some value. For this reason the script source is accessible via the template.scriptSource property, i.e.:
```
println template.scriptSource
```
In the above example. Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[StreamingTemplateEngine](#StreamingTemplateEngine())**()`Create a streaming template engine instance using the default class loader |
| `**[StreamingTemplateEngine](#StreamingTemplateEngine(java.lang.ClassLoader))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parentLoader)`Create a streaming template engine instance using a custom class loader |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Template](template)` | `**[createTemplate](#createTemplate(java.io.Reader))**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader)`Creates a template instance using the template source from the provided Reader. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [TemplateEngine](templateengine)` | `[createTemplate](templateengine#createTemplate(java.io.Reader)), [createTemplate](templateengine#createTemplate(java.lang.String)), [createTemplate](templateengine#createTemplate(java.io.File)), [createTemplate](templateengine#createTemplate(java.io.File,%20java.nio.charset.Charset)), [createTemplate](templateengine#createTemplate(java.net.URL)), [createTemplate](templateengine#createTemplate(java.net.URL,%20java.nio.charset.Charset))` |
Constructor Detail
------------------
### public **StreamingTemplateEngine**()
Create a streaming template engine instance using the default class loader
### public **StreamingTemplateEngine**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parentLoader)
Create a streaming template engine instance using a custom class loader
The custom loader is used when parsing the template code
**Parameters:**
`parentLoader` - The class loader to use when parsing the template code.
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Template](template) **createTemplate**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader)
Creates a template instance using the template source from the provided Reader. The template can be applied repeatedly on different bindings to produce custom output. **Technical detail**
Under the hood the returned template is represented as a four argument closure where the three first arguments are [curried](../lang/closure#curry "curried") in while generating the template.
In essence we start with a closure on the form:
```
{ parentClass, stringSectionList, binding, out ->
//code generated by parsing the template data
}
```
We then curry in the parentClass and stringSectionList arguments so that the StreamingTemplate instance returned from 'createTemplate' internally contains a template closure on the form:
```
{ binding, out ->
//code generated by parsing the template data
}
```
Calling `template.make(binding)`, curries in the 'binding' argument:
```
public Writable make(final Map map) {
final Closure template = this.template.curry(new Object[]{map});
return (Writable) template;
}
```
This only leaves the 'out' argument unbound. The only method on the [writable](../lang/writable "writable") interface is [writeTo(Writer out)](../lang/writable#writeTo "writeTo(Writer out)") so groovy rules about casting a closure to a one-method-interface apply and the above works. I.e. we return the now one argument closure as the Writable which can be serialized to System.out, a file, etc according to the Writable interface contract.
**See Also:**
[TemplateEngine.createTemplate](templateengine#createTemplate(java.io.Reader) "TemplateEngine.createTemplate")
groovy [Java] Interface Template [Java] Interface Template
=========================
```
public interface Template
```
A template is a block of text with an associated binding that can be output to a writer or evaluated to a string.
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Writable](../lang/writable)` | `**[make](#make())**()` |
| | `public [Writable](../lang/writable)` | `**[make](#make(java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") binding)` |
Method Detail
-------------
### public [Writable](../lang/writable) **make**()
### public [Writable](../lang/writable) **make**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") binding)
groovy [Java] Interface TemplateResolver [Java] Interface TemplateResolver
=================================
```
public interface TemplateResolver
```
Interface for template resolvers, which, given a template identifier, return an URL where the template can be loaded.
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[configure](#configure(java.lang.ClassLoader,%20groovy.text.markup.TemplateConfiguration))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") templateClassLoader, [TemplateConfiguration](templateconfiguration) configuration)`This method is called once the template engine is initialized, providing the resolver with the template engine configuration and its template class loader. |
| | `public [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL")` | `**[resolveTemplate](#resolveTemplate(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templatePath)`Resolvers must implement this method in order to resolve a template, given a template path. |
Method Detail
-------------
### public void **configure**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") templateClassLoader, [TemplateConfiguration](templateconfiguration) configuration)
This method is called once the template engine is initialized, providing the resolver with the template engine configuration and its template class loader.
**Parameters:**
`templateClassLoader` - the classloader where templates will be searched for
`configuration` - the configuration of the template engine
### public [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") **resolveTemplate**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templatePath)
Resolvers must implement this method in order to resolve a template, given a template path. They must return a valid URL or an IOException.
**throws:**
IOException
**Parameters:**
`templatePath` - path to the template
**Returns:**
the template URL, that will be used to load the template
| programming_docs |
groovy [Groovy] Class MarkupTemplateTypeCheckingExtension.1 [Groovy] Class MarkupTemplateTypeCheckingExtension.1
====================================================
* groovy.text.markup.MarkupTemplateTypeCheckingExtension.1
```
class MarkupTemplateTypeCheckingExtension.1
extends [ResolveVisitor](../../../org/codehaus/groovy/control/resolvevisitor)
```
Inherited fields
| Fields inherited from class | Fields |
| **`class [ResolveVisitor](../../../org/codehaus/groovy/control/resolvevisitor)`** | `[DEFAULT\_IMPORTS](../../../org/codehaus/groovy/control/resolvevisitor#DEFAULT_IMPORTS), [EMPTY\_STRING\_ARRAY](../../../org/codehaus/groovy/control/resolvevisitor#EMPTY_STRING_ARRAY), [QUESTION\_MARK](../../../org/codehaus/groovy/control/resolvevisitor#QUESTION_MARK)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[MarkupTemplateTypeCheckingExtension.1](#MarkupTemplateTypeCheckingExtension.1())**()` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `void` | `**[addError](#addError(java.lang.String,%20org.codehaus.groovy.ast.ASTNode))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") msg, [ASTNode](../../../org/codehaus/groovy/ast/astnode) expr)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [ResolveVisitor](../../../org/codehaus/groovy/control/resolvevisitor)` | `[getSourceUnit](../../../org/codehaus/groovy/control/resolvevisitor#getSourceUnit()), [resolve](../../../org/codehaus/groovy/control/resolvevisitor#resolve(org.codehaus.groovy.ast.ClassNode)), [resolve](../../../org/codehaus/groovy/control/resolvevisitor#resolve(org.codehaus.groovy.ast.ClassNode,%20boolean,%20boolean,%20boolean)), [resolveFromCompileUnit](../../../org/codehaus/groovy/control/resolvevisitor#resolveFromCompileUnit(org.codehaus.groovy.ast.ClassNode)), [resolveFromDefaultImports](../../../org/codehaus/groovy/control/resolvevisitor#resolveFromDefaultImports(org.codehaus.groovy.ast.ClassNode)), [resolveFromDefaultImports](../../../org/codehaus/groovy/control/resolvevisitor#resolveFromDefaultImports(org.codehaus.groovy.ast.ClassNode,%20java.lang.String)), [resolveFromModule](../../../org/codehaus/groovy/control/resolvevisitor#resolveFromModule(org.codehaus.groovy.ast.ClassNode,%20boolean)), [resolveFromStaticInnerClasses](../../../org/codehaus/groovy/control/resolvevisitor#resolveFromStaticInnerClasses(org.codehaus.groovy.ast.ClassNode)), [resolveNestedClass](../../../org/codehaus/groovy/control/resolvevisitor#resolveNestedClass(org.codehaus.groovy.ast.ClassNode)), [resolveToInner](../../../org/codehaus/groovy/control/resolvevisitor#resolveToInner(org.codehaus.groovy.ast.ClassNode)), [resolveToOuter](../../../org/codehaus/groovy/control/resolvevisitor#resolveToOuter(org.codehaus.groovy.ast.ClassNode)), [setClassNodeResolver](../../../org/codehaus/groovy/control/resolvevisitor#setClassNodeResolver(org.codehaus.groovy.control.ClassNodeResolver)), [startResolving](../../../org/codehaus/groovy/control/resolvevisitor#startResolving(org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.control.SourceUnit)), [transform](../../../org/codehaus/groovy/control/resolvevisitor#transform(org.codehaus.groovy.ast.expr.Expression)), [transformAnnotationConstantExpression](../../../org/codehaus/groovy/control/resolvevisitor#transformAnnotationConstantExpression(org.codehaus.groovy.ast.expr.AnnotationConstantExpression)), [transformBinaryExpression](../../../org/codehaus/groovy/control/resolvevisitor#transformBinaryExpression(org.codehaus.groovy.ast.expr.BinaryExpression)), [transformClosureExpression](../../../org/codehaus/groovy/control/resolvevisitor#transformClosureExpression(org.codehaus.groovy.ast.expr.ClosureExpression)), [transformConstructorCallExpression](../../../org/codehaus/groovy/control/resolvevisitor#transformConstructorCallExpression(org.codehaus.groovy.ast.expr.ConstructorCallExpression)), [transformDeclarationExpression](../../../org/codehaus/groovy/control/resolvevisitor#transformDeclarationExpression(org.codehaus.groovy.ast.expr.DeclarationExpression)), [transformMethodCallExpression](../../../org/codehaus/groovy/control/resolvevisitor#transformMethodCallExpression(org.codehaus.groovy.ast.expr.MethodCallExpression)), [transformPropertyExpression](../../../org/codehaus/groovy/control/resolvevisitor#transformPropertyExpression(org.codehaus.groovy.ast.expr.PropertyExpression)), [transformVariableExpression](../../../org/codehaus/groovy/control/resolvevisitor#transformVariableExpression(org.codehaus.groovy.ast.expr.VariableExpression)), [visitAnnotation](../../../org/codehaus/groovy/control/resolvevisitor#visitAnnotation(org.codehaus.groovy.ast.AnnotationNode)), [visitBlockStatement](../../../org/codehaus/groovy/control/resolvevisitor#visitBlockStatement(org.codehaus.groovy.ast.stmt.BlockStatement)), [visitCatchStatement](../../../org/codehaus/groovy/control/resolvevisitor#visitCatchStatement(org.codehaus.groovy.ast.stmt.CatchStatement)), [visitClass](../../../org/codehaus/groovy/control/resolvevisitor#visitClass(org.codehaus.groovy.ast.ClassNode)), [visitConstructorOrMethod](../../../org/codehaus/groovy/control/resolvevisitor#visitConstructorOrMethod(org.codehaus.groovy.ast.MethodNode,%20boolean)), [visitField](../../../org/codehaus/groovy/control/resolvevisitor#visitField(org.codehaus.groovy.ast.FieldNode)), [visitForLoop](../../../org/codehaus/groovy/control/resolvevisitor#visitForLoop(org.codehaus.groovy.ast.stmt.ForStatement)), [visitMethod](../../../org/codehaus/groovy/control/resolvevisitor#visitMethod(org.codehaus.groovy.ast.MethodNode)), [visitProperty](../../../org/codehaus/groovy/control/resolvevisitor#visitProperty(org.codehaus.groovy.ast.PropertyNode))` |
| `class [ClassCodeExpressionTransformer](../../../org/codehaus/groovy/ast/classcodeexpressiontransformer)` | `[setSourcePosition](../../../org/codehaus/groovy/ast/classcodeexpressiontransformer#setSourcePosition(org.codehaus.groovy.ast.expr.Expression,%20org.codehaus.groovy.ast.expr.Expression)), [transform](../../../org/codehaus/groovy/ast/classcodeexpressiontransformer#transform(org.codehaus.groovy.ast.expr.Expression)), [visitAnnotation](../../../org/codehaus/groovy/ast/classcodeexpressiontransformer#visitAnnotation(org.codehaus.groovy.ast.AnnotationNode)), [visitAssertStatement](../../../org/codehaus/groovy/ast/classcodeexpressiontransformer#visitAssertStatement(org.codehaus.groovy.ast.stmt.AssertStatement)), [visitCaseStatement](../../../org/codehaus/groovy/ast/classcodeexpressiontransformer#visitCaseStatement(org.codehaus.groovy.ast.stmt.CaseStatement)), [visitConstructorOrMethod](../../../org/codehaus/groovy/ast/classcodeexpressiontransformer#visitConstructorOrMethod(org.codehaus.groovy.ast.MethodNode,%20boolean)), [visitDoWhileLoop](../../../org/codehaus/groovy/ast/classcodeexpressiontransformer#visitDoWhileLoop(org.codehaus.groovy.ast.stmt.DoWhileStatement)), [visitExpressionStatement](../../../org/codehaus/groovy/ast/classcodeexpressiontransformer#visitExpressionStatement(org.codehaus.groovy.ast.stmt.ExpressionStatement)), [visitField](../../../org/codehaus/groovy/ast/classcodeexpressiontransformer#visitField(org.codehaus.groovy.ast.FieldNode)), [visitForLoop](../../../org/codehaus/groovy/ast/classcodeexpressiontransformer#visitForLoop(org.codehaus.groovy.ast.stmt.ForStatement)), [visitIfElse](../../../org/codehaus/groovy/ast/classcodeexpressiontransformer#visitIfElse(org.codehaus.groovy.ast.stmt.IfStatement)), [visitProperty](../../../org/codehaus/groovy/ast/classcodeexpressiontransformer#visitProperty(org.codehaus.groovy.ast.PropertyNode)), [visitReturnStatement](../../../org/codehaus/groovy/ast/classcodeexpressiontransformer#visitReturnStatement(org.codehaus.groovy.ast.stmt.ReturnStatement)), [visitSwitch](../../../org/codehaus/groovy/ast/classcodeexpressiontransformer#visitSwitch(org.codehaus.groovy.ast.stmt.SwitchStatement)), [visitSynchronizedStatement](../../../org/codehaus/groovy/ast/classcodeexpressiontransformer#visitSynchronizedStatement(org.codehaus.groovy.ast.stmt.SynchronizedStatement)), [visitThrowStatement](../../../org/codehaus/groovy/ast/classcodeexpressiontransformer#visitThrowStatement(org.codehaus.groovy.ast.stmt.ThrowStatement)), [visitWhileLoop](../../../org/codehaus/groovy/ast/classcodeexpressiontransformer#visitWhileLoop(org.codehaus.groovy.ast.stmt.WhileStatement))` |
| `class [ClassCodeVisitorSupport](../../../org/codehaus/groovy/ast/classcodevisitorsupport)` | `[addError](../../../org/codehaus/groovy/ast/classcodevisitorsupport#addError(java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [getSourceUnit](../../../org/codehaus/groovy/ast/classcodevisitorsupport#getSourceUnit()), [visitAnnotation](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitAnnotation(org.codehaus.groovy.ast.AnnotationNode)), [visitAnnotations](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitAnnotations(org.codehaus.groovy.ast.AnnotatedNode)), [visitAnnotations](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitAnnotations(Iterable)), [visitAssertStatement](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitAssertStatement(org.codehaus.groovy.ast.stmt.AssertStatement)), [visitBlockStatement](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitBlockStatement(org.codehaus.groovy.ast.stmt.BlockStatement)), [visitBreakStatement](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitBreakStatement(org.codehaus.groovy.ast.stmt.BreakStatement)), [visitCaseStatement](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitCaseStatement(org.codehaus.groovy.ast.stmt.CaseStatement)), [visitCatchStatement](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitCatchStatement(org.codehaus.groovy.ast.stmt.CatchStatement)), [visitClass](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitClass(org.codehaus.groovy.ast.ClassNode)), [visitClassCodeContainer](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitClassCodeContainer(org.codehaus.groovy.ast.stmt.Statement)), [visitConstructor](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitConstructor(org.codehaus.groovy.ast.ConstructorNode)), [visitConstructorOrMethod](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitConstructorOrMethod(org.codehaus.groovy.ast.MethodNode,%20boolean)), [visitContinueStatement](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitContinueStatement(org.codehaus.groovy.ast.stmt.ContinueStatement)), [visitDeclarationExpression](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitDeclarationExpression(org.codehaus.groovy.ast.expr.DeclarationExpression)), [visitDoWhileLoop](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitDoWhileLoop(org.codehaus.groovy.ast.stmt.DoWhileStatement)), [visitExpressionStatement](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitExpressionStatement(org.codehaus.groovy.ast.stmt.ExpressionStatement)), [visitField](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitField(org.codehaus.groovy.ast.FieldNode)), [visitForLoop](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitForLoop(org.codehaus.groovy.ast.stmt.ForStatement)), [visitIfElse](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitIfElse(org.codehaus.groovy.ast.stmt.IfStatement)), [visitImports](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitImports(org.codehaus.groovy.ast.ModuleNode)), [visitMethod](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitMethod(org.codehaus.groovy.ast.MethodNode)), [visitObjectInitializerStatements](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitObjectInitializerStatements(org.codehaus.groovy.ast.ClassNode)), [visitPackage](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitPackage(org.codehaus.groovy.ast.PackageNode)), [visitProperty](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitProperty(org.codehaus.groovy.ast.PropertyNode)), [visitReturnStatement](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitReturnStatement(org.codehaus.groovy.ast.stmt.ReturnStatement)), [visitStatement](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitStatement(org.codehaus.groovy.ast.stmt.Statement)), [visitSwitch](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitSwitch(org.codehaus.groovy.ast.stmt.SwitchStatement)), [visitSynchronizedStatement](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitSynchronizedStatement(org.codehaus.groovy.ast.stmt.SynchronizedStatement)), [visitThrowStatement](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitThrowStatement(org.codehaus.groovy.ast.stmt.ThrowStatement)), [visitTryCatchFinally](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitTryCatchFinally(org.codehaus.groovy.ast.stmt.TryCatchStatement)), [visitWhileLoop](../../../org/codehaus/groovy/ast/classcodevisitorsupport#visitWhileLoop(org.codehaus.groovy.ast.stmt.WhileStatement))` |
| `class [CodeVisitorSupport](../../../org/codehaus/groovy/ast/codevisitorsupport)` | `[afterSwitchConditionExpressionVisited](../../../org/codehaus/groovy/ast/codevisitorsupport#afterSwitchConditionExpressionVisited(org.codehaus.groovy.ast.stmt.SwitchStatement)), [visitArgumentlistExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitArgumentlistExpression(org.codehaus.groovy.ast.expr.ArgumentListExpression)), [visitArrayExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitArrayExpression(org.codehaus.groovy.ast.expr.ArrayExpression)), [visitAssertStatement](../../../org/codehaus/groovy/ast/codevisitorsupport#visitAssertStatement(org.codehaus.groovy.ast.stmt.AssertStatement)), [visitAttributeExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitAttributeExpression(org.codehaus.groovy.ast.expr.AttributeExpression)), [visitBinaryExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitBinaryExpression(org.codehaus.groovy.ast.expr.BinaryExpression)), [visitBitwiseNegationExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitBitwiseNegationExpression(org.codehaus.groovy.ast.expr.BitwiseNegationExpression)), [visitBlockStatement](../../../org/codehaus/groovy/ast/codevisitorsupport#visitBlockStatement(org.codehaus.groovy.ast.stmt.BlockStatement)), [visitBooleanExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitBooleanExpression(org.codehaus.groovy.ast.expr.BooleanExpression)), [visitBreakStatement](../../../org/codehaus/groovy/ast/codevisitorsupport#visitBreakStatement(org.codehaus.groovy.ast.stmt.BreakStatement)), [visitBytecodeExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitBytecodeExpression(org.codehaus.groovy.classgen.BytecodeExpression)), [visitCaseStatement](../../../org/codehaus/groovy/ast/codevisitorsupport#visitCaseStatement(org.codehaus.groovy.ast.stmt.CaseStatement)), [visitCastExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitCastExpression(org.codehaus.groovy.ast.expr.CastExpression)), [visitCatchStatement](../../../org/codehaus/groovy/ast/codevisitorsupport#visitCatchStatement(org.codehaus.groovy.ast.stmt.CatchStatement)), [visitClassExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitClassExpression(org.codehaus.groovy.ast.expr.ClassExpression)), [visitClosureExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitClosureExpression(org.codehaus.groovy.ast.expr.ClosureExpression)), [visitClosureListExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitClosureListExpression(org.codehaus.groovy.ast.expr.ClosureListExpression)), [visitConstantExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitConstantExpression(org.codehaus.groovy.ast.expr.ConstantExpression)), [visitConstructorCallExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitConstructorCallExpression(org.codehaus.groovy.ast.expr.ConstructorCallExpression)), [visitContinueStatement](../../../org/codehaus/groovy/ast/codevisitorsupport#visitContinueStatement(org.codehaus.groovy.ast.stmt.ContinueStatement)), [visitDeclarationExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitDeclarationExpression(org.codehaus.groovy.ast.expr.DeclarationExpression)), [visitDoWhileLoop](../../../org/codehaus/groovy/ast/codevisitorsupport#visitDoWhileLoop(org.codehaus.groovy.ast.stmt.DoWhileStatement)), [visitEmptyStatement](../../../org/codehaus/groovy/ast/codevisitorsupport#visitEmptyStatement(org.codehaus.groovy.ast.stmt.EmptyStatement)), [visitExpressionStatement](../../../org/codehaus/groovy/ast/codevisitorsupport#visitExpressionStatement(org.codehaus.groovy.ast.stmt.ExpressionStatement)), [visitFieldExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitFieldExpression(org.codehaus.groovy.ast.expr.FieldExpression)), [visitForLoop](../../../org/codehaus/groovy/ast/codevisitorsupport#visitForLoop(org.codehaus.groovy.ast.stmt.ForStatement)), [visitGStringExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitGStringExpression(org.codehaus.groovy.ast.expr.GStringExpression)), [visitIfElse](../../../org/codehaus/groovy/ast/codevisitorsupport#visitIfElse(org.codehaus.groovy.ast.stmt.IfStatement)), [visitLambdaExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitLambdaExpression(org.codehaus.groovy.ast.expr.LambdaExpression)), [visitListExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitListExpression(org.codehaus.groovy.ast.expr.ListExpression)), [visitMapEntryExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitMapEntryExpression(org.codehaus.groovy.ast.expr.MapEntryExpression)), [visitMapExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitMapExpression(org.codehaus.groovy.ast.expr.MapExpression)), [visitMethodCallExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitMethodCallExpression(org.codehaus.groovy.ast.expr.MethodCallExpression)), [visitMethodPointerExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitMethodPointerExpression(org.codehaus.groovy.ast.expr.MethodPointerExpression)), [visitMethodReferenceExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitMethodReferenceExpression(org.codehaus.groovy.ast.expr.MethodReferenceExpression)), [visitNotExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitNotExpression(org.codehaus.groovy.ast.expr.NotExpression)), [visitPostfixExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitPostfixExpression(org.codehaus.groovy.ast.expr.PostfixExpression)), [visitPrefixExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitPrefixExpression(org.codehaus.groovy.ast.expr.PrefixExpression)), [visitPropertyExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitPropertyExpression(org.codehaus.groovy.ast.expr.PropertyExpression)), [visitRangeExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitRangeExpression(org.codehaus.groovy.ast.expr.RangeExpression)), [visitReturnStatement](../../../org/codehaus/groovy/ast/codevisitorsupport#visitReturnStatement(org.codehaus.groovy.ast.stmt.ReturnStatement)), [visitShortTernaryExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitShortTernaryExpression(org.codehaus.groovy.ast.expr.ElvisOperatorExpression)), [visitSpreadExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitSpreadExpression(org.codehaus.groovy.ast.expr.SpreadExpression)), [visitSpreadMapExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitSpreadMapExpression(org.codehaus.groovy.ast.expr.SpreadMapExpression)), [visitStaticMethodCallExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitStaticMethodCallExpression(org.codehaus.groovy.ast.expr.StaticMethodCallExpression)), [visitSwitch](../../../org/codehaus/groovy/ast/codevisitorsupport#visitSwitch(org.codehaus.groovy.ast.stmt.SwitchStatement)), [visitSynchronizedStatement](../../../org/codehaus/groovy/ast/codevisitorsupport#visitSynchronizedStatement(org.codehaus.groovy.ast.stmt.SynchronizedStatement)), [visitTernaryExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitTernaryExpression(org.codehaus.groovy.ast.expr.TernaryExpression)), [visitThrowStatement](../../../org/codehaus/groovy/ast/codevisitorsupport#visitThrowStatement(org.codehaus.groovy.ast.stmt.ThrowStatement)), [visitTryCatchFinally](../../../org/codehaus/groovy/ast/codevisitorsupport#visitTryCatchFinally(org.codehaus.groovy.ast.stmt.TryCatchStatement)), [visitTupleExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitTupleExpression(org.codehaus.groovy.ast.expr.TupleExpression)), [visitUnaryMinusExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitUnaryMinusExpression(org.codehaus.groovy.ast.expr.UnaryMinusExpression)), [visitUnaryPlusExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitUnaryPlusExpression(org.codehaus.groovy.ast.expr.UnaryPlusExpression)), [visitVariableExpression](../../../org/codehaus/groovy/ast/codevisitorsupport#visitVariableExpression(org.codehaus.groovy.ast.expr.VariableExpression)), [visitWhileLoop](../../../org/codehaus/groovy/ast/codevisitorsupport#visitWhileLoop(org.codehaus.groovy.ast.stmt.WhileStatement))` |
Constructor Detail
------------------
###
**MarkupTemplateTypeCheckingExtension.1**()
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") void **addError**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") msg, [ASTNode](../../../org/codehaus/groovy/ast/astnode) expr)
| programming_docs |
groovy [Groovy] Class MarkupTemplateTypeCheckingExtension [Groovy] Class MarkupTemplateTypeCheckingExtension
==================================================
* groovy.text.markup.MarkupTemplateTypeCheckingExtension
```
class MarkupTemplateTypeCheckingExtension
extends [TypeCheckingDSL](../../../org/codehaus/groovy/transform/stc/groovytypecheckingextensionsupport.typecheckingdsl)
```
A static compilation type checking extension, responsible for transforming unresolved method calls into direct calls to [BaseTemplate.methodMissing](basetemplate#methodMissing(java.lang.String,%20java.lang.Object) "BaseTemplate.methodMissing") for faster rendering.
This extension also supports optional type checking of the model
Nested Class Summary
--------------------
Nested classes
| Modifiers | Name | Description |
| `**class**` | `[MarkupTemplateTypeCheckingExtension.1](markuptemplatetypecheckingextension.1)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[MarkupTemplateTypeCheckingExtension](#MarkupTemplateTypeCheckingExtension())**()` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[run](#run())**()` |
Constructor Detail
------------------
###
**MarkupTemplateTypeCheckingExtension**()
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **run**()
groovy [Java] Class BaseTemplate [Java] Class BaseTemplate
=========================
* groovy.text.markup.BaseTemplate
All Implemented Interfaces and Traits: [Writable](../../lang/writable)
```
public abstract class BaseTemplate
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [Writable](../../lang/writable)
```
All templates compiled through [MarkupTemplateEngine](markuptemplateengine "MarkupTemplateEngine") extend this abstract class, which provides a number of utility methods to generate markup. An instance of this class can be obtained after calling [Template.make](../template#make() "Template.make") or [Template.make](../template#make(java.util.Map) "Template.make"))} on a template generated by [MarkupTemplateEngine.createTemplate](markuptemplateengine#createTemplate(java.io.Reader) "MarkupTemplateEngine.createTemplate").
It is advised to use a distinct template instance for each thread (or more simply, each rendered document) for thread safety and avoiding mixing models.
For the application needs, it is possible to provide more helper methods by extending this class and configuring the base template class using the [TemplateConfiguration.setBaseTemplateClass](templateconfiguration#setBaseTemplateClass(Class) "TemplateConfiguration.setBaseTemplateClass") method.
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[BaseTemplate](#BaseTemplate(groovy.text.markup.MarkupTemplateEngine,%20java.util.Map,%20Map,%20groovy.text.markup.TemplateConfiguration))**([MarkupTemplateEngine](markuptemplateengine) templateEngine, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") model, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> modelTypes, [TemplateConfiguration](templateconfiguration) configuration)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[call](#call())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[call](#call(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[call](#call(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") arguments)` |
| | `public [BaseTemplate](basetemplate)` | `**[comment](#comment(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") cs)`Renders the supplied object using its [Object.toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString "Object.toString") method inside a comment markup block (<! |
| | `public [Closure](../../lang/closure)` | `**[contents](#contents(groovy.lang.Closure))**([Closure](../../lang/closure) cl)`Wraps a closure so that it can be used as a prototype for inclusion in layouts. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[fragment](#fragment(java.util.Map,%20java.lang.String))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") model, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templateText)`Renders an embedded template as a fragment. |
| | `public [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")` | `**[getModel](#getModel())**()` |
| | `public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer")` | `**[getOut](#getOut())**()`Convenience method to return the current writer instance. |
| | `public void` | `**[includeEscaped](#includeEscaped(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templatePath)`Includes contents of another file, not as a template but as escaped text. |
| | `public void` | `**[includeGroovy](#includeGroovy(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templatePath)`Includes another template inside this template. |
| | `public void` | `**[includeUnescaped](#includeUnescaped(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templatePath)`Includes contents of another file, not as a template but as unescaped text. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[layout](#layout(java.util.Map,%20java.lang.String))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") model, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templateName)`Imports a template and renders it using the specified model, allowing fine grained composition of templates and layouting. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[layout](#layout(java.util.Map,%20java.lang.String,%20boolean))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") model, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templateName, boolean inheritModel)`Imports a template and renders it using the specified model, allowing fine grained composition of templates and layouting. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[methodMissing](#methodMissing(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") tagName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)`This is the main method responsible for writing a tag and its attributes. |
| | `public void` | `**[newLine](#newLine())**()`Adds a new line to the output. |
| | `public [BaseTemplate](basetemplate)` | `**[pi](#pi(Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<?, ?> attrs)` |
| | `public abstract [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[run](#run())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[stringOf](#stringOf(groovy.lang.Closure))**([Closure](../../lang/closure) cl)` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[tryEscape](#tryEscape(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") contents)`Escapes the string representation of the supplied object if it derives from [CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence"), otherwise returns the object itself. |
| | `public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer")` | `**[writeTo](#writeTo(java.io.Writer))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out)`Main method used to render a template. |
| | `public [BaseTemplate](basetemplate)` | `**[xmlDeclaration](#xmlDeclaration())**()`Renders an XML declaration header. |
| | `public [BaseTemplate](basetemplate)` | `**[yield](#yield(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj)`Renders the object provided as parameter using its [Object.toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "Object.toString") method, The contents is rendered after being escaped for XML, enforcing valid XML output. |
| | `public [BaseTemplate](basetemplate)` | `**[yieldUnescaped](#yieldUnescaped(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj)`Renders the object provided as parameter using its [Object.toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "Object.toString") method, The contents is rendered as is, unescaped. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **BaseTemplate**([MarkupTemplateEngine](markuptemplateengine) templateEngine, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") model, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> modelTypes, [TemplateConfiguration](templateconfiguration) configuration)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **call**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **call**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **call**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") arguments)
### public [BaseTemplate](basetemplate) **comment**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") cs)
Renders the supplied object using its [Object.toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString "Object.toString") method inside a comment markup block (<!-- ... -->). The object is rendered as is, unescaped.
**throws:**
IOException
**Parameters:**
`cs` - the object to be rendered inside an XML comment block.
**Returns:**
this template instance.
### public [Closure](../../lang/closure) **contents**([Closure](../../lang/closure) cl)
Wraps a closure so that it can be used as a prototype for inclusion in layouts. This is useful when you want to use a closure in a model, but that you don't want to render the result of the closure but instead call it as if it was a specification of a template fragment.
**Parameters:**
`cl` - the fragment to be wrapped
**Returns:**
a wrapped closure returning an empty string
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **fragment**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") model, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templateText)
Renders an embedded template as a fragment. Fragments are cached in a template, meaning that if you use the same fragment in a template, it will only be compiled once, but once **per template instance**. This is less performant than using [layout(java.util.Map, String)](#layout(java.util.Map,%20java.lang.String)).
**throws:**
IOException
**throws:**
ClassNotFoundException
**Parameters:**
`model` - model to be passed to the template
`templateText` - template body
**Returns:**
this template instance
### public [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") **getModel**()
### public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") **getOut**()
Convenience method to return the current writer instance.
**Returns:**
the current writer
### public void **includeEscaped**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templatePath)
Includes contents of another file, not as a template but as escaped text.
**throws:**
IOException
**Parameters:**
`templatePath` - the path to the other file
### public void **includeGroovy**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templatePath)
Includes another template inside this template.
**throws:**
IOException
**throws:**
ClassNotFoundException
**Parameters:**
`templatePath` - the path to the included resource.
### public void **includeUnescaped**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templatePath)
Includes contents of another file, not as a template but as unescaped text.
**throws:**
IOException
**Parameters:**
`templatePath` - the path to the other file
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **layout**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") model, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templateName)
Imports a template and renders it using the specified model, allowing fine grained composition of templates and layouting. This works similarily to a template include but allows a distinct model to be used. This version doesn't inherit the model from the parent. If you need model inheritance, see [layout(java.util.Map, String, boolean)](#layout(java.util.Map,%20java.lang.String,%20boolean)).
**throws:**
IOException
**throws:**
ClassNotFoundException
**Parameters:**
`model` - model to be passed to the template
`templateName` - the name of the template to be used as a layout
**Returns:**
this template instance
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **layout**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") model, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templateName, boolean inheritModel)
Imports a template and renders it using the specified model, allowing fine grained composition of templates and layouting. This works similarily to a template include but allows a distinct model to be used. If the layout inherits from the parent model, a new model is created, with the values from the parent model, eventually overridden with those provided specifically for this layout.
**throws:**
IOException
**throws:**
ClassNotFoundException
**Parameters:**
`model` - model to be passed to the template
`templateName` - the name of the template to be used as a layout
`inheritModel` - a boolean indicating if we should inherit the parent model
**Returns:**
this template instance
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **methodMissing**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") tagName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
This is the main method responsible for writing a tag and its attributes. The arguments may be:
* a closure
in which case the closure is rendered inside the tag body * a string
, in which case the string is rendered as the tag body * a map of attributes
in which case the attributes are rendered inside the opening tag
or a combination of (attributes,string), (attributes,closure)
**throws:**
IOException
**Parameters:**
`tagName` - the name of the tag
`args` - tag generation arguments
**Returns:**
this template instance
### public void **newLine**()
Adds a new line to the output. The new line string can be configured by [TemplateConfiguration.setNewLineString](templateconfiguration#setNewLineString(String) "TemplateConfiguration.setNewLineString")
**throws:**
IOException
### public [BaseTemplate](basetemplate) **pi**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<?, ?> attrs)
Renders processing instructions. The supplied map contains all elements to be rendered as processing instructions. The key is the name of the element, the value is either a map of attributes, or an object to be rendered directly. For example:
`pi("xml-stylesheet":[href:"mystyle.css", type:"text/css"])` will be rendered as:
```
<?xml-stylesheet href='mystyle.css' type='text/css'?>
```
**throws:**
IOException
**Parameters:**
`attrs` - the attributes to render
**Returns:**
this template instance
### public abstract [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **run**()
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **stringOf**([Closure](../../lang/closure) cl)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **tryEscape**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") contents)
Escapes the string representation of the supplied object if it derives from [CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence"), otherwise returns the object itself.
**Parameters:**
`contents` - an object to be escaped for XML
**Returns:**
an escaped string, or the object itself
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") **writeTo**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") out)
Main method used to render a template.
**throws:**
IOException
**Parameters:**
`out` - the Writer to which this Writable should output its data.
**Returns:**
a writer instance
### public [BaseTemplate](basetemplate) **xmlDeclaration**()
Renders an XML declaration header. If the declaration encoding is set in the [template configuration](templateconfiguration#getDeclarationEncoding() "template configuration"), then the encoding is rendered into the declaration.
**throws:**
IOException
**Returns:**
this template instance
### public [BaseTemplate](basetemplate) **yield**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj)
Renders the object provided as parameter using its [Object.toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "Object.toString") method, The contents is rendered after being escaped for XML, enforcing valid XML output.
**throws:**
IOException
**Parameters:**
`obj` - the object to be rendered
**Returns:**
this template instance
### public [BaseTemplate](basetemplate) **yieldUnescaped**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") obj)
Renders the object provided as parameter using its [Object.toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "Object.toString") method, The contents is rendered as is, unescaped. This means that depending on what the [Object.toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "Object.toString") method call returns, you might create invalid markup.
**throws:**
IOException
**Parameters:**
`obj` - the object to be rendered unescaped
**Returns:**
this template instance
| programming_docs |
groovy [Groovy] Class TagLibAdapter [Groovy] Class TagLibAdapter
============================
* groovy.text.markup.TagLibAdapter
```
class TagLibAdapter
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Adapts Grails taglibs for use in the template engine. An adapter may be created like this:
```
def model = [:]
def tpl = template.make(model)
model.g = new TagLibAdapter(tpl)
model.g.registerTagLib(SimpleTagLib)
```
where *SimpleTagLib* is:
```
class SimpleTagLib {
def emoticon = { attrs, body ->
out << body() << (attrs.happy == 'true' ? " :-)" : " :-(")
}
}
```
Then it can be used inside a template like this:
```
g.emoticon(happy:'true') { 'Hi John' }
```
Performance-wise, it would be better to reimplement the taglib, but this makes it easier to reuse existing code. Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[TagLibAdapter](#TagLibAdapter(groovy.text.markup.BaseTemplate))**([BaseTemplate](basetemplate) tpl)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[methodMissing](#methodMissing(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)` |
| | `void` | `**[registerTagLib](#registerTagLib(java.lang.Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") tagLibClass)` |
| | `void` | `**[registerTagLib](#registerTagLib(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") tagLib)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
###
**TagLibAdapter**([BaseTemplate](basetemplate) tpl)
Method Detail
-------------
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **methodMissing**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
### void **registerTagLib**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") tagLibClass)
### void **registerTagLib**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") tagLib)
groovy [Java] Class TemplateConfiguration [Java] Class TemplateConfiguration
==================================
* groovy.text.markup.TemplateConfiguration
```
public class TemplateConfiguration
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Configuration options for the [markup template engine](markuptemplateengine "markup template engine").
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[TemplateConfiguration](#TemplateConfiguration())**()` |
| `**[TemplateConfiguration](#TemplateConfiguration(groovy.text.markup.TemplateConfiguration))**([TemplateConfiguration](templateconfiguration) that)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getAutoIndentString](#getAutoIndentString())**()` |
| | `public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<? extends [BaseTemplate](basetemplate "BaseTemplate")>` | `**[getBaseTemplateClass](#getBaseTemplateClass())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getDeclarationEncoding](#getDeclarationEncoding())**()`
**Returns:**
the encoding used in the declaration header
|
| | `public [Locale](https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html "Locale")` | `**[getLocale](#getLocale())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getNewLineString](#getNewLineString())**()` |
| | `public boolean` | `**[isAutoEscape](#isAutoEscape())**()`
**Returns:**
true if variables in the model which are assignable to [CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence") should be automatically escaped.
|
| | `public boolean` | `**[isAutoIndent](#isAutoIndent())**()`
**Returns:**
true if the template engine should handle indents automatically
|
| | `public boolean` | `**[isAutoNewLine](#isAutoNewLine())**()` |
| | `public boolean` | `**[isCacheTemplates](#isCacheTemplates())**()` |
| | `public boolean` | `**[isExpandEmptyElements](#isExpandEmptyElements())**()`
**Returns:**
whether elements without body should be written in the short form (ex: <br/>) or in an expanded form (ex: <br></br>)
|
| | `public boolean` | `**[isUseDoubleQuotes](#isUseDoubleQuotes())**()`
**Returns:**
true if attributes should use double quotes instead of single quotes
|
| | `public void` | `**[setAutoEscape](#setAutoEscape(boolean))**(boolean autoEscape)`Set to true if you want variables in the model which are assignable to [CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence") to be escaped automatically in templates. |
| | `public void` | `**[setAutoIndent](#setAutoIndent(boolean))**(boolean autoIndent)`Set this to true if you want the template engine to render indents automatically. |
| | `public void` | `**[setAutoIndentString](#setAutoIndentString(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") autoIndentString)` |
| | `public void` | `**[setAutoNewLine](#setAutoNewLine(boolean))**(boolean autoNewLine)` |
| | `public void` | `**[setBaseTemplateClass](#setBaseTemplateClass(Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<? extends [BaseTemplate](basetemplate "BaseTemplate")> baseTemplateClass)`Set the template base class. |
| | `public void` | `**[setCacheTemplates](#setCacheTemplates(boolean))**(boolean cacheTemplates)`If cache is enabled, then templates are compiled once for each source (URL or File). |
| | `public void` | `**[setDeclarationEncoding](#setDeclarationEncoding(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") declarationEncoding)`Set the encoding used to write the declaration header. |
| | `public void` | `**[setExpandEmptyElements](#setExpandEmptyElements(boolean))**(boolean expandEmptyElements)` |
| | `public void` | `**[setLocale](#setLocale(java.util.Locale))**([Locale](https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html "Locale") locale)` |
| | `public void` | `**[setNewLineString](#setNewLineString(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") newLineString)` |
| | `public void` | `**[setUseDoubleQuotes](#setUseDoubleQuotes(boolean))**(boolean useDoubleQuotes)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **TemplateConfiguration**()
### public **TemplateConfiguration**([TemplateConfiguration](templateconfiguration) that)
Method Detail
-------------
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getAutoIndentString**()
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<? extends [BaseTemplate](basetemplate "BaseTemplate")> **getBaseTemplateClass**()
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getDeclarationEncoding**()
**Returns:**
the encoding used in the declaration header
### public [Locale](https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html "Locale") **getLocale**()
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getNewLineString**()
### public boolean **isAutoEscape**()
**Returns:**
true if variables in the model which are assignable to [CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence") should be automatically escaped.
### public boolean **isAutoIndent**()
**Returns:**
true if the template engine should handle indents automatically
### public boolean **isAutoNewLine**()
### public boolean **isCacheTemplates**()
### public boolean **isExpandEmptyElements**()
**Returns:**
whether elements without body should be written in the short form (ex: <br/>) or in an expanded form (ex: <br></br>)
### public boolean **isUseDoubleQuotes**()
**Returns:**
true if attributes should use double quotes instead of single quotes
### public void **setAutoEscape**(boolean autoEscape)
Set to true if you want variables in the model which are assignable to [CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence") to be escaped automatically in templates. If this flag is set to true and that you want a value not to be automatically escaped, then you need to use *${unescaped.variable}* instead of *$variable*
**Parameters:**
`autoEscape` - value if the autoEscape flag
### public void **setAutoIndent**(boolean autoIndent)
Set this to true if you want the template engine to render indents automatically. In that case, the supplied writer is wrapped into a [DelegatingIndentWriter](delegatingindentwriter "DelegatingIndentWriter") and indents are inserted after each call to newLine.
**Parameters:**
`autoIndent` - the auto-indent flag
### public void **setAutoIndentString**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") autoIndentString)
### public void **setAutoNewLine**(boolean autoNewLine)
### public void **setBaseTemplateClass**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<? extends [BaseTemplate](basetemplate "BaseTemplate")> baseTemplateClass)
Set the template base class. You can use a distinct template class to provide more statically available data to your templates.
**Parameters:**
`baseTemplateClass` - a class extending [BaseTemplate](basetemplate "BaseTemplate")
### public void **setCacheTemplates**(boolean cacheTemplates)
If cache is enabled, then templates are compiled once for each source (URL or File). It is recommended to keep this flag to true unless you are in development mode and want automatic reloading of templates.
**Parameters:**
`cacheTemplates` - should templates be cached
### public void **setDeclarationEncoding**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") declarationEncoding)
Set the encoding used to write the declaration header. Note that it is the responsibility of the user to ensure that it matches the writer encoding.
**Parameters:**
`declarationEncoding` - encoding to be used in the declaration string
### public void **setExpandEmptyElements**(boolean expandEmptyElements)
### public void **setLocale**([Locale](https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html "Locale") locale)
### public void **setNewLineString**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") newLineString)
### public void **setUseDoubleQuotes**(boolean useDoubleQuotes)
groovy [Java] Class DelegatingIndentWriter [Java] Class DelegatingIndentWriter
===================================
* groovy.text.markup.DelegatingIndentWriter
```
public class DelegatingIndentWriter
extends [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer")
```
A writer which delegates to another writer and supports an additional indenting level.
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[SPACES](#SPACES)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[TAB](#TAB)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[DelegatingIndentWriter](#DelegatingIndentWriter(java.io.Writer))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") delegate)` |
| `**[DelegatingIndentWriter](#DelegatingIndentWriter(java.io.Writer,%20java.lang.String))**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") delegate, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") indentString)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer")` | `**[append](#append(java.lang.CharSequence))**([CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence") csq)` |
| | `public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer")` | `**[append](#append(java.lang.CharSequence,%20int,%20int))**([CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence") csq, int start, int end)` |
| | `public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer")` | `**[append](#append(char))**(char c)` |
| | `public void` | `**[close](#close())**()` |
| | `public void` | `**[flush](#flush())**()` |
| | `public int` | `**[next](#next())**()` |
| | `public int` | `**[previous](#previous())**()` |
| | `public void` | `**[write](#write(int))**(int c)` |
| | `public void` | `**[write](#write(char%5B%5D))**(char[] cbuf)` |
| | `public void` | `**[write](#write(char%5B%5D,%20int,%20int))**(char[] cbuf, int off, int len)` |
| | `public void` | `**[write](#write(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str)` |
| | `public void` | `**[write](#write(java.lang.String,%20int,%20int))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str, int off, int len)` |
| | `public void` | `**[writeIndent](#writeIndent())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer")` | `[append](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#append(java.lang.CharSequence,%20int,%20int) "append"), [append](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#append(java.lang.CharSequence,%20int,%20int) "append"), [append](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#append(char) "append"), [append](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#append(char) "append"), [append](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#append(java.lang.CharSequence) "append"), [append](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#append(java.lang.CharSequence) "append"), [flush](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#flush() "flush"), [write](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#write(java.lang.String,%20int,%20int) "write"), [write](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#write(int) "write"), [write](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#write(java.lang.String) "write"), [write](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#write(%5BC,%20int,%20int) "write"), [write](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#write(%5BC) "write"), [close](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#close() "close"), [nullWriter](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#nullWriter() "nullWriter"), [wait](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html#notifyAll() "notifyAll")` |
Field Detail
------------
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **SPACES**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **TAB**
Constructor Detail
------------------
### public **DelegatingIndentWriter**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") delegate)
### public **DelegatingIndentWriter**([Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") delegate, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") indentString)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") **append**([CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence") csq)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") **append**([CharSequence](https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html "CharSequence") csq, int start, int end)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Writer](https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html "Writer") **append**(char c)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **close**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **flush**()
### public int **next**()
### public int **previous**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **write**(int c)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **write**(char[] cbuf)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **write**(char[] cbuf, int off, int len)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **write**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **write**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str, int off, int len)
### public void **writeIndent**()
| programming_docs |
groovy [Java] Class MarkupTemplateEngine.DefaultTemplateResolver [Java] Class MarkupTemplateEngine.DefaultTemplateResolver
=========================================================
* groovy.text.markup.MarkupTemplateEngine.DefaultTemplateResolver
All Implemented Interfaces and Traits: [TemplateResolver](templateresolver)
```
public static class MarkupTemplateEngine.DefaultTemplateResolver
```
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[DefaultTemplateResolver](#DefaultTemplateResolver())**()` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[configure](#configure(java.lang.ClassLoader,%20groovy.text.markup.TemplateConfiguration))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") templateClassLoader, [TemplateConfiguration](templateconfiguration) configuration)` |
| | `public [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL")` | `**[resolveTemplate](#resolveTemplate(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templatePath)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **DefaultTemplateResolver**()
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **configure**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") templateClassLoader, [TemplateConfiguration](templateconfiguration) configuration)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") **resolveTemplate**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templatePath)
groovy [Java] Class MarkupTemplateEngine.TemplateResource [Java] Class MarkupTemplateEngine.TemplateResource
==================================================
* groovy.text.markup.MarkupTemplateEngine.TemplateResource
```
public static class MarkupTemplateEngine.TemplateResource
```
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public boolean` | `**[hasLocale](#hasLocale())**()` |
| | `public static [TemplateResource](../../../templateresource)` | `**[parse](#parse(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") fullPath)` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()` |
| | `public [TemplateResource](../../../templateresource)` | `**[withLocale](#withLocale(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") locale)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### public boolean **hasLocale**()
### public static [TemplateResource](../../../templateresource) **parse**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") fullPath)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
### public [TemplateResource](../../../templateresource) **withLocale**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") locale)
groovy [Java] Class MarkupTemplateEngine.CachingTemplateResolver [Java] Class MarkupTemplateEngine.CachingTemplateResolver
=========================================================
* groovy.text.markup.MarkupTemplateEngine.CachingTemplateResolver
```
public static class MarkupTemplateEngine.CachingTemplateResolver
extends [DefaultTemplateResolver](../../../defaulttemplateresolver)
```
A template resolver which avoids calling [ClassLoader.getResource](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html#getResource(java.lang.String) "ClassLoader.getResource") if a template path already has been queried before. This improves performance if caching is enabled in the configuration.
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**protected [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL")>**` | `[cache](#cache)` | |
| `**protected boolean**` | `[useCache](#useCache)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[CachingTemplateResolver](#CachingTemplateResolver(Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL")> cache)`Creates a new caching template resolver. |
| `**[CachingTemplateResolver](#CachingTemplateResolver())**()`Creates a new caching template resolver using a concurrent hash map as the backing cache. |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[configure](#configure(java.lang.ClassLoader,%20groovy.text.markup.TemplateConfiguration))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") templateClassLoader, [TemplateConfiguration](templateconfiguration) configuration)` |
| | `public [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL")` | `**[resolveTemplate](#resolveTemplate(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templatePath)` |
Field Detail
------------
### protected final [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL")> **cache**
### protected boolean **useCache**
Constructor Detail
------------------
### public **CachingTemplateResolver**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL")> cache)
Creates a new caching template resolver. The cache implementation being used depends on the use of the template engine. If multiple templates can be rendered in parallel, it **must** be using a thread-safe cache.
**Parameters:**
`cache` - the backing cache
### public **CachingTemplateResolver**()
Creates a new caching template resolver using a concurrent hash map as the backing cache.
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **configure**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") templateClassLoader, [TemplateConfiguration](templateconfiguration) configuration)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") **resolveTemplate**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templatePath)
groovy [Java] Class MarkupTemplateEngine [Java] Class MarkupTemplateEngine
=================================
* groovy.text.markup.MarkupTemplateEngine
```
public class MarkupTemplateEngine
extends [TemplateEngine](../templateengine)
```
A template engine which leverages [StreamingMarkupBuilder](../../xml/streamingmarkupbuilder "StreamingMarkupBuilder") to generate XML/XHTML.
Nested Class Summary
--------------------
Nested classes
| Modifiers | Name | Description |
| `**static class**` | `[MarkupTemplateEngine.CachingTemplateResolver](markuptemplateengine.cachingtemplateresolver)` | A template resolver which avoids calling [ClassLoader.getResource](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html#getResource(java.lang.String) "ClassLoader.getResource") if a template path already has been queried before. |
| `**static class**` | `[MarkupTemplateEngine.DefaultTemplateResolver](markuptemplateengine.defaulttemplateresolver)` | |
| `**static class**` | `[MarkupTemplateEngine.TemplateResource](markuptemplateengine.templateresource)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[MarkupTemplateEngine](#MarkupTemplateEngine())**()` |
| `**[MarkupTemplateEngine](#MarkupTemplateEngine(groovy.text.markup.TemplateConfiguration))**([TemplateConfiguration](templateconfiguration) tplConfig)` |
| `**[MarkupTemplateEngine](#MarkupTemplateEngine(java.lang.ClassLoader,%20groovy.text.markup.TemplateConfiguration))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parentLoader, [TemplateConfiguration](templateconfiguration) tplConfig)` |
| `**[MarkupTemplateEngine](#MarkupTemplateEngine(java.lang.ClassLoader,%20groovy.text.markup.TemplateConfiguration,%20groovy.text.markup.TemplateResolver))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parentLoader, [TemplateConfiguration](templateconfiguration) tplConfig, [TemplateResolver](templateresolver) resolver)` |
| `**[MarkupTemplateEngine](#MarkupTemplateEngine(java.lang.ClassLoader,%20java.io.File,%20groovy.text.markup.TemplateConfiguration))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parentLoader, [File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") templateDirectory, [TemplateConfiguration](templateconfiguration) tplConfig)`Convenience constructor to build a template engine which searches for templates into a directory |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[call](#call(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.classgen.GeneratorContext,%20org.codehaus.groovy.ast.ClassNode))**([SourceUnit](../../../org/codehaus/groovy/control/sourceunit) source, [GeneratorContext](../../../org/codehaus/groovy/classgen/generatorcontext) context, [ClassNode](../../../org/codehaus/groovy/ast/classnode) classNode)` |
| | `public [Template](../template)` | `**[createTemplate](#createTemplate(java.io.Reader))**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader)` |
| | `public [Template](../template)` | `**[createTemplate](#createTemplate(java.io.Reader,%20java.lang.String))**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sourceName)` |
| | `public [Template](../template)` | `**[createTemplate](#createTemplate(java.net.URL))**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") resource)` |
| | `public [Template](../template)` | `**[createTemplateByPath](#createTemplateByPath(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templatePath)` |
| | `public [Template](../template)` | `**[createTypeCheckedModelTemplate](#createTypeCheckedModelTemplate(java.lang.String,%20Map))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") source, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> modelTypes)` |
| | `public [Template](../template)` | `**[createTypeCheckedModelTemplate](#createTypeCheckedModelTemplate(java.lang.String,%20java.lang.String,%20Map))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") source, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sourceName, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> modelTypes)` |
| | `public [Template](../template)` | `**[createTypeCheckedModelTemplate](#createTypeCheckedModelTemplate(java.io.Reader,%20Map))**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> modelTypes)` |
| | `public [Template](../template)` | `**[createTypeCheckedModelTemplate](#createTypeCheckedModelTemplate(java.io.Reader,%20java.lang.String,%20Map))**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sourceName, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> modelTypes)` |
| | `public [Template](../template)` | `**[createTypeCheckedModelTemplate](#createTypeCheckedModelTemplate(java.net.URL,%20Map))**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") resource, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> modelTypes)` |
| | `public [Template](../template)` | `**[createTypeCheckedModelTemplateByPath](#createTypeCheckedModelTemplateByPath(java.lang.String,%20Map))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templatePath, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> modelTypes)` |
| | `public [CompilerConfiguration](../../../org/codehaus/groovy/control/compilerconfiguration)` | `**[getCompilerConfiguration](#getCompilerConfiguration())**()` |
| | `public [TemplateConfiguration](templateconfiguration)` | `**[getTemplateConfiguration](#getTemplateConfiguration())**()` |
| | `public [GroovyClassLoader](../../lang/groovyclassloader)` | `**[getTemplateLoader](#getTemplateLoader())**()` |
| | `public [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL")` | `**[resolveTemplate](#resolveTemplate(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templatePath)` |
| | `public [URLClassLoader](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html "URLClassLoader")` | `**[run](#run())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [TemplateEngine](../templateengine)` | `[createTemplate](../templateengine#createTemplate(java.io.Reader)), [createTemplate](../templateengine#createTemplate(java.lang.String)), [createTemplate](../templateengine#createTemplate(java.io.File)), [createTemplate](../templateengine#createTemplate(java.io.File,%20java.nio.charset.Charset)), [createTemplate](../templateengine#createTemplate(java.net.URL)), [createTemplate](../templateengine#createTemplate(java.net.URL,%20java.nio.charset.Charset))` |
Constructor Detail
------------------
### public **MarkupTemplateEngine**()
### public **MarkupTemplateEngine**([TemplateConfiguration](templateconfiguration) tplConfig)
### public **MarkupTemplateEngine**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parentLoader, [TemplateConfiguration](templateconfiguration) tplConfig)
### public **MarkupTemplateEngine**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parentLoader, [TemplateConfiguration](templateconfiguration) tplConfig, [TemplateResolver](templateresolver) resolver)
### public **MarkupTemplateEngine**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parentLoader, [File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") templateDirectory, [TemplateConfiguration](templateconfiguration) tplConfig)
Convenience constructor to build a template engine which searches for templates into a directory
**Parameters:**
`templateDirectory` - directory where to find templates
`tplConfig` - template engine configuration
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **call**([SourceUnit](../../../org/codehaus/groovy/control/sourceunit) source, [GeneratorContext](../../../org/codehaus/groovy/classgen/generatorcontext) context, [ClassNode](../../../org/codehaus/groovy/ast/classnode) classNode)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Template](../template) **createTemplate**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader)
### public [Template](../template) **createTemplate**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sourceName)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Template](../template) **createTemplate**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") resource)
### public [Template](../template) **createTemplateByPath**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templatePath)
### public [Template](../template) **createTypeCheckedModelTemplate**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") source, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> modelTypes)
### public [Template](../template) **createTypeCheckedModelTemplate**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") source, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sourceName, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> modelTypes)
### public [Template](../template) **createTypeCheckedModelTemplate**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> modelTypes)
### public [Template](../template) **createTypeCheckedModelTemplate**([Reader](https://docs.oracle.com/javase/8/docs/api/java/io/Reader.html "Reader") reader, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sourceName, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> modelTypes)
### public [Template](../template) **createTypeCheckedModelTemplate**([URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") resource, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> modelTypes)
### public [Template](../template) **createTypeCheckedModelTemplateByPath**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templatePath, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> modelTypes)
### public [CompilerConfiguration](../../../org/codehaus/groovy/control/compilerconfiguration) **getCompilerConfiguration**()
### public [TemplateConfiguration](templateconfiguration) **getTemplateConfiguration**()
### public [GroovyClassLoader](../../lang/groovyclassloader) **getTemplateLoader**()
### public [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") **resolveTemplate**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") templatePath)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [URLClassLoader](https://docs.oracle.com/javase/8/docs/api/java/net/URLClassLoader.html "URLClassLoader") **run**()
| programming_docs |
groovy [Java] Class GrabAnnotationTransformation [Java] Class GrabAnnotationTransformation
=========================================
* groovy.grape.GrabAnnotationTransformation
All Implemented Interfaces and Traits:
[ASTTransformation](../../org/codehaus/groovy/transform/asttransformation), [CompilationUnitAware](../transform/compilationunitaware)
```
@[GroovyASTTransformation](../../org/codehaus/groovy/transform/groovyasttransformation "GroovyASTTransformation")(phase=CompilePhase.CONVERSION)
public class GrabAnnotationTransformation
extends [ClassCodeVisitorSupport](../../org/codehaus/groovy/ast/classcodevisitorsupport)
implements [ASTTransformation](../../org/codehaus/groovy/transform/asttransformation), [CompilationUnitAware](../transform/compilationunitaware)
```
Transformation for declarative dependency management.
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [SourceUnit](../../org/codehaus/groovy/control/sourceunit)` | `**[getSourceUnit](#getSourceUnit())**()` |
| | `public void` | `**[setCompilationUnit](#setCompilationUnit(org.codehaus.groovy.control.CompilationUnit))**([CompilationUnit](../../org/codehaus/groovy/control/compilationunit) compilationUnit)` |
| | `public void` | `**[visit](#visit(org.codehaus.groovy.ast.ASTNode,%20org.codehaus.groovy.control.SourceUnit))**([ASTNode](../../org/codehaus/groovy/ast/astnode)[] nodes, [SourceUnit](../../org/codehaus/groovy/control/sourceunit) source)` |
| | `public void` | `**[visitAnnotations](#visitAnnotations(org.codehaus.groovy.ast.AnnotatedNode))**([AnnotatedNode](../../org/codehaus/groovy/ast/annotatednode) node)`Adds the annotation to the internal target list if a match is found. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [ClassCodeVisitorSupport](../../org/codehaus/groovy/ast/classcodevisitorsupport)` | `[addError](../../org/codehaus/groovy/ast/classcodevisitorsupport#addError(java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [getSourceUnit](../../org/codehaus/groovy/ast/classcodevisitorsupport#getSourceUnit()), [visitAnnotation](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitAnnotation(org.codehaus.groovy.ast.AnnotationNode)), [visitAnnotations](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitAnnotations(org.codehaus.groovy.ast.AnnotatedNode)), [visitAnnotations](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitAnnotations(Iterable)), [visitAssertStatement](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitAssertStatement(org.codehaus.groovy.ast.stmt.AssertStatement)), [visitBlockStatement](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitBlockStatement(org.codehaus.groovy.ast.stmt.BlockStatement)), [visitBreakStatement](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitBreakStatement(org.codehaus.groovy.ast.stmt.BreakStatement)), [visitCaseStatement](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitCaseStatement(org.codehaus.groovy.ast.stmt.CaseStatement)), [visitCatchStatement](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitCatchStatement(org.codehaus.groovy.ast.stmt.CatchStatement)), [visitClass](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitClass(org.codehaus.groovy.ast.ClassNode)), [visitClassCodeContainer](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitClassCodeContainer(org.codehaus.groovy.ast.stmt.Statement)), [visitConstructor](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitConstructor(org.codehaus.groovy.ast.ConstructorNode)), [visitConstructorOrMethod](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitConstructorOrMethod(org.codehaus.groovy.ast.MethodNode,%20boolean)), [visitContinueStatement](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitContinueStatement(org.codehaus.groovy.ast.stmt.ContinueStatement)), [visitDeclarationExpression](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitDeclarationExpression(org.codehaus.groovy.ast.expr.DeclarationExpression)), [visitDoWhileLoop](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitDoWhileLoop(org.codehaus.groovy.ast.stmt.DoWhileStatement)), [visitExpressionStatement](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitExpressionStatement(org.codehaus.groovy.ast.stmt.ExpressionStatement)), [visitField](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitField(org.codehaus.groovy.ast.FieldNode)), [visitForLoop](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitForLoop(org.codehaus.groovy.ast.stmt.ForStatement)), [visitIfElse](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitIfElse(org.codehaus.groovy.ast.stmt.IfStatement)), [visitImports](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitImports(org.codehaus.groovy.ast.ModuleNode)), [visitMethod](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitMethod(org.codehaus.groovy.ast.MethodNode)), [visitObjectInitializerStatements](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitObjectInitializerStatements(org.codehaus.groovy.ast.ClassNode)), [visitPackage](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitPackage(org.codehaus.groovy.ast.PackageNode)), [visitProperty](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitProperty(org.codehaus.groovy.ast.PropertyNode)), [visitReturnStatement](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitReturnStatement(org.codehaus.groovy.ast.stmt.ReturnStatement)), [visitStatement](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitStatement(org.codehaus.groovy.ast.stmt.Statement)), [visitSwitch](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitSwitch(org.codehaus.groovy.ast.stmt.SwitchStatement)), [visitSynchronizedStatement](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitSynchronizedStatement(org.codehaus.groovy.ast.stmt.SynchronizedStatement)), [visitThrowStatement](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitThrowStatement(org.codehaus.groovy.ast.stmt.ThrowStatement)), [visitTryCatchFinally](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitTryCatchFinally(org.codehaus.groovy.ast.stmt.TryCatchStatement)), [visitWhileLoop](../../org/codehaus/groovy/ast/classcodevisitorsupport#visitWhileLoop(org.codehaus.groovy.ast.stmt.WhileStatement))` |
| `class [CodeVisitorSupport](../../org/codehaus/groovy/ast/codevisitorsupport)` | `[afterSwitchConditionExpressionVisited](../../org/codehaus/groovy/ast/codevisitorsupport#afterSwitchConditionExpressionVisited(org.codehaus.groovy.ast.stmt.SwitchStatement)), [visitArgumentlistExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitArgumentlistExpression(org.codehaus.groovy.ast.expr.ArgumentListExpression)), [visitArrayExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitArrayExpression(org.codehaus.groovy.ast.expr.ArrayExpression)), [visitAssertStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitAssertStatement(org.codehaus.groovy.ast.stmt.AssertStatement)), [visitAttributeExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitAttributeExpression(org.codehaus.groovy.ast.expr.AttributeExpression)), [visitBinaryExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitBinaryExpression(org.codehaus.groovy.ast.expr.BinaryExpression)), [visitBitwiseNegationExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitBitwiseNegationExpression(org.codehaus.groovy.ast.expr.BitwiseNegationExpression)), [visitBlockStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitBlockStatement(org.codehaus.groovy.ast.stmt.BlockStatement)), [visitBooleanExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitBooleanExpression(org.codehaus.groovy.ast.expr.BooleanExpression)), [visitBreakStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitBreakStatement(org.codehaus.groovy.ast.stmt.BreakStatement)), [visitBytecodeExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitBytecodeExpression(org.codehaus.groovy.classgen.BytecodeExpression)), [visitCaseStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitCaseStatement(org.codehaus.groovy.ast.stmt.CaseStatement)), [visitCastExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitCastExpression(org.codehaus.groovy.ast.expr.CastExpression)), [visitCatchStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitCatchStatement(org.codehaus.groovy.ast.stmt.CatchStatement)), [visitClassExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitClassExpression(org.codehaus.groovy.ast.expr.ClassExpression)), [visitClosureExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitClosureExpression(org.codehaus.groovy.ast.expr.ClosureExpression)), [visitClosureListExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitClosureListExpression(org.codehaus.groovy.ast.expr.ClosureListExpression)), [visitConstantExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitConstantExpression(org.codehaus.groovy.ast.expr.ConstantExpression)), [visitConstructorCallExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitConstructorCallExpression(org.codehaus.groovy.ast.expr.ConstructorCallExpression)), [visitContinueStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitContinueStatement(org.codehaus.groovy.ast.stmt.ContinueStatement)), [visitDeclarationExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitDeclarationExpression(org.codehaus.groovy.ast.expr.DeclarationExpression)), [visitDoWhileLoop](../../org/codehaus/groovy/ast/codevisitorsupport#visitDoWhileLoop(org.codehaus.groovy.ast.stmt.DoWhileStatement)), [visitEmptyStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitEmptyStatement(org.codehaus.groovy.ast.stmt.EmptyStatement)), [visitExpressionStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitExpressionStatement(org.codehaus.groovy.ast.stmt.ExpressionStatement)), [visitFieldExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitFieldExpression(org.codehaus.groovy.ast.expr.FieldExpression)), [visitForLoop](../../org/codehaus/groovy/ast/codevisitorsupport#visitForLoop(org.codehaus.groovy.ast.stmt.ForStatement)), [visitGStringExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitGStringExpression(org.codehaus.groovy.ast.expr.GStringExpression)), [visitIfElse](../../org/codehaus/groovy/ast/codevisitorsupport#visitIfElse(org.codehaus.groovy.ast.stmt.IfStatement)), [visitLambdaExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitLambdaExpression(org.codehaus.groovy.ast.expr.LambdaExpression)), [visitListExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitListExpression(org.codehaus.groovy.ast.expr.ListExpression)), [visitMapEntryExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitMapEntryExpression(org.codehaus.groovy.ast.expr.MapEntryExpression)), [visitMapExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitMapExpression(org.codehaus.groovy.ast.expr.MapExpression)), [visitMethodCallExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitMethodCallExpression(org.codehaus.groovy.ast.expr.MethodCallExpression)), [visitMethodPointerExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitMethodPointerExpression(org.codehaus.groovy.ast.expr.MethodPointerExpression)), [visitMethodReferenceExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitMethodReferenceExpression(org.codehaus.groovy.ast.expr.MethodReferenceExpression)), [visitNotExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitNotExpression(org.codehaus.groovy.ast.expr.NotExpression)), [visitPostfixExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitPostfixExpression(org.codehaus.groovy.ast.expr.PostfixExpression)), [visitPrefixExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitPrefixExpression(org.codehaus.groovy.ast.expr.PrefixExpression)), [visitPropertyExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitPropertyExpression(org.codehaus.groovy.ast.expr.PropertyExpression)), [visitRangeExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitRangeExpression(org.codehaus.groovy.ast.expr.RangeExpression)), [visitReturnStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitReturnStatement(org.codehaus.groovy.ast.stmt.ReturnStatement)), [visitShortTernaryExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitShortTernaryExpression(org.codehaus.groovy.ast.expr.ElvisOperatorExpression)), [visitSpreadExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitSpreadExpression(org.codehaus.groovy.ast.expr.SpreadExpression)), [visitSpreadMapExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitSpreadMapExpression(org.codehaus.groovy.ast.expr.SpreadMapExpression)), [visitStaticMethodCallExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitStaticMethodCallExpression(org.codehaus.groovy.ast.expr.StaticMethodCallExpression)), [visitSwitch](../../org/codehaus/groovy/ast/codevisitorsupport#visitSwitch(org.codehaus.groovy.ast.stmt.SwitchStatement)), [visitSynchronizedStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitSynchronizedStatement(org.codehaus.groovy.ast.stmt.SynchronizedStatement)), [visitTernaryExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitTernaryExpression(org.codehaus.groovy.ast.expr.TernaryExpression)), [visitThrowStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitThrowStatement(org.codehaus.groovy.ast.stmt.ThrowStatement)), [visitTryCatchFinally](../../org/codehaus/groovy/ast/codevisitorsupport#visitTryCatchFinally(org.codehaus.groovy.ast.stmt.TryCatchStatement)), [visitTupleExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitTupleExpression(org.codehaus.groovy.ast.expr.TupleExpression)), [visitUnaryMinusExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitUnaryMinusExpression(org.codehaus.groovy.ast.expr.UnaryMinusExpression)), [visitUnaryPlusExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitUnaryPlusExpression(org.codehaus.groovy.ast.expr.UnaryPlusExpression)), [visitVariableExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitVariableExpression(org.codehaus.groovy.ast.expr.VariableExpression)), [visitWhileLoop](../../org/codehaus/groovy/ast/codevisitorsupport#visitWhileLoop(org.codehaus.groovy.ast.stmt.WhileStatement))` |
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [SourceUnit](../../org/codehaus/groovy/control/sourceunit) **getSourceUnit**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setCompilationUnit**([CompilationUnit](../../org/codehaus/groovy/control/compilationunit) compilationUnit)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **visit**([ASTNode](../../org/codehaus/groovy/ast/astnode)[] nodes, [SourceUnit](../../org/codehaus/groovy/control/sourceunit) source)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **visitAnnotations**([AnnotatedNode](../../org/codehaus/groovy/ast/annotatednode) node)
Adds the annotation to the internal target list if a match is found.
**Parameters:**
`node` - the AST node we are processing
groovy [Java] Class Grape [Java] Class Grape
==================
* groovy.grape.Grape
```
public class Grape
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Facade to GrapeEngine.
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[AUTO\_DOWNLOAD\_SETTING](#AUTO_DOWNLOAD_SETTING)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[DISABLE\_CHECKSUMS\_SETTING](#DISABLE_CHECKSUMS_SETTING)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[SYSTEM\_PROPERTIES\_SETTING](#SYSTEM_PROPERTIES_SETTING)` | |
| `**protected static [GrapeEngine](grapeengine)**` | `[instance](#instance)` | |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public static void` | `**[addResolver](#addResolver(Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> args)` |
| | `public static [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>>>` | `**[enumerateGrapes](#enumerateGrapes())**()` |
| | `public static boolean` | `**[getDisableChecksums](#getDisableChecksums())**()`Global flag to ignore checksums. |
| | `public static boolean` | `**[getEnableAutoDownload](#getEnableAutoDownload())**()`This is a static access auto download enabler. |
| | `public static boolean` | `**[getEnableGrapes](#getEnableGrapes())**()`This is a static access kill-switch. |
| | `public static [GrapeEngine](grapeengine)` | `**[getInstance](#getInstance())**()` |
| | `public static void` | `**[grab](#grab(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") endorsed)` |
| | `public static void` | `**[grab](#grab(Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> dependency)` |
| | `public static void` | `**[grab](#grab(Map,%20java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> args, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") dependencies)` |
| | `public static [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")[]` | `**[listDependencies](#listDependencies(java.lang.ClassLoader))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") cl)` |
| | `public static [URI](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html "URI")[]` | `**[resolve](#resolve(Map,%20java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> args, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") dependencies)` |
| | `public static [URI](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html "URI")[]` | `**[resolve](#resolve(Map,%20java.util.List,%20java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> args, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") depsInfo, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") dependencies)` |
| | `public [Void](https://docs.oracle.com/javase/8/docs/api/java/lang/Void.html "Void")` | `**[run](#run())**()` |
| | `public static void` | `**[setDisableChecksums](#setDisableChecksums(boolean))**(boolean disableChecksums)`Set global flag to ignore checksums. |
| | `public static void` | `**[setEnableAutoDownload](#setEnableAutoDownload(boolean))**(boolean enableAutoDownload)`This is a static access auto download enabler. |
| | `public static void` | `**[setEnableGrapes](#setEnableGrapes(boolean))**(boolean enableGrapes)`This is a static access kill-switch. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **AUTO\_DOWNLOAD\_SETTING**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **DISABLE\_CHECKSUMS\_SETTING**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **SYSTEM\_PROPERTIES\_SETTING**
### protected static [GrapeEngine](grapeengine) **instance**
Method Detail
-------------
### public static void **addResolver**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> args)
### public static [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>>> **enumerateGrapes**()
### public static boolean **getDisableChecksums**()
Global flag to ignore checksums. By default it is set to false.
### public static boolean **getEnableAutoDownload**()
This is a static access auto download enabler. It will set the 'autoDownload' value to the passed in arguments map if not already set. If 'autoDownload' is set the value will not be adjusted.
This applies to the grab and resolve calls.
If it is set to false, only previously downloaded grapes will be used. This may cause failure in the grape call if the library has not yet been downloaded
If it is set to true, then any jars not already downloaded will automatically be downloaded. Also, any versions expressed as a range will be checked for new versions and downloaded (with dependencies) if found.
By default it is set to true.
### public static boolean **getEnableGrapes**()
This is a static access kill-switch. All of the static shortcut methods in this class will not work if this property is set to false. By default it is set to true.
### public static [GrapeEngine](grapeengine) **getInstance**()
### public static void **grab**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") endorsed)
### public static void **grab**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> dependency)
### public static void **grab**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> args, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") dependencies)
### public static [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")[] **listDependencies**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") cl)
### public static [URI](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html "URI")[] **resolve**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> args, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") dependencies)
### public static [URI](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html "URI")[] **resolve**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> args, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") depsInfo, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") dependencies)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Void](https://docs.oracle.com/javase/8/docs/api/java/lang/Void.html "Void") **run**()
### public static void **setDisableChecksums**(boolean disableChecksums)
Set global flag to ignore checksums. By default it is set to false.
### public static void **setEnableAutoDownload**(boolean enableAutoDownload)
This is a static access auto download enabler. It will set the 'autoDownload' value to the passed in arguments map if not already set. If 'autoDownload' is set the value will not be adjusted.
This applies to the grab and resolve calls.
If it is set to false, only previously downloaded grapes will be used. This may cause failure in the grape call if the library has not yet been downloaded.
If it is set to true, then any jars not already downloaded will automatically be downloaded. Also, any versions expressed as a range will be checked for new versions and downloaded (with dependencies) if found. By default it is set to true.
### public static void **setEnableGrapes**(boolean enableGrapes)
This is a static access kill-switch. All of the static shortcut methods in this class will not work if this property is set to false. By default it is set to true.
| programming_docs |
groovy [Java] Interface GrapeEngine [Java] Interface GrapeEngine
============================
```
public interface GrapeEngine
```
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[addResolver](#addResolver(Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> args)` |
| | `public [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>>>` | `**[enumerateGrapes](#enumerateGrapes())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[grab](#grab(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") endorsedModule)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[grab](#grab(java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[grab](#grab(java.util.Map,%20java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") dependencies)` |
| | `public [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")[]` | `**[listDependencies](#listDependencies(java.lang.ClassLoader))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") classLoader)` |
| | `public [URI](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html "URI")[]` | `**[resolve](#resolve(java.util.Map,%20java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") dependencies)` |
| | `public [URI](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html "URI")[]` | `**[resolve](#resolve(java.util.Map,%20java.util.List,%20java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") depsInfo, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") dependencies)` |
Method Detail
-------------
### public void **addResolver**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> args)
### public [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>>> **enumerateGrapes**()
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **grab**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") endorsedModule)
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **grab**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args)
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **grab**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") dependencies)
### public [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")[] **listDependencies**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") classLoader)
### public [URI](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html "URI")[] **resolve**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") dependencies)
### public [URI](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html "URI")[] **resolve**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") depsInfo, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") dependencies)
groovy [Groovy] Class GrapeIvy [Groovy] Class GrapeIvy
=======================
* groovy.grape.GrapeIvy
All Implemented Interfaces and Traits: [GrapeEngine](grapeengine)
```
@[AutoFinal](../transform/autofinal "AutoFinal")
@[CompileStatic](../transform/compilestatic "CompileStatic")
class GrapeIvy
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [GrapeEngine](grapeengine)
```
Implementation supporting `@Grape` and `@Grab` annotations based on Ivy.
Properties Summary
------------------
Properties
| Type | Name and description |
| `**[Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>**` | `[downloadedArtifacts](#downloadedArtifacts)` |
| `**boolean**` | `[enableGrapes](#enableGrapes)` |
| `**[Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<groovy.grape.IvyGrabRecord>**` | `[grabRecordsForCurrDependencies](#grabRecordsForCurrDependencies)`Stores the IvyGrabRecord(s) for all dependencies in each grab() call. |
| `**org.apache.ivy.Ivy**` | `[ivyInstance](#ivyInstance)` |
| `**[Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader"), [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<groovy.grape.IvyGrabRecord>>**` | `[loadedDeps](#loadedDeps)` |
| `**[Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>**` | `[resolvedDependencies](#resolvedDependencies)` |
| `**org.apache.ivy.core.settings.IvySettings**` | `[settings](#settings)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[GrapeIvy](#GrapeIvy())**()` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `void` | `**[addResolver](#addResolver(Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> args)` |
| | `[ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader")` | `**[chooseClassLoader](#chooseClassLoader(java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args)` |
| | `groovy.grape.IvyGrabRecord` | `**[createGrabRecord](#createGrabRecord(java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") dep)` |
| | `[Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>>>` | `**[enumerateGrapes](#enumerateGrapes())**()` |
| | `org.apache.ivy.core.report.ResolveReport` | `**[getDependencies](#getDependencies(java.util.Map,%20groovy.grape.IvyGrabRecord))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args, groovy.grape.IvyGrabRecord[] grabRecords)` |
| | `[File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File")` | `**[getGrapeCacheDir](#getGrapeCacheDir())**()` |
| | `[File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File")` | `**[getGrapeDir](#getGrapeDir())**()` |
| | `[File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File")` | `**[getGroovyRoot](#getGroovyRoot())**()` |
| | `[File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File")` | `**[getLocalGrapeConfig](#getLocalGrapeConfig())**()` |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[grab](#grab(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") endorsedModule)` |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[grab](#grab(java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args)` |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[grab](#grab(java.util.Map,%20java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")[] dependencies)` |
| | `[Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")[]` | `**[listDependencies](#listDependencies(java.lang.ClassLoader))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") classLoader)` |
| | `void` | `**[processOtherServices](#processOtherServices(java.lang.ClassLoader,%20java.io.File))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") loader, [File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") f)` |
| | `void` | `**[processRunners](#processRunners(java.io.InputStream,%20java.lang.String,%20java.lang.ClassLoader))**([InputStream](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html "InputStream") is, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") loader)` |
| | `void` | `**[processSerializedCategoryMethods](#processSerializedCategoryMethods(java.io.InputStream))**([InputStream](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html "InputStream") is)` |
| | `[URI](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html "URI")[]` | `**[resolve](#resolve(java.util.Map,%20java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")[] dependencies)` |
| | `[URI](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html "URI")[]` | `**[resolve](#resolve(java.util.Map,%20java.util.List,%20java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") depsInfo, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")[] dependencies)` |
| | `[URI](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html "URI")[]` | `**[resolve](#resolve(java.lang.ClassLoader,%20java.util.Map,%20java.util.Map))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") loader, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")[] dependencies)` |
| | `[URI](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html "URI")[]` | `**[resolve](#resolve(java.lang.ClassLoader,%20java.util.Map,%20java.util.List,%20java.util.Map))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") loader, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") depsInfo, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")[] dependencies)` |
| | `void` | `**[uninstallArtifact](#uninstallArtifact(java.lang.String,%20java.lang.String,%20java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") group, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") module, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") rev)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Property Detail
---------------
###
[Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> **downloadedArtifacts**
### boolean **enableGrapes**
### final [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<groovy.grape.IvyGrabRecord> **grabRecordsForCurrDependencies**
Stores the IvyGrabRecord(s) for all dependencies in each grab() call.
### org.apache.ivy.Ivy **ivyInstance**
### final [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader"), [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<groovy.grape.IvyGrabRecord>> **loadedDeps**
###
[Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> **resolvedDependencies**
### org.apache.ivy.core.settings.IvySettings **settings**
Constructor Detail
------------------
###
**GrapeIvy**()
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") void **addResolver**(@NamedParams(value: [org.codehaus.groovy.ast.AnnotationNode@688d3f38[@NamedParam(value: name, type: String, required: true)], org.codehaus.groovy.ast.AnnotationNode@3f7246a3[@NamedParam(value: root, type: String, required: true)], org.codehaus.groovy.ast.AnnotationNode@abd4c6b[@NamedParam(value: m2Compatible, type: Boolean, required: false)]]) [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> args)
###
[ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") **chooseClassLoader**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args)
### groovy.grape.IvyGrabRecord **createGrabRecord**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") dep)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>>> **enumerateGrapes**()
### org.apache.ivy.core.report.ResolveReport **getDependencies**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args, groovy.grape.IvyGrabRecord[] grabRecords)
###
[File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") **getGrapeCacheDir**()
###
[File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") **getGrapeDir**()
###
[File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") **getGroovyRoot**()
###
[File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") **getLocalGrapeConfig**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **grab**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") endorsedModule)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **grab**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **grab**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")[] dependencies)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")[] **listDependencies**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") classLoader)
### void **processOtherServices**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") loader, [File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") f)
### void **processRunners**([InputStream](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html "InputStream") is, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") loader)
### void **processSerializedCategoryMethods**([InputStream](https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html "InputStream") is)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") [URI](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html "URI")[] **resolve**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")[] dependencies)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") [URI](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html "URI")[] **resolve**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") depsInfo, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")[] dependencies)
###
[URI](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html "URI")[] **resolve**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") loader, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")[] dependencies)
###
[URI](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html "URI")[] **resolve**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") loader, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") args, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") depsInfo, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")[] dependencies)
### void **uninstallArtifact**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") group, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") module, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") rev)
| programming_docs |
groovy [Java] Enum SealedMode [Java] Enum SealedMode
======================
* groovy.transform.SealedMode
```
public enum SealedMode
extends [Enum](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html "Enum")
```
Intended mode to use for sealed classes when using the `@Sealed` annotation (or `sealed` keyword).
**Since:**
4.0.0
**See Also:**
[Sealed](sealed "Sealed")
Enum Constants Summary
----------------------
Enum constants classes
| Enum constant | Description |
| `**[AUTO](#AUTO)**` | Produce native sealed classes when compiling for a suitable target bytecode (JDK17+) and automatically emulate the concept on earlier JDKs. |
| `**[EMULATE](#EMULATE)**` | Indicate the sealed nature using annotations. |
| `**[NATIVE](#NATIVE)**` | Produce Java-like code with sealed nature indicated by "native" bytecode information (JEP 360/397/409). |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Enum](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html "Enum")` | `[name](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#name() "name"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#hashCode() "hashCode"), [compareTo](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo(java.lang.Object) "compareTo"), [compareTo](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo(java.lang.Enum) "compareTo"), [valueOf](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#valueOf(java.lang.Class,%20java.lang.String) "valueOf"), [describeConstable](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#describeConstable() "describeConstable"), [getDeclaringClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getDeclaringClass() "getDeclaringClass"), [ordinal](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#ordinal() "ordinal"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait(long) "wait"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#notifyAll() "notifyAll")` |
Enum Constant Detail
--------------------
### public [SealedMode](sealedmode) **AUTO**
Produce native sealed classes when compiling for a suitable target bytecode (JDK17+) and automatically emulate the concept on earlier JDKs.
### public [SealedMode](sealedmode) **EMULATE**
Indicate the sealed nature using annotations. This allows sealed hierarchies in earlier JDKs but for integration purposes won't be recognised by Java.
### public [SealedMode](sealedmode) **NATIVE**
Produce Java-like code with sealed nature indicated by "native" bytecode information (JEP 360/397/409). Produces a compile-time error when used on earlier JDKs.
groovy [Java] Annotation Type SelfType [Java] Annotation Type SelfType
===============================
* groovy.transform.SelfType
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE})
public @interface SelfType
```
This annotation can be added on a trait to declare the list of types that a class implementing that trait is supposed to extend. This is useful when you want to be able to call methods from the class implementing the trait without having to declare all of them as members of the trait. Self types are particularly useful in combination with [CompileStatic](compilestatic "CompileStatic"), if you know that a trait can only be applied to a specific type but that the trait cannot extend that type itself. For example, imagine the following code:
```
class Component { void methodInComponent() }
trait ComponentDecorator {
void logAndCall() {
println "Calling method in component"
methodInComponent()
}
// other useful methods
}
class DecoratedComponent extends Component implements ComponentDecorator {}
```
This will work because the trait uses the dynamic backend, so there is no check at compile time that the *methodInComponent* call in *logAndCall* is actually defined. If you annotate the trait with [CompileStatic](compilestatic "CompileStatic"), compilation will fail because the trait does not define the method. To declare that the trait can be applied on something that will extend *Component*, you need to add the *SelfType* annotation like this:
```
class Component { void methodInComponent() }
@CompileStatic
@SelfType(Component)
trait ComponentDecorator {
void logAndCall() {
println "Calling method in component"
methodInComponent()
}
// other useful methods
}
class DecoratedComponent extends Component implements ComponentDecorator {}
```
This pattern can therefore be used to avoid explicit casts everywhere you need to call a method that you know is defined in the class that will implement the trait but normally don't have access to, which is often the case where a trait needs to be applied on a class provided by a third-party library.
**Since:**
2.4.0
Element Summary
---------------
Required Element Summary
| Type | Name and Description |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[]**` | `[value](#value)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] **value**
groovy [Java] Annotation Type Memoized [Java] Annotation Type Memoized
===============================
* groovy.transform.Memoized
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ ElementType.METHOD })
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.MemoizedASTTransformation")
public @interface Memoized
```
Method annotation that creates a cache for the results of the execution of the annotated method. Whenever the method is called, the mapping between the parameters and the return value is preserved in a cache making subsequent calls with the same arguments fast.
Example usage:
```
class MemoizedExample {
@Memoized
int sum(int n1, int n2) {
println "$n1 + $n2 = ${n1 + n2}"
n1 + n2
}
}
```
which becomes (approximately):
```
class MemoizedExample {
private final Closure memoizedSum = { int n1, int n2 ->
private$method$memoizedSum(n1,n2)
}.memoize()
int sum(int n1, int n2) {
memoizedSum(n1, n2)
}
private private$method$memoizedSum(int n1, int n2) {
println "$n1 + $n2 = ${n1 + n2}"
n1 + n2
}
}
```
Upon execution of this code:
```
def instance = new MemoizedExample()
println instance.sum(1, 2)
println instance.sum(1, 2)
println instance.sum(2, 3)
println instance.sum(2, 3)
```
The following will be output:
```
1 + 2 = 3
3
3
2 + 3 = 5
5
5
```
More examples:
```
import groovy.transform.*
// Script variable which is changed when increment()
// method is invoked.
// If cached method call is invoked then the value
// of this variable will not change.
@Field boolean incrementChange = false
@Memoized
int increment(int value) {
incrementChange = true
value + 1
}
// Invoke increment with argument 10.
increment(10)
// increment is invoked so incrementChange is true.
assert incrementChange
// Set incrementChange back to false.
incrementChange = false
// Invoke increment with argument 10.
increment(10)
// Now the cached method is used and
// incrementChange is not changed.
assert !incrementChange
// Invoke increment with other argument value.
increment(11)
// increment is invoked so incrementChange is true.
assert incrementChange
```
**Since:**
2.2.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**int**` | `[maxCacheSize](#maxCacheSize)`The maximum size the cache can grow to. |
| `**int**` | `[protectedCacheSize](#protectedCacheSize)`Number of cached return values to protect from garbage collection. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public int **maxCacheSize**
The maximum size the cache can grow to.
**Default:**
0
### public int **protectedCacheSize**
Number of cached return values to protect from garbage collection.
**Default:**
0
groovy [Java] Annotation Type NullCheck [Java] Annotation Type NullCheck
================================
* groovy.transform.NullCheck
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.NullCheckASTTransformation")
public @interface NullCheck
```
Class, method or constructor annotation which indicates that each parameter should be checked to ensure it isn't null. If placed at the class level, all explicit methods and constructors will be checked. Explicit means those declared within the class and not inherited or added by transforms (but see [includeGenerated()](#includeGenerated())).
Example usage:
```
import groovy.transform.NullCheck
import static groovy.test.GroovyAssert.shouldFail
@NullCheck
class Greeter {
private String audience
Greeter(String audience) {
this.audience = audience.toLowerCase()
}
String greeting(String salutation) {
salutation.toUpperCase() + ' ' + audience
}
}
assert new Greeter('World').greeting('hello') == 'HELLO world'
def ex = shouldFail(IllegalArgumentException) { new Greeter(null) }
assert ex.message == 'audience cannot be null'
ex = shouldFail(IllegalArgumentException) { new Greeter('Universe').greeting(null) }
assert ex.message == 'salutation cannot be null'
```
The produced code for the above example looks like this:
```
class Greeter {
private String audience
Foo(String audience) {
if (audience == null) throw new IllegalArgumentException('audience cannot be null')
this.audience = audience.toLowerCase()
}
String greeting(String salutation) {
if (salutation == null) throw new IllegalArgumentException('salutation cannot be null')
salutation.toUpperCase() + ' ' + audience
}
}
```
**Since:**
3.0.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[includeGenerated](#includeGenerated)`Whether to try to add null checking to generated methods/constructors such as those added by other transforms. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **includeGenerated**
Whether to try to add null checking to generated methods/constructors such as those added by other transforms. Using this option may lead to surprising results, e.g. it will only apply to methods/constructors added prior to when the `NullCheck` transformation is processed. Null checking is not enabled for constructors containing generated bytecode or generated constructors with calls to this(...) or super(...) regardless of this flag.
**Since:**
3.0.2
**Default:**
false
groovy [Java] Annotation Type AnnotationCollector [Java] Annotation Type AnnotationCollector
==========================================
* groovy.transform.AnnotationCollector
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.ANNOTATION_TYPE, ElementType.TYPE})
public @interface AnnotationCollector
```
The AnnotationCollector can be used to define aliases for groups of annotations. The Alias needs to be a class or annotation annotated with AnnotationCollector, otherwise nothing is required. The alias will be replaced on the AST level and will never appear in later. Any members of the class or annotation will be ignored, but could be used by a custom processor. Annotation arguments are mapped to the aliased annotations if existing. Should the default processor not be able to map one of the arguments and error will be given. Is this not wished or if you want a different mapping a custom processor has to be used. There are two ways of using the alias. The first way is by providing the annotations as list/array:
```
import groovy.transform.*
@AnnotationCollector([ToString, EqualsAndHashCode, Immutable])
@interface Alias {}
@Alias(excludes=["a"])
class Foo {
Integer a, b
}
assert Foo.class.annotations.size() == 3
assert new Foo(a: 1, b: 2).toString() == "Foo(2)"
```
In the example above we have Alias as the alias annotation and an argument excludes which will be mapped to ToString and EqualsAndHashCode. Immutable doesn't have excludes, thus nothing will be done there.
The other way is to add annotations to the alias:
```
import groovy.transform.*
@ToString(excludes=["a"])
@EqualsAndHashCode
@Immutable
@AnnotationCollector
@interface Alias {}
@Alias
class Foo {
Integer a, b
}
assert Foo.class.annotations.size() == 3
assert new Foo(a: 1, b: 2).toString() == "Foo(2)"
```
In the example above we have again Alias as the alias annotation, but this time the argument is part of the alias. Instead of mapping excludes to ToString as well as EqualsAndHashCode, only ToString will have the excludes. Again the alias can have an argument excludes, which would overwrite the excludes given in from the definition and be mapped to ToString as well as EqualsAndHashCode. If both ways are combined, then the list overwrites annotation usage. NOTE: The aliasing does not support aliasing of aliased annotations. More examples:
```
//--------------------------------------------------------------------------
import groovy.transform.*
@AnnotationCollector([EqualsAndHashCode, ToString])
@interface Simple {}
@Simple
class User {
String username
int age
}
def user = new User(username: 'mrhaki', age: 39)
assert user.toString() == 'User(mrhaki, 39)'
// We still have 2 annotations:
assert User.class.annotations.size() == 2
// We can use the attributes from the
// grouped annotations.
@Simple(excludes = 'street')
class Address {
String street, town
}
def address = new Address(street: 'Evergreen Terrace', town: 'Springfield')
assert address.toString() == 'Address(Springfield)'
```
```
//--------------------------------------------------------------------------
// Use a custom processor to handle attributes.
import org.codehaus.groovy.transform.*
import org.codehaus.groovy.ast.*
import org.codehaus.groovy.control.*
class SimpleProcessor extends AnnotationCollectorTransform {
public List<AnnotationNode> visit(AnnotationNode collector,
AnnotationNode aliasAnnotationUsage,
AnnotatedNode aliasAnnotated,
SourceUnit source) {
// Get attributes and attribute value for dontUse.
def attributes = aliasAnnotationUsage.getMembers()
def dontUse = attributes.get('dontUse')
attributes.remove('dontUse')
if (dontUse) {
// Assign value of dontUse to excludes attributes.
aliasAnnotationUsage.addMember("excludes", dontUse)
}
super.visit(collector, aliasAnnotationUsage, aliasAnnotated, source)
}
}
new GroovyShell(this.class.classLoader).evaluate '''
import groovy.transform.*
@AnnotationCollector(value = [EqualsAndHashCode, ToString], processor = 'SimpleProcessor')
@interface Simple {}
@Simple(dontUse = 'age')
class User {
String username
int age
}
def user = new User(username: 'mrhaki', age: 39)
assert user.toString() == 'User(mrhaki)'
'''
```
```
//--------------------------------------------------------------------------
// Use AnnotationCollector as last annotation to group the
// previous annotations.
import groovy.transform.*
@EqualsAndHashCode
@ToString
@AnnotationCollector
@interface Simple {}
@Simple
class User {
String username
}
def user = new User(username: 'mrhaki')
assert user.toString() == 'User(mrhaki)'
```
**See Also:**
[AnnotationCollectorTransform](../../org/codehaus/groovy/transform/annotationcollectortransform "AnnotationCollectorTransform")
**Since:**
2.1.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**[AnnotationCollectorMode](annotationcollectormode)**` | `[mode](#mode)`When the collector annotation is replaced, whether to check for duplicates between the replacement annotations and existing explicit annotations. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[processor](#processor)`Processor used for computing custom logic or the list of annotations, or both. |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")**` | `[serializeClass](#serializeClass)`Used internally - the default value is a marker value indicating that the attribute hasn't been set. |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[]**` | `[value](#value)`List of aliased annotations. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [AnnotationCollectorMode](annotationcollectormode) **mode**
When the collector annotation is replaced, whether to check for duplicates between the replacement annotations and existing explicit annotations. If you use a custom processor, it is up to that processor whether it honors or ignores this parameter. The default processor honors the parameter.
**Default:**
AnnotationCollectorMode.DUPLICATE
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **processor**
Processor used for computing custom logic or the list of annotations, or both. The default is org.codehaus.groovy.transform.AnnotationCollectorTransform. Custom processors need to extend that class.
**Default:**
"org.codehaus.groovy.transform.AnnotationCollectorTransform"
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **serializeClass**
Used internally - the default value is a marker value indicating that the attribute hasn't been set. Normally set automatically during annotation processing to an automatically created nested helper class which holds serialization information used in pre-compiled scenarios. If set to the collector annotation, re-purposes the annotation itself to become the helper class (legacy approach used in Groovy 2.5 up to 2.5.2).
**Default:**
Undefined.CLASS.class
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] **value**
List of aliased annotations.
**Default:**
{}
| programming_docs |
groovy [Java] Annotation Type WithReadLock [Java] Annotation Type WithReadLock
===================================
* groovy.transform.WithReadLock
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.METHOD})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.ReadWriteLockASTTransformation")
public @interface WithReadLock
```
This annotation is used in conjunction with [WithWriteLock](withwritelock "WithWriteLock") to support read and write synchronization on a method.
To use this annotation, declare `@WithReadLock` on your method. The method may be either an instance method or a static method. The resulting method will allow multiple threads to read the information at the same time. However, if some other method obtains a write lock, then this method will force callers to wait until the write is complete.
This annotation is a declarative wrapper around the JDK's `java.util.concurrent.locks.ReentrantReadWriteLock`. Objects containing this annotation will have a ReentrantReadWriteLock field named `$reentrantLock` added to the class, and method access is protected by the lock. If the method is static then the field is static and named `$REENTRANTLOCK`.
The annotation takes an optional parameter for the name of the field. This field must exist on the class and must be of type ReentrantReadWriteLock.
To understand how this annotation works, it is convenient to think in terms of the source code it replaces. The following is a typical usage of this annotation from Groovy:
```
import groovy.transform.*;
public class ResourceProvider {
private final Map<String, String> data = new HashMap<String, String>();
@WithReadLock
public String getResource(String key) throws Exception {
return data.get(key);
}
@WithWriteLock
public void refresh() throws Exception {
//reload the resources into memory
}
}
```
As part of the Groovy compiler, code resembling this is produced:
```
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.concurrent.locks.ReadWriteLock;
public class ResourceProvider {
private final ReadWriteLock $reentrantlock = new ReentrantReadWriteLock();
private final Map<String, String> data = new HashMap<String, String>();
public String getResource(String key) throws Exception {
$reentrantlock.readLock().lock();
try {
return data.get(key);
} finally {
$reentrantlock.readLock().unlock();
}
}
public void refresh() throws Exception {
$reentrantlock.writeLock().lock();
try {
//reload the resources into memory
} finally {
$reentrantlock.writeLock().unlock();
}
}
}
```
**Since:**
1.8.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[value](#value)`
**Returns:**
if a user specified lock object with the given name should be used the lock object must exist.
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **value**
**Returns:**
if a user specified lock object with the given name should be used the lock object must exist. If the annotated method is static then the lock object must be static. If the annotated method is not static then the lock object must not be static.
**Default:**
""
groovy [Java] Annotation Type PropertyOptions [Java] Annotation Type PropertyOptions
======================================
* groovy.transform.PropertyOptions
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE})
public @interface PropertyOptions
```
Marker annotation used to indicate that special property handling code will be generated for this class.
**See Also:**
[Immutable](immutable "Immutable")
[ImmutableBase](immutablebase "ImmutableBase")
[MapConstructor](mapconstructor "MapConstructor")
[TupleConstructor](tupleconstructor "TupleConstructor")
**Since:**
2.5.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<? extends [PropertyHandler](options/propertyhandler "PropertyHandler")>**` | `[propertyHandler](#propertyHandler)`The property handler class which creates the necessary code for getting, setting or initializing properties. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<? extends [PropertyHandler](options/propertyhandler "PropertyHandler")> **propertyHandler**
The property handler class which creates the necessary code for getting, setting or initializing properties.
**Default:**
DefaultPropertyHandler.class
groovy [Java] Annotation Type ExternalizeVerifier [Java] Annotation Type ExternalizeVerifier
==========================================
* groovy.transform.ExternalizeVerifier
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.ExternalizeVerifierASTTransformation")
public @interface ExternalizeVerifier
```
Class annotation used to assist in the creation of `Externalizable` classes. The `@ExternalizeVerifier` annotation instructs the compiler to check that a class has `writeExternal()` and `readExternal()` methods, implements the `Externalizable` interface and that each property (and optionally field) is not final and, optionally for non-primitives, has a type which is either `Externalizable` or `Serializable`. Properties or fields marked as `transient` are ignored. This annotation is typically used in conjunction with the `@ExternalizeMethods` annotation but most usually not directly but rather via `@AutoExternalizable` which is a shortcut for both annotations.
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[checkPropertyTypes](#checkPropertyTypes)`Turns on strict type checking for property (or field) types. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[excludes](#excludes)`Comma separated list of property names to exclude from externalization verification. |
| `**boolean**` | `[includeFields](#includeFields)`Include fields as well as properties when verifying externalization properties. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **checkPropertyTypes**
Turns on strict type checking for property (or field) types. In strict mode, such types must also implement Serializable or Externalizable. If your properties have interface types that don't implement Serializable but all the concrete implementations do, or the type is of a non-Serializable class but the property will be null at runtime, then your instances will still be serializable but you can't turn on strict checking.
**Default:**
false
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **excludes**
Comma separated list of property names to exclude from externalization verification. For convenience, a String with comma separated names can be used in addition to an array (using Groovy's literal list notation) of String values.
**Default:**
{}
### public boolean **includeFields**
Include fields as well as properties when verifying externalization properties.
**Default:**
false
groovy [Java] Annotation Type Synchronized [Java] Annotation Type Synchronized
===================================
* groovy.transform.Synchronized
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.METHOD})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.SynchronizedASTTransformation")
public @interface Synchronized
```
Method annotation to make a method call synchronized for concurrency handling with some useful baked-in conventions.
`@Synchronized` is a safer variant of the `synchronized` method modifier. The annotation can only be used on static and instance methods. It operates similarly to the `synchronized` keyword, but it locks on different objects. When used with an instance method, the `synchronized` keyword locks on `this`, but the annotation locks on a (by default automatically generated) field named `$lock`. If the field does not exist, it is created for you. If you annotate a static method, the annotation locks on a static field named `$LOCK` instead.
If you want, you can create these locks yourself. The `$lock` and `$LOCK` fields will not be generated if you create them yourself. You can also choose to lock on another field, by specifying its name as parameter to the `@Synchronized` annotation. In this usage variant, the lock field will not be created automatically, and you must explicitly create it yourself.
*Rationale:* Locking on `this` or your own class object can have unfortunate side-effects, as other code not under your control can lock on these objects as well, which can cause race conditions and other nasty threading-related bugs.
*Example usage:*
```
class SynchronizedExample {
private final myLock = new Object()
@Synchronized
static void greet() {
println "world"
}
@Synchronized
int answerToEverything() {
return 42
}
@Synchronized("myLock")
void foo() {
println "bar"
}
}
```
which becomes:
```
class SynchronizedExample {
private static final $LOCK = new Object[0]
private final $lock = new Object[0]
private final myLock = new Object()
static void greet() {
synchronized($LOCK) {
println "world"
}
}
int answerToEverything() {
synchronized($lock) {
return 42
}
}
void foo() {
synchronized(myLock) {
println "bar"
}
}
}
```
*Credits:* this annotation is inspired by the Project Lombok annotation of the same name. The functionality has been kept similar to ease the learning curve when swapping between these two tools. *Details:* If `$lock` and/or `$LOCK` are auto-generated, the fields are initialized with an empty `Object[]` array, and not just a new `Object()` as many snippets using this pattern tend to use. This is because a new `Object` is NOT serializable, but a 0-size array is. Therefore, using `@Synchronized` will not prevent your object from being serialized.
More examples:
```
import groovy.transform.Synchronized
class Util {
private counter = 0
private def list = ['Groovy']
private Object listLock = new Object[0]
@Synchronized
void workOnCounter() {
assert 0 == counter
counter++
assert 1 == counter
counter --
assert 0 == counter
}
@Synchronized('listLock')
void workOnList() {
assert 'Groovy' == list[0]
list << 'Grails'
assert 2 == list.size()
list = list - 'Grails'
assert 'Groovy' == list[0]
}
}
def util = new Util()
def tc1 = Thread.start {
100.times {
util.workOnCounter()
sleep 20
util.workOnList()
sleep 10
}
}
def tc2 = Thread.start {
100.times {
util.workOnCounter()
sleep 10
util.workOnList()
sleep 15
}
}
tc1.join()
tc2.join()
```
**Since:**
1.7.3
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[value](#value)`
**Returns:**
if a user specified lock object with the given name should be used
**Default:**
""
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **value**
**Returns:**
if a user specified lock object with the given name should be used
**Default:**
""
groovy [Java] Annotation Type VisibilityOptions [Java] Annotation Type VisibilityOptions
========================================
* groovy.transform.VisibilityOptions
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE, ElementType.CONSTRUCTOR, ElementType.METHOD})
public @interface VisibilityOptions
```
Marker annotation used in the context of AST transformations to provide a custom visibility.
**Since:**
2.5.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**[Visibility](options/visibility)**` | `[constructor](#constructor)`
**Default:**
Visibility.UNDEFINED
|
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[id](#id)`
**Default:**
Undefined.STRING
|
| `**[Visibility](options/visibility)**` | `[method](#method)`
**Default:**
Visibility.UNDEFINED
|
| `**[Visibility](options/visibility)**` | `[type](#type)`
**Default:**
Visibility.UNDEFINED
|
| `**[Visibility](options/visibility)**` | `[value](#value)`
**Default:**
Visibility.UNDEFINED
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [Visibility](options/visibility) **constructor**
**Default:**
Visibility.UNDEFINED
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **id**
**Default:**
Undefined.STRING
### public [Visibility](options/visibility) **method**
**Default:**
Visibility.UNDEFINED
### public [Visibility](options/visibility) **type**
**Default:**
Visibility.UNDEFINED
### public [Visibility](options/visibility) **value**
**Default:**
Visibility.UNDEFINED
| programming_docs |
groovy [Groovy] Annotation Type RecordType [Groovy] Annotation Type RecordType
===================================
* groovy.transform.RecordType
All Implemented Interfaces and Traits: [Annotation](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html "Annotation")
```
@[RecordBase](recordbase "RecordBase")
@[RecordOptions](recordoptions "RecordOptions")
@[TupleConstructor](tupleconstructor "TupleConstructor")(namedVariant: true, force: true, defaultsMode: DefaultsMode.AUTO)
@[PropertyOptions](propertyoptions "PropertyOptions")
@[KnownImmutable](knownimmutable "KnownImmutable")
@[POJO](stc/pojo "POJO")
@[CompileStatic](compilestatic "CompileStatic")
@[AnnotationCollector](annotationcollector "AnnotationCollector")(mode: AnnotationCollectorMode.PREFER_EXPLICIT_MERGED)
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(value: RetentionPolicy.RUNTIME)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")(value: [ElementType.TYPE])
@[Incubating](../../org/apache/groovy/lang/annotation/incubating "Incubating")
@interface RecordType
```
Meta annotation used when defining record-like classes.
It allows you to write classes in this shortened form:
```
@groovy.transform.RecordType
class Cyclist {
String firstName
String lastName
}
def richie = new Cyclist('Richie', 'Porte')
assert richie.toString() =~ /Cyclist.*firstName.*Richie/
```
The `@RecordType` meta-annotation corresponds to adding the following annotations: [RecordBase](recordbase "RecordBase") (which internally piggybacks on `@ToString` and `@EqualsAndHashCode`), [ImmutableOptions](immutableoptions "ImmutableOptions"), [PropertyOptions](propertyoptions "PropertyOptions"), [CompileStatic](compilestatic "CompileStatic"), [POJO](stc/pojo "POJO"), [TupleConstructor](tupleconstructor "TupleConstructor") and [KnownImmutable](knownimmutable "KnownImmutable"). Together these annotations instruct the compiler to execute the necessary transformations to add the necessary getters, constructors, equals, hashCode and other helper methods that are typically written when creating record-like classes with the defined properties. A class created in this way has the following characteristics:
* The class is automatically made final
* The serialVersionUID is by default 0
* Properties automatically have private, final backing fields with getters which are the same name as the fields.
* A map-based constructor is provided which allows you to set properties by name.
* A tuple-style constructor is provided which allows you to set properties in the same order as they are defined.
* Default `equals`, `hashCode` and `toString` methods are provided based on the property values.
Record-like classes are particularly useful for data structures.
**See Also:**
[RecordBase](recordbase "RecordBase")
[ImmutableOptions](immutableoptions "ImmutableOptions")
[PropertyOptions](propertyoptions "PropertyOptions")
[TupleConstructor](tupleconstructor "TupleConstructor")
[KnownImmutable](knownimmutable "KnownImmutable")
[CompileStatic](compilestatic "CompileStatic")
[POJO](stc/pojo "POJO")
**Since:**
4.0.0
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
groovy [Java] Annotation Type Final [Java] Annotation Type Final
============================
* groovy.transform.Final
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.FinalASTTransformation")
public @interface Final
```
Annotation to add the final modifier to classes, methods, constructors, and fields. Using ``final`` and directly using ``@Final`` will have the same result. However, the intention is almost never to use ``@Final`` directly but rather as part of an annotation collector (meta-annotation). If you like the behavior of an existing annotation but would really like a version that also ensured the respective annotated node was final, you can create such an element, e.g.:
```
@AnnotationCollector
@Canonical
@Final
@interface MyCanonical {}
@MyCanonical class Foo {}
```
Here, class `Foo` will be final as well as having all the normal `Canonical` enhancements. Similarly, if you wanted to, you could define:
```
@AnnotationCollector([Singleton, Final]) @interface MySingleton {}
```
Classes annotated with @MySingleton would be final as well as have all the `Singleton` enhancements. As another example, you could define:
```
@AnnotationCollector([NullCheck, Final, AutoFinal]) @interface MyNullCheck {}
```
Methods annotated with @MyNullCheck would be final (from @Final), would have all parameters marked final (from @AutoFinal), and would have all parameters checked against `null` (from @NullCheck). In general, it would be bad style to have an explicit `final` modifier and a `@Final` annotation (or more than one `@Final` annotation), but in that scenario if there is an explicit `final` or at least one enabled `@Final`, then the annotated class or member will be final.
**Since:**
4.0.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[enabled](#enabled)`When disabled, this annotation effectively becomes a no-op. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **enabled**
When disabled, this annotation effectively becomes a no-op. Typically only used to override an annotation collector already containing an enabled `@Final` annotation. Care must be taken when disabling final in this way since the annotation collector probably had good reason for enabling final.
**Default:**
true
groovy [Java] Annotation Type TupleConstructor [Java] Annotation Type TupleConstructor
=======================================
* groovy.transform.TupleConstructor
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.TupleConstructorASTTransformation")
public @interface TupleConstructor
```
Class annotation used to assist in the creation of tuple constructors in classes. If the class is also annotated with `@ImmutableBase`, then the generated constructor will contain additional code needed for immutable classes. Should be used with care with other annotations which create constructors - see "Known Limitations" for more details.
It allows you to write classes in this shortened form:
```
@groovy.transform.TupleConstructor class Customer {
String first, last
int age
Date since
Collection favItems
}
def c1 = new Customer(first:'Tom', last:'Jones', age:21, since:new Date(), favItems:['Books', 'Games'])
def c2 = new Customer('Tom', 'Jones', 21, new Date(), ['Books', 'Games'])
def c3 = new Customer('Tom', 'Jones')
```
The `@TupleConstructor` annotation instructs the compiler to execute an AST transformation which adds the necessary constructor method to your class. A tuple constructor is created with a parameter for each property (and optionally field and super properties). The default order is properties, pseudo/JavaBean properties and then fields for parent classes first (if includeSuperXxx annotation attributes are used). A default value is provided (using Java's default values) for all parameters in the constructor. Groovy's normal conventions then allows any number of parameters to be left off the end of the parameter list including all of the parameters - giving a no-arg constructor which can be used with the map-style naming conventions.
The order of parameters is given by the properties of any super classes (if `includeSuperProperties` is set) with the most super first followed by the properties of the class followed by the fields of the class (if `includeFields` is set). Within each grouping the order is as attributes appear within the respective class.
More examples:
```
//--------------------------------------------------------------------------
import groovy.transform.TupleConstructor
@TupleConstructor()
class Person {
String name
List likes
private boolean active = false
}
def person = new Person('mrhaki', ['Groovy', 'Java'])
assert person.name == 'mrhaki'
assert person.likes == ['Groovy', 'Java']
person = new Person('mrhaki')
assert person.name == 'mrhaki'
assert !person.likes
```
```
//--------------------------------------------------------------------------
// includeFields in the constructor creation.
import groovy.transform.TupleConstructor
@TupleConstructor(includeFields=true)
class Person {
String name
List likes
private boolean active = false
boolean isActivated() { active }
}
def person = new Person('mrhaki', ['Groovy', 'Java'], true)
assert person.name == 'mrhaki'
assert person.likes == ['Groovy', 'Java']
assert person.activated
```
```
//--------------------------------------------------------------------------
// use force attribute to force creation of constructor
// even if we define our own constructors.
import groovy.transform.TupleConstructor
@TupleConstructor(force=true)
class Person {
String name
List likes
private boolean active = false
Person(boolean active) {
this.active = active
}
boolean isActivated() { active }
}
def person = new Person('mrhaki', ['Groovy', 'Java'])
assert person.name == 'mrhaki'
assert person.likes == ['Groovy', 'Java']
assert !person.activated
person = new Person(true)
assert person.activated
```
```
//--------------------------------------------------------------------------
// include properties and fields from super class.
import groovy.transform.TupleConstructor
@TupleConstructor(includeFields=true)
class Person {
String name
List likes
private boolean active = false
boolean isActivated() { active }
}
@TupleConstructor(callSuper=true, includeSuperProperties=true, includeSuperFields=true)
class Student extends Person {
List courses
}
def student = new Student('mrhaki', ['Groovy', 'Java'], true, ['IT'])
assert student.name == 'mrhaki'
assert student.likes == ['Groovy', 'Java']
assert student.activated
assert student.courses == ['IT']
```
Custom visibility:
* The `@TupleConstructor` annotation generates a public constructor unless an applicable [VisibilityOptions](visibilityoptions "VisibilityOptions") annotation is also present. It can be useful to change the visibility if you want to also create a builder or provide your own static factory method for object creation. You can make the constructor private and access it from the builder or your factory method. (Note: you'll probably want to use `@CompileStatic` in conjunction with such an approach since dynamic Groovy currently gives the ability to access even private constructors.)
* An optional `visibilityId` attribute can be specified. If present, it must match the optional `id` attribute of an applicable `VisibilityOptions` annotation. This can be useful if multiple `VisibilityOptions` annotations are needed.
Custom property handling:
* The `@TupleConstructor` annotation supports customization using `@PropertyOptions` which allows a custom property handler to be defined. This is most typically used behind the scenes by the `@Immutable` meta-annotation but you can also define your own handler. If a custom handler is present, it will determine the code generated when initializing any property (or field).
Named-argument support:
* Groovy supports named-arguments for classes with a no-arg constructor or a constructor with a Map as the first argument. This is compatible with the default kind of constructor(s) that `@TupleConstructor` produces.
* If the `defaults` annotation attribute is set to `false`, and no other map-based constructor are added then named-argument processing will not be available.
* If there is more than one included property (and/or field) and the first property (or field) has type Object, AbstractMap, Map or HashMap, then a special `LinkedHashMap` constructor will be created in addition to the tuple constructor to support named parameters in the normal way. This won't be created if the class is already annotated with `@MapConstructor` or if the `defaults` annotation attribute is set to `false`.
* If the first property (or field) has type `LinkedHashMap` or if there is a single Object, AbstractMap, Map or HashMap property (or field), then no additional constructor will be added and Groovy's normal map-style naming conventions will not be available.
Known limitations/special cases:
* This AST transform might become a no-op if you are defining your own constructors or combining with other AST transforms which create constructors (e.g. `@InheritConstructors`); the order in which the particular transforms are processed becomes important in that case. See the `force` attribute for further details about customizing this behavior.
* This AST transform normally uses default parameter values which creates multiple constructors under the covers. You should use with care if you are defining your own constructors or combining with other AST transforms which create constructors (e.g. `@InheritConstructors`); the order in which the particular transforms are processed becomes important in that case. See the `defaults` attribute for further details about customizing this behavior.
**See Also:**
[PropertyOptions](propertyoptions "PropertyOptions")
[VisibilityOptions](visibilityoptions "VisibilityOptions")
**Since:**
1.8.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[allNames](#allNames)`Whether to include all fields and/or properties within the constructor, including those with names that are considered internal. |
| `**boolean**` | `[allProperties](#allProperties)`Whether to include all properties (as per the JavaBean spec) in the generated constructor. |
| `**boolean**` | `[callSuper](#callSuper)`Should super properties be called within a call to the parent constructor rather than set as properties. |
| `**boolean**` | `[defaults](#defaults)`Used to set whether default value processing is enabled (the default) or disabled. |
| `**[DefaultsMode](defaultsmode)**` | `[defaultsMode](#defaultsMode)`Used to set the mode for default value processing. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[excludes](#excludes)`List of field and/or property names to exclude from the constructor. |
| `**boolean**` | `[force](#force)`By default, this annotation becomes a no-op if you provide your own constructor. |
| `**boolean**` | `[includeFields](#includeFields)`Include fields in the constructor. |
| `**boolean**` | `[includeProperties](#includeProperties)`Include properties in the constructor. |
| `**boolean**` | `[includeSuperFields](#includeSuperFields)`Include visible fields from super classes in the constructor. |
| `**boolean**` | `[includeSuperProperties](#includeSuperProperties)`Include properties from super classes in the constructor. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[includes](#includes)`List of field and/or property names to include within the constructor. |
| `**boolean**` | `[namedVariant](#namedVariant)`If true, add a map-based named-arg variant. |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")**` | `[post](#post)`A Closure containing statements which will be appended to the end of the generated constructor. |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")**` | `[pre](#pre)`A Closure containing statements which will be prepended to the generated constructor. |
| `**boolean**` | `[useSetters](#useSetters)`By default, properties are set directly using their respective field. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[visibilityId](#visibilityId)`If specified, must match the "id" attribute in a VisibilityOptions annotation to enable a custom visibility. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **allNames**
Whether to include all fields and/or properties within the constructor, including those with names that are considered internal.
**Since:**
2.5.0
**Default:**
false
### public boolean **allProperties**
Whether to include all properties (as per the JavaBean spec) in the generated constructor. When true, Groovy treats any explicitly created setXxx() methods as property setters as per the JavaBean specification. JavaBean properties come after any Groovy properties but before any fields for a given class (unless 'includes' is used to determine the order).
**Since:**
2.5.0
**Default:**
false
### public boolean **callSuper**
Should super properties be called within a call to the parent constructor rather than set as properties. Typically used in combination with `includeSuperProperties`. Can't be true if using `pre` with a `super` first statement.
**Default:**
false
### public boolean **defaults**
Used to set whether default value processing is enabled (the default) or disabled. Ignored if an explicit value is given for `defaultsMode()`. By default, every constructor parameter is given a default value. This is the equivalent of [DefaultsMode.ON](defaultsmode#ON "DefaultsMode.ON"). When set to false, default values are not allowed for properties and fields. This is the equivalent of [DefaultsMode.OFF](defaultsmode#OFF "DefaultsMode.OFF").
**Since:**
2.5.0
**Default:**
true
### public [DefaultsMode](defaultsmode) **defaultsMode**
Used to set the mode for default value processing. When set to `ON` (the default value), every constructor parameter is given a default value. This value will be Java's default for primitive types (zero or false) and null for Objects, unless an initial value is given when declaring the property or field. A consequence of this design is that you can leave off parameters from the right if the default value will suffice. As far as Java interoperability is concerned, Groovy will create additional constructors under the covers representing the constructors with parameters left off, all the way from the constructor with all arguments to the no-arg constructor. When set to `AUTO`, default values are catered for where explicit default values are given for the respective property/field. Additional positional constructors are generated as per Groovy's normal default value processing. Properties/fields with an explicit initial value are deemed {
**em:**
optional} and may be dropped. Properties/fields with no initial value are deemed {@em mandatory} and must be supplied as an argument to the respective constructor. Optional arguments to a positional constructor are dropped from the right. When set to `OFF`, default values are not allowed for properties and fields. Only the constructor containing all arguments will be provided. In particular, a no-arg constructor won't be provided and since this is currently used by Groovy when using named-arguments, the named-argument style won't be available.
**Since:**
4.0.0
**Default:**
DefaultsMode.ON
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **excludes**
List of field and/or property names to exclude from the constructor. Must not be used if 'includes' is used. For convenience, a String with comma separated names can be used in addition to an array (using Groovy's literal list notation) of String values.
**Default:**
{}
### public boolean **force**
By default, this annotation becomes a no-op if you provide your own constructor. By setting `force=true` then the tuple constructor(s) will be added regardless of whether existing constructors exist. It is up to you to avoid creating duplicate constructors.
**Default:**
false
### public boolean **includeFields**
Include fields in the constructor. Fields come after any properties.
**Default:**
false
### public boolean **includeProperties**
Include properties in the constructor.
**Default:**
true
### public boolean **includeSuperFields**
Include visible fields from super classes in the constructor. Groovy properties, JavaBean properties and fields (in that order) from superclasses come before the members from a subclass (unless 'includes' is used to determine the order).
**Default:**
false
### public boolean **includeSuperProperties**
Include properties from super classes in the constructor. Groovy properties, JavaBean properties and fields (in that order) from superclasses come before the members from a subclass (unless 'includes' is used to determine the order).
**Default:**
false
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **includes**
List of field and/or property names to include within the constructor. The order of inclusion is determined by the order in which the names are specified. Must not be used if 'excludes' is used. For convenience, a String with comma separated names can be used in addition to an array (using Groovy's literal list notation) of String values. The default value is a special marker value indicating that no includes are defined; all fields are included if includes remains undefined and excludes is explicitly or implicitly an empty list.
**Default:**
{ Undefined.STRING }
### public boolean **namedVariant**
If true, add a map-based named-arg variant. Similar to using `@MapConstructor` but handles just the parameters handled by the generated tuple constructor. Setting `namedVariant=true` is incompatible with using `@MapConstructor`.
**Since:**
4.0.0
**Default:**
false
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **post**
A Closure containing statements which will be appended to the end of the generated constructor. Useful for validation steps or tweaking the populated fields/properties.
**Since:**
2.5.0
**Default:**
Undefined.CLASS.class
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **pre**
A Closure containing statements which will be prepended to the generated constructor. The first statement within the Closure may be `super(someArgs)` in which case the no-arg super constructor won't be called.
**Since:**
2.5.0
**Default:**
Undefined.CLASS.class
### public boolean **useSetters**
By default, properties are set directly using their respective field. By setting `useSetters=true` then a writable property will be set using its setter. If turning on this flag we recommend that setters that might be called are made null-safe wrt the parameter.
**Since:**
2.5.0
**Default:**
false
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **visibilityId**
If specified, must match the "id" attribute in a VisibilityOptions annotation to enable a custom visibility.
**Since:**
2.5.0
**Default:**
Undefined.STRING
| programming_docs |
groovy [Groovy] Annotation Type Immutable [Groovy] Annotation Type Immutable
==================================
* groovy.transform.Immutable
All Implemented Interfaces and Traits: [Annotation](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html "Annotation")
```
@[ToString](tostring "ToString")(cache: true, includeSuperProperties: true)
@[EqualsAndHashCode](equalsandhashcode "EqualsAndHashCode")(cache: true)
@[ImmutableBase](immutablebase "ImmutableBase")
@[Final](final "Final")
@[ImmutableOptions](immutableoptions "ImmutableOptions")
@[PropertyOptions](propertyoptions "PropertyOptions")(propertyHandler: ImmutablePropertyHandler)
@[TupleConstructor](tupleconstructor "TupleConstructor")(defaults: false)
@[MapConstructor](mapconstructor "MapConstructor")(noArg: true, includeSuperProperties: true, includeFields: true)
@[KnownImmutable](knownimmutable "KnownImmutable")
@[AnnotationCollector](annotationcollector "AnnotationCollector")(mode: AnnotationCollectorMode.PREFER_EXPLICIT_MERGED)
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(value: RetentionPolicy.RUNTIME)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")(value: [ElementType.TYPE])
@interface Immutable
```
Meta annotation used when defining immutable classes.
It allows you to write classes in this shortened form:
```
@groovy.transform.Immutable class Customer {
String first, last
int age
Date since
Collection favItems
}
def d = new Date()
def c1 = new Customer(first:'Tom', last:'Jones', age:21, since:d, favItems:['Books', 'Games'])
def c2 = new Customer('Tom', 'Jones', 21, d, ['Books', 'Games'])
assert c1 == c2
```
The `@Immutable` meta-annotation corresponds to adding the following annotations: [ToString](tostring "ToString"), [EqualsAndHashCode](equalsandhashcode "EqualsAndHashCode"), [ImmutableBase](immutablebase "ImmutableBase"), [ImmutableOptions](immutableoptions "ImmutableOptions"), [PropertyOptions](propertyoptions "PropertyOptions"), [TupleConstructor](tupleconstructor "TupleConstructor"), [MapConstructor](mapconstructor "MapConstructor") and [KnownImmutable](knownimmutable "KnownImmutable"). Together these annotations instruct the compiler to execute the necessary transformations to add the necessary getters, constructors, equals, hashCode and other helper methods that are typically written when creating immutable classes with the defined properties. A class created in this way has the following characteristics:
* The class is automatically made final.
* Properties must be of an immutable type or a type with a strategy for handling non-immutable characteristics. Specifically, the type must be one of the primitive or wrapper types, Strings, enums, other `@Immutable` classes or known immutables (e.g. java.awt.Color, java.net.URI, java.util.UUID). Also handled are Cloneable classes, collections, maps and arrays, other "effectively immutable" classes with special handling (e.g. java.util.Date), and usages of java.util.Optional where the contained type is immutable (e.g. Optional<String>).
* Properties automatically have private, final backing fields with getters. Attempts to update the property will result in a `ReadOnlyPropertyException`.
* A map-based constructor is provided which allows you to set properties by name.
* A tuple-style constructor is provided which allows you to set properties in the same order as they are defined.
* Default `equals`, `hashCode` and `toString` methods are provided based on the property values. Though not normally required, you may write your own implementations of these methods. For `equals` and `hashCode`, if you do write your own method, it is up to you to obey the general contract for `equals` methods and supply a corresponding matching `hashCode` method. If you do provide one of these methods explicitly, the default implementation will be made available in a private "underscore" variant which you can call. E.g., you could provide a (not very elegant) multi-line formatted `toString` method for `Customer` above as follows:
```
String toString() {
_toString().replaceAll(/\(/, '(\n\t').replaceAll(/\)/, '\n)').replaceAll(/, /, '\n\t')
}
```
If an "underscore" version of the respective method already exists, then no default implementation is provided.
* `Date`s, `Cloneable`s and arrays are defensively copied on the way in (constructor) and out (getters). Arrays and `Cloneable` objects use the `clone` method. For your own classes, it is up to you to define this method and use deep cloning if appropriate.
* `Collection`s and `Map`s are wrapped by immutable wrapper classes (but not deeply cloned!). Attempts to update them will result in an `UnsupportedOperationException`.
* Fields that are enums or other `@Immutable` classes are allowed but for an otherwise possible mutable property type, an error is thrown.
* You don't have to follow Groovy's normal property conventions, e.g. you can create an explicit private field and then you can write explicit get and set methods. Such an approach, isn't currently prohibited (to give you some wiggle room to get around these conventions) but any fields created in this way are deemed not to be part of the significant state of the object and aren't factored into the `equals` or `hashCode` methods. Similarly, you may use static properties (though usually this is discouraged) and these too will be ignored as far as significant state is concerned. If you do break standard conventions, you do so at your own risk and your objects may no longer be immutable. It is up to you to ensure that your objects remain immutable at least to the extent expected in other parts of your program!
Immutable classes are particularly useful for functional and concurrent styles of programming and for use as key values within maps. If you want similar functionality to what this annotation provides but don't need immutability then consider using `@Canonical`. Customising behaviour:
You can customise the toString() method provided for you by `@Immutable` by also adding the `@ToString` annotation to your class definition.
Limitations:
* As outlined above, Arrays and `Cloneable` objects use the `clone` method. For your own classes, it is up to you to define this method and use deep cloning if appropriate.
* As outlined above, `Collection`s and `Map`s are wrapped by immutable wrapper classes (but not deeply cloned!).
* Currently `BigInteger` and `BigDecimal` are deemed immutable but see: http://bugs.sun.com/bugdatabase/view\_bug.do?bug\_id=6348370
* `java.awt.Color` is treated as "effectively immutable" but is not final so while not normally used with child classes, it isn't strictly immutable. Use at your own risk.
* `java.util.Date` is treated as "effectively immutable" but is not final so it isn't strictly immutable. Use at your own risk.
* Groovy's normal map-style naming conventions will not be available if the first property has type `LinkedHashMap` or if there is a single Map, AbstractMap or HashMap property.
More examples:
--------------------------------------------------------------------------------
```
import groovy.transform.*
@Canonical
class Building {
String name
int floors
boolean officeSpace
}
// Constructors are added.
def officeSpace = new Building('Initech office', 1, true)
// toString() added.
assert officeSpace.toString() == 'Building(Initech office, 1, true)'
// Default values are used if constructor
// arguments are not assigned.
def theOffice = new Building('Wernham Hogg Paper Company')
assert theOffice.floors == 0
theOffice.officeSpace = true
def anotherOfficeSpace = new Building(name: 'Initech office', floors: 1, officeSpace: true)
// equals() method is added.
assert anotherOfficeSpace == officeSpace
// equals() and hashCode() are added, so duplicate is not in Set.
def offices = [officeSpace, anotherOfficeSpace, theOffice] as Set
assert offices.size() == 2
assert offices.name.join(',') == 'Initech office,Wernham Hogg Paper Company'
@Canonical
@ToString(excludes='age') // Customize one of the transformations.
class Person {
String name
int age
}
def mrhaki = new Person('mrhaki', 37)
assert mrhaki.toString() == 'Person(mrhaki)'
```
**See Also:**
[ToString](tostring "ToString")
[EqualsAndHashCode](equalsandhashcode "EqualsAndHashCode")
[ImmutableBase](immutablebase "ImmutableBase")
[ImmutableOptions](immutableoptions "ImmutableOptions")
[PropertyOptions](propertyoptions "PropertyOptions")
[TupleConstructor](tupleconstructor "TupleConstructor")
[MapConstructor](mapconstructor "MapConstructor")
[Final](final "Final")
[KnownImmutable](knownimmutable "KnownImmutable")
[Canonical](canonical "Canonical")
**Since:**
1.7
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `abstract boolean` | `**[copyWith](#copyWith())**()`No longer used directly but instead collected from [ImmutableBase](immutablebase "ImmutableBase"). |
| | `abstract [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[]` | `**[knownImmutableClasses](#knownImmutableClasses())**()`No longer used directly but instead collected from [ImmutableOptions](immutableoptions "ImmutableOptions"). |
| | `abstract [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]` | `**[knownImmutables](#knownImmutables())**()`No longer used directly but instead collected from [ImmutableOptions](immutableoptions "ImmutableOptions"). |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### abstract boolean **copyWith**()
No longer used directly but instead collected from [ImmutableBase](immutablebase "ImmutableBase"). Remains for legacy handling only.
### abstract [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] **knownImmutableClasses**()
No longer used directly but instead collected from [ImmutableOptions](immutableoptions "ImmutableOptions"). Remains for legacy handling only.
### abstract [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **knownImmutables**()
No longer used directly but instead collected from [ImmutableOptions](immutableoptions "ImmutableOptions"). Remains for legacy handling only.
groovy [Java] Annotation Type RecordBase [Java] Annotation Type RecordBase
=================================
* groovy.transform.RecordBase
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")({"org.codehaus.groovy.transform.RecordTypeASTTransformation","org.codehaus.groovy.transform.RecordCompletionASTTransformation"})
public @interface RecordBase
```
Class annotation used to assist in the creation of record-like classes.
**See Also:**
[ImmutableOptions](immutableoptions "ImmutableOptions")
[MapConstructor](mapconstructor "MapConstructor")
[TupleConstructor](tupleconstructor "TupleConstructor")
[PropertyOptions](propertyoptions "PropertyOptions")
[RecordOptions](recordoptions "RecordOptions")
**Since:**
4.0.0
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
groovy [Java] Annotation Type ImmutableOptions [Java] Annotation Type ImmutableOptions
=======================================
* groovy.transform.ImmutableOptions
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE})
public @interface ImmutableOptions
```
Class annotation used to assist in the creation of immutable classes. Defines any known immutable properties (or fields) or known immutable classes.
**See Also:**
[Immutable](immutable "Immutable")
[ImmutablePropertyHandler](options/immutablepropertyhandler "ImmutablePropertyHandler")
**Since:**
2.5.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[]**` | `[knownImmutableClasses](#knownImmutableClasses)`Allows you to provide `@Immutable` with a list of classes which are deemed immutable. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[knownImmutables](#knownImmutables)`Allows you to provide `@Immutable` with a list of property names which are deemed immutable. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] **knownImmutableClasses**
Allows you to provide `@Immutable` with a list of classes which are deemed immutable. By supplying a class in this list, you are vouching for its immutability and `@Immutable` will do no further checks. Example:
```
import groovy.transform.*
@Immutable(knownImmutableClasses = [Address])
class Person {
String first, last
Address address
}
@TupleConstructor
class Address {
final String street
}
```
**Default:**
{}
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **knownImmutables**
Allows you to provide `@Immutable` with a list of property names which are deemed immutable. By supplying a property's name in this list, you are vouching for its immutability and `@Immutable` will do no further checks. Example:
```
@groovy.transform.Immutable(knownImmutables = ['address'])
class Person {
String first, last
Address address
}
...
```
**Default:**
{}
groovy [Java] Annotation Type SourceURI [Java] Annotation Type SourceURI
================================
* groovy.transform.SourceURI
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.LOCAL_VARIABLE, ElementType.FIELD})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.SourceURIASTTransformation")
public @interface SourceURI
```
Variable annotation used for getting the URI of the current script.
The type of the variable annotated with `@SourceURI` must be assignment compatible with [URI](https://docs.oracle.com/javase/8/docs/api/java/net/URI.html "URI"). It will be used to hold a URI object that references the source for the current script.
By default the URI will be made absolute (which is to say it will have an authority) in the case where a relative path was used for the source of the script. If you want to leave relative URIs as relative, then set `allowRelative` to `true`.
Example usage:
```
@groovy.transform.SourceURI def sourceURI
assert sourceURI instanceof java.net.URI
```
**Since:**
2.3.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[allowRelative](#allowRelative)`
**Default:**
false
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **allowRelative**
**Default:**
false
| programming_docs |
groovy [Java] Annotation Type Internal [Java] Annotation Type Internal
===============================
* groovy.transform.Internal
```
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE, ElementType.FIELD})
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
public @interface Internal
```
The Internal annotation is used to mark members that are internal.
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
groovy [Groovy] Annotation Type CompileDynamic [Groovy] Annotation Type CompileDynamic
=======================================
* groovy.transform.CompileDynamic
All Implemented Interfaces and Traits: [Annotation](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html "Annotation")
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[AnnotationCollector](annotationcollector "AnnotationCollector")(processor: org.codehaus.groovy.transform.CompileDynamicProcessor)
@interface CompileDynamic
```
An annotation which is just a shortcut for @CompileStatic(TypeCheckingMode.SKIP). This can be used for example if you statically compile a full class but you want to skip some methods without having to use the full annotation.
**Since:**
2.1.0
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
groovy [Java] Class Undefined [Java] Class Undefined
======================
* groovy.transform.Undefined
```
public final class Undefined
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Java doesn't allow you to have null as an attribute value. It wants you to indicate what you really mean by null, so that is what we do here - as ugly as it is.
Nested Class Summary
--------------------
Nested classes
| Modifiers | Name | Description |
| `**static class**` | `[Undefined.CLASS](undefined.class)` | |
| `**static class**` | `[Undefined.EXCEPTION](undefined.exception)` | |
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[STRING](#STRING)` | |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public static boolean` | `**[isUndefined](#isUndefined(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") other)` |
| | `public static boolean` | `**[isUndefined](#isUndefined(org.codehaus.groovy.ast.ClassNode))**([ClassNode](../../org/codehaus/groovy/ast/classnode) other)` |
| | `public static boolean` | `**[isUndefinedException](#isUndefinedException(org.codehaus.groovy.ast.ClassNode))**([ClassNode](../../org/codehaus/groovy/ast/classnode) other)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **STRING**
Method Detail
-------------
### public static boolean **isUndefined**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") other)
### public static boolean **isUndefined**([ClassNode](../../org/codehaus/groovy/ast/classnode) other)
### public static boolean **isUndefinedException**([ClassNode](../../org/codehaus/groovy/ast/classnode) other)
groovy [Java] Annotation Type NamedDelegate [Java] Annotation Type NamedDelegate
====================================
* groovy.transform.NamedDelegate
```
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")(ElementType.PARAMETER)
public @interface NamedDelegate
```
Marker interface used to indicate that the property names of the annotated parameter represent valid key names when using named arguments and that the property types are applicable for type checking purposes.
**Since:**
2.5.0
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
groovy [Java] Annotation Type NamedParam [Java] Annotation Type NamedParam
=================================
* groovy.transform.NamedParam
```
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")(ElementType.PARAMETER)
@[Repeatable](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Repeatable.html "Repeatable")(NamedParams.class)
public @interface NamedParam
```
Marker interface used to indicate that the name of the annotated parameter (or specified optional name) is a valid key name when using named arguments and that the parameter type is applicable for type checking purposes.
**Since:**
2.5.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[required](#required)`
**Default:**
false
|
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")**` | `[type](#type)`
**Default:**
Object.class
|
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[value](#value)`
**Default:**
Undefined.STRING
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **required**
**Default:**
false
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **type**
**Default:**
Object.class
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **value**
**Default:**
Undefined.STRING
groovy [Java] Annotation Type InheritConstructors [Java] Annotation Type InheritConstructors
==========================================
* groovy.transform.InheritConstructors
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.InheritConstructorsASTTransformation")
public @interface InheritConstructors
```
Class annotation to make constructors from a super class available in a sub class. Should be used with care with other annotations which create constructors - see "Known Limitations" for more details.
`@InheritConstructors` saves you typing some boilerplate code.
*Example usage:*
```
class Person {
String first, last
Person(String first, String last) {
this.first = first
this.last = last.toUpperCase()
}
}
@groovy.transform.InheritConstructors
class PersonAge extends Person {
int age
}
def js = new PersonAge('John', 'Smith')
js.age = 25
assert "$js.last, $js.first is $js.age years old" == 'SMITH, John is 25 years old'
```
for this case, the `PersonAge` class will be equivalent to the following code:
```
class PersonAge extends Person {
PersonAge(String first, String last) {
super(first, last)
}
int age
}
```
You may add additional constructors in addition to inherited ones. If the argument types of a supplied constructor exactly match those of a parent constructor, then that constructor won't be inherited. *Style note:* Don't go overboard using this annotation. Typical Groovy style is to use named-arg constructors when possible. This is easy to do for Groovy objects or any objects following JavaBean conventions. In other cases, inheriting the constructors may be useful. However, sub-classes often introduce new properties and these are often best set in a constructor; especially if that matches the style adopted in parent classes. So, even for the example above, it may have been better style to define an explicit constructor for `PersonAge` that also set the `age` property. Sometimes, consistent style is much more important than saving a few keystrokes.
As another example, this:
```
@InheritConstructors class CustomException extends RuntimeException { }
```
is equivalent to this:
```
class CustomException extends RuntimeException {
CustomException() {
super()
}
CustomException(String message) {
super(message)
}
CustomException(String message, Throwable cause) {
super(message, cause)
}
CustomException(Throwable cause) {
super(cause)
}
}
```
Known Limitations: * This AST transform creates (potentially) numerous constructors. You should take care to avoid constructors with duplicate signatures if you are defining your own constructors or combining with other AST transforms which create constructors (e.g. `@TupleConstructor`); the order in which the particular transforms are processed becomes important in that case.
* If you create Groovy constructors with optional arguments this leads to multiple constructors created in the byte code. The expansion to multiple constructors occurs in a later phase to this AST transformation. This means that you can't override (i.e. not inherit) the constructors with signatures that Groovy adds later. If you get it wrong you will get a compile-time error about the duplication.
More examples:
```
//--------------------------------------------------------------------------
import groovy.transform.InheritConstructors
@InheritConstructors
class MyException extends Exception {
}
def e = new MyException()
def e1 = new MyException('message') // Other constructors are available.
assert 'message' == e1.message
```
```
//--------------------------------------------------------------------------
import groovy.transform.InheritConstructors
class Person {
String name
Person(String name) {
this.name = name
}
}
@InheritConstructors
class Child extends Person {}
def child = new Child('Liam')
assert 'Liam' == child.name
```
**Since:**
1.7.3
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[constructorAnnotations](#constructorAnnotations)`Whether to carry over annotations on the copied constructors. |
| `**boolean**` | `[parameterAnnotations](#parameterAnnotations)`Whether to carry over parameter annotations on the copied constructors. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **constructorAnnotations**
Whether to carry over annotations on the copied constructors. Currently Closure annotation members are not supported.
**Returns:**
true if copied constructor should keep constructor annotations
**Default:**
false
### public boolean **parameterAnnotations**
Whether to carry over parameter annotations on the copied constructors. Currently Closure annotation members are not supported.
**Returns:**
true if copied constructor should keep parameter annotations
**Default:**
false
groovy [Java] Annotation Type NonSealed [Java] Annotation Type NonSealed
================================
* groovy.transform.NonSealed
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE})
@[Incubating](../../org/apache/groovy/lang/annotation/incubating "Incubating")
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.NonSealedASTTransformation")
public @interface NonSealed
```
Class annotation used to demarcate non-sealed classes.
**Since:**
4.0.0
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
groovy [Java] Annotation Type BaseScript [Java] Annotation Type BaseScript
=================================
* groovy.transform.BaseScript
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.LOCAL_VARIABLE, ElementType.PACKAGE, ElementType.TYPE /*, ElementType.IMPORT*/})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.BaseScriptASTTransformation")
public @interface BaseScript
```
Variable annotation used for changing the base script class of the current script.
The type of the variable annotated with `@BaseScript` must extend [Script](../lang/script "Script"). It will be used as the base script class. The annotated variable will become shortcut to `this` object. Using this annotation will override base script set by Groovy compiler or [CompilerConfiguration](../../org/codehaus/groovy/control/compilerconfiguration "CompilerConfiguration") of [GroovyShell](../lang/groovyshell "GroovyShell") Example usage:
```
abstract class CustomScript extends Script {
int getTheMeaningOfLife() { 42 }
}
@BaseScript CustomScript baseScript
assert baseScript == this
assert theMeaningOfLife == 42
assert theMeaningOfLife == baseScript.theMeaningOfLife
```
In this example, the base script of the current script will be changed to `CustomScript` allowing usage of `getTheMeaningOfLife()` method. `baseScript` variable will become typed shortcut for `this` object which enables better IDE support. The custom base script may implement the run() method and specify a different method name to be used for the script body by declaring a single abstract method. For example:
```
abstract class CustomScriptBodyMethod extends Script {
abstract def runScript()
def preRun() { println "preRunning" }
def postRun() { println "postRunning" }
def run() {
preRun()
try {
3.times { runScript() }
} finally {
postRun()
}
}
}
@BaseScript CustomScriptBodyMethod baseScript
println "Script body run"
```
That will produce the following output:
```
preRunning
Script body run
Script body run
Script body run
postRunning
```
Note that while you can declare arguments for the script body's method, as the AST is currently implemented they are not accessible in the script body code. More examples:
```
// Simple Car class to save state and distance.
class Car {
String state
Long distance = 0
}
// Custom Script with methods that change the Car's state.
// The Car object is passed via the binding.
abstract class CarScript extends Script {
def start() {
this.binding.car.state = 'started'
}
def stop() {
this.binding.car.state = 'stopped'
}
def drive(distance) {
this.binding.car.distance += distance
}
}
// Define Car object here, so we can use it in assertions later on.
def car = new Car()
// Add to script binding (CarScript references this.binding.car).
def binding = new Binding(car: car)
// Configure the GroovyShell.
def shell = new GroovyShell(this.class.classLoader, binding)
// Simple DSL to start, drive and stop the car.
// The methods are defined in the CarScript class.
def carDsl = '''
start()
drive 20
stop()
'''
// Run DSL script.
shell.evaluate """
// Use BaseScript annotation to set script
// for evaluating the DSL.
@groovy.transform.BaseScript CarScript carScript
$carDsl
"""
// Checks to see that Car object has changed.
assert car.distance == 20
assert car.state == 'stopped'
```
**Since:**
2.2.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")**` | `[value](#value)`
**Default:**
Script.class
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **value**
**Default:**
Script.class
| programming_docs |
groovy [Java] Annotation Type SealedOptions [Java] Annotation Type SealedOptions
====================================
* groovy.transform.SealedOptions
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE})
@[Incubating](../../org/apache/groovy/lang/annotation/incubating "Incubating")
public @interface SealedOptions
```
Class annotation used to assist in the creation of sealed classes.
**Since:**
4.0.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[alwaysAnnotate](#alwaysAnnotate)`Add annotations even for native sealed classes. |
| `**[SealedMode](sealedmode)**` | `[mode](#mode)`Mode to use when creating sealed classes. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **alwaysAnnotate**
Add annotations even for native sealed classes. Ignored when emulating sealed classes since then annotations are always used.
**Default:**
true
### public [SealedMode](sealedmode) **mode**
Mode to use when creating sealed classes.
**Default:**
SealedMode.AUTO
groovy [Java] Enum RecordTypeMode [Java] Enum RecordTypeMode
==========================
* groovy.transform.RecordTypeMode
```
public enum RecordTypeMode
extends [Enum](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html "Enum")
```
Intended mode to use for records when using the `@RecordType` annotation (or `record` keyword).
**Since:**
4.0.0
**See Also:**
[RecordType](recordtype "RecordType")
Enum Constants Summary
----------------------
Enum constants classes
| Enum constant | Description |
| `**[AUTO](#AUTO)**` | Produce native records when compiling for a suitable target bytecode (JDK16+). |
| `**[EMULATE](#EMULATE)**` | Produce a record-like class. |
| `**[NATIVE](#NATIVE)**` | Produce a Java-like "native" record (JEP 359/384/395). |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Enum](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html "Enum")` | `[name](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#name() "name"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#hashCode() "hashCode"), [compareTo](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo(java.lang.Object) "compareTo"), [compareTo](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo(java.lang.Enum) "compareTo"), [valueOf](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#valueOf(java.lang.Class,%20java.lang.String) "valueOf"), [describeConstable](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#describeConstable() "describeConstable"), [getDeclaringClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getDeclaringClass() "getDeclaringClass"), [ordinal](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#ordinal() "ordinal"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait(long) "wait"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#notifyAll() "notifyAll")` |
Enum Constant Detail
--------------------
### public [RecordTypeMode](recordtypemode) **AUTO**
Produce native records when compiling for a suitable target bytecode (JDK16+).
### public [RecordTypeMode](recordtypemode) **EMULATE**
Produce a record-like class.
### public [RecordTypeMode](recordtypemode) **NATIVE**
Produce a Java-like "native" record (JEP 359/384/395).
groovy [Groovy] Annotation Type Canonical [Groovy] Annotation Type Canonical
==================================
* groovy.transform.Canonical
All Implemented Interfaces and Traits: [Annotation](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html "Annotation")
```
@[AnnotationCollector](annotationcollector "AnnotationCollector")(value: [ToString, TupleConstructor, EqualsAndHashCode], mode: AnnotationCollectorMode.PREFER_EXPLICIT_MERGED)
@interface Canonical
```
The `@Canonical` meta-annotation combines the `@EqualsAndHashCode`, `@ToString` and `@TupleConstructor` annotations. It is used to assist in the creation of mutable classes. It instructs the compiler to execute AST transformations which add positional constructors, equals, hashCode and a pretty print toString to your class.
You can write classes in this shortened form:
```
import groovy.transform.Canonical
@Canonical class Customer {
String first, last
int age
Date since
Collection favItems = ['Food']
def object
}
def d = new Date()
def anyObject = new Object()
def c1 = new Customer(first:'Tom', last:'Jones', age:21, since:d, favItems:['Books', 'Games'], object: anyObject)
def c2 = new Customer('Tom', 'Jones', 21, d, ['Books', 'Games'], anyObject)
assert c1 == c2
```
You don't need to provide all arguments in constructor calls. If using named parameters, any property names not referenced will be given their default value (as per Java's default unless an explicit initialization constant is provided when defining the property). If using a tuple constructor, parameters are supplied in the order in which the properties are defined. Supplied parameters fill the tuple from the left. Any parameters missing on the right are given their default value.
```
def c3 = new Customer(last: 'Jones', age: 21)
def c4 = new Customer('Tom', 'Jones')
assert null == c3.since
assert 0 == c4.age
assert c3.favItems == ['Food'] && c4.favItems == ['Food']
```
If you don't need all of the functionality of `@Canonical`, you can simply directly use one or more of the individual annotations which `@Canonical` aggregates. In addition, you can use `@Canonical` in combination with explicit use one or more of the individual annotations in cases where you need to further customize the annotation attributes. Any applicable annotation attributes from `@Canonical` missing from the explicit annotation will be merged but any existing annotation attributes within the explicit annotation take precedence. So, for example in this case here:
```
@Canonical(includeNames=true, excludes='c')
@[ToString](tostring "ToString")(excludes='a,b')
class MyClass { ... }
```
The generated `toString` will include property names and exclude the `a` and `b` properties. A class created using `@Canonical` has the following characteristics:
* A no-arg constructor is provided which allows you to set properties by name using Groovy's normal bean conventions.
* Tuple-style constructors are provided which allow you to set properties in the same order as they are defined.
* Default `equals`, `hashCode` and `toString` methods are provided based on the property values. See the GroovyDoc for the individual annotations for more details. If you want similar functionality to what this annotation provides but also require immutability, see the `@`[Immutable](immutable "Immutable") annotation.
More examples:
```
import groovy.transform.*
@Canonical
class Building {
String name
int floors
boolean officeSpace
}
// Constructors are added.
def officeSpace = new Building('Initech office', 1, true)
// toString() added.
assert officeSpace.toString() == 'Building(Initech office, 1, true)'
// Default values are used if constructor
// arguments are not assigned.
def theOffice = new Building('Wernham Hogg Paper Company')
assert theOffice.floors == 0
theOffice.officeSpace = true
def anotherOfficeSpace = new Building(name: 'Initech office', floors: 1, officeSpace: true)
// equals() method is added.
assert anotherOfficeSpace == officeSpace
// equals() and hashCode() are added, so duplicate is not in Set.
def offices = [officeSpace, anotherOfficeSpace, theOffice] as Set
assert offices.size() == 2
assert offices.name.join(',') == 'Initech office,Wernham Hogg Paper Company'
@Canonical
@ToString(excludes='age') // Customize one of the transformations.
class Person {
String name
int age
}
def mrhaki = new Person('mrhaki', 37)
assert mrhaki.toString() == 'Person(mrhaki)'
```
**See Also:**
[EqualsAndHashCode](equalsandhashcode "EqualsAndHashCode")
[ToString](tostring "ToString")
[TupleConstructor](tupleconstructor "TupleConstructor")
[Immutable](immutable "Immutable")
**Since:**
1.8.0
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
groovy [Java] Interface CompilationUnitAware [Java] Interface CompilationUnitAware
=====================================
```
public interface CompilationUnitAware
```
This interface is for AST transformations which must be aware of the compilation unit where they are applied.
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[setCompilationUnit](#setCompilationUnit(org.codehaus.groovy.control.CompilationUnit))**([CompilationUnit](../../org/codehaus/groovy/control/compilationunit) unit)` |
Method Detail
-------------
### public void **setCompilationUnit**([CompilationUnit](../../org/codehaus/groovy/control/compilationunit) unit)
groovy [Java] Enum PackageScopeTarget [Java] Enum PackageScopeTarget
==============================
* groovy.transform.PackageScopeTarget
```
public enum PackageScopeTarget
extends [Enum](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html "Enum")
```
Intended target when `@`PackageScope is placed at the class level.
**Since:**
1.8.0
Enum Constants Summary
----------------------
Enum constants classes
| Enum constant | Description |
| `**[CLASS](#CLASS)**` | Make the Class have package protected visibility. |
| `**[CONSTRUCTORS](#CONSTRUCTORS)**` | Make the Class constructors have package protected visibility. |
| `**[FIELDS](#FIELDS)**` | Make the Class fields have package protected visibility. |
| `**[METHODS](#METHODS)**` | Make the Class methods have package protected visibility. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Enum](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html "Enum")` | `[name](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#name() "name"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#hashCode() "hashCode"), [compareTo](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo(java.lang.Object) "compareTo"), [compareTo](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo(java.lang.Enum) "compareTo"), [valueOf](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#valueOf(java.lang.Class,%20java.lang.String) "valueOf"), [describeConstable](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#describeConstable() "describeConstable"), [getDeclaringClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getDeclaringClass() "getDeclaringClass"), [ordinal](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#ordinal() "ordinal"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait(long) "wait"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#notifyAll() "notifyAll")` |
Enum Constant Detail
--------------------
### public [PackageScopeTarget](packagescopetarget) **CLASS**
Make the Class have package protected visibility.
### public [PackageScopeTarget](packagescopetarget) **CONSTRUCTORS**
Make the Class constructors have package protected visibility.
### public [PackageScopeTarget](packagescopetarget) **FIELDS**
Make the Class fields have package protected visibility.
### public [PackageScopeTarget](packagescopetarget) **METHODS**
Make the Class methods have package protected visibility.
groovy [Groovy] Annotation Type TimedInterrupt [Groovy] Annotation Type TimedInterrupt
=======================================
* groovy.transform.TimedInterrupt
All Implemented Interfaces and Traits: [Annotation](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html "Annotation")
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(value: RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")(value: [ElementType.PACKAGE, ElementType.METHOD, ElementType.FIELD, ElementType.TYPE, ElementType.LOCAL_VARIABLE])
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")(value: [org.codehaus.groovy.transform.TimedInterruptibleASTTransformation])
@interface TimedInterrupt
```
Allows safe timed executions of scripts by adding elapsed time checks into loops (for, while) and at the start of closures and methods and throwing an exception if a timeout occurs.
This is especially useful when executing foreign scripts that you do not have control over. Inject this transformation into a script that you want to timeout after a specified amount of time.
Annotating anything in a script will cause for loops, while loops, methods, and closures to make an elapsed time check and throw a TimeoutException if the check yields true. The annotation by default will apply to any classes defined in the script as well. Annotating a class will cause (by default) all classes in the entire file ('Compilation Unit') to be enhanced. You can fine tune what is enhanced using the annotation parameters. Static methods and static fields are ignored.
The following is sample usage of the annotation forcing the script to timeout after 5 minutes (300 seconds):
```
import groovy.transform.TimedInterrupt
import java.util.concurrent.TimeUnit
@TimedInterrupt(value = 300L, unit = TimeUnit.SECONDS)
class MyClass {
def method() {
println '...'
}
}
```
This sample script will be transformed at compile time to something that resembles this:
```
import java.util.concurrent.TimeUnit
import java.util.concurrent.TimeoutException
public class MyClass {
// XXXXXX below is a placeholder for a hashCode value at runtime
final private long timedInterruptXXXXXX$expireTime
final private java.util.Date timedInterruptXXXXXX$startTime
public MyClass() {
timedInterruptXXXXXX$expireTime = System.nanoTime() + TimeUnit.NANOSECONDS.convert(300, TimeUnit.SECONDS)
timedInterruptXXXXXX$startTime = new java.util.Date()
}
public java.lang.Object method() {
if (timedInterruptXXXXXX$expireTime < System.nanoTime()) {
throw new TimeoutException('Execution timed out after 300 units. Start time: ' + timedInterruptXXXXXX$startTime)
}
return this.println('...')
}
}
```
See the unit test for this class for additional examples.
**See Also:**
[ThreadInterrupt](threadinterrupt "ThreadInterrupt")
[ConditionalInterrupt](conditionalinterrupt "ConditionalInterrupt")
**Since:**
1.8.0
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `abstract boolean` | `**[applyToAllClasses](#applyToAllClasses())**()`Set this to false if you have multiple classes within one source file and only want timeout checks on some of the classes (or you want different time constraints on different classes). |
| | `abstract boolean` | `**[applyToAllMembers](#applyToAllMembers())**()`Set this to false if you have multiple methods/closures within a class or script and only want timeout checks on some of them (or you want different time constraints on different methods/closures). |
| | `abstract boolean` | `**[checkOnMethodStart](#checkOnMethodStart())**()`By default a time check is added to the start of all user-defined methods. |
| | `abstract [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[thrown](#thrown())**()`The type of exception thrown when timeout is reached. |
| | `abstract [TimeUnit](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html "TimeUnit")` | `**[unit](#unit())**()`The TimeUnit of the value parameter. |
| | `abstract long` | `**[value](#value())**()`The maximum elapsed time the script will be allowed to run for. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### abstract boolean **applyToAllClasses**()
Set this to false if you have multiple classes within one source file and only want timeout checks on some of the classes (or you want different time constraints on different classes). Place an annotation with appropriate parameters on each class you want enhanced. Set to true (the default) for blanket coverage of timeout checks on all methods, loops and closures within all classes/script code. For even finer-grained control see `applyToAllMembers`.
**See Also:**
[applyToAllMembers()](#applyToAllMembers())
### abstract boolean **applyToAllMembers**()
Set this to false if you have multiple methods/closures within a class or script and only want timeout checks on some of them (or you want different time constraints on different methods/closures). Place annotations with appropriate parameters on the methods/closures that you want enhanced. When false, `applyToAllClasses` is automatically set to false. Set to true (the default) for blanket coverage of timeout checks on all methods, loops and closures within the class/script.
**Since:**
2.2.0\*
**See Also:**
[applyToAllClasses()](#applyToAllClasses())
### abstract boolean **checkOnMethodStart**()
By default a time check is added to the start of all user-defined methods. To turn this off simply set this parameter to false.
### abstract [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **thrown**()
The type of exception thrown when timeout is reached.
### abstract [TimeUnit](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html "TimeUnit") **unit**()
The TimeUnit of the value parameter. By default it is TimeUnit.SECONDS.
### abstract long **value**()
The maximum elapsed time the script will be allowed to run for. By default it is measure in seconds
| programming_docs |
groovy [Java] Enum AutoCloneStyle [Java] Enum AutoCloneStyle
==========================
* groovy.transform.AutoCloneStyle
```
public enum AutoCloneStyle
extends [Enum](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html "Enum")
```
Intended style to use for cloning when using the `@`AutoClone annotation.
**Since:**
1.8.0
**See Also:**
[AutoClone](autoclone "AutoClone")
Enum Constants Summary
----------------------
Enum constants classes
| Enum constant | Description |
| `**[CLONE](#CLONE)**` | Uses only cloning. |
| `**[COPY\_CONSTRUCTOR](#COPY_CONSTRUCTOR)**` | Uses the copy constructor pattern. |
| `**[SERIALIZATION](#SERIALIZATION)**` | Uses serialization to clone. |
| `**[SIMPLE](#SIMPLE)**` | Uses the no-arg constructor followed by property/field copying/cloning. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Enum](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html "Enum")` | `[name](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#name() "name"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#hashCode() "hashCode"), [compareTo](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo(java.lang.Object) "compareTo"), [compareTo](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo(java.lang.Enum) "compareTo"), [valueOf](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#valueOf(java.lang.Class,%20java.lang.String) "valueOf"), [describeConstable](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#describeConstable() "describeConstable"), [getDeclaringClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getDeclaringClass() "getDeclaringClass"), [ordinal](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#ordinal() "ordinal"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait(long) "wait"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#notifyAll() "notifyAll")` |
Enum Constant Detail
--------------------
### public [AutoCloneStyle](autoclonestyle) **CLONE**
Uses only cloning.
### public [AutoCloneStyle](autoclonestyle) **COPY\_CONSTRUCTOR**
Uses the copy constructor pattern.
### public [AutoCloneStyle](autoclonestyle) **SERIALIZATION**
Uses serialization to clone.
### public [AutoCloneStyle](autoclonestyle) **SIMPLE**
Uses the no-arg constructor followed by property/field copying/cloning.
groovy [Java] Annotation Type AutoClone [Java] Annotation Type AutoClone
================================
* groovy.transform.AutoClone
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.AutoCloneASTTransformation")
public @interface AutoClone
```
Class annotation used to assist in the creation of `Cloneable` classes. The `@AutoClone` annotation instructs the compiler to execute an AST transformation which adds a public `clone()` method and adds `Cloneable` to the list of interfaces which the class implements.
Because the JVM doesn't have a one-size fits all cloning strategy, several customizations exist for the cloning implementation. By default, the `clone()` method will call `super.clone()` before calling `clone()` on each `Cloneable` property of the class.
Example usage:
```
import groovy.transform.AutoClone
@AutoClone
class Person {
String first, last
List favItems
Date since
}
```
Which will create a class equivalent to the following:
```
class Person implements Cloneable {
...
public Person clone() throws CloneNotSupportedException {
Person result = (Person) super.clone()
result.favItems = favItems instanceof Cloneable ? (List) favItems.clone() : favItems
result.since = (Date) since.clone()
return result
}
...
}
```
Which can be used as follows:
```
def p = new Person(first:'John', last:'Smith', favItems:['ipod', 'shiraz'], since:new Date())
def p2 = p.clone()
assert p instanceof Cloneable
assert p.favItems instanceof Cloneable
assert p.since instanceof Cloneable
assert !(p.first instanceof Cloneable)
assert !p.is(p2)
assert !p.favItems.is(p2.favItems)
assert !p.since.is(p2.since)
assert p.first.is(p2.first)
```
In the above example, `super.clone()` is called which in this case calls `clone()` from `java.lang.Object`. This does a bit-wise copy of all the properties (references and primitive values). Properties like `first` has type `String` which is not `Cloneable` so it is left as the bit-wise copy. Both `Date` and `ArrayList` are `Cloneable` so the `clone()` method on each of those properties will be called. For the list, a shallow copy is made during its `clone()` method. If your classes require deep cloning, it is up to you to provide the appropriate deep cloning logic in the respective `clone()` method for your class.
If one of your properties contains an object that doesn't support cloning or attempts deep copying of a data structure containing an object that doesn't support cloning, then a `CloneNotSupportedException` may occur at runtime.
Another popular cloning strategy is known as the copy constructor pattern. If any of your fields are `final` and `Cloneable` you should set `style=COPY_CONSTRUCTOR` which will then use the copy constructor pattern. Here is an example making use of the copy constructor pattern:
```
import groovy.transform.AutoClone
import static groovy.transform.AutoCloneStyle.*
@AutoClone(style=COPY_CONSTRUCTOR)
class Person {
final String first, last
final Date birthday
}
@AutoClone(style=COPY_CONSTRUCTOR)
class Customer extends Person {
final int numPurchases
final List favItems
}
```
Which will create classes equivalent to the following:
```
class Person implements Cloneable {
...
protected Person(Person other) throws CloneNotSupportedException {
first = other.first
last = other.last
birthday = (Date) other.birthday.clone()
}
public Person clone() throws CloneNotSupportedException {
return new Person(this)
}
...
}
class Customer extends Person {
...
protected Customer(Customer other) throws CloneNotSupportedException {
super(other)
numPurchases = other.numPurchases
favItems = other.favItems instanceof Cloneable ? (List) other.favItems.clone() : other.favItems
}
public Customer clone() throws CloneNotSupportedException {
return new Customer(this)
}
...
}
```
If you use this style on a child class, the parent class must also have a copy constructor (created using this annotation or by hand). This approach can be slightly slower than the traditional cloning approach but the `Cloneable` fields of your class can be final. When using the copy constructor style, you can provide your own custom constructor by hand if you wish. If you do so, it is up to you to correctly copy, clone or deep clone the properties of your class. As a variation of the last two styles, if you set `style=SIMPLE` then the no-arg constructor will be called followed by setting the individual properties (and/or fields) calling `clone()` if the property/field implements `Cloneable`. Here is an example:
```
import groovy.transform.AutoClone
import static groovy.transform.AutoCloneStyle.*
@AutoClone(style=SIMPLE)
class Person {
final String first, last
final Date birthday
}
@AutoClone(style=SIMPLE)
class Customer {
final List favItems
}
```
Which will create classes equivalent to the following:
```
class Person implements Cloneable {
...
public Person clone() throws CloneNotSupportedException {
def result = new Person()
copyOrCloneMembers(result)
return result
}
protected void copyOrCloneMembers(Person other) {
other.first = first
other.last = last
other.birthday = (Date) birthday.clone()
}
...
}
class Customer extends Person {
...
public Customer clone() throws CloneNotSupportedException {
def result = new Customer()
copyOrCloneMembers(result)
return result
}
protected void copyOrCloneMembers(Customer other) {
super.copyOrCloneMembers(other)
other.favItems = favItems instanceof Cloneable ? (List) favItems.clone() : favItems
}
...
}
```
You would typically use this style only for base classes where you didn't want the normal `Object` `clone()` method to be called and you would typically need to use the `SIMPLE` style for any child classes. As a final example, if your class already implements the `Serializable` or `Externalizable` interface, you can choose the following cloning style:
```
@AutoClone(style=SERIALIZATION)
class Person implements Serializable {
String first, last
Date birthday
}
```
which outputs a class with the following form:
```
class Person implements Cloneable, Serializable {
...
Person clone() throws CloneNotSupportedException {
def baos = new ByteArrayOutputStream()
baos.withObjectOutputStream{ it.writeObject(this) }
def bais = new ByteArrayInputStream(baos.toByteArray())
bais.withObjectInputStream(getClass().classLoader){ (Person) it.readObject() }
}
...
}
```
This will output an error if your class doesn't implement one of `Serializable` or `Externalizable`, will typically be significantly slower than the other approaches, also doesn't allow fields to be final, will take up more memory as even immutable classes like String will be cloned but does have the advantage that it performs deep cloning automatically. Further references on cloning:
* <http://www.codeguru.com/java/tij/tij0128.shtml>
* <http://www.artima.com/objectsandjava/webuscript/ClonCollInner1.html>
* <http://courses.dce.harvard.edu/~cscie160/JDCTipsCloning>
* <http://www.agiledeveloper.com/articles/cloning072002.htm>
**See Also:**
[AutoCloneStyle](autoclonestyle "AutoCloneStyle")
[ExternalizeMethods](externalizemethods "ExternalizeMethods")
**Since:**
1.8.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[excludes](#excludes)`Comma separated list of property (and/or field) names to exclude from cloning. |
| `**boolean**` | `[includeFields](#includeFields)`Include fields as well as properties when cloning. |
| `**[AutoCloneStyle](autoclonestyle)**` | `[style](#style)`Style to use when cloning. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **excludes**
Comma separated list of property (and/or field) names to exclude from cloning. For convenience, a String with comma separated names can be used in addition to an array (using Groovy's literal list notation) of String values.
NOTE: When using the `CLONE` style, property (and/or field) copying might occur as part of calling `super.clone()` which will ignore this list. You can then use this list to streamline the provided `clone()` implementation by selecting which Cloneable properties (and/or fields) will have a subsequent call to their `clone()` method. If you have immutable properties (and/or fields) this can be useful as the extra `clone()` will not be necessary and cloning will be more efficient.
NOTE: This doesn't affect property (and/or field) copying that might occur as part of serialization when using the `SERIALIZATION` style, i.e. this flag is ignored; instead adjust your serialization code to include or exclude the desired properties (and/or fields) which should carry over during cloning.
**Default:**
{}
### public boolean **includeFields**
Include fields as well as properties when cloning.
NOTE: When using the `CLONE` style, field copying might occur as part of calling `super.clone()` and might be all you require; if you turn on this flag, the provided `clone()` implementation will also subsequently call `clone()` for each `Cloneable` field which can be useful if you have mutable fields.
NOTE: This doesn't affect field copying that might occur as part of serialization when using the `SERIALIZATION` style, i.e. this flag is ignored; instead adjust your serialization code to include or exclude your fields.
**Default:**
false
### public [AutoCloneStyle](autoclonestyle) **style**
Style to use when cloning.
**Default:**
AutoCloneStyle.CLONE
groovy [Java] Annotation Type TailRecursive [Java] Annotation Type TailRecursive
====================================
* groovy.transform.TailRecursive
```
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.METHOD})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")({"org.codehaus.groovy.transform.tailrec.TailRecursiveASTTransformation"})
public @interface TailRecursive
```
Method annotation used to transform methods with tail recursive calls into iterative methods automagically since the JVM cannot do this itself. This works for both static and non-static methods.
It allows you to write a method like this:
```
import groovy.transform.TailRecursive
class Target {
@TailRecursive
long sumUp(long number, long sum = 0) {
if (number == 0)
return sum;
sumUp(number - 1, sum + number)
}
}
def target = new Target()
assert target.sumUp(100) == 5050
assert target.sumUp(1000000) == 500000500000 //will blow the stack on most machines when used without @TailRecursive
```
`@TailRecursive` is supposed to work in combination with `@CompileStatic`
Known shortcomings:
* Only non-void methods are currently being handled. Void methods will fail compilation.
* Only direct recursion (calling the exact same method again) is supported.
* Mixing of tail calls and non-tail calls is not possible. The compiler will complain if some recursive calls cannot be handled.
* Checking if a recursive call is really tail-recursive is not very strict. You might run into cases where non-tail calls will be considered tail calls.
* In the presence of method overloading and method overriding you might run into situations where a call is considered recursive although it really is not.
* Catching `Throwable` around a recursive might lead to problems
* Non trivial continuation passing style examples do not work.
* Probably many unrecognized edge cases.
More examples:
```
import groovy.transform.TailRecursive
@TailRecursive
long sizeOfList(list, counter = 0) {
if (list.size() == 0) {
counter
} else {
sizeOfList(list.tail(), counter + 1)
}
}
// Without @TailRecursive a StackOverFlowError
// is thrown.
assert sizeOfList(1..10000) == 10000
```
**Since:**
2.3
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
groovy [Java] Annotation Type MapConstructor [Java] Annotation Type MapConstructor
=====================================
* groovy.transform.MapConstructor
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.MapConstructorASTTransformation")
public @interface MapConstructor
```
Class annotation used to assist in the creation of map constructors in classes. If the class is also annotated with `@ImmutableBase`, then the generated constructor will contain additional code needed for immutable classes.
It allows you to write classes in this shortened form:
```
import groovy.transform.*
@TupleConstructor
class Person {
String first, last
}
@CompileStatic // optional
@ToString(includeSuperProperties=true)
@MapConstructor(pre={ super(args?.first, args?.last); args = args ?: [:] }, post = { first = first?.toUpperCase() })
class Author extends Person {
String bookName
}
assert new Author(first: 'Dierk', last: 'Koenig', bookName: 'ReGinA').toString() == 'Author(ReGinA, DIERK, Koenig)'
assert new Author().toString() == 'Author(null, null, null)'
```
The `@MapConstructor` annotation instructs the compiler to execute an AST transformation which adds the necessary constructor method to your class. A map constructor is created which sets properties, and optionally fields and super properties if the property/field name is a key within the map.
For the above example, the generated constructor will be something like:
```
public Author(java.util.Map args) {
super(args?.first, args?.last)
args = args ? args : [:]
if (args.containsKey('bookName')) {
this.bookName = args['bookName']
}
first = first?.toUpperCase()
}
```
Custom visibility:
* The `@MapConstructor` annotation generates a public constructor unless an applicable [VisibilityOptions](visibilityoptions "VisibilityOptions") annotation is also present. It can be useful to change the visibility if you want to also create a builder or provide your own static factory method for object creation. You can make the constructor private and access it from the builder or your factory method. (Note: you'll probably want to use `@CompileStatic` in conjunction with such an approach since dynamic Groovy currently gives the ability to access even private constructors.)
* An optional `visibilityId` attribute can be specified. If present, it must match the optional `id` attribute of an applicable `VisibilityOptions` annotation. This can be useful if multiple `VisibilityOptions` annotations are needed.
Custom property handling:
* The `@MapConstructor` annotation supports customization using `@PropertyOptions` which allows a custom property handler to be defined. This is most typically used behind the scenes by the `@Immutable` meta-annotation but you can also define your own handler. If a custom handler is present, it will determine the code generated when initializing any property (or field).
Known limitations/special cases:
* The generated map constructor will have an argument of type `Map` unless a single property (or field) is included and the type of that property (or field) is Object, AbstractMap, Map or HashMap. In this case, the generated constructor will be of type `LinkedHashMap`. This allows the possibility of also adding a tuple constructor without conflict, although no such constructor is added automatically. You can disable this behavior by setting the specialNamedArgHandling annotation attribute to false. This means that for the special case mentioned above, you will not be able to also add a tuple constructor with a single Map argument but you can supply any kind of map as your argument. We'd also recommend not having both a map constructor and a tuple constructor with a single Object, AbstractMap or HashMap since it can cause confusion as to which will be called.
**See Also:**
[PropertyOptions](propertyoptions "PropertyOptions")
[VisibilityOptions](visibilityoptions "VisibilityOptions")
**Since:**
2.5.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[allNames](#allNames)`Whether to include all fields and/or properties within the constructor, including those with names that are considered internal. |
| `**boolean**` | `[allProperties](#allProperties)`Whether to include all properties (as per the JavaBean spec) in the generated constructor. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[excludes](#excludes)`List of field and/or property names to exclude from the constructor. |
| `**boolean**` | `[includeFields](#includeFields)`Include fields in the constructor. |
| `**boolean**` | `[includeProperties](#includeProperties)`Include properties in the constructor. |
| `**boolean**` | `[includeStatic](#includeStatic)`Whether to include static properties in the constructor. |
| `**boolean**` | `[includeSuperFields](#includeSuperFields)`Include fields from super classes in the constructor. |
| `**boolean**` | `[includeSuperProperties](#includeSuperProperties)`Include properties from super classes in the constructor. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[includes](#includes)`List of field and/or property names to include within the constructor. |
| `**boolean**` | `[noArg](#noArg)`In addition to the map constructor, provide a no-arg constructor which calls the map constructor with an empty map. |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")**` | `[post](#post)`A Closure containing statements which will be appended to the end of the generated constructor. |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")**` | `[pre](#pre)`A Closure containing statements which will be prepended to the generated constructor. |
| `**boolean**` | `[specialNamedArgHandling](#specialNamedArgHandling)`If true, change the type of the map constructor argument from Map to LinkedHashMap only for the case where the class has a single property (or field) with a Map-like type. |
| `**boolean**` | `[useSetters](#useSetters)`By default, Groovy properties are set directly using their respective field. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[visibilityId](#visibilityId)`If specified, must match the "id" attribute in a VisibilityOptions annotation to enable a custom visibility. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **allNames**
Whether to include all fields and/or properties within the constructor, including those with names that are considered internal.
**Default:**
false
### public boolean **allProperties**
Whether to include all properties (as per the JavaBean spec) in the generated constructor. When true, Groovy treats any explicitly created setXxx() methods as property setters as per the JavaBean specification. JavaBean properties come after any Groovy properties but before any fields for a given class (unless 'includes' is used to determine the order).
**Default:**
false
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **excludes**
List of field and/or property names to exclude from the constructor. Must not be used if 'includes' is used. For convenience, a String with comma separated names can be used in addition to an array (using Groovy's literal list notation) of String values.
**Default:**
{}
### public boolean **includeFields**
Include fields in the constructor. Fields come after any properties.
**Default:**
false
### public boolean **includeProperties**
Include properties in the constructor.
**Default:**
true
### public boolean **includeStatic**
Whether to include static properties in the constructor.
**Default:**
false
### public boolean **includeSuperFields**
Include fields from super classes in the constructor. Groovy properties, JavaBean properties and fields (in that order) from superclasses come before the members from a subclass (unless 'includes' is used to determine the order).
**Default:**
false
### public boolean **includeSuperProperties**
Include properties from super classes in the constructor. Groovy properties, JavaBean properties and fields (in that order) from superclasses come before the members from a subclass (unless 'includes' is used to determine the order).
**Default:**
false
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **includes**
List of field and/or property names to include within the constructor. Must not be used if 'excludes' is used. For convenience, a String with comma separated names can be used in addition to an array (using Groovy's literal list notation) of String values. The default value is a special marker value indicating that no includes are defined; all fields and/or properties are included if 'includes' remains undefined and 'excludes' is explicitly or implicitly an empty list.
**Default:**
{ Undefined.STRING }
### public boolean **noArg**
In addition to the map constructor, provide a no-arg constructor which calls the map constructor with an empty map.
**Default:**
false
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **post**
A Closure containing statements which will be appended to the end of the generated constructor. Useful for validation steps or tweaking the populated fields/properties.
**Default:**
Undefined.CLASS.class
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **pre**
A Closure containing statements which will be prepended to the generated constructor. The first statement within the Closure may be "super(someArgs)" in which case the no-arg super constructor won't be called.
**Default:**
Undefined.CLASS.class
### public boolean **specialNamedArgHandling**
If true, change the type of the map constructor argument from Map to LinkedHashMap only for the case where the class has a single property (or field) with a Map-like type. This allows both a map and a tuple constructor to be used side-by-side so long as care is taken about the types used when calling.
**Default:**
true
### public boolean **useSetters**
By default, Groovy properties are set directly using their respective field. By setting `useSetters=true` then a writable property will be set using its setter. If turning on this flag we recommend that setters that might be called are made null-safe wrt the parameter.
**Default:**
false
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **visibilityId**
If specified, must match the "id" attribute in a VisibilityOptions annotation to enable a custom visibility.
**Default:**
Undefined.STRING
| programming_docs |
groovy [Groovy] Annotation Type ImmutableProperties [Groovy] Annotation Type ImmutableProperties
============================================
* groovy.transform.ImmutableProperties
All Implemented Interfaces and Traits: [Annotation](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html "Annotation")
```
@[ImmutableOptions](immutableoptions "ImmutableOptions")
@[PropertyOptions](propertyoptions "PropertyOptions")(propertyHandler: ImmutablePropertyHandler)
@[AnnotationCollector](annotationcollector "AnnotationCollector")(mode: AnnotationCollectorMode.PREFER_EXPLICIT_MERGED)
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(value: RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")(value: [ElementType.TYPE])
@interface ImmutableProperties
```
Meta annotation used when just the immutable properties part of `@Immutable` is desired.
**See Also:**
[Immutable](immutable "Immutable")
**Since:**
4.0.0
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
groovy [Java] Annotation Type TypeChecked.TypeCheckingInfo [Java] Annotation Type TypeChecked.TypeCheckingInfo
===================================================
* groovy.transform.TypeChecked.TypeCheckingInfo
```
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")(ElementType.METHOD)
public @interface TypeChecked.TypeCheckingInfo
```
This annotation is added by
**TypeChecked:**
on methods which have type checking turned on. It is used to embed type information into binary, so that the type checker can use this information, if available, for precompiled classes.
Element Summary
---------------
Required Element Summary
| Type | Name and Description |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[inferredType](#inferredType)`An encoded type information. |
Optional Element Summary
| Type | Name and Description |
| `**int**` | `[version](#version)`Returns the type checker information protocol number. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **inferredType**
An encoded type information.
**Returns:**
the inferred type
### public int **version**
Returns the type checker information protocol number. This is used if the format of the string used in [inferredType()](#inferredType()) changes.
**Returns:**
the protocol version
**Default:**
0
groovy [Java] Annotation Type CompileStatic [Java] Annotation Type CompileStatic
====================================
* groovy.transform.CompileStatic
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ ElementType.METHOD, ElementType.TYPE,
ElementType.CONSTRUCTOR
})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.sc.StaticCompileTransformation")
public @interface CompileStatic
```
This will let the Groovy compiler use compile time checks in the style of Java then perform static compilation, thus bypassing the Groovy meta object protocol.
When a class is annotated, all methods, properties, files, inner classes, etc. of the annotated class will be type checked. When a method is annotated, static compilation applies only to items (closures and anonymous inner classes) within the method.
By using [TypeCheckingMode.SKIP](typecheckingmode#SKIP "TypeCheckingMode.SKIP"), static compilation can be skipped on an element within a class or method otherwise marked with CompileStatic. For example a class can be annotated with CompileStatic, and a method within can be marked to skip static checking to use dynamic language features.
**See Also:**
[CompileDynamic](compiledynamic "CompileDynamic")
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[extensions](#extensions)`The list of (classpath resources) paths to type checking DSL scripts, also known as type checking extensions. |
| `**[TypeCheckingMode](typecheckingmode)**` | `[value](#value)`
**Default:**
TypeCheckingMode.PASS
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **extensions**
The list of (classpath resources) paths to type checking DSL scripts, also known as type checking extensions.
**Returns:**
an array of paths to groovy scripts that must be on compile classpath
**Default:**
{}
### public [TypeCheckingMode](typecheckingmode) **value**
**Default:**
TypeCheckingMode.PASS
groovy [Groovy] Annotation Type ConditionalInterrupt [Groovy] Annotation Type ConditionalInterrupt
=============================================
* groovy.transform.ConditionalInterrupt
All Implemented Interfaces and Traits: [Annotation](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html "Annotation")
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(value: RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")(value: [ElementType.PACKAGE, ElementType.METHOD, ElementType.FIELD, ElementType.TYPE, ElementType.LOCAL_VARIABLE])
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")(value: [org.codehaus.groovy.transform.ConditionalInterruptibleASTTransformation])
@interface ConditionalInterrupt
```
Allows "interrupt-safe" executions of scripts by adding a custom check for interruption into loops (for, while, ...) and at the start of closures and methods.
This is especially useful when executing foreign scripts that you do not have control over. Inject this transformation into a script that you need to interrupt based on some custom criteria.
Annotating anything in a script will cause for loops, while loops, methods, and closures to make a check against the specified closure. If the closure yields true (according to GroovyTruth), then the script will throw an InterruptedException. The annotation by default applies to any classes defined in the script as well. Annotated a class will cause (by default) all classes in the entire file ('Compilation Unit') to be enhanced. You can fine tune what is enhanced using the annotation parameters.
The following is sample usage of the annotation:
```
@ConditionalInterrupt({ counter++> 10})
import groovy.transform.ConditionalInterrupt
counter = 0
def scriptMethod() {
4.times {
println 'executing script method...'
}
}
scriptMethod()
```
Which results in the following code being generated (XXXXXX will be replaced with some runtime generated hashCode). Notice the checks and exceptions:
```
public class script1291741477073 extends groovy.lang.Script {
Object counter = 0
public java.lang.Object run() {
counter = 0
}
public java.lang.Object scriptMethod() {
if (this.conditionalTransformXXXXXX$condition()) {
throw new java.lang.InterruptedException('Execution interrupted. The following condition failed: { counter++> 10}')
}
4.times({
if (this.conditionalTransformXXXXXX$condition()) {
throw new java.lang.InterruptedException('Execution interrupted. The following condition failed: { counter++> 10}')
}
this.println('executing script method...')
})
}
private java.lang.Object conditionalTransformXXXXXX$condition() {
counter++ > 10
}
}
```
Note that when you're annotating scripts, the variable scoping semantics are unchanged. Therefore, you must be careful about the variable scope you're using. Make sure that variables you reference in the closure parameter are in scope during script execution. The following example will throw a MissingPropertyException because counter is not in scope for a class:
```
import groovy.transform.ConditionalInterrupt
def counter = 0
@ConditionalInterrupt({ counter++> 10})
class MyClass {
def myMethod() {
4.times {
println 'executing script method...'
}
}
}
new MyClass().myMethod()
```
Additional usage examples can be found in the unit test for this class.
**See Also:**
[TimedInterrupt](timedinterrupt "TimedInterrupt")
[ThreadInterrupt](threadinterrupt "ThreadInterrupt")
**Since:**
1.8.0
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `abstract boolean` | `**[applyToAllClasses](#applyToAllClasses())**()`Set this to false if you have multiple classes within one source file and only want a conditional check on some of the classes. |
| | `abstract boolean` | `**[applyToAllMembers](#applyToAllMembers())**()`Set this to false if you have multiple methods/closures within a class or script and only want conditional checks on some of them. |
| | `abstract boolean` | `**[checkOnMethodStart](#checkOnMethodStart())**()`By default a conditional check is added to the start of all user-defined methods. |
| | `abstract [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[thrown](#thrown())**()`Sets the type of exception which is thrown. |
| | `abstract [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[value](#value())**()`Conditional check - set as a closure expression. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### abstract boolean **applyToAllClasses**()
Set this to false if you have multiple classes within one source file and only want a conditional check on some of the classes. Place annotations on the classes you want enhanced. Set to true (the default) for blanket coverage of conditional checks on all methods, loops and closures within all classes/script code. For even finer-grained control see `applyToAllMembers`.
**See Also:**
[applyToAllMembers()](#applyToAllMembers())
### abstract boolean **applyToAllMembers**()
Set this to false if you have multiple methods/closures within a class or script and only want conditional checks on some of them. Place annotations on the methods/closures that you want enhanced. When false, `applyToAllClasses` is automatically set to false. Set to true (the default) for blanket coverage of conditional checks on all methods, loops and closures within the class/script.
**Since:**
2.2.0\*
**See Also:**
[applyToAllClasses()](#applyToAllClasses())
### abstract boolean **checkOnMethodStart**()
By default a conditional check is added to the start of all user-defined methods. To turn this off simply set this parameter to false.
### abstract [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **thrown**()
Sets the type of exception which is thrown.
### abstract [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **value**()
Conditional check - set as a closure expression.
groovy [Java] Class Undefined.CLASS [Java] Class Undefined.CLASS
============================
* groovy.transform.Undefined.CLASS
```
public static final class Undefined.CLASS
```
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
groovy [Java] Annotation Type WithWriteLock [Java] Annotation Type WithWriteLock
====================================
* groovy.transform.WithWriteLock
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.METHOD})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.ReadWriteLockASTTransformation")
public @interface WithWriteLock
```
This annotation is used in conjunction with [WithReadLock](withreadlock "WithReadLock") to support read and write synchronization on a method.
To use this annotation, declare `@WithWriteLock` on your method. The method may be either an instance method or a static method. The resulting method will allow only one thread access to the method at a time, and will wait to access the method until any other read locks have been released.
This annotation is a declarative wrapper around the JDK's `java.util.concurrent.locks.ReentrantReadWriteLock`. Objects containing this annotation will have a ReentrantReadWriteLock field named `$reentrantLock` added to the class, and method access is protected by the lock. If the method is static then the field is static and named `$REENTRANTLOCK`.
The annotation takes an optional parameter for the name of the field. This field must exist on the class and must be of type ReentrantReadWriteLock.
To understand how this annotation works, it is convenient to think in terms of the source code it replaces. The following is a typical usage of this annotation from Groovy:
```
import groovy.transform.*;
public class ResourceProvider {
private final Map<String, String> data = new HashMap<String, String>();
@WithReadLock
public String getResource(String key) throws Exception {
return data.get(key);
}
@WithWriteLock
public void refresh() throws Exception {
//reload the resources into memory
}
}
```
As part of the Groovy compiler, code resembling this is produced:
```
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.concurrent.locks.ReadWriteLock;
public class ResourceProvider {
private final ReadWriteLock $reentrantlock = new ReentrantReadWriteLock();
private final Map<String, String> data = new HashMap<String, String>();
public String getResource(String key) throws Exception {
$reentrantlock.readLock().lock();
try {
return data.get(key);
} finally {
$reentrantlock.readLock().unlock();
}
}
public void refresh() throws Exception {
$reentrantlock.writeLock().lock();
try {
//reload the resources into memory
} finally {
$reentrantlock.writeLock().unlock();
}
}
}
```
**Since:**
1.8.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[value](#value)`
**Returns:**
if a user specified lock object with the given name should be used the lock object must exist.
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **value**
**Returns:**
if a user specified lock object with the given name should be used the lock object must exist. If the annotated method is static then the lock object must be static. If the annotated method is not static then the lock object must not be static.
**Default:**
""
| programming_docs |
groovy [Java] Enum AnnotationCollectorMode [Java] Enum AnnotationCollectorMode
===================================
* groovy.transform.AnnotationCollectorMode
```
public enum AnnotationCollectorMode
extends [Enum](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html "Enum")
```
Enum Constants Summary
----------------------
Enum constants classes
| Enum constant | Description |
| `**[DUPLICATE](#DUPLICATE)**` | Annotations from the annotation collection will always be inserted. |
| `**[PREFER\_COLLECTOR](#PREFER_COLLECTOR)**` | Annotations from the collector will be added and any existing annotations with the same name will be removed. |
| `**[PREFER\_COLLECTOR\_MERGED](#PREFER_COLLECTOR_MERGED)**` | Annotations from the collector will be added and any existing annotations with the same name will be removed but any new parameters found within existing annotations will be merged into the added annotation. |
| `**[PREFER\_EXPLICIT](#PREFER_EXPLICIT)**` | Annotations from the collector will be ignored if any existing annotations with the same name are found. |
| `**[PREFER\_EXPLICIT\_MERGED](#PREFER_EXPLICIT_MERGED)**` | Annotations from the collector will be ignored if any existing annotations with the same name are found but any new parameters on the collector annotation will be added to existing annotations. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Enum](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html "Enum")` | `[name](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#name() "name"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#hashCode() "hashCode"), [compareTo](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo(java.lang.Object) "compareTo"), [compareTo](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo(java.lang.Enum) "compareTo"), [valueOf](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#valueOf(java.lang.Class,%20java.lang.String) "valueOf"), [describeConstable](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#describeConstable() "describeConstable"), [getDeclaringClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getDeclaringClass() "getDeclaringClass"), [ordinal](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#ordinal() "ordinal"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait(long) "wait"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#notifyAll() "notifyAll")` |
Enum Constant Detail
--------------------
### public [AnnotationCollectorMode](annotationcollectormode) **DUPLICATE**
Annotations from the annotation collection will always be inserted. After all transforms have been run, it will be an error if multiple annotations (excluding those with SOURCE retention) exist.
### public [AnnotationCollectorMode](annotationcollectormode) **PREFER\_COLLECTOR**
Annotations from the collector will be added and any existing annotations with the same name will be removed.
### public [AnnotationCollectorMode](annotationcollectormode) **PREFER\_COLLECTOR\_MERGED**
Annotations from the collector will be added and any existing annotations with the same name will be removed but any new parameters found within existing annotations will be merged into the added annotation.
### public [AnnotationCollectorMode](annotationcollectormode) **PREFER\_EXPLICIT**
Annotations from the collector will be ignored if any existing annotations with the same name are found.
### public [AnnotationCollectorMode](annotationcollectormode) **PREFER\_EXPLICIT\_MERGED**
Annotations from the collector will be ignored if any existing annotations with the same name are found but any new parameters on the collector annotation will be added to existing annotations.
groovy [Java] Annotation Type Sealed [Java] Annotation Type Sealed
=============================
* groovy.transform.Sealed
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE})
@[Incubating](../../org/apache/groovy/lang/annotation/incubating "Incubating")
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")({
"org.codehaus.groovy.transform.SealedASTTransformation",
"org.codehaus.groovy.transform.SealedCompletionASTTransformation"})
public @interface Sealed
```
Class annotation used to assist in the creation of sealed classes.
**Since:**
4.0.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[]**` | `[permittedSubclasses](#permittedSubclasses)`List of the permitted subclasses. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")[] **permittedSubclasses**
List of the permitted subclasses.
**Default:**
{}
groovy [Java] Annotation Type AutoImplement [Java] Annotation Type AutoImplement
====================================
* groovy.transform.AutoImplement
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.AutoImplementASTTransformation")
public @interface AutoImplement
```
Class annotation used to provide default dummy methods for a class extending an abstract super class or implementing one or more interfaces.
Example usage:
```
import groovy.transform.AutoImplement
@AutoImplement
class EmptyStringIterator implements Iterator {
boolean hasNext() { false }
}
assert !new EmptyStringIterator().hasNext()
```
In the above example, since `hasNext` returns false, the `next` method should never be called, so any dummy implementation would do for `next`. The "empty" implementation provided by default when using `@AutoImplement` will suffice - which effectively returns `null` in Groovy for non-void, non-primitive methods. As a point of interest, the default implementation for methods returning primitive types is to return the default value (which incidentally never satisfies Groovy truth). For `boolean` this means returning `false`, so for the above example we could have (albeit perhaps less instructive of our intent) by just using:
```
@AutoImplement
class EmptyStringIterator implements Iterator { }
```
If we didn't want to assume that callers of our `EmptyStringIterator` correctly followed the `Iterator` contract, then we might want to guard against inappropriate calls to `next`. Rather than just returning `null`, we might want to throw an exception. This is easily done using the `exception` annotation attribute as shown below:
```
import groovy.transform.AutoImplement
import static groovy.test.GroovyAssert.shouldFail
@AutoImplement(exception=UnsupportedOperationException)
class EmptyStringIterator implements Iterator {
boolean hasNext() { false }
}
shouldFail(UnsupportedOperationException) {
new EmptyStringIterator().next()
}
```
All implemented methods will throw an instance of this exception constructed using its no-arg constructor. You can also supply a single `message` annotation attribute in which case the message will be passed as an argument during exception construction as shown in the following example:
```
@AutoImplement(exception=UnsupportedOperationException, message='Not supported for this empty iterator')
class EmptyStringIterator implements Iterator {
boolean hasNext() { false }
}
def ex = shouldFail(UnsupportedOperationException) {
new EmptyStringIterator().next()
}
assert ex.message == 'Not supported for this empty iterator'
```
Finally, you can alternatively supply a `code` annotation attribute in which case a closure block can be supplied which should contain the code to execute for all implemented methods. This can be seen in the following example:
```
@AutoImplement(code = { throw new UnsupportedOperationException("Not supported for ${getClass().simpleName}") })
class EmptyStringIterator implements Iterator {
boolean hasNext() { false }
}
def ex = shouldFail(UnsupportedOperationException) {
new EmptyStringIterator().next()
}
assert ex.message == 'Not supported for EmptyStringIterator'
```
**Since:**
2.5.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")**` | `[code](#code)`If defined, all unimplemented methods will execute the code found within the supplied closure. |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<? extends [RuntimeException](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html "RuntimeException")>**` | `[exception](#exception)`If defined, all unimplemented methods will throw this exception. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[message](#message)`If `exception` is defined, `message` can be used to specify the exception message. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **code**
If defined, all unimplemented methods will execute the code found within the supplied closure.
**Default:**
Undefined.CLASS.class
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<? extends [RuntimeException](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html "RuntimeException")> **exception**
If defined, all unimplemented methods will throw this exception. Will be ignored if `code` is defined.
**Default:**
Undefined.EXCEPTION.class
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **message**
If `exception` is defined, `message` can be used to specify the exception message. Will be ignored if `code` is defined or `exception` isn't defined.
**Default:**
Undefined.STRING
groovy [Java] Annotation Type KnownImmutable [Java] Annotation Type KnownImmutable
=====================================
* groovy.transform.KnownImmutable
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE})
public @interface KnownImmutable
```
Class annotation used as a marker for immutable classes. Not usually used explicitly but rather implicitly via the `@Immutable` meta annotation which adds it automatically. If you create your own Java or Groovy immutable class manually, you can add this annotation if you don't want to have to list your class as one of the known immutable classes.
**See Also:**
[Immutable](immutable "Immutable")
**Since:**
2.5.0
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
groovy [Java] Annotation Type Trait [Java] Annotation Type Trait
============================
* groovy.transform.Trait
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.trait.TraitASTTransformation")
public @interface Trait
```
Used to mark a class as being a trait.
**Since:**
2.3.0
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
groovy [Java] Annotation Type IndexedProperty [Java] Annotation Type IndexedProperty
======================================
* groovy.transform.IndexedProperty
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.FIELD})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.IndexedPropertyASTTransformation")
public @interface IndexedProperty
```
Field annotation used with properties to provide an indexed getter and setter for the property. Groovy provides nice GPath syntax support for accessing indexed properties but Java tools or frameworks may expect the JavaBean style getters and setters. Only the getter is produced when an immutable field can be determined.
*Example usage:* suppose you have a class with the following properties:
```
@IndexedProperty FieldType[] someField
@IndexedProperty List otherField
`@IndexedProperty` List furtherField
```
will add the following methods to the class containing the properties:
```
FieldType getSomeField(int index) {
someField[index]
}
FieldType getOtherField(int index) {
otherField[index]
}
Object getFurtherField(int index) {
furtherField[index]
}
void setSomeField(int index, FieldType val) {
someField[index] = val
}
void setOtherField(int index, FieldType val) {
otherField[index] = val
}
void setFurtherField(int index, Object val) {
furtherField[index] = val
}
```
Normal Groovy visibility rules for properties apply (i.e. no `public`, `private` or `package` visibility can be specified) or you will receive a compile-time error message. The normal Groovy property getters and setters will also be created.
More examples:
```
import groovy.transform.IndexedProperty
class Group {
String name
List members = []
}
class IndexedGroup {
String name
@IndexedProperty List members = []
}
def group = new Group(name: 'Groovy')
group.members[0] = 'mrhaki'
group.members[1] = 'Hubert'
assert 2 == group.members.size()
assert ['mrhaki', 'Hubert'] == group.members
try {
group.setMembers(0, 'hubert') // Not index property
} catch (MissingMethodException e) {
assert e
}
def indexedGroup = new IndexedGroup(name: 'Grails')
indexedGroup.members[0] = 'mrhaki'
indexedGroup.setMembers 1, 'Hubert'
assert 2 == indexedGroup.members.size()
assert 'mrhaki' == indexedGroup.getMembers(0)
assert 'Hubert' == indexedGroup.members[1]
```
**Since:**
1.7.3
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
| programming_docs |
groovy [Java] Annotation Type ImmutableBase [Java] Annotation Type ImmutableBase
====================================
* groovy.transform.ImmutableBase
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.ImmutableASTTransformation")
public @interface ImmutableBase
```
Class annotation used to assist in the creation of immutable classes. Checks on the validity of an immutable class and makes some preliminary changes to the class. Usually used via the `@Immutable` meta annotation.
Custom property handling:
* The `@ImmutableBase` annotation supports customization using `@PropertyOptions` which allows a custom property handler to be defined. This is most typically used behind the scenes by the `@Immutable` meta-annotation but you can also define your own handler. If a custom handler is present, it will determine the code generated for the getters and setters of any property.
**See Also:**
[Immutable](immutable "Immutable")
[ImmutableOptions](immutableoptions "ImmutableOptions")
[MapConstructor](mapconstructor "MapConstructor")
[TupleConstructor](tupleconstructor "TupleConstructor")
[PropertyOptions](propertyoptions "PropertyOptions")
**Since:**
2.5.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[copyWith](#copyWith)`If `true`, this adds a method `copyWith` which takes a Map of new property values and returns a new instance of the Immutable class with these values set. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **copyWith**
If `true`, this adds a method `copyWith` which takes a Map of new property values and returns a new instance of the Immutable class with these values set. Example:
```
@groovy.transform.Immutable(copyWith = true)
class Person {
String first, last
}
def tim = new Person( 'tim', 'yates' )
def alice = tim.copyWith( first:'alice' )
assert tim.first == 'tim'
assert alice.first == 'alice'
```
Unknown keys in the map are ignored, and if the values would not change the object, then the original object is returned. If a method called `copyWith` that takes a single parameter already exists in the class, then this setting is ignored, and no method is generated.
**Default:**
false
groovy [Java] Annotation Type NamedParams [Java] Annotation Type NamedParams
==================================
* groovy.transform.NamedParams
```
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")(ElementType.PARAMETER)
public @interface NamedParams
```
Collector annotation for [NamedParam](namedparam "NamedParam").
**Since:**
2.5.0
Element Summary
---------------
Required Element Summary
| Type | Name and Description |
| `**[NamedParam](namedparam)[]**` | `[value](#value)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [NamedParam](namedparam)[] **value**
groovy [Java] Annotation Type AutoFinal [Java] Annotation Type AutoFinal
================================
* groovy.transform.AutoFinal
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.AutoFinalASTTransformation")
public @interface AutoFinal
```
Annotation to automatically add the final qualifier to method, constructor, and closure parameters.
The annotation can be placed at the class level in which case it applies to all methods, constructors, and closures within the class and any inner classes. It can also be applied to an individual method, constructor, field with a Closure initial value or a Closure assigned to a local variable. In the case of fields (or local variables) it only adjusts the parameters of the referenced Closure not the field (or local variable) itself.
If you wish to automatically apply the annotation to all classes of a project, consider using `groovyc --configscript`. Google "Customising The Groovy Compiler", or see [CompilerConfiguration](../../org/codehaus/groovy/control/compilerconfiguration "CompilerConfiguration") for further details. This will ensure that all arguments will automatically be final, completely eliminating the need to clutter the code with final keywords in any parameter list.
*Example usage:*
```
@groovy.transform.AutoFinal
class Person {
final String first, last
Person(String first, String last) {
this.first = first
this.last = last
}
String fullName(boolean reversed = false, String separator = ' ') {
final concatCls = { String n0, String n1 -> "$n0$separator$n1" }
concatCls(reversed ? last : first, reversed ? first : last)
}
}
final js = new Person('John', 'Smith')
assert js.fullName() == 'John Smith'
assert js.fullName(true, ', ') == 'Smith, John'
```
for this case, the constructor for the `Person` class will be equivalent to the following code:
```
Person(final String first, final String last) {
...
}
```
And after normal default parameter processing takes place, the following overloaded methods will exist:
```
String fullName(final boolean reversed, final String separator) { ... }
String fullName(final boolean reversed) { fullName(reversed, ' ') }
String fullName() { fullName(false) }
```
and the closure will have become:
```
{ final String n0, final String n1 -> "$n0$separator$n1" }
```
**Since:**
2.5.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[enabled](#enabled)`Indicates that adding final to parameters should not be applied on this node. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **enabled**
Indicates that adding final to parameters should not be applied on this node.
Normally not required since leaving off the annotation will achieve the same affect. However, it can be useful for selectively disabling this annotation in just a small part of an otherwise annotated class. As an example, it would make sense to set this to `false` on a method which altered parameters in a class already marked as `@AutoFinal`. All nodes in the class except that single method would be processed.
**Default:**
true
groovy [Groovy] Annotation Type ThreadInterrupt [Groovy] Annotation Type ThreadInterrupt
========================================
* groovy.transform.ThreadInterrupt
All Implemented Interfaces and Traits: [Annotation](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html "Annotation")
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(value: RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")(value: [ElementType.PACKAGE, ElementType.METHOD, ElementType.FIELD, ElementType.TYPE, ElementType.LOCAL_VARIABLE])
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")(value: [org.codehaus.groovy.transform.ThreadInterruptibleASTTransformation])
@interface ThreadInterrupt
```
Allows "interrupt-safe" executions of scripts by adding Thread.currentThread().isInterrupted() checks into loops (for, while) and at the start of closures and methods.
This is especially useful when executing foreign scripts that you do not have control over. Inject this transformation into a script that you need to interrupt.
Annotating anything in a script will cause for loops, while loops, methods, and closures to make an isInterruptedCheck and throw a InterruptedException if the check yields true. The annotation by default will apply to any classes defined in the script as well. Annotated a class will cause (by default) all classes in the entire file ('Compilation Unit') to be enhanced. You can fine tune what is enhanced using the annotation parameters.
The following is sample usage of the annotation:
```
@groovy.transform.ThreadInterrupt
def scriptMethod() {
4.times {
println 'executing script method...'
}
}
class MyClass {
def myMethod() {
for (i in (1..10)) {
println 'executing method...'
}
}
}
scriptMethod()
new MyClass().myMethod()
```
Which results in the following code being generated. Notice the checks and exceptions:
```
public class script1290627909406 extends groovy.lang.Script {
public java.lang.Object scriptMethod() {
if (java.lang.Thread.currentThread().isInterrupted()) {
throw new java.lang.InterruptedException('Execution Interrupted')
}
4.times({
if (java.lang.Thread.currentThread().isInterrupted()) {
throw new java.lang.InterruptedException('Execution Interrupted')
}
this.println('executing script method...')
})
}
}
public class MyClass extends java.lang.Object {
public java.lang.Object myMethod() {
if (java.lang.Thread.currentThread().isInterrupted()) {
throw new java.lang.InterruptedException('Execution Interrupted')
}
for (java.lang.Object i : (1..10)) {
if (java.lang.Thread.currentThread().isInterrupted()) {
throw new java.lang.InterruptedException('Execution Interrupted')
}
this.println('executing method...')
}
}
}
this.scriptMethod()
new MyClass().myMethod()
```
Additional usage examples can be found in the unit test for this class.
**See Also:**
[TimedInterrupt](timedinterrupt "TimedInterrupt")
[ConditionalInterrupt](conditionalinterrupt "ConditionalInterrupt")
**Since:**
1.8.0
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `abstract boolean` | `**[applyToAllClasses](#applyToAllClasses())**()`Set this to false if you have multiple classes within one source file and only want isInterrupted checks on some of the classes. |
| | `abstract boolean` | `**[applyToAllMembers](#applyToAllMembers())**()`Set this to false if you have multiple methods/closures within a class or script and only want isInterrupted checks on some of them. |
| | `abstract boolean` | `**[checkOnMethodStart](#checkOnMethodStart())**()`By default an isInterrupted check is added to the start of all user-defined methods. |
| | `abstract [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")` | `**[thrown](#thrown())**()`Sets the type of exception which is thrown. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### abstract boolean **applyToAllClasses**()
Set this to false if you have multiple classes within one source file and only want isInterrupted checks on some of the classes. Place annotations on the classes you want enhanced. Set to true (the default) for blanket coverage of isInterrupted checks on all methods, loops and closures within all classes/script code. For even finer-grained control see `applyToAllMembers`.
**See Also:**
[applyToAllMembers()](#applyToAllMembers())
### abstract boolean **applyToAllMembers**()
Set this to false if you have multiple methods/closures within a class or script and only want isInterrupted checks on some of them. Place annotations on the methods/closures that you want enhanced. When false, `applyToAllClasses` is automatically set to false. Set to true (the default) for blanket coverage of isInterrupted checks on all methods, loops and closures within the class/script.
**Since:**
2.2.0
**See Also:**
[applyToAllClasses()](#applyToAllClasses())
### abstract boolean **checkOnMethodStart**()
By default an isInterrupted check is added to the start of all user-defined methods. To turn this off simply set this parameter to false.
### abstract [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **thrown**()
Sets the type of exception which is thrown.
groovy [Java] Annotation Type ASTTest [Java] Annotation Type ASTTest
==============================
* groovy.transform.ASTTest
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.PACKAGE, ElementType.TYPE, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.ASTTestTransformation")
public @interface ASTTest
```
This AST transformation aims at helping in debugging other AST transformations. It provides a basic infrastructure for performing tests on AST nodes. You can place this annotation on any node which accepts an annotation (types, methods, annotations, constructors, fields, local variables, packages or parameters), then use a script which is run against this AST node at a specific phase. For example, you could test the [Field](field "Field") AST transformation this way:
```
import groovy.transform.*
@ASTTest(value = {
def owner = node.declaringClass
assert owner.fields.any { it.name == 'x' }
})
@Field int x
```
The closure code is executed after the specified phase has completed. If no phase is provided, then the code is executed after the [semantic analysis](../../org/codehaus/groovy/control/compilephase#SEMANTIC_ANALYSIS "semantic analysis") phase and each subsequent phase. The `node` variable refers to the AST node where the AST test annotation is put. In the previous example, it means that *node* refers to the declaration "int x".
**Since:**
2.0.0
Element Summary
---------------
Required Element Summary
| Type | Name and Description |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<? extends [Closure](../lang/closure "Closure")<?>>**` | `[value](#value)`A closure which is executed against the annotated node after the specified phase has completed. |
Optional Element Summary
| Type | Name and Description |
| `**[CompilePhase](../../org/codehaus/groovy/control/compilephase)**` | `[phase](#phase)`The compile phase after which the test code should run. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [CompilePhase](../../org/codehaus/groovy/control/compilephase) **phase**
The compile phase after which the test code should run.
**Default:**
CompilePhase.SEMANTIC\_ANALYSIS
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<? extends [Closure](../lang/closure "Closure")<?>> **value**
A closure which is executed against the annotated node after the specified phase has completed.
| programming_docs |
groovy [Java] Annotation Type Sortable [Java] Annotation Type Sortable
===============================
* groovy.transform.Sortable
```
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.SortableASTTransformation")
public @interface Sortable
```
A class annotation used to make a class Comparable by (potentially) multiple Comparators. As an example, given this class:
```
@Sortable class Person {
String first
String last
Integer born
}
```
The generated Groovy class will: * implement the `Comparable` interface
* have a `compareTo` method based on the `first`, `last` and `born` properties (priority ordering will be according to the ordering of property definition, highest first, unless 'includes' is used; in which case, priority will be according to the order given in the includes list)
* have three `Comparator` methods named `comparatorByFirst`, `comparatorByLast` and `comparatorByBorn`
* sort by natural order by default, reversed natural order can be specified
The properties within the class must themselves be `Comparable` or `@Sortable`. More examples:
```
//--------------------------------------------------------------------------
import groovy.transform.Sortable
import groovy.transform.ToString
@Sortable
@ToString
class Course {
// Order of properties determines priority when sorting
String title
Date beginDate
Integer maxAttendees // int doesn't implement Comparable, so use Integer
}
final Course groovy = new Course(
title: 'Groovy', beginDate: new Date() + 7, maxAttendees: 40)
final Course groovy2 = new Course(
title: 'Groovy', beginDate: new Date() + 2, maxAttendees: 50)
final Course grails = new Course(
title: 'Grails', beginDate: new Date() + 1, maxAttendees: 20)
final List<Course> courses = [groovy, groovy2, grails]
assert courses.last().title == 'Grails'
// Use toSorted() method to sort
final List<Course> sorted = courses.toSorted()
assert sorted.first().title == 'Grails'
assert sorted.last().title == 'Groovy'
assert sorted.maxAttendees == [20, 50, 40]
```
```
//--------------------------------------------------------------------------
// Order of fields for includes determines priority when sorting
import groovy.transform.Sortable
import groovy.transform.ToString
@Sortable(includes = ['title', 'maxAttendees'])
// Or @Sortable(excludes = ['beginDate'])
@ToString
class Course {
String title
Date beginDate
Integer maxAttendees
}
final Course groovy = new Course(
title: 'Groovy', beginDate: new Date() + 7, maxAttendees: 40)
final Course groovy2 = new Course(
title: 'Groovy', beginDate: new Date() + 2, maxAttendees: 50)
final Course grails = new Course(
title: 'Grails', beginDate: new Date() + 1, maxAttendees: 20)
final List<Course> courses = [groovy, groovy2, grails]
// Use toSorted() method to sort
final List<Course> sorted = courses.toSorted()
assert sorted.first().title == 'Grails'
assert sorted.last().title == 'Groovy'
assert sorted.maxAttendees == [20, 40, 50]
//--------------------------------------------------------------------------
// Static methods to create comparators.
final Comparator byMaxAttendees = Course.comparatorByMaxAttendees()
final List<Course> sortedByMaxAttendees = courses.sort(false, byMaxAttendees)
assert sortedByMaxAttendees.maxAttendees == [20, 40, 50]
// beginDate is not used for sorting
assert sortedByMaxAttendees[2].beginDate < sortedByMaxAttendees[1].beginDate
assert Course.declaredMethods.name.findAll { it.startsWith('comparatorBy') }.toSorted() == ['comparatorByMaxAttendees', 'comparatorByTitle']
//--------------------------------------------------------------------------
// Sorting by max attendees using reversed order
import groovy.transform.Sortable
import groovy.transform.ToString
@Sortable(includes = ['points'], reversed = true)
@ToString
class LeaderBoardEntry {
String team
int points
}
final LeaderBoardEntry teamA = new LeaderBoardEntry(team: "Team A", points: 30)
final LeaderBoardEntry teamB = new LeaderBoardEntry(team: "Team B", points: 80)
final LeaderBoardEntry teamC = new LeaderBoardEntry(team: "Team C", points: 50)
final List<LeaderBoardEntry> leaderBoard = [teamA, teamB, teamC].toSorted()
assert leaderBoard.first().team == 'Team B'
assert leaderBoard.last().team == 'Team A'
assert leaderBoard.points == [80, 50, 30]
```
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[allNames](#allNames)`Whether to include all fields and/or properties in the comparison algorithm, including those with names that are considered internal. |
| `**boolean**` | `[allProperties](#allProperties)`Whether to include all properties (as per the JavaBean spec) in the comparison algorithm. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[excludes](#excludes)`Property names to exclude in the comparison algorithm. |
| `**boolean**` | `[includeSuperProperties](#includeSuperProperties)`Whether to include super properties in the comparison algorithm. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[includes](#includes)`Property names to include in the comparison algorithm. |
| `**boolean**` | `[reversed](#reversed)`Set to true so that comparator uses reversed natural order. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **allNames**
Whether to include all fields and/or properties in the comparison algorithm, including those with names that are considered internal.
**Since:**
2.5.2
**Default:**
false
### public boolean **allProperties**
Whether to include all properties (as per the JavaBean spec) in the comparison algorithm. Groovy recognizes any field-like definitions with no explicit visibility as property definitions and always includes them in the comparison algorithm. Groovy also treats any explicitly created getXxx() or isYyy() methods as property getters as per the JavaBean specification. Set this flag to false explicitly exclude such properties. JavaBean properties come after any Groovy properties for a given class (unless 'includes' is used to determine the order).
**Since:**
2.5.2
**Default:**
true
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **excludes**
Property names to exclude in the comparison algorithm. Must not be used if 'includes' is used.
**Default:**
{}
### public boolean **includeSuperProperties**
Whether to include super properties in the comparison algorithm. Groovy properties and potentially JavaBean properties (in that order) from superclasses come before the members from a subclass (unless 'includes' is used to determine the order).
**Since:**
2.5.2
**Default:**
false
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **includes**
Property names to include in the comparison algorithm. Must not be used if 'excludes' is used. The default value is a special marker value indicating that no includes are defined; all properties are included if 'includes' remains undefined and 'excludes' is explicitly or implicitly an empty list.
**Default:**
{ Undefined.STRING }
### public boolean **reversed**
Set to true so that comparator uses reversed natural order.
**Since:**
2.5.0
**Default:**
false
groovy [Java] Annotation Type Field [Java] Annotation Type Field
============================
* groovy.transform.Field
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.LOCAL_VARIABLE})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.FieldASTTransformation")
public @interface Field
```
Variable annotation used for changing the scope of a variable within a script from being within the run method of the script to being at the class level for the script.
The annotated variable will become a private field of the script class. The type of the field will be the same as the type of the variable. Example usage:
```
import groovy.transform.Field
@Field List awe = [1, 2, 3]
def awesum() { awe.sum() }
assert awesum() == 6
```
In this example, without the annotation, variable `awe` would be a local script variable (technically speaking it will be a local variable within the `run` method of the script class). Such a local variable would not be visible inside the `awesum` method. With the annotation, `awe` becomes a private List field in the script class and is visible within the `awesum` method.
**Since:**
1.8.0
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
groovy [Java] Annotation Type EqualsAndHashCode [Java] Annotation Type EqualsAndHashCode
========================================
* groovy.transform.EqualsAndHashCode
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.EqualsAndHashCodeASTTransformation")
public @interface EqualsAndHashCode
```
Class annotation used to assist in creating appropriate `equals()` and `hashCode()` methods.
It allows you to write classes in this shortened form:
```
import groovy.transform.EqualsAndHashCode
@EqualsAndHashCode
class Person {
String first, last
int age
}
def p1 = new Person(first:'John', last:'Smith', age:21)
def p2 = new Person(first:'John', last:'Smith', age:21)
assert p1 == p2
def map = [:]
map[p1] = 45
assert map[p2] == 45
```
The `@EqualsAndHashCode` annotation instructs the compiler to execute an AST transformation which adds the necessary equals and hashCode methods to the class. The `hashCode()` method is calculated using Groovy's `HashCodeHelper` class which implements an algorithm similar to the one outlined in the book *Effective Java*.
The `equals()` method compares the values of the individual properties (and optionally fields) of the class. It can also optionally call equals on the super class. Two different equals method implementations are supported both of which support the equals contract outlined in the javadoc for `java.lang.Object`
To illustrate the 'canEqual' implementation style (see http://www.artima.com/lejava/articles/equality.html for further details), consider this class:
```
@EqualsAndHashCode
class IntPair {
int x, y
}
```
The generated `equals` and `canEqual` methods will be something like below:
```
public boolean equals(java.lang.Object other)
if (other == null) return false
if (this.is(other)) return true
if (!(other instanceof IntPair)) return false
if (!other.canEqual(this)) return false
if (x != other.x) return false
if (y != other.y) return false
return true
}
public boolean canEqual(java.lang.Object other) {
return other instanceof IntPair
}
```
If no further options are specified, this is the default style for `@Canonical` and `@EqualsAndHashCode` annotated classes. The advantage of this style is that it allows inheritance to be used in limited cases where its purpose is for overriding implementation details rather than creating a derived type with different behavior. This is useful when using JPA Proxies for example or as shown in the following examples:
```
import groovy.transform.*
@Canonical class IntPair { int x, y }
def p1 = new IntPair(1, 2)
// overridden getter but deemed an IntPair as far as domain is concerned
def p2 = new IntPair(1, 1) { int getY() { 2 } }
// additional helper method added through inheritance but
// deemed an IntPair as far as our domain is concerned
@InheritConstructors class IntPairWithSum extends IntPair {
def sum() { x + y }
}
def p3 = new IntPairWithSum(1, 2)
assert p1 == p2 && p2 == p1
assert p1 == p3 && p3 == p1
assert p3 == p2 && p2 == p3
```
Note that if you create any domain classes which don't have exactly the same contract as `IntPair` then you should provide an appropriate `equals` and `canEqual` method. The easiest way to achieve this would be to use the `@Canonical` or `@EqualsAndHashCode` annotations as shown below:
```
@EqualsAndHashCode
@TupleConstructor(includeSuperProperties=true)
class IntTriple extends IntPair { int z }
def t1 = new IntTriple(1, 2, 3)
assert p1 != t1 && p2 != t1 && t1 != p3
```
The alternative supported style regards any kind of inheritance as creation of a new type and is illustrated in the following example:
```
@EqualsAndHashCode(useCanEqual=false)
class IntPair {
int x, y
}
```
The generated equals method will be something like below:
```
public boolean equals(java.lang.Object other)
if (other == null) return false
if (this.is(other)) return true
if (IntPair != other.getClass()) return false
if (x != other.x) return false
if (y != other.y) return false
return true
}
```
This style is appropriate for final classes (where inheritance is not allowed) which have only `java.lang.Object` as a super class. Most `@Immutable` classes fall in to this category. For such classes, there is no need to introduce the `canEqual()` method. Note that if you explicitly set `useCanEqual=false` for child nodes in a class hierarchy but have it `true` for parent nodes and you also have `callSuper=true` in the child, then your generated equals methods will not strictly follow the equals contract.
Note that when used in the recommended fashion, the two implementations supported adhere to the equals contract. You can provide your own equivalence relationships if you need, e.g. for comparing instances of the `IntPair` and `IntTriple` classes discussed earlier, you could provide the following method in `IntPair`:
```
boolean hasEqualXY(other) { other.x == getX() && other.y == getY() }
```
Then for the objects defined earlier, the following would be true:
```
assert p1.hasEqualXY(t1) && t1.hasEqualXY(p1)
assert p2.hasEqualXY(t1) && t1.hasEqualXY(p2)
assert p3.hasEqualXY(t1) && t1.hasEqualXY(p3)
```
There is also support for including or excluding fields/properties by name when constructing the equals and hashCode methods as shown here:
```
import groovy.transform.*
@EqualsAndHashCode(excludes="z")
@TupleConstructor
public class Point2D {
int x, y, z
}
assert new Point2D(1, 1, 1).equals(new Point2D(1, 1, 2))
assert !new Point2D(1, 1, 1).equals(new Point2D(2, 1, 1))
@EqualsAndHashCode(excludes=["y", "z"])
@TupleConstructor
public class Point1D {
int x, y, z
}
assert new Point1D(1, 1, 1).equals(new Point1D(1, 1, 2))
assert new Point1D(1, 1, 1).equals(new Point1D(1, 2, 1))
assert !new Point1D(1, 1, 1).equals(new Point1D(2, 1, 1))
```
**Note:** `@EqualsAndHashCode` is a transform to help reduce boilerplate in the common cases. It provides a useful implementation of `equals()` and `hashCode()` but not necessarily the most appropriate or efficient one for every use case. You should write custom versions if your scenario demands it. In particular, if you have mutually-referential classes, the implementations provided may not be suitable and may recurse infinitely (leading to a `StackOverflowError`). In such cases, you need to remove the infinite loop from your data structures or write your own custom methods. If your data structures are self-referencing, the code generated by this transform will try to avoid infinite recursion but the algorithm used may not suit your scenario, so use with caution if you have such structures. A future version of this transform may better handle some additional recursive scenarios. More examples:
```
import groovy.transform.EqualsAndHashCode
@EqualsAndHashCode(includeFields=true)
class User {
String name
boolean active
List likes
private int age = 37
}
def user = new User(name: 'mrhaki', active: false, likes: ['Groovy', 'Java'])
def mrhaki = new User(name: 'mrhaki', likes: ['Groovy', 'Java'])
def hubert = new User(name: 'Hubert Klein Ikkink', likes: ['Groovy', 'Java'])
assert user == mrhaki
assert mrhaki != hubert
Set users = new HashSet()
users.add user
users.add mrhaki
users.add hubert
assert users.size() == 2
```
**See Also:**
[HashCodeHelper](../../org/codehaus/groovy/util/hashcodehelper "HashCodeHelper")
**Since:**
1.8.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[allNames](#allNames)`Whether to include all fields and/or properties in equals and hashCode calculations, including those with names that are considered internal. |
| `**boolean**` | `[allProperties](#allProperties)`Whether to include all properties (as per the JavaBean spec) in the generated constructor. |
| `**boolean**` | `[cache](#cache)`Whether to cache hashCode calculations. |
| `**boolean**` | `[callSuper](#callSuper)`Whether to include super in equals and hashCode calculations. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[excludes](#excludes)`List of property names (and field names if includeFields is true) to exclude from the equals and hashCode calculations. |
| `**boolean**` | `[includeFields](#includeFields)`Include fields as well as properties in equals and hashCode calculations. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[includes](#includes)`List of property names (and field names if includeFields is true) to include within the equals and hashCode calculations. |
| `**boolean**` | `[pojo](#pojo)`Whether to avoid using Groovy runtime methods and instead use methods like [Objects.hash](https://docs.oracle.com/javase/8/docs/api/java/util/Objects.html#hash(Object...) "Objects.hash") |
| `**boolean**` | `[useCanEqual](#useCanEqual)`Generate a canEqual method to be used by equals. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **allNames**
Whether to include all fields and/or properties in equals and hashCode calculations, including those with names that are considered internal.
**Since:**
2.5.0
**Default:**
false
### public boolean **allProperties**
Whether to include all properties (as per the JavaBean spec) in the generated constructor. When true, Groovy treats any explicitly created setXxx() methods as property setters as per the JavaBean specification. JavaBean properties come after any Groovy properties but before any fields for a given class (unless 'includes' is used to determine the order).
**Since:**
2.5.0
**Default:**
false
### public boolean **cache**
Whether to cache hashCode calculations. You should only set this to true if you know the object is immutable (or technically mutable but never changed).
**Default:**
false
### public boolean **callSuper**
Whether to include super in equals and hashCode calculations.
**Default:**
false
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **excludes**
List of property names (and field names if includeFields is true) to exclude from the equals and hashCode calculations. Must not be used if 'includes' is used. For convenience, a String with comma separated names can be used in addition to an array (using Groovy's literal list notation) of String values.
**Default:**
{}
### public boolean **includeFields**
Include fields as well as properties in equals and hashCode calculations.
**Default:**
false
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **includes**
List of property names (and field names if includeFields is true) to include within the equals and hashCode calculations. Must not be used if 'excludes' is used. For convenience, a String with comma separated names can be used in addition to an array (using Groovy's literal list notation) of String values. The default value is a special marker value indicating that no includes are defined; all fields and/or properties are included if 'includes' remains undefined and 'excludes' is explicitly or implicitly an empty list.
**Default:**
{ Undefined.STRING }
### public boolean **pojo**
Whether to avoid using Groovy runtime methods and instead use methods like [Objects.hash](https://docs.oracle.com/javase/8/docs/api/java/util/Objects.html#hash(Object...) "Objects.hash") and [Objects.equals](https://docs.oracle.com/javase/8/docs/api/java/util/Objects.html#equals(Object,%20Object) "Objects.equals") for the generated `equals` and `hashCode` methods. The generated code is more similar to what is typically used in POJO classes. The presence of the `@POJO` annotation on a class is looked for by default but this annotation attribute allows the feature to be explicitly configured if desired. *NOTE:* this is an incubating feature and may change in future versions.
**Since:**
4.0.0
**Default:**
false
### public boolean **useCanEqual**
Generate a canEqual method to be used by equals.
**Default:**
true
| programming_docs |
groovy [Java] Annotation Type ToString [Java] Annotation Type ToString
===============================
* groovy.transform.ToString
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.ToStringASTTransformation")
public @interface ToString
```
Class annotation used to assist in the creation of `toString()` methods in classes. The `@ToString` annotation instructs the compiler to execute an AST transformation which adds the necessary toString() method.
It allows you to write classes in this shortened form:
```
@ToString
class Customer {
String first, last
int age
Date since = new Date()
Collection favItems
private answer = 42
}
println new Customer(first:'Tom', last:'Jones', age:21, favItems:['Books', 'Games'])
```
Which will have this output:
```
Customer(Tom, Jones, 21, Wed Jul 14 23:57:14 EST 2010, [Books, Games])
```
There are numerous options to customize the format of the generated output. E.g. if you change the first annotation to:
```
@ToString(includeNames=true)
```
Then the output will be:
```
Customer(first:Tom, last:Jones, age:21, since:Wed Jul 14 23:57:50 EST 2010, favItems:[Books, Games])
```
Or if you change the first annotation to:
```
@ToString(includeNames=true,includeFields=true,excludes="since,favItems")
```
Then the output will be:
```
Customer(first:Tom, last:Jones, age:21, answer:42)
```
If you have this example:
```
import groovy.transform.ToString
@ToString class NamedThing {
String name
}
@ToString(includeNames=true,includeSuper=true)
class AgedThing extends NamedThing {
int age
}
String agedThingAsString = new AgedThing(name:'Lassie', age:5).toString()
assert agedThingAsString == 'AgedThing(age:5, super:NamedThing(Lassie))'
```
`@ToString` can also be used in conjunction with `@Canonical` and `@Immutable`. If you want to omit fields or properties referring to null, you can use the ignoreNulls flag:
```
import groovy.transform.ToString
@ToString(ignoreNulls = true) class NamedThing {
String name
}
assert new NamedThing(name: null).toString() == 'NamedThing()'
```
By default the fully-qualified class name is used as part of the generated toString. If you want to exclude the package, you can set the includePackage flag to false, e.g.:
```
package my.company
import groovy.transform.ToString
@ToString(includePackage = false) class NamedThing {
String name
}
println new NamedThing(name: "Lassie")
```
Which results in:
```
NamedThing(name: Lassie)
```
If the includePackage flag is `true` (the default), then the output will be:
```
my.company.NamedThing(name: Lassie)
```
More examples:
```
//--------------------------------------------------------------------------
// Most simple implementation of toString.
import groovy.transform.ToString
@ToString
class Person {
String name
List likes
private boolean active = false
}
def person = new Person(name: 'mrhaki', likes: ['Groovy', 'Java'])
assert person.toString() == 'Person(mrhaki, [Groovy, Java])'
```
```
//--------------------------------------------------------------------------
// includeNames to output the names of the properties.
import groovy.transform.ToString
@ToString(includeNames=true)
class Person {
String name
List likes
private boolean active = false
}
def person = new Person(name: 'mrhaki', likes: ['Groovy', 'Java'])
assert person.toString() == 'Person(name:mrhaki, likes:[Groovy, Java])'
```
```
//--------------------------------------------------------------------------
// includeFields to not only output properties, but also field values.
import groovy.transform.ToString
@ToString(includeNames=true, includeFields=true)
class Person {
String name
List likes
private boolean active = false
}
def person = new Person(name: 'mrhaki', likes: ['Groovy', 'Java'])
assert person.toString() == 'Person(name:mrhaki, likes:[Groovy, Java], active:false)'
```
```
//--------------------------------------------------------------------------
// Use includeSuper to include properties from super class in output.
import groovy.transform.ToString
@ToString(includeNames=true)
class Person {
String name
List likes
private boolean active = false
}
@ToString(includeSuper=true, includeNames=true)
class Student extends Person {
List courses
}
def student = new Student(name: 'mrhaki', likes: ['Groovy', 'Java'], courses: ['IT', 'Business'])
assert student.toString() == 'Student(courses:[IT, Business], super:Person(name:mrhaki, likes:[Groovy, Java]))'
```
```
//--------------------------------------------------------------------------
// excludes active field and likes property from output
import groovy.transform.ToString
@ToString(includeNames=true, includeFields=true, excludes='active,likes')
class Person {
String name
List likes
private boolean active = false
}
def person = new Person(name: 'mrhaki', likes: ['Groovy', 'Java'])
assert person.toString() == 'Person(name:mrhaki)'
```
```
//--------------------------------------------------------------------------
// Don't include the package name in the output
package com.mrhaki.blog.groovy
import groovy.transform.*
@ToString(includePackage=false)
class Course {
String title
Integer maxAttendees
}
final Course course = new Course(title: 'Groovy 101', maxAttendees: 200)
assert course.toString() == 'Course(Groovy 101, 200)'
```
```
//--------------------------------------------------------------------------
// Don't use properties with null value.
package com.mrhaki.blog.groovy
import groovy.transform.*
@ToString(ignoreNulls=true)
class Course {
String title
Integer maxAttendees
}
final Course course = new Course(title: 'Groovy 101')
assert course.toString() == 'com.mrhaki.blog.groovy.Course(Groovy 101)'
```
```
//--------------------------------------------------------------------------
// Cache toString() result.
package com.mrhaki.blog.groovy
import groovy.transform.*
@ToString(cache=true)
class Course {
String title
Integer maxAttendees
}
Course course = new Course(title: 'Groovy 101', maxAttendees: 200)
assert course.toString() == 'com.mrhaki.blog.groovy.Course(Groovy 101, 200)'
// Value change will not be reflected in toString().
course.title = 'Grails with REST'
assert course.toString() == 'com.mrhaki.blog.groovy.Course(Groovy 101, 200)'
assert course.title == 'Grails with REST'
```
**See Also:**
[Immutable](immutable "Immutable")
[Canonical](canonical "Canonical")
**Since:**
1.8.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[allNames](#allNames)`Whether to include all fields and/or properties in the generated toString, including those with names that are considered internal. |
| `**boolean**` | `[allProperties](#allProperties)`Whether to include all properties (as per the JavaBean spec) in the generated toString. |
| `**boolean**` | `[cache](#cache)`Whether to cache toString() calculations. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[excludes](#excludes)`List of field and/or property names to exclude from generated toString. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[fieldSeparator](#fieldSeparator)`The string to use between each property/field. |
| `**boolean**` | `[ignoreNulls](#ignoreNulls)`Don't display any fields or properties with value null. |
| `**boolean**` | `[includeFields](#includeFields)`Include fields as well as properties in the generated toString. |
| `**boolean**` | `[includeNames](#includeNames)`Whether to include names of properties/fields in the generated toString. |
| `**boolean**` | `[includePackage](#includePackage)`Whether to include the fully-qualified class name (i.e. including the package) or just the simple class name in the generated toString. |
| `**boolean**` | `[includeSuper](#includeSuper)`Whether to include the toString() of super in the generated toString. |
| `**boolean**` | `[includeSuperFields](#includeSuperFields)`Include super fields in the generated toString. |
| `**boolean**` | `[includeSuperProperties](#includeSuperProperties)`Whether to include super properties in the generated toString. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[includes](#includes)`List of field and/or property names to include within the generated toString. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[leftDelimiter](#leftDelimiter)`The String to use after the classname and before the list of properties/fields. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[nameValueSeparator](#nameValueSeparator)`The string to use between the name of the property/field and its value when `includeNames` is true. |
| `**boolean**` | `[pojo](#pojo)`Whether to avoid using Groovy runtime methods when printing the toString for class members. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[rightDelimiter](#rightDelimiter)`The String to use after the list of properties/fields. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **allNames**
Whether to include all fields and/or properties in the generated toString, including those with names that are considered internal.
**Since:**
2.5.0
**Default:**
false
### public boolean **allProperties**
Whether to include all properties (as per the JavaBean spec) in the generated toString. Groovy recognizes any field-like definitions with no explicit visibility as property definitions and always includes them in the `@ToString` generated toString (as well as auto-generating the appropriate getters and setters). Groovy also treats any explicitly created getXxx() or isYyy() methods as property getters as per the JavaBean specification. Old versions of Groovy did not. So set this flag to false for the old behavior or if you want to explicitly exclude such properties. JavaBean properties come after any Groovy properties but before any fields for a given class (unless 'includes' is used to determine the order).
**Since:**
2.5.0
**Default:**
true
### public boolean **cache**
Whether to cache toString() calculations. You should only set this to true if you know the object is immutable (or technically mutable but never changed).
**Since:**
2.1.0
**Default:**
false
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **excludes**
List of field and/or property names to exclude from generated toString. Must not be used if 'includes' is used. For convenience, a String with comma separated names can be used in addition to an array (using Groovy's literal list notation) of String values.
**Default:**
{}
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **fieldSeparator**
The string to use between each property/field.
**Since:**
4.0.0
**Default:**
", "
### public boolean **ignoreNulls**
Don't display any fields or properties with value null.
**Default:**
false
### public boolean **includeFields**
Include fields as well as properties in the generated toString. Fields come after any properties.
**Default:**
false
### public boolean **includeNames**
Whether to include names of properties/fields in the generated toString.
**Default:**
false
### public boolean **includePackage**
Whether to include the fully-qualified class name (i.e. including the package) or just the simple class name in the generated toString.
**Since:**
2.0.6
**Default:**
true
### public boolean **includeSuper**
Whether to include the toString() of super in the generated toString.
**Default:**
false
### public boolean **includeSuperFields**
Include super fields in the generated toString. Groovy properties, JavaBean properties and fields (in that order) from superclasses come after the members from a subclass (unless 'includes' is used to determine the order).
**Since:**
2.5.0
**Default:**
false
### public boolean **includeSuperProperties**
Whether to include super properties in the generated toString. Groovy properties, JavaBean properties and fields (in that order) from superclasses come after the members from a subclass (unless 'includes' is used to determine the order).
**Since:**
2.4.0
**Default:**
false
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **includes**
List of field and/or property names to include within the generated toString. The order of inclusion is determined by the order in which the names are specified. Must not be used if 'excludes' is used. For convenience, a String with comma separated names can be used in addition to an array (using Groovy's literal list notation) of String values. The default value is a special marker value indicating that no includes are defined; all fields and/or properties are included if 'includes' remains undefined and 'excludes' is explicitly or implicitly an empty list. The special name 'super' can be used instead of using the 'includeSuper' flag.
**Default:**
{ Undefined.STRING }
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **leftDelimiter**
The String to use after the classname and before the list of properties/fields.
**Since:**
4.0.0
**Default:**
"("
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **nameValueSeparator**
The string to use between the name of the property/field and its value when `includeNames` is true.
**Since:**
4.0.0
**Default:**
":"
### public boolean **pojo**
Whether to avoid using Groovy runtime methods when printing the toString for class members. The generated code is more similar to what is typically used in POJO classes. The presence of the `@POJO` annotation on a class is looked for by default but this annotation attribute allows the feature to be explicitly configured if desired. *NOTE:* this is an incubating feature and may change in future versions.
**Since:**
4.0.0
**Default:**
false
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **rightDelimiter**
The String to use after the list of properties/fields.
**Since:**
4.0.0
**Default:**
")"
groovy [Java] Annotation Type ExternalizeMethods [Java] Annotation Type ExternalizeMethods
=========================================
* groovy.transform.ExternalizeMethods
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.ExternalizeMethodsASTTransformation")
public @interface ExternalizeMethods
```
Class annotation used to assist in the creation of `Externalizable` classes. The `@ExternalizeMethods` annotation instructs the compiler to execute an AST transformation which adds `writeExternal()` and `readExternal()` methods to a class and adds `Externalizable` to the interfaces which the class implements. The `writeExternal()` method writes each property (and optionally field) of the class while the `readExternal()` method will read each one back in the same order. Properties or fields marked as `transient` are ignored. This annotation is typically used in conjunction with the `@ExternalizeVerifier` annotation but most usually not directly but rather via `@AutoExternalizable` which is a shortcut for both annotations.
Example usage:
```
import groovy.transform.*
@ExternalizeMethods
class Person {
String first, last
List favItems
Date since
}
```
Which will create a class of the following form:
```
class Person implements Externalizable {
...
public void writeExternal(ObjectOutput out) throws IOException {
out.writeObject(first)
out.writeObject(last)
out.writeObject(favItems)
out.writeObject(since)
}
public void readExternal(ObjectInput oin) {
first = (String) oin.readObject()
last = (String) oin.readObject()
favItems = (List) oin.readObject()
since = (Date) oin.readObject()
}
...
}
```
**Since:**
1.8.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[excludes](#excludes)`Comma separated list of property names to exclude from externalizing. |
| `**boolean**` | `[includeFields](#includeFields)`Include fields as well as properties when externalizing. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **excludes**
Comma separated list of property names to exclude from externalizing. For convenience, a String with comma separated names can be used in addition to an array (using Groovy's literal list notation) of String values.
**Default:**
{}
### public boolean **includeFields**
Include fields as well as properties when externalizing.
**Default:**
false
| programming_docs |
groovy [Java] Class Undefined.EXCEPTION [Java] Class Undefined.EXCEPTION
================================
* groovy.transform.Undefined.EXCEPTION
```
public static final class Undefined.EXCEPTION
extends [RuntimeException](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html "RuntimeException")
```
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [RuntimeException](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html "RuntimeException")` | `[printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#printStackTrace() "printStackTrace"), [printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#printStackTrace(java.io.PrintStream) "printStackTrace"), [printStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#printStackTrace(java.io.PrintWriter) "printStackTrace"), [fillInStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#fillInStackTrace() "fillInStackTrace"), [getCause](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getCause() "getCause"), [initCause](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#initCause(java.lang.Throwable) "initCause"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#toString() "toString"), [getMessage](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getMessage() "getMessage"), [getSuppressed](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getSuppressed() "getSuppressed"), [getLocalizedMessage](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getLocalizedMessage() "getLocalizedMessage"), [getStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getStackTrace() "getStackTrace"), [setStackTrace](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#setStackTrace(%5BLjava.lang.StackTraceElement;) "setStackTrace"), [addSuppressed](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#addSuppressed(java.lang.Throwable) "addSuppressed"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#equals(java.lang.Object) "equals"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html#notifyAll() "notifyAll")` |
groovy [Java] Annotation Type NamedVariant [Java] Annotation Type NamedVariant
===================================
* groovy.transform.NamedVariant
```
@[Incubating](../../org/apache/groovy/lang/annotation/incubating "Incubating")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.METHOD, ElementType.CONSTRUCTOR})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.NamedVariantASTTransformation")
public @interface NamedVariant
```
Allows construction of a named-arg equivalent method or constructor. The method or constructor will have at least a first argument of type `Map` and may have more arguments. As such, it can be called using Groovy's named-arg syntax. The original method/constructor is retained and is called by the generated method/constructor. One benefit of this approach is the potential for improved type checking. The annotated "tuple" method/constructor can be type rich and will be checked as such during normal compilation. The generated method/constructor using the map argument will be named-argument friendly but the map also hides type information. The generated method however contains no business logic so the chance of errors is minimal. Any arguments identified as named arguments will be supplied as part of the map. Any additional arguments are supplied in the normal tuple style. Named parameters are identified in one of three ways:
1. Use one or more `@NamedParam` annotations to explicitly identify such parameters
2. Use one or more `@NamedDelegate` annotations to explicitly identify such parameters as delegate parameters
3. If no parameters with `@NamedParam` or `@NamedDelegate` annotations are found then:
* If `autoDelegate` is false (the default), all parameters are treated as if they were named parameters
* If `autoDelegate` is true, the first parameter is treated as if it is a delegate parameter
You can also mix and match the `@NamedParam` and `@NamedDelegate` annotations. Named arguments will be supplied via the map with their property name (configurable via annotation attributes within `@NamedParam`) being the key and value being the argument value. For named delegates, any properties of the delegate can become map keys. Duplicate keys across delegate properties or named parameters are not allowed. The type of delegate parameters must be compatible with Groovy's `as` cast operation from a `Map`. Here is an example using implicit named parameters.
```
import groovy.transform.*
@NamedVariant
int makeSense(int dollars, int cents) {
100 * dollars + cents
}
assert makeSense(dollars: 2, cents: 50) == 250
```
Here is an example using a delegate parameter.
```
import groovy.transform.*
@ToString(includeNames=true)
class Color {
Integer r, g, b
}
@NamedVariant
String foo(
```
**NamedDelegate:**
Color shade) { shade } def result = foo(g: 12, b: 42, r: 12) assert result.toString() == 'Color(r:12, g:12, b:42)' You could also explicitly annotate the `shade` argument with the `@NamedDelegate` annotation if you wanted. The generated method will be something like this:
```
String foo(Map args) {
return foo(args as Color)
}
```
The generated method/constructor retains the visibility and return type of the original method/constructor but the [VisibilityOptions](visibilityoptions "VisibilityOptions") annotation can be added to customize the visibility. You could have the annotated method/constructor private for instance but have the generated one be public.
**See Also:**
[VisibilityOptions](visibilityoptions "VisibilityOptions")
[NamedParam](namedparam "NamedParam")
[NamedDelegate](nameddelegate "NamedDelegate")
**Since:**
2.5.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[autoDelegate](#autoDelegate)`If true, add an implicit
**NamedDelegate:**
to the first parameter if no
**NamedDelegate:**
or
**NamedParam:**
annotations are found on any parameter.
|
| `**boolean**` | `[coerce](#coerce)`If true, will use `as` to convert map parameter to required class |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[visibilityId](#visibilityId)`If specified, must match the optional "id" attribute in an applicable `VisibilityOptions` annotation. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **autoDelegate**
If true, add an implicit
**NamedDelegate:**
to the first parameter if no
**NamedDelegate:**
or
**NamedParam:**
annotations are found on any parameter.
**Since:**
2.5.3
**Default:**
false
### public boolean **coerce**
If true, will use `as` to convert map parameter to required class
**Since:**
3.0.6
**Default:**
false
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **visibilityId**
If specified, must match the optional "id" attribute in an applicable `VisibilityOptions` annotation.
**Default:**
Undefined.STRING
groovy [Java] Annotation Type RecordOptions [Java] Annotation Type RecordOptions
====================================
* groovy.transform.RecordOptions
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE})
public @interface RecordOptions
```
Class annotation used to assist in the creation of record-like classes.
**See Also:**
[ImmutableOptions](immutableoptions "ImmutableOptions")
[MapConstructor](mapconstructor "MapConstructor")
[TupleConstructor](tupleconstructor "TupleConstructor")
[PropertyOptions](propertyoptions "PropertyOptions")
[RecordBase](recordbase "RecordBase")
**Since:**
4.0.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[components](#components)`If `true`, this adds a method `components()` to the record which returns its components as a typed tuple `Tuple0`, `Tuple1`... |
| `**boolean**` | `[copyWith](#copyWith)`If `true`, this adds a method `copyWith` which takes a Map of new property values and returns a new instance of the record class with these values set. |
| `**boolean**` | `[getAt](#getAt)`If `true`, this adds a method `getAt(int)` which given an integer n, returns the n'th component in the record. |
| `**[RecordTypeMode](recordtypemode)**` | `[mode](#mode)`Mode to use when creating record type classes. |
| `**boolean**` | `[size](#size)`If `true`, this adds a method `size()` to the record which returns the number of components. |
| `**boolean**` | `[toList](#toList)`If `true`, this adds a method `toList()` to the record which returns the record's components as a list. |
| `**boolean**` | `[toMap](#toMap)`If `true`, this adds a method `toMap()` to the record. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **components**
If `true`, this adds a method `components()` to the record which returns its components as a typed tuple `Tuple0`, `Tuple1`... Example:
```
import groovy.transform.*
@RecordOptions(components=true)
record Point(int x, int y, String color) {}
def (x, y, c) = new Point(100, 200, 'green').components()
assert x == 100
assert y.intdiv(2) == 100
assert c.toUpperCase() == 'GREEN'
```
The signature of the components method for this example is:
```
Tuple3<Integer, Integer, String> components()
```
This is suitable for destructuring in `TypeChecked` scenarios. If a method `components()` already exists in the class, then this setting is ignored, and no additional method is generated. It is a compile-time error if there are more components in the record than the largest TupleN class in the Groovy codebase.
**Default:**
false
### public boolean **copyWith**
If `true`, this adds a method `copyWith` which takes a Map of new property values and returns a new instance of the record class with these values set. Example:
```
@groovy.transform.RecordType(copyWith = true)
class Person {
String first, last
}
def tim = new Person('tim', 'yates')
def alice = tim.copyWith(first:'alice')
assert tim.toString() == 'Person[first=tim, last=yates]'
assert alice.toString() == 'Person[first=alice, last=yates]'
```
Unknown keys in the map are ignored, and if the values would not change the object, then the original object is returned. If a method called `copyWith` that takes a single parameter already exists in the class, then this setting is ignored, and no method is generated.
**Default:**
false
### public boolean **getAt**
If `true`, this adds a method `getAt(int)` which given an integer n, returns the n'th component in the record. Example:
```
import static groovy.test.GroovyAssert.shouldFail
record Point(int x, int y, String color) {}
def p = new Point(100, 200, 'green')
assert p[0] == 100
assert p[1] == 200
assert p[2] == 'green'
shouldFail(IllegalArgumentException) {
p[-1]
}
// getAt also enables destructuring
def (x, y, c) = p
assert x == 100
assert y == 200
assert c == 'green'
```
If a method `getAt(int)` already exists in the class, then this setting is ignored, and no additional method is generated.
**Default:**
true
### public [RecordTypeMode](recordtypemode) **mode**
Mode to use when creating record type classes.
**Default:**
RecordTypeMode.AUTO
### public boolean **size**
If `true`, this adds a method `size()` to the record which returns the number of components. Example:
```
record Point(int x, int y, String color) {}
def p = new Point(100, 200, 'green')
assert p.size() == 3
```
If a method `size()` already exists in the class, then this setting is ignored, and no additional method is generated.
**Default:**
true
### public boolean **toList**
If `true`, this adds a method `toList()` to the record which returns the record's components as a list. Example:
```
record Point(int x, int y, String color) {}
def p = new Point(100, 200, 'green')
assert p.toList() == [100, 200, 'green']
```
If a method `toList()` already exists in the class, then this setting is ignored, and no additional method is generated.
**Default:**
true
### public boolean **toMap**
If `true`, this adds a method `toMap()` to the record. Example:
```
record Point(int x, int y, String color) {}
def p = new Point(100, 200, 'green')
assert p.toMap() == [x:100, y:200, color:'green']
```
If a method `toMap()` already exists in the class, then this setting is ignored, and no additional method is generated.
**Default:**
true
groovy [Java] Enum TypeCheckingMode [Java] Enum TypeCheckingMode
============================
* groovy.transform.TypeCheckingMode
```
public enum TypeCheckingMode
extends [Enum](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html "Enum")
```
This enumeration can be used whenever it is preferred to annotate a class as [TypeChecked](typechecked "TypeChecked") in general, but where only one or more methods are "dynamic". This allows the user to annotate the class itself then annotate only the methods which require exclusion.
Enum Constants Summary
----------------------
Enum constants classes
| Enum constant | Description |
| `**[PASS](#PASS)**` | |
| `**[SKIP](#SKIP)**` | |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Enum](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html "Enum")` | `[name](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#name() "name"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#hashCode() "hashCode"), [compareTo](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo(java.lang.Object) "compareTo"), [compareTo](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo(java.lang.Enum) "compareTo"), [valueOf](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#valueOf(java.lang.Class,%20java.lang.String) "valueOf"), [describeConstable](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#describeConstable() "describeConstable"), [getDeclaringClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getDeclaringClass() "getDeclaringClass"), [ordinal](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#ordinal() "ordinal"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait(long) "wait"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#notifyAll() "notifyAll")` |
Enum Constant Detail
--------------------
### public [TypeCheckingMode](typecheckingmode) **PASS**
### public [TypeCheckingMode](typecheckingmode) **SKIP**
groovy [Java] Annotation Type PackageScope [Java] Annotation Type PackageScope
===================================
* groovy.transform.PackageScope
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD})
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.PackageScopeASTTransformation")
public @interface PackageScope
```
Annotation used for turning off Groovy's auto visibility conventions. By default, Groovy automatically turns package protected fields into properties and makes package protected methods, constructors and classes public. This annotation allows this feature to be turned off and revert back to Java behavior if needed. Place it on classes, fields, constructors or methods of interest as follows:
```
@PackageScope class Bar { // package protected
@PackageScope int field // package protected; not a property
@PackageScope method(){} // package protected
}
```
or for greater control, at the class level with one or more `PackageScopeTarget` values:
```
import static groovy.transform.PackageScopeTarget.*
@PackageScope([CLASS, FIELDS])
class Foo { // class will have package protected scope
int field1, field2 // both package protected
def method(){} // public
}
@PackageScope(METHODS)
class Bar { // public
int field // treated as a property
def method1(){} // package protected
def method2(){} // package protected
}
```
This transformation is not frequently needed but can be useful in certain testing scenarios or when using a third-party library or framework which relies upon package scoping.
**Since:**
1.8.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**[PackageScopeTarget](packagescopetarget)[]**` | `[value](#value)`
**Default:**
{ PackageScopeTarget.CLASS }
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [PackageScopeTarget](packagescopetarget)[] **value**
**Default:**
{ PackageScopeTarget.CLASS }
| programming_docs |
groovy [Java] Annotation Type Generated [Java] Annotation Type Generated
================================
* groovy.transform.Generated
```
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE, ElementType.FIELD})
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
public @interface Generated
```
The Generated annotation is used to mark members that have been generated.
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
groovy [Groovy] Annotation Type AutoExternalize [Groovy] Annotation Type AutoExternalize
========================================
* groovy.transform.AutoExternalize
All Implemented Interfaces and Traits: [Annotation](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html "Annotation")
```
@[AnnotationCollector](annotationcollector "AnnotationCollector")(value: [ExternalizeMethods, ExternalizeVerifier])
@interface AutoExternalize
```
Class annotation used to assist in the creation of `Externalizable` classes. The `@AutoExternalize` annotation instructs the compiler to execute an AST transformation which adds `writeExternal()` and `readExternal()` methods to a class and adds `Externalizable` to the interfaces which the class implements. The `writeExternal()` method writes each property (or field) for the class while the `readExternal()` method will read each one back in the same order. Properties or fields marked as `transient` are ignored.
Example usage:
```
import groovy.transform.*
@AutoExternalize
class Person {
String first, last
List favItems
Date since
}
```
Which will create a class of the following form:
```
class Person implements Externalizable {
...
public void writeExternal(ObjectOutput out) throws IOException {
out.writeObject(first)
out.writeObject(last)
out.writeObject(favItems)
out.writeObject(since)
}
public void readExternal(ObjectInput oin) {
first = oin.readObject()
last = oin.readObject()
favItems = oin.readObject()
since = oin.readObject()
}
...
}
```
The `@AutoExternalize` transform is implemented as a combination of the `@ExternalizeMethods` and `@ExternalizeVerifier` transforms.
**Since:**
1.8.0
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
groovy [Java] Annotation Type TypeChecked [Java] Annotation Type TypeChecked
==================================
* groovy.transform.TypeChecked
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ ElementType.METHOD, ElementType.TYPE, ElementType.CONSTRUCTOR })
@[GroovyASTTransformationClass](../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.StaticTypesTransformation")
public @interface TypeChecked
```
This will let the Groovy compiler use compile time checks in the style of Java.
Nested Class Summary
--------------------
Nested classes
| Modifiers | Name | Description |
| `**@interface**` | `[TypeChecked.TypeCheckingInfo](typechecked.typecheckinginfo)` | This annotation is added by
**TypeChecked:**
on methods which have type checking turned on.
|
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[extensions](#extensions)`The list of (classpath resources) paths to type checking DSL scripts, also known as type checking extensions. |
| `**[TypeCheckingMode](typecheckingmode)**` | `[value](#value)`
**Default:**
TypeCheckingMode.PASS
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **extensions**
The list of (classpath resources) paths to type checking DSL scripts, also known as type checking extensions.
**Returns:**
an array of paths to groovy scripts that must be on compile classpath
**Default:**
{}
### public [TypeCheckingMode](typecheckingmode) **value**
**Default:**
TypeCheckingMode.PASS
groovy [Java] Enum DefaultsMode [Java] Enum DefaultsMode
========================
* groovy.transform.DefaultsMode
```
public enum DefaultsMode
extends [Enum](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html "Enum")
```
Intended mode to use when generating constructors to emulate default parameter values when using the [TupleConstructor](tupleconstructor "TupleConstructor") annotation.
**Since:**
4.0.0
**See Also:**
[TupleConstructor](tupleconstructor "TupleConstructor")
Enum Constants Summary
----------------------
Enum constants classes
| Enum constant | Description |
| `**[AUTO](#AUTO)**` | Produce multiple constructors as required to handle any mandatory and optional arguments. |
| `**[OFF](#OFF)**` | Produce a single constructor corresponding to the complete list of properties/fields of the class being compiled. |
| `**[ON](#ON)**` | Produce multiple constructors as required from all parameters through to the no-arg constructor. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Enum](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html "Enum")` | `[name](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#name() "name"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#hashCode() "hashCode"), [compareTo](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo(java.lang.Object) "compareTo"), [compareTo](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo(java.lang.Enum) "compareTo"), [valueOf](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#valueOf(java.lang.Class,%20java.lang.String) "valueOf"), [describeConstable](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#describeConstable() "describeConstable"), [getDeclaringClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getDeclaringClass() "getDeclaringClass"), [ordinal](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#ordinal() "ordinal"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait(long) "wait"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#notifyAll() "notifyAll")` |
Enum Constant Detail
--------------------
### public [DefaultsMode](defaultsmode) **AUTO**
Produce multiple constructors as required to handle any mandatory and optional arguments. An argument is optional if the respective property/field has an explicit initial value. A property/field without an initial value is deemed mandatory.
### public [DefaultsMode](defaultsmode) **OFF**
Produce a single constructor corresponding to the complete list of properties/fields of the class being compiled.
### public [DefaultsMode](defaultsmode) **ON**
Produce multiple constructors as required from all parameters through to the no-arg constructor. Defaults will be set according to any explicit initial values or the default value otherwise.
groovy [Java] Annotation Type Pure [Java] Annotation Type Pure
===========================
* groovy.transform.Pure
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.METHOD})
public @interface Pure
```
Mark the return value of "pure" method only comes from expressions involving constants or other pure methods
**Since:**
4.0.0
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
groovy [Java] Enum Visibility [Java] Enum Visibility
======================
* groovy.transform.options.Visibility
```
public enum Visibility
extends [Enum](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html "Enum")
```
Indicates the visibility of a node.
**Since:**
2.5.0
Enum Constants Summary
----------------------
Enum constants classes
| Enum constant | Description |
| `**[PACKAGE\_PRIVATE](#PACKAGE_PRIVATE)**` | |
| `**[PRIVATE](#PRIVATE)**` | |
| `**[PROTECTED](#PROTECTED)**` | |
| `**[PUBLIC](#PUBLIC)**` | |
| `**[UNDEFINED](#UNDEFINED)**` | |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public int` | `**[getModifier](#getModifier())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Enum](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html "Enum")` | `[name](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#name() "name"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#hashCode() "hashCode"), [compareTo](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo(java.lang.Object) "compareTo"), [compareTo](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo(java.lang.Enum) "compareTo"), [valueOf](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#valueOf(java.lang.Class,%20java.lang.String) "valueOf"), [describeConstable](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#describeConstable() "describeConstable"), [getDeclaringClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getDeclaringClass() "getDeclaringClass"), [ordinal](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#ordinal() "ordinal"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#wait(long) "wait"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#notifyAll() "notifyAll")` |
Enum Constant Detail
--------------------
### public [Visibility](visibility) **PACKAGE\_PRIVATE**
### public [Visibility](visibility) **PRIVATE**
### public [Visibility](visibility) **PROTECTED**
### public [Visibility](visibility) **PUBLIC**
### public [Visibility](visibility) **UNDEFINED**
Method Detail
-------------
### public int **getModifier**()
groovy [Java] Class LegacyHashMapPropertyHandler [Java] Class LegacyHashMapPropertyHandler
=========================================
* groovy.transform.options.LegacyHashMapPropertyHandler
```
public class LegacyHashMapPropertyHandler
extends [ImmutablePropertyHandler](immutablepropertyhandler)
```
The `@Immutable` transformation in earlier versions of Groovy tried to be smart in the case of an immutable class with a single HashMap property, the supplied Map constructor tried to be compatible with both expected tuple behavior and expected named-argument behavior by peeking into the supplied map and guessing as to which approach might be applicable. Recent versions of Groovy now allow both `@TupleConstructor` and `@MapConstructor` annotations to co-exist which provide's a more flexible solution to this problem. While more flexible, the new approach isn't fully compatible with the previous approach. If for some reason you need the old behavior, you can try this property handler. Some features of the new approach won't be available to you.
**Since:**
2.5.0
Inherited fields
| Fields inherited from class | Fields |
| **`class [PropertyHandler](propertyhandler)`** | `[PROPERTY\_OPTIONS\_TYPE](propertyhandler#PROPERTY_OPTIONS_TYPE)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Statement](../../../org/codehaus/groovy/ast/stmt/statement)` | `**[createPropInit](#createPropInit(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.AnnotationNode,%20org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.PropertyNode,%20org.codehaus.groovy.ast.Parameter))**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno, [ClassNode](../../../org/codehaus/groovy/ast/classnode) cNode, [PropertyNode](../../../org/codehaus/groovy/ast/propertynode) pNode, [Parameter](../../../org/codehaus/groovy/ast/parameter) namedArgsMap)` |
| | `public boolean` | `**[validateAttributes](#validateAttributes(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.AnnotationNode))**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno)` |
| | `public boolean` | `**[validateProperties](#validateProperties(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.stmt.BlockStatement,%20org.codehaus.groovy.ast.ClassNode,%20List))**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [BlockStatement](../../../org/codehaus/groovy/ast/stmt/blockstatement) body, [ClassNode](../../../org/codehaus/groovy/ast/classnode) cNode, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[PropertyNode](../../../org/codehaus/groovy/ast/propertynode "PropertyNode")> props)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [ImmutablePropertyHandler](immutablepropertyhandler)` | `[checkFinalArgNotOverridden](immutablepropertyhandler#checkFinalArgNotOverridden(org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.FieldNode)), [cloneCollectionExpr](immutablepropertyhandler#cloneCollectionExpr(org.codehaus.groovy.ast.expr.Expression,%20org.codehaus.groovy.ast.ClassNode)), [createAsImmutableX](immutablepropertyhandler#createAsImmutableX(org.codehaus.groovy.ast.expr.Expression,%20org.codehaus.groovy.ast.ClassNode)), [createConstructorStatement](immutablepropertyhandler#createConstructorStatement(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.PropertyNode,%20org.codehaus.groovy.ast.Parameter)), [createPropGetter](immutablepropertyhandler#createPropGetter(org.codehaus.groovy.ast.PropertyNode)), [createPropInit](immutablepropertyhandler#createPropInit(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.AnnotationNode,%20org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.PropertyNode,%20org.codehaus.groovy.ast.Parameter)), [createPropSetter](immutablepropertyhandler#createPropSetter(org.codehaus.groovy.ast.PropertyNode)), [validateAttributes](immutablepropertyhandler#validateAttributes(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.AnnotationNode)), [validateProperties](immutablepropertyhandler#validateProperties(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.stmt.BlockStatement,%20org.codehaus.groovy.ast.ClassNode,%20List))` |
| `class [PropertyHandler](propertyhandler)` | `[createPropGetter](propertyhandler#createPropGetter(org.codehaus.groovy.ast.PropertyNode)), [createPropInit](propertyhandler#createPropInit(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.AnnotationNode,%20org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.PropertyNode,%20org.codehaus.groovy.ast.Parameter)), [createPropSetter](propertyhandler#createPropSetter(org.codehaus.groovy.ast.PropertyNode)), [createPropertyHandler](propertyhandler#createPropertyHandler(org.codehaus.groovy.transform.AbstractASTTransformation,%20groovy.lang.GroovyClassLoader,%20org.codehaus.groovy.ast.ClassNode)), [isValidAttribute](propertyhandler#isValidAttribute(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.AnnotationNode,%20java.lang.String)), [validateAttributes](propertyhandler#validateAttributes(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.AnnotationNode)), [validateProperties](propertyhandler#validateProperties(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.stmt.BlockStatement,%20org.codehaus.groovy.ast.ClassNode,%20List))` |
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Statement](../../../org/codehaus/groovy/ast/stmt/statement) **createPropInit**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno, [ClassNode](../../../org/codehaus/groovy/ast/classnode) cNode, [PropertyNode](../../../org/codehaus/groovy/ast/propertynode) pNode, [Parameter](../../../org/codehaus/groovy/ast/parameter) namedArgsMap)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **validateAttributes**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **validateProperties**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [BlockStatement](../../../org/codehaus/groovy/ast/stmt/blockstatement) body, [ClassNode](../../../org/codehaus/groovy/ast/classnode) cNode, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[PropertyNode](../../../org/codehaus/groovy/ast/propertynode "PropertyNode")> props)
| programming_docs |
groovy [Java] Class ImmutablePropertyHandler [Java] Class ImmutablePropertyHandler
=====================================
* groovy.transform.options.ImmutablePropertyHandler
```
public class ImmutablePropertyHandler
extends [PropertyHandler](propertyhandler)
```
Inherited fields
| Fields inherited from class | Fields |
| **`class [PropertyHandler](propertyhandler)`** | `[PROPERTY\_OPTIONS\_TYPE](propertyhandler#PROPERTY_OPTIONS_TYPE)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `protected [Statement](../../../org/codehaus/groovy/ast/stmt/statement)` | `**[checkFinalArgNotOverridden](#checkFinalArgNotOverridden(org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.FieldNode))**([ClassNode](../../../org/codehaus/groovy/ast/classnode) cNode, [FieldNode](../../../org/codehaus/groovy/ast/fieldnode) fNode)` |
| | `protected [Expression](../../../org/codehaus/groovy/ast/expr/expression)` | `**[cloneCollectionExpr](#cloneCollectionExpr(org.codehaus.groovy.ast.expr.Expression,%20org.codehaus.groovy.ast.ClassNode))**([Expression](../../../org/codehaus/groovy/ast/expr/expression) fieldExpr, [ClassNode](../../../org/codehaus/groovy/ast/classnode) type)` |
| | `protected [Expression](../../../org/codehaus/groovy/ast/expr/expression)` | `**[createAsImmutableX](#createAsImmutableX(org.codehaus.groovy.ast.expr.Expression,%20org.codehaus.groovy.ast.ClassNode))**([Expression](../../../org/codehaus/groovy/ast/expr/expression) expr, [ClassNode](../../../org/codehaus/groovy/ast/classnode) type)` |
| | `protected [Statement](../../../org/codehaus/groovy/ast/stmt/statement)` | `**[createConstructorStatement](#createConstructorStatement(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.PropertyNode,%20org.codehaus.groovy.ast.Parameter))**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [ClassNode](../../../org/codehaus/groovy/ast/classnode) cNode, [PropertyNode](../../../org/codehaus/groovy/ast/propertynode) pNode, [Parameter](../../../org/codehaus/groovy/ast/parameter) namedArgsMap)` |
| | `public [Statement](../../../org/codehaus/groovy/ast/stmt/statement)` | `**[createPropGetter](#createPropGetter(org.codehaus.groovy.ast.PropertyNode))**([PropertyNode](../../../org/codehaus/groovy/ast/propertynode) pNode)` |
| | `public [Statement](../../../org/codehaus/groovy/ast/stmt/statement)` | `**[createPropInit](#createPropInit(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.AnnotationNode,%20org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.PropertyNode,%20org.codehaus.groovy.ast.Parameter))**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno, [ClassNode](../../../org/codehaus/groovy/ast/classnode) cNode, [PropertyNode](../../../org/codehaus/groovy/ast/propertynode) pNode, [Parameter](../../../org/codehaus/groovy/ast/parameter) namedArgsMap)` |
| | `public [Statement](../../../org/codehaus/groovy/ast/stmt/statement)` | `**[createPropSetter](#createPropSetter(org.codehaus.groovy.ast.PropertyNode))**([PropertyNode](../../../org/codehaus/groovy/ast/propertynode) pNode)` |
| | `public boolean` | `**[validateAttributes](#validateAttributes(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.AnnotationNode))**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno)` |
| | `public boolean` | `**[validateProperties](#validateProperties(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.stmt.BlockStatement,%20org.codehaus.groovy.ast.ClassNode,%20List))**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [BlockStatement](../../../org/codehaus/groovy/ast/stmt/blockstatement) body, [ClassNode](../../../org/codehaus/groovy/ast/classnode) cNode, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[PropertyNode](../../../org/codehaus/groovy/ast/propertynode "PropertyNode")> props)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [PropertyHandler](propertyhandler)` | `[createPropGetter](propertyhandler#createPropGetter(org.codehaus.groovy.ast.PropertyNode)), [createPropInit](propertyhandler#createPropInit(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.AnnotationNode,%20org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.PropertyNode,%20org.codehaus.groovy.ast.Parameter)), [createPropSetter](propertyhandler#createPropSetter(org.codehaus.groovy.ast.PropertyNode)), [createPropertyHandler](propertyhandler#createPropertyHandler(org.codehaus.groovy.transform.AbstractASTTransformation,%20groovy.lang.GroovyClassLoader,%20org.codehaus.groovy.ast.ClassNode)), [isValidAttribute](propertyhandler#isValidAttribute(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.AnnotationNode,%20java.lang.String)), [validateAttributes](propertyhandler#validateAttributes(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.AnnotationNode)), [validateProperties](propertyhandler#validateProperties(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.stmt.BlockStatement,%20org.codehaus.groovy.ast.ClassNode,%20List))` |
Method Detail
-------------
### protected [Statement](../../../org/codehaus/groovy/ast/stmt/statement) **checkFinalArgNotOverridden**([ClassNode](../../../org/codehaus/groovy/ast/classnode) cNode, [FieldNode](../../../org/codehaus/groovy/ast/fieldnode) fNode)
### protected [Expression](../../../org/codehaus/groovy/ast/expr/expression) **cloneCollectionExpr**([Expression](../../../org/codehaus/groovy/ast/expr/expression) fieldExpr, [ClassNode](../../../org/codehaus/groovy/ast/classnode) type)
### protected [Expression](../../../org/codehaus/groovy/ast/expr/expression) **createAsImmutableX**([Expression](../../../org/codehaus/groovy/ast/expr/expression) expr, [ClassNode](../../../org/codehaus/groovy/ast/classnode) type)
### protected [Statement](../../../org/codehaus/groovy/ast/stmt/statement) **createConstructorStatement**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [ClassNode](../../../org/codehaus/groovy/ast/classnode) cNode, [PropertyNode](../../../org/codehaus/groovy/ast/propertynode) pNode, [Parameter](../../../org/codehaus/groovy/ast/parameter) namedArgsMap)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Statement](../../../org/codehaus/groovy/ast/stmt/statement) **createPropGetter**([PropertyNode](../../../org/codehaus/groovy/ast/propertynode) pNode)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Statement](../../../org/codehaus/groovy/ast/stmt/statement) **createPropInit**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno, [ClassNode](../../../org/codehaus/groovy/ast/classnode) cNode, [PropertyNode](../../../org/codehaus/groovy/ast/propertynode) pNode, [Parameter](../../../org/codehaus/groovy/ast/parameter) namedArgsMap)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Statement](../../../org/codehaus/groovy/ast/stmt/statement) **createPropSetter**([PropertyNode](../../../org/codehaus/groovy/ast/propertynode) pNode)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **validateAttributes**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **validateProperties**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [BlockStatement](../../../org/codehaus/groovy/ast/stmt/blockstatement) body, [ClassNode](../../../org/codehaus/groovy/ast/classnode) cNode, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[PropertyNode](../../../org/codehaus/groovy/ast/propertynode "PropertyNode")> props)
groovy [Java] Class DefaultPropertyHandler [Java] Class DefaultPropertyHandler
===================================
* groovy.transform.options.DefaultPropertyHandler
```
public class DefaultPropertyHandler
extends [PropertyHandler](propertyhandler)
```
Inherited fields
| Fields inherited from class | Fields |
| **`class [PropertyHandler](propertyhandler)`** | `[PROPERTY\_OPTIONS\_TYPE](propertyhandler#PROPERTY_OPTIONS_TYPE)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Statement](../../../org/codehaus/groovy/ast/stmt/statement)` | `**[createPropInit](#createPropInit(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.AnnotationNode,%20org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.PropertyNode,%20org.codehaus.groovy.ast.Parameter))**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno, [ClassNode](../../../org/codehaus/groovy/ast/classnode) cNode, [PropertyNode](../../../org/codehaus/groovy/ast/propertynode) pNode, [Parameter](../../../org/codehaus/groovy/ast/parameter) namedArgsMap)` |
| | `public boolean` | `**[validateAttributes](#validateAttributes(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.AnnotationNode))**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno)` |
| | `public boolean` | `**[validateProperties](#validateProperties(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.stmt.BlockStatement,%20org.codehaus.groovy.ast.ClassNode,%20List))**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [BlockStatement](../../../org/codehaus/groovy/ast/stmt/blockstatement) body, [ClassNode](../../../org/codehaus/groovy/ast/classnode) cNode, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[PropertyNode](../../../org/codehaus/groovy/ast/propertynode "PropertyNode")> props)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [PropertyHandler](propertyhandler)` | `[createPropGetter](propertyhandler#createPropGetter(org.codehaus.groovy.ast.PropertyNode)), [createPropInit](propertyhandler#createPropInit(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.AnnotationNode,%20org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.PropertyNode,%20org.codehaus.groovy.ast.Parameter)), [createPropSetter](propertyhandler#createPropSetter(org.codehaus.groovy.ast.PropertyNode)), [createPropertyHandler](propertyhandler#createPropertyHandler(org.codehaus.groovy.transform.AbstractASTTransformation,%20groovy.lang.GroovyClassLoader,%20org.codehaus.groovy.ast.ClassNode)), [isValidAttribute](propertyhandler#isValidAttribute(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.AnnotationNode,%20java.lang.String)), [validateAttributes](propertyhandler#validateAttributes(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.AnnotationNode)), [validateProperties](propertyhandler#validateProperties(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.stmt.BlockStatement,%20org.codehaus.groovy.ast.ClassNode,%20List))` |
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Statement](../../../org/codehaus/groovy/ast/stmt/statement) **createPropInit**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno, [ClassNode](../../../org/codehaus/groovy/ast/classnode) cNode, [PropertyNode](../../../org/codehaus/groovy/ast/propertynode) pNode, [Parameter](../../../org/codehaus/groovy/ast/parameter) namedArgsMap)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **validateAttributes**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **validateProperties**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [BlockStatement](../../../org/codehaus/groovy/ast/stmt/blockstatement) body, [ClassNode](../../../org/codehaus/groovy/ast/classnode) cNode, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[PropertyNode](../../../org/codehaus/groovy/ast/propertynode "PropertyNode")> props)
groovy [Java] Class PropertyHandler [Java] Class PropertyHandler
============================
* groovy.transform.options.PropertyHandler
```
@[Incubating](../../../org/apache/groovy/lang/annotation/incubating "Incubating")
public abstract class PropertyHandler
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Used to provide custom property handling when getting, setting or initializing properties.
**Since:**
2.5.0
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [ClassNode](../../../org/codehaus/groovy/ast/classnode)**` | `[PROPERTY\_OPTIONS\_TYPE](#PROPERTY_OPTIONS_TYPE)` | |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Statement](../../../org/codehaus/groovy/ast/stmt/statement)` | `**[createPropGetter](#createPropGetter(org.codehaus.groovy.ast.PropertyNode))**([PropertyNode](../../../org/codehaus/groovy/ast/propertynode) pNode)`Create the getter block used when reading the property including any defensive copying. |
| | `public abstract [Statement](../../../org/codehaus/groovy/ast/stmt/statement)` | `**[createPropInit](#createPropInit(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.AnnotationNode,%20org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.PropertyNode,%20org.codehaus.groovy.ast.Parameter))**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno, [ClassNode](../../../org/codehaus/groovy/ast/classnode) cNode, [PropertyNode](../../../org/codehaus/groovy/ast/propertynode) pNode, [Parameter](../../../org/codehaus/groovy/ast/parameter) namedArgMap)`Create a statement that will initialize the property including any defensive copying. |
| | `public [Statement](../../../org/codehaus/groovy/ast/stmt/statement)` | `**[createPropSetter](#createPropSetter(org.codehaus.groovy.ast.PropertyNode))**([PropertyNode](../../../org/codehaus/groovy/ast/propertynode) pNode)`Create the setter block used when setting the property. |
| | `public static [PropertyHandler](propertyhandler)` | `**[createPropertyHandler](#createPropertyHandler(org.codehaus.groovy.transform.AbstractASTTransformation,%20groovy.lang.GroovyClassLoader,%20org.codehaus.groovy.ast.ClassNode))**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [GroovyClassLoader](../../lang/groovyclassloader) loader, [ClassNode](../../../org/codehaus/groovy/ast/classnode) cNode)` |
| | `protected boolean` | `**[isValidAttribute](#isValidAttribute(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.AnnotationNode,%20java.lang.String))**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") memberName)` |
| | `public abstract boolean` | `**[validateAttributes](#validateAttributes(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.AnnotationNode))**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno)` |
| | `public boolean` | `**[validateProperties](#validateProperties(org.codehaus.groovy.transform.AbstractASTTransformation,%20org.codehaus.groovy.ast.stmt.BlockStatement,%20org.codehaus.groovy.ast.ClassNode,%20List))**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [BlockStatement](../../../org/codehaus/groovy/ast/stmt/blockstatement) body, [ClassNode](../../../org/codehaus/groovy/ast/classnode) cNode, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[PropertyNode](../../../org/codehaus/groovy/ast/propertynode "PropertyNode")> props)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### public static final [ClassNode](../../../org/codehaus/groovy/ast/classnode) **PROPERTY\_OPTIONS\_TYPE**
Method Detail
-------------
### public [Statement](../../../org/codehaus/groovy/ast/stmt/statement) **createPropGetter**([PropertyNode](../../../org/codehaus/groovy/ast/propertynode) pNode)
Create the getter block used when reading the property including any defensive copying.
**Parameters:**
`pNode` - the property node
### public abstract [Statement](../../../org/codehaus/groovy/ast/stmt/statement) **createPropInit**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno, [ClassNode](../../../org/codehaus/groovy/ast/classnode) cNode, [PropertyNode](../../../org/codehaus/groovy/ast/propertynode) pNode, [Parameter](../../../org/codehaus/groovy/ast/parameter) namedArgMap)
Create a statement that will initialize the property including any defensive copying. Null if no statement should be added.
**Parameters:**
`xform` - the transform being processed
`anno` - the '@ImmutableBase' annotation node
`cNode` - the classnode containing the property
`pNode` - the property node to initialize
`namedArgMap` - an "args" Map if the property value should come from a named arg map or null if not
### public [Statement](../../../org/codehaus/groovy/ast/stmt/statement) **createPropSetter**([PropertyNode](../../../org/codehaus/groovy/ast/propertynode) pNode)
Create the setter block used when setting the property. Can be null for read-only properties.
**Parameters:**
`pNode` - the property node
### public static [PropertyHandler](propertyhandler) **createPropertyHandler**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [GroovyClassLoader](../../lang/groovyclassloader) loader, [ClassNode](../../../org/codehaus/groovy/ast/classnode) cNode)
### protected boolean **isValidAttribute**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") memberName)
### public abstract boolean **validateAttributes**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno)
### public boolean **validateProperties**([AbstractASTTransformation](../../../org/codehaus/groovy/transform/abstractasttransformation) xform, [BlockStatement](../../../org/codehaus/groovy/ast/stmt/blockstatement) body, [ClassNode](../../../org/codehaus/groovy/ast/classnode) cNode, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[PropertyNode](../../../org/codehaus/groovy/ast/propertynode "PropertyNode")> props)
| programming_docs |
groovy [Java] Class FirstParam.Component [Java] Class FirstParam.Component
=================================
* groovy.transform.stc.FirstParam.Component
```
public static class FirstParam.Component
extends [FirstParam](firstparam)
```
A hint used to instruct the type checker to pick the type of the component of the first parameter type, which is therefore expected to be an array, like in this example:
`void <T> doWithArray(T[] array, @ClosureParams(FirstParam.Component.class) Closure c) { array.each { c.call(it)} }` Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [ClassNode](../../../org/codehaus/groovy/ast/classnode)[]` | `**[getParameterTypes](#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) unit, [ASTNode](../../../org/codehaus/groovy/ast/astnode) usage)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [PickAnyArgumentHint](pickanyargumenthint)` | `[getParameterTypes](pickanyargumenthint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [SingleSignatureClosureHint](singlesignatureclosurehint)` | `[getClosureSignatures](singlesignatureclosurehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [getParameterTypes](singlesignatureclosurehint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [ClosureSignatureHint](closuresignaturehint)` | `[findClassNode](closuresignaturehint#findClassNode(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String)), [getClosureSignatures](closuresignaturehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.ClassNode,%20int)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.MethodNode,%20int,%20int))` |
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [ClassNode](../../../org/codehaus/groovy/ast/classnode)[] **getParameterTypes**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) unit, [ASTNode](../../../org/codehaus/groovy/ast/astnode) usage)
groovy [Java] Class FirstParam.ThirdGenericType [Java] Class FirstParam.ThirdGenericType
========================================
* groovy.transform.stc.FirstParam.ThirdGenericType
```
public static class FirstParam.ThirdGenericType
extends [PickAnyArgumentHint](pickanyargumenthint)
```
A hint used to instruct the type checker to pick the third generic type of the first parameter type. For example:
`void <T,U,V> doWithElements(Triple<T,U,V> src, @ClosureParams(FirstParam.ThirdGenericType.class) Closure c) { src.each { c.call(it) } }`
**Since:**
2.3.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[ThirdGenericType](#ThirdGenericType())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [PickAnyArgumentHint](pickanyargumenthint)` | `[getParameterTypes](pickanyargumenthint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [SingleSignatureClosureHint](singlesignatureclosurehint)` | `[getClosureSignatures](singlesignatureclosurehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [getParameterTypes](singlesignatureclosurehint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [ClosureSignatureHint](closuresignaturehint)` | `[findClassNode](closuresignaturehint#findClassNode(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String)), [getClosureSignatures](closuresignaturehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.ClassNode,%20int)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.MethodNode,%20int,%20int))` |
Constructor Detail
------------------
### public **ThirdGenericType**()
groovy [Java] Class FromAbstractTypeMethods [Java] Class FromAbstractTypeMethods
====================================
* groovy.transform.stc.FromAbstractTypeMethods
```
public class FromAbstractTypeMethods
extends [ClosureSignatureHint](closuresignaturehint)
```
This signature hint uses abstract methods from some type (abstract class or interface) in order to infer the expected parameter types. This is especially useful for closure parameter type inference when implicit closure coercion is in action.
**Since:**
2.3.0
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[ClassNode](../../../org/codehaus/groovy/ast/classnode "ClassNode")>` | `**[getClosureSignatures](#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode))**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) compilationUnit, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options, [ASTNode](../../../org/codehaus/groovy/ast/astnode) usage)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [ClosureSignatureHint](closuresignaturehint)` | `[findClassNode](closuresignaturehint#findClassNode(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String)), [getClosureSignatures](closuresignaturehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.ClassNode,%20int)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.MethodNode,%20int,%20int))` |
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[ClassNode](../../../org/codehaus/groovy/ast/classnode "ClassNode")> **getClosureSignatures**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) compilationUnit, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options, [ASTNode](../../../org/codehaus/groovy/ast/astnode) usage)
groovy [Java] Class ThirdParam.ThirdGenericType [Java] Class ThirdParam.ThirdGenericType
========================================
* groovy.transform.stc.ThirdParam.ThirdGenericType
```
public static class ThirdParam.ThirdGenericType
extends [PickAnyArgumentHint](pickanyargumenthint)
```
A hint used to instruct the type checker to pick the second generic type of the third parameter type. For example:
`void <T,U,V> doWithElements(String first, Integer second, Triple<T,U,V> src, @ClosureParams(SecondParam.ThirdGenericType.class) Closure c) { ... }`
**Since:**
2.3.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[ThirdGenericType](#ThirdGenericType())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [PickAnyArgumentHint](pickanyargumenthint)` | `[getParameterTypes](pickanyargumenthint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [SingleSignatureClosureHint](singlesignatureclosurehint)` | `[getClosureSignatures](singlesignatureclosurehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [getParameterTypes](singlesignatureclosurehint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [ClosureSignatureHint](closuresignaturehint)` | `[findClassNode](closuresignaturehint#findClassNode(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String)), [getClosureSignatures](closuresignaturehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.ClassNode,%20int)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.MethodNode,%20int,%20int))` |
Constructor Detail
------------------
### public **ThirdGenericType**()
groovy [Java] Class ThirdParam.SecondGenericType [Java] Class ThirdParam.SecondGenericType
=========================================
* groovy.transform.stc.ThirdParam.SecondGenericType
```
public static class ThirdParam.SecondGenericType
extends [PickAnyArgumentHint](pickanyargumenthint)
```
A hint used to instruct the type checker to pick the second generic type of the third parameter type. For example:
`void <T,U> doWithElements(String first, Integer second, Tuple<T,U> third, @ClosureParams(SecondParam.SecondGenericType.class) Closure c) { ... }`
**Since:**
2.3.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[SecondGenericType](#SecondGenericType())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [PickAnyArgumentHint](pickanyargumenthint)` | `[getParameterTypes](pickanyargumenthint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [SingleSignatureClosureHint](singlesignatureclosurehint)` | `[getClosureSignatures](singlesignatureclosurehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [getParameterTypes](singlesignatureclosurehint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [ClosureSignatureHint](closuresignaturehint)` | `[findClassNode](closuresignaturehint#findClassNode(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String)), [getClosureSignatures](closuresignaturehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.ClassNode,%20int)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.MethodNode,%20int,%20int))` |
Constructor Detail
------------------
### public **SecondGenericType**()
groovy [Java] Class FirstParam.FirstGenericType [Java] Class FirstParam.FirstGenericType
========================================
* groovy.transform.stc.FirstParam.FirstGenericType
```
public static class FirstParam.FirstGenericType
extends [PickAnyArgumentHint](pickanyargumenthint)
```
A hint used to instruct the type checker to pick the first generic type of the first parameter type. For example:
`void <T> doWithElements(List<T> src, @ClosureParams(FirstParam.FirstGenericType.class) Closure c) { src.each { c.call(it) } }`
**Since:**
2.3.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[FirstGenericType](#FirstGenericType())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [PickAnyArgumentHint](pickanyargumenthint)` | `[getParameterTypes](pickanyargumenthint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [SingleSignatureClosureHint](singlesignatureclosurehint)` | `[getClosureSignatures](singlesignatureclosurehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [getParameterTypes](singlesignatureclosurehint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [ClosureSignatureHint](closuresignaturehint)` | `[findClassNode](closuresignaturehint#findClassNode(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String)), [getClosureSignatures](closuresignaturehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.ClassNode,%20int)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.MethodNode,%20int,%20int))` |
Constructor Detail
------------------
### public **FirstGenericType**()
groovy [Java] Annotation Type ClosureParams [Java] Annotation Type ClosureParams
====================================
* groovy.transform.stc.ClosureParams
```
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")(ElementType.PARAMETER)
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
public @interface ClosureParams
```
Parameter annotation aimed at helping IDEs or the static type checker to infer the parameter types of a closure. Without this annotation, a method signature may look like this:
`public <T,R> List<R> doSomething(List<T> source, Closure<R> consumer)`
The problem this annotation tries to solve is to define the expected parameter types of the *consumer* closure. The generics type defined in `Closure<R>` correspond to the result type of the closure, but tell nothing about what the closure must accept as arguments.
There's no way in Java or Groovy to express the type signature of the expected closure call method from outside the closure itself, so we rely on an annotation here. Unfortunately, annotations also have limitations (like not being able to use generics placeholder as annotation values) that prevent us from expressing the type directly.
Additionally, closures are polymorphic. This means that a single closure can be used with different, valid, parameter signatures. A typical use case can be found when a closure accepts either a [Entry](https://docs.oracle.com/javase/8/docs/api/java/util/Map/Entry.html "Entry") or a (key,value) pair, like the [DefaultGroovyMethods.each](../../../org/codehaus/groovy/runtime/defaultgroovymethods#each(java.util.Map,%20groovy.lang.Closure) "DefaultGroovyMethods.each") method.
For those reasons, the [ClosureParams](closureparams "ClosureParams") annotation takes these arguments:
* [ClosureParams.value](closureparams#value() "ClosureParams.value") defines a [ClosureSignatureHint](closuresignaturehint "ClosureSignatureHint") hint class that the compiler will use to infer the parameter types
* [ClosureParams.conflictResolutionStrategy](closureparams#conflictResolutionStrategy() "ClosureParams.conflictResolutionStrategy") defines a [ClosureSignatureConflictResolver](closuresignatureconflictresolver "ClosureSignatureConflictResolver") resolver class that the compiler will use to potentially reduce ambiguities remaining after initial inference calculations
* [ClosureParams.options](closureparams#options() "ClosureParams.options"), a set of options that are passed to the hint when the type is inferred (and also available to the resolver)
As a result, the previous signature can be written like this:
`public <T,R> List<R> doSomething(List<T> source, @ClosureParams(FirstParam.FirstGenericType.class) Closure<R> consumer)` Which uses the FirstParam.FirstGenericType first generic type of the first argument
hint to tell that the only expected argument type corresponds to the type of the first generic argument type of the first method parameter. Element Summary
---------------
Required Element Summary
| Type | Name and Description |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<? extends [ClosureSignatureHint](closuresignaturehint "ClosureSignatureHint")>**` | `[value](#value)` |
Optional Element Summary
| Type | Name and Description |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<? extends [ClosureSignatureConflictResolver](closuresignatureconflictresolver "ClosureSignatureConflictResolver")>**` | `[conflictResolutionStrategy](#conflictResolutionStrategy)`
**Default:**
ClosureSignatureConflictResolver.class
|
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[options](#options)`
**Default:**
{}
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<? extends [ClosureSignatureConflictResolver](closuresignatureconflictresolver "ClosureSignatureConflictResolver")> **conflictResolutionStrategy**
**Default:**
ClosureSignatureConflictResolver.class
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **options**
**Default:**
{}
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<? extends [ClosureSignatureHint](closuresignaturehint "ClosureSignatureHint")> **value**
| programming_docs |
groovy [Java] Class SecondParam.SecondGenericType [Java] Class SecondParam.SecondGenericType
==========================================
* groovy.transform.stc.SecondParam.SecondGenericType
```
public static class SecondParam.SecondGenericType
extends [PickAnyArgumentHint](pickanyargumenthint)
```
A hint used to instruct the type checker to pick the second generic type of the second parameter type. For example:
`void <T,U> doWithElements(String base, Tuple<T,U> src, @ClosureParams(SecondParam.SecondGenericType.class) Closure c) { ... }`
**Since:**
2.3.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[SecondGenericType](#SecondGenericType())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [PickAnyArgumentHint](pickanyargumenthint)` | `[getParameterTypes](pickanyargumenthint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [SingleSignatureClosureHint](singlesignatureclosurehint)` | `[getClosureSignatures](singlesignatureclosurehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [getParameterTypes](singlesignatureclosurehint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [ClosureSignatureHint](closuresignaturehint)` | `[findClassNode](closuresignaturehint#findClassNode(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String)), [getClosureSignatures](closuresignaturehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.ClassNode,%20int)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.MethodNode,%20int,%20int))` |
Constructor Detail
------------------
### public **SecondGenericType**()
groovy [Java] Class ThirdParam.FirstGenericType [Java] Class ThirdParam.FirstGenericType
========================================
* groovy.transform.stc.ThirdParam.FirstGenericType
```
public static class ThirdParam.FirstGenericType
extends [PickAnyArgumentHint](pickanyargumenthint)
```
A hint used to instruct the type checker to pick the first generic type of the third parameter type. For example:
`void <T> doWithElements(String first, Integer second, List<T> third, @ClosureParams(SecondParam.FirstGenericType.class) Closure c) { ... } }`
**Since:**
2.3.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[FirstGenericType](#FirstGenericType())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [PickAnyArgumentHint](pickanyargumenthint)` | `[getParameterTypes](pickanyargumenthint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [SingleSignatureClosureHint](singlesignatureclosurehint)` | `[getClosureSignatures](singlesignatureclosurehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [getParameterTypes](singlesignatureclosurehint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [ClosureSignatureHint](closuresignaturehint)` | `[findClassNode](closuresignaturehint#findClassNode(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String)), [getClosureSignatures](closuresignaturehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.ClassNode,%20int)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.MethodNode,%20int,%20int))` |
Constructor Detail
------------------
### public **FirstGenericType**()
groovy [Java] Class ThirdParam.Component [Java] Class ThirdParam.Component
=================================
* groovy.transform.stc.ThirdParam.Component
```
public static class ThirdParam.Component
extends [ThirdParam](thirdparam)
```
A hint used to instruct the type checker to pick the type of the component of the third parameter type, which is therefore expected to be an array, like in this example:
`void <T> doWithArray(String first, int second, T[] third, @ClosureParams(FirstParam.Component.class) Closure c) { ... }` Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [ClassNode](../../../org/codehaus/groovy/ast/classnode)[]` | `**[getParameterTypes](#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) unit, [ASTNode](../../../org/codehaus/groovy/ast/astnode) usage)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [PickAnyArgumentHint](pickanyargumenthint)` | `[getParameterTypes](pickanyargumenthint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [SingleSignatureClosureHint](singlesignatureclosurehint)` | `[getClosureSignatures](singlesignatureclosurehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [getParameterTypes](singlesignatureclosurehint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [ClosureSignatureHint](closuresignaturehint)` | `[findClassNode](closuresignaturehint#findClassNode(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String)), [getClosureSignatures](closuresignaturehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.ClassNode,%20int)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.MethodNode,%20int,%20int))` |
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [ClassNode](../../../org/codehaus/groovy/ast/classnode)[] **getParameterTypes**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) unit, [ASTNode](../../../org/codehaus/groovy/ast/astnode) usage)
groovy [Java] Class ThirdParam [Java] Class ThirdParam
=======================
* groovy.transform.stc.ThirdParam
```
public class ThirdParam
extends [PickAnyArgumentHint](pickanyargumenthint)
```
A hint used to instruct the type checker to pick the third parameter type. For example:
`public <T,U,V> def doWith(T first, U second, V third, @ClosureParams(ThirdParam.class) Closure c) { ... }` This class has several inner classes that also helps picking generic argument types instead of the parameter type.
**Since:**
2.3.0
Nested Class Summary
--------------------
Nested classes
| Modifiers | Name | Description |
| `**static class**` | `[ThirdParam.Component](thirdparam.component)` | |
| `**static class**` | `[ThirdParam.FirstGenericType](thirdparam.firstgenerictype)` | |
| `**static class**` | `[ThirdParam.SecondGenericType](thirdparam.secondgenerictype)` | |
| `**static class**` | `[ThirdParam.ThirdGenericType](thirdparam.thirdgenerictype)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[ThirdParam](#ThirdParam())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [PickAnyArgumentHint](pickanyargumenthint)` | `[getParameterTypes](pickanyargumenthint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [SingleSignatureClosureHint](singlesignatureclosurehint)` | `[getClosureSignatures](singlesignatureclosurehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [getParameterTypes](singlesignatureclosurehint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [ClosureSignatureHint](closuresignaturehint)` | `[findClassNode](closuresignaturehint#findClassNode(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String)), [getClosureSignatures](closuresignaturehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.ClassNode,%20int)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.MethodNode,%20int,%20int))` |
Constructor Detail
------------------
### public **ThirdParam**()
groovy [Java] Class PickFirstResolver [Java] Class PickFirstResolver
==============================
* groovy.transform.stc.PickFirstResolver
```
public class PickFirstResolver
extends [ClosureSignatureConflictResolver](closuresignatureconflictresolver)
```
Returns the first of several candidates found. This is useful if several types should be supported but only the first should be the default/inferred type. Other options in the list are obtained through explicitly typing the parameter(s).
**Since:**
2.5.0
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[ClassNode](../../../org/codehaus/groovy/ast/classnode "ClassNode")>` | `**[resolve](#resolve(List,%20org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.expr.Expression,%20org.codehaus.groovy.ast.expr.ClosureExpression,%20org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String))**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[ClassNode](../../../org/codehaus/groovy/ast/classnode "ClassNode")> candidates, [ClassNode](../../../org/codehaus/groovy/ast/classnode) receiver, [Expression](../../../org/codehaus/groovy/ast/expr/expression) arguments, [ClosureExpression](../../../org/codehaus/groovy/ast/expr/closureexpression) closure, [MethodNode](../../../org/codehaus/groovy/ast/methodnode) methodNode, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) compilationUnit, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [ClosureSignatureConflictResolver](closuresignatureconflictresolver)` | `[resolve](closuresignatureconflictresolver#resolve(List,%20org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.expr.Expression,%20org.codehaus.groovy.ast.expr.ClosureExpression,%20org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String))` |
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[ClassNode](../../../org/codehaus/groovy/ast/classnode "ClassNode")> **resolve**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[ClassNode](../../../org/codehaus/groovy/ast/classnode "ClassNode")> candidates, [ClassNode](../../../org/codehaus/groovy/ast/classnode) receiver, [Expression](../../../org/codehaus/groovy/ast/expr/expression) arguments, [ClosureExpression](../../../org/codehaus/groovy/ast/expr/closureexpression) closure, [MethodNode](../../../org/codehaus/groovy/ast/methodnode) methodNode, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) compilationUnit, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options)
groovy [Java] Class SecondParam.ThirdGenericType [Java] Class SecondParam.ThirdGenericType
=========================================
* groovy.transform.stc.SecondParam.ThirdGenericType
```
public static class SecondParam.ThirdGenericType
extends [PickAnyArgumentHint](pickanyargumenthint)
```
A hint used to instruct the type checker to pick the second generic type of the second parameter type. For example:
`void <T,U,V> doWithElements(String base, Triple<T,U,V> src, @ClosureParams(SecondParam.ThirdGenericType.class) Closure c) { ... }`
**Since:**
2.3.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[ThirdGenericType](#ThirdGenericType())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [PickAnyArgumentHint](pickanyargumenthint)` | `[getParameterTypes](pickanyargumenthint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [SingleSignatureClosureHint](singlesignatureclosurehint)` | `[getClosureSignatures](singlesignatureclosurehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [getParameterTypes](singlesignatureclosurehint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [ClosureSignatureHint](closuresignaturehint)` | `[findClassNode](closuresignaturehint#findClassNode(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String)), [getClosureSignatures](closuresignaturehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.ClassNode,%20int)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.MethodNode,%20int,%20int))` |
Constructor Detail
------------------
### public **ThirdGenericType**()
groovy [Java] Class SecondParam [Java] Class SecondParam
========================
* groovy.transform.stc.SecondParam
```
public class SecondParam
extends [PickAnyArgumentHint](pickanyargumenthint)
```
A hint used to instruct the type checker to pick the second parameter type. For example:
`public <T,U> def doWith(T first, U second, @ClosureParams(SecondParam.class) Closure c) { c.call(src); }` This class has several inner classes that also helps picking generic argument types instead of the parameter type.
**Since:**
2.3.0
Nested Class Summary
--------------------
Nested classes
| Modifiers | Name | Description |
| `**static class**` | `[SecondParam.Component](secondparam.component)` | |
| `**static class**` | `[SecondParam.FirstGenericType](secondparam.firstgenerictype)` | |
| `**static class**` | `[SecondParam.SecondGenericType](secondparam.secondgenerictype)` | |
| `**static class**` | `[SecondParam.ThirdGenericType](secondparam.thirdgenerictype)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[SecondParam](#SecondParam())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [PickAnyArgumentHint](pickanyargumenthint)` | `[getParameterTypes](pickanyargumenthint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [SingleSignatureClosureHint](singlesignatureclosurehint)` | `[getClosureSignatures](singlesignatureclosurehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [getParameterTypes](singlesignatureclosurehint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [ClosureSignatureHint](closuresignaturehint)` | `[findClassNode](closuresignaturehint#findClassNode(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String)), [getClosureSignatures](closuresignaturehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.ClassNode,%20int)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.MethodNode,%20int,%20int))` |
Constructor Detail
------------------
### public **SecondParam**()
groovy [Java] Class SecondParam.Component [Java] Class SecondParam.Component
==================================
* groovy.transform.stc.SecondParam.Component
```
public static class SecondParam.Component
extends [SecondParam](secondparam)
```
A hint used to instruct the type checker to pick the type of the component of the second parameter type, which is therefore expected to be an array, like in this example:
`void <T> doWithArray(String first, T[] array, @ClosureParams(FirstParam.Component.class) Closure c) { ... }` Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [ClassNode](../../../org/codehaus/groovy/ast/classnode)[]` | `**[getParameterTypes](#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) unit, [ASTNode](../../../org/codehaus/groovy/ast/astnode) usage)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [PickAnyArgumentHint](pickanyargumenthint)` | `[getParameterTypes](pickanyargumenthint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [SingleSignatureClosureHint](singlesignatureclosurehint)` | `[getClosureSignatures](singlesignatureclosurehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [getParameterTypes](singlesignatureclosurehint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [ClosureSignatureHint](closuresignaturehint)` | `[findClassNode](closuresignaturehint#findClassNode(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String)), [getClosureSignatures](closuresignaturehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.ClassNode,%20int)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.MethodNode,%20int,%20int))` |
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [ClassNode](../../../org/codehaus/groovy/ast/classnode)[] **getParameterTypes**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) unit, [ASTNode](../../../org/codehaus/groovy/ast/astnode) usage)
| programming_docs |
groovy [Java] Class SingleSignatureClosureHint [Java] Class SingleSignatureClosureHint
=======================================
* groovy.transform.stc.SingleSignatureClosureHint
```
public abstract class SingleSignatureClosureHint
extends [ClosureSignatureHint](closuresignaturehint)
```
A simplified version of a [ClosureSignatureHint](closuresignaturehint "ClosureSignatureHint") which is suitable for monomorphic closures, that is to say closures which only respond to a single signature.
**Since:**
2.3.0
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[ClassNode](../../../org/codehaus/groovy/ast/classnode "ClassNode")>` | `**[getClosureSignatures](#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode))**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) compilationUnit, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options, [ASTNode](../../../org/codehaus/groovy/ast/astnode) usage)` |
| | `public abstract [ClassNode](../../../org/codehaus/groovy/ast/classnode)[]` | `**[getParameterTypes](#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) unit, [ASTNode](../../../org/codehaus/groovy/ast/astnode) usage)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [ClosureSignatureHint](closuresignaturehint)` | `[findClassNode](closuresignaturehint#findClassNode(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String)), [getClosureSignatures](closuresignaturehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.ClassNode,%20int)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.MethodNode,%20int,%20int))` |
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[ClassNode](../../../org/codehaus/groovy/ast/classnode "ClassNode")> **getClosureSignatures**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) compilationUnit, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options, [ASTNode](../../../org/codehaus/groovy/ast/astnode) usage)
### public abstract [ClassNode](../../../org/codehaus/groovy/ast/classnode)[] **getParameterTypes**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) unit, [ASTNode](../../../org/codehaus/groovy/ast/astnode) usage)
groovy [Java] Class ClosureSignatureHint [Java] Class ClosureSignatureHint
=================================
* groovy.transform.stc.ClosureSignatureHint
```
public abstract class ClosureSignatureHint
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
A closure signature hint class is always used in conjunction with the [ClosureParams](closureparams "ClosureParams") annotation. It is called at compile time (or may be used by IDEs) to infer the types of the parameters of a [Closure](../../lang/closure "Closure").
A closure hint class is responsible for generating the list of arguments that a closure accepts. Since closures may accept several signatures, [getClosureSignatures(org.codehaus.groovy.ast.MethodNode, org.codehaus.groovy.control.SourceUnit, org.codehaus.groovy.control.CompilationUnit, String[], org.codehaus.groovy.ast.ASTNode)](#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)) should return a list.
Whenever the type checker encounters a method call that targets a method accepting a closure, it will search for the [ClosureParams](closureparams "ClosureParams") annotation on the [Closure](../../lang/closure "Closure") argument. If it is found, then it creates an instance of the hint class and calls the [getClosureSignatures(org.codehaus.groovy.ast.MethodNode, org.codehaus.groovy.control.SourceUnit, org.codehaus.groovy.control.CompilationUnit, String[], org.codehaus.groovy.ast.ASTNode)](#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)) method, which will in turn return the list of signatures.
*Note that the signature concept here is used only to describe the parameter types, not the result type, which is found in the generic type argument of the [Closure](../../lang/closure "Closure") class.*
Several predefined hints can be found, which should cover most of the use cases.
**Since:**
2.3.0
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `protected [ClassNode](../../../org/codehaus/groovy/ast/classnode)` | `**[findClassNode](#findClassNode(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String))**([SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) compilationUnit, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") className)`Produces a [ClassNode](../../../org/codehaus/groovy/ast/classnode "ClassNode") given a string representing the type. |
| | `public abstract [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[ClassNode](../../../org/codehaus/groovy/ast/classnode "ClassNode")>` | `**[getClosureSignatures](#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode))**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) compilationUnit, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options, [ASTNode](../../../org/codehaus/groovy/ast/astnode) usage)` |
| | `public static [ClassNode](../../../org/codehaus/groovy/ast/classnode)` | `**[pickGenericType](#pickGenericType(org.codehaus.groovy.ast.ClassNode,%20int))**([ClassNode](../../../org/codehaus/groovy/ast/classnode) type, int gtIndex)`A helper method which will extract the n-th generic type from a class node. |
| | `public static [ClassNode](../../../org/codehaus/groovy/ast/classnode)` | `**[pickGenericType](#pickGenericType(org.codehaus.groovy.ast.MethodNode,%20int,%20int))**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, int parameterIndex, int gtIndex)`A helper method which will extract the n-th generic type from the n-th parameter of a method node. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### protected [ClassNode](../../../org/codehaus/groovy/ast/classnode) **findClassNode**([SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) compilationUnit, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") className)
Produces a [ClassNode](../../../org/codehaus/groovy/ast/classnode "ClassNode") given a string representing the type. Checks the supplied compilation unit in case it is also being compiled.
**Parameters:**
`sourceUnit` - source unit
`compilationUnit` - compilation unit
`className` - the type name to resolve
### public abstract [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[ClassNode](../../../org/codehaus/groovy/ast/classnode "ClassNode")> **getClosureSignatures**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) compilationUnit, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options, [ASTNode](../../../org/codehaus/groovy/ast/astnode) usage)
Subclasses should implement this method, which returns the list of accepted closure signatures.
The compiler will call this method each time, in a source file, a method call using a closure literal is encountered and that the target method has the corresponding [Closure](../../lang/closure "Closure") parameter annotated with [ClosureParams](closureparams "ClosureParams"). So imagine the following code needs to be compiled:
`**groovy.transform.TypeChecked:**
void doSomething() {
println ['a','b'].collect { it.toUpperCase() }
}` The *collect* method accepts a closure, but normally, the type checker doesn't have enough type information in the sole [DefaultGroovyMethods.collect](../../../org/codehaus/groovy/runtime/defaultgroovymethods#collect(java.lang.Iterable,%20groovy.lang.Closure) "DefaultGroovyMethods.collect") method signature to infer the type of *it*. With the annotation, it will now try to find an annotation on the closure parameter. If it finds it, then an instance of the hint class is created and the type checker calls it with the following arguments:
* the method node corresponding to the target method (here, the [DefaultGroovyMethods.collect](../../../org/codehaus/groovy/runtime/defaultgroovymethods#collect(java.lang.Iterable,%20groovy.lang.Closure) "DefaultGroovyMethods.collect") method
* the (optional) list of options found in the annotation
Now, the hint instance can return the list of expected parameters. Here, it would have to say that the collect method accepts a closure for which the only argument is of the type of the first generic type of the first argument.
With that type information, the type checker can now infer that the type of *it* is *String*, because the first argument (here the receiver of the collect method) is a *List<String>*
Subclasses are therefore expected to return the signatures according to the available context, which is only the target method and the potential options.
**Parameters:**
`node` - the method node for which a [Closure](../../lang/closure "Closure") parameter was annotated with [ClosureParams](closureparams "ClosureParams")
`sourceUnit` - the source unit of the file being compiled
`compilationUnit` - the compilation unit of the file being compiled
`options` - the options, corresponding to the [ClosureParams.options](closureparams#options() "ClosureParams.options") found on the annotation
`usage` - the AST node, in the compiled file, which triggered a call to this method. Normally only used for logging/error handling
**Returns:**
a non-null list of signature, where a signature corresponds to an array of class nodes, each of them matching a parameter.
### public static [ClassNode](../../../org/codehaus/groovy/ast/classnode) **pickGenericType**([ClassNode](../../../org/codehaus/groovy/ast/classnode) type, int gtIndex)
A helper method which will extract the n-th generic type from a class node.
**Parameters:**
`type` - the class node from which to pick a generic type
`gtIndex` - the index of the generic type to extract
**Returns:**
the n-th generic type, or [ClassHelper.OBJECT\_TYPE](../../../org/codehaus/groovy/ast/classhelper#OBJECT_TYPE "ClassHelper.OBJECT_TYPE") if it doesn't exist.
### public static [ClassNode](../../../org/codehaus/groovy/ast/classnode) **pickGenericType**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, int parameterIndex, int gtIndex)
A helper method which will extract the n-th generic type from the n-th parameter of a method node.
**Parameters:**
`node` - the method node from which the generic type should be picked
`parameterIndex` - the index of the parameter in the method parameter list
`gtIndex` - the index of the generic type to extract
**Returns:**
the generic type, or [ClassHelper.OBJECT\_TYPE](../../../org/codehaus/groovy/ast/classhelper#OBJECT_TYPE "ClassHelper.OBJECT_TYPE") if it doesn't exist.
groovy [Java] Class FirstParam.SecondGenericType [Java] Class FirstParam.SecondGenericType
=========================================
* groovy.transform.stc.FirstParam.SecondGenericType
```
public static class FirstParam.SecondGenericType
extends [PickAnyArgumentHint](pickanyargumenthint)
```
A hint used to instruct the type checker to pick the second generic type of the first parameter type. For example:
`void <T,U> doWithElements(Tuple<T,U> src, @ClosureParams(FirstParam.SecondGenericType.class) Closure c) { src.each { c.call(it) } }`
**Since:**
2.3.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[SecondGenericType](#SecondGenericType())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [PickAnyArgumentHint](pickanyargumenthint)` | `[getParameterTypes](pickanyargumenthint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [SingleSignatureClosureHint](singlesignatureclosurehint)` | `[getClosureSignatures](singlesignatureclosurehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [getParameterTypes](singlesignatureclosurehint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [ClosureSignatureHint](closuresignaturehint)` | `[findClassNode](closuresignaturehint#findClassNode(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String)), [getClosureSignatures](closuresignaturehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.ClassNode,%20int)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.MethodNode,%20int,%20int))` |
Constructor Detail
------------------
### public **SecondGenericType**()
groovy [Java] Class IncorrectTypeHintException [Java] Class IncorrectTypeHintException
=======================================
* groovy.transform.stc.IncorrectTypeHintException
```
public class IncorrectTypeHintException
extends [SyntaxException](../../../org/codehaus/groovy/syntax/syntaxexception)
```
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[IncorrectTypeHintException](#IncorrectTypeHintException(org.codehaus.groovy.ast.MethodNode,%20java.lang.Throwable,%20int,%20int))**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) mn, [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") e, int line, int column)` |
| `**[IncorrectTypeHintException](#IncorrectTypeHintException(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20int,%20int))**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) mn, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") msg, int line, int column)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [SyntaxException](../../../org/codehaus/groovy/syntax/syntaxexception)` | `[getEndColumn](../../../org/codehaus/groovy/syntax/syntaxexception#getEndColumn()), [getEndLine](../../../org/codehaus/groovy/syntax/syntaxexception#getEndLine()), [getLine](../../../org/codehaus/groovy/syntax/syntaxexception#getLine()), [getMessage](../../../org/codehaus/groovy/syntax/syntaxexception#getMessage()), [getOriginalMessage](../../../org/codehaus/groovy/syntax/syntaxexception#getOriginalMessage()), [getSourceLocator](../../../org/codehaus/groovy/syntax/syntaxexception#getSourceLocator()), [getStartColumn](../../../org/codehaus/groovy/syntax/syntaxexception#getStartColumn()), [getStartLine](../../../org/codehaus/groovy/syntax/syntaxexception#getStartLine()), [setSourceLocator](../../../org/codehaus/groovy/syntax/syntaxexception#setSourceLocator(java.lang.String))` |
| `class [GroovyException](../../../org/codehaus/groovy/groovyexception)` | `[isFatal](../../../org/codehaus/groovy/groovyexception#isFatal()), [setFatal](../../../org/codehaus/groovy/groovyexception#setFatal(boolean))` |
Constructor Detail
------------------
### public **IncorrectTypeHintException**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) mn, [Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") e, int line, int column)
### public **IncorrectTypeHintException**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) mn, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") msg, int line, int column)
groovy [Java] Class FirstParam [Java] Class FirstParam
=======================
* groovy.transform.stc.FirstParam
```
public class FirstParam
extends [PickAnyArgumentHint](pickanyargumenthint)
```
A hint used to instruct the type checker to pick the first parameter type. For example:
`public <T> def doWith(T src, @ClosureParams(FirstParam.class) Closure c) { c.call(src); }` This class has several inner classes that also helps picking generic argument types instead of the parameter type.
**Since:**
2.3.0
Nested Class Summary
--------------------
Nested classes
| Modifiers | Name | Description |
| `**static class**` | `[FirstParam.Component](firstparam.component)` | |
| `**static class**` | `[FirstParam.FirstGenericType](firstparam.firstgenerictype)` | |
| `**static class**` | `[FirstParam.SecondGenericType](firstparam.secondgenerictype)` | |
| `**static class**` | `[FirstParam.ThirdGenericType](firstparam.thirdgenerictype)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[FirstParam](#FirstParam())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [PickAnyArgumentHint](pickanyargumenthint)` | `[getParameterTypes](pickanyargumenthint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [SingleSignatureClosureHint](singlesignatureclosurehint)` | `[getClosureSignatures](singlesignatureclosurehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [getParameterTypes](singlesignatureclosurehint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [ClosureSignatureHint](closuresignaturehint)` | `[findClassNode](closuresignaturehint#findClassNode(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String)), [getClosureSignatures](closuresignaturehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.ClassNode,%20int)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.MethodNode,%20int,%20int))` |
Constructor Detail
------------------
### public **FirstParam**()
| programming_docs |
groovy [Java] Class MapEntryOrKeyValue [Java] Class MapEntryOrKeyValue
===============================
* groovy.transform.stc.MapEntryOrKeyValue
```
public class MapEntryOrKeyValue
extends [ClosureSignatureHint](closuresignaturehint)
```
A special hint which handles a common use case in the Groovy methods that work on maps. In case of an iteration on a list of map entries, you often want the user to be able to work either on a [Entry](https://docs.oracle.com/javase/8/docs/api/java/util/Map/Entry.html "Entry") map entry or on a key,value pair.
The result is a closure which can have the following forms:
* `{ key, value `->` ... }` where key is the key of a map entry, and value the corresponding value
* `{ entry `->` ... }` where entry is a [Entry](https://docs.oracle.com/javase/8/docs/api/java/util/Map/Entry.html "Entry") map entry
* `{ ... }` where *it* is an implicit [Entry](https://docs.oracle.com/javase/8/docs/api/java/util/Map/Entry.html "Entry") map entry
This hint handles all those cases by picking the generics from the first argument of the method (by default).
The options array is used to modify the behavior of this hint. Each string in the option array consists of a key=value pair.
* *argNum=index* of the parameter representing the map (by default, 0)
* *index=true or false*, by default false. If true, then an additional "int" parameter is added, for "withIndex" variants
`void doSomething(String str, Map<K,>V map, @ClosureParams(value=MapEntryOrKeyValue.class,options="argNum=1") Closure c) { ... }` Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[ClassNode](../../../org/codehaus/groovy/ast/classnode "ClassNode")>` | `**[getClosureSignatures](#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode))**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) compilationUnit, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options, [ASTNode](../../../org/codehaus/groovy/ast/astnode) usage)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [ClosureSignatureHint](closuresignaturehint)` | `[findClassNode](closuresignaturehint#findClassNode(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String)), [getClosureSignatures](closuresignaturehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.ClassNode,%20int)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.MethodNode,%20int,%20int))` |
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[ClassNode](../../../org/codehaus/groovy/ast/classnode "ClassNode")> **getClosureSignatures**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) compilationUnit, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options, [ASTNode](../../../org/codehaus/groovy/ast/astnode) usage)
groovy [Java] Class ClosureSignatureConflictResolver [Java] Class ClosureSignatureConflictResolver
=============================================
* groovy.transform.stc.ClosureSignatureConflictResolver
```
public class ClosureSignatureConflictResolver
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
If multiple candidate signatures are found after applying type hints, a conflict resolver can attempt to resolve the ambiguity.
**Since:**
2.5.0
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[ClassNode](../../../org/codehaus/groovy/ast/classnode "ClassNode")>` | `**[resolve](#resolve(List,%20org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.expr.Expression,%20org.codehaus.groovy.ast.expr.ClosureExpression,%20org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String))**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[ClassNode](../../../org/codehaus/groovy/ast/classnode "ClassNode")> candidates, [ClassNode](../../../org/codehaus/groovy/ast/classnode) receiver, [Expression](../../../org/codehaus/groovy/ast/expr/expression) arguments, [ClosureExpression](../../../org/codehaus/groovy/ast/expr/closureexpression) closure, [MethodNode](../../../org/codehaus/groovy/ast/methodnode) methodNode, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) compilationUnit, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options)`
**Parameters:**
`candidates` - the list of signatures as determined after applying type hints and performing initial inference calculations
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[ClassNode](../../../org/codehaus/groovy/ast/classnode "ClassNode")> **resolve**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[ClassNode](../../../org/codehaus/groovy/ast/classnode "ClassNode")> candidates, [ClassNode](../../../org/codehaus/groovy/ast/classnode) receiver, [Expression](../../../org/codehaus/groovy/ast/expr/expression) arguments, [ClosureExpression](../../../org/codehaus/groovy/ast/expr/closureexpression) closure, [MethodNode](../../../org/codehaus/groovy/ast/methodnode) methodNode, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) compilationUnit, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options)
**Parameters:**
`candidates` - the list of signatures as determined after applying type hints and performing initial inference calculations
`receiver` - the receiver the method is being called on
`arguments` - the arguments for the closure
`closure` - the closure expression under analysis
`methodNode` - the method for which a [Closure](../../lang/closure "Closure") parameter was annotated with [ClosureParams](closureparams "ClosureParams")
`sourceUnit` - the source unit of the file being compiled
`compilationUnit` - the compilation unit of the file being compiled
`options` - the options, corresponding to the [ClosureParams.options](closureparams#options() "ClosureParams.options") found on the annotation
**Returns:**
a non-null list of signatures, where a signature corresponds to an array of class nodes, each of them matching a parameter. A list with more than one element indicates that all ambiguities haven't yet been resolved.
groovy [Java] Annotation Type POJO [Java] Annotation Type POJO
===========================
* groovy.transform.stc.POJO
```
@[Incubating](../../../org/apache/groovy/lang/annotation/incubating "Incubating")
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")(ElementType.TYPE)
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
public @interface POJO
```
Marker interface to indicate that the normal GroovyObject methods should not be added.
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
groovy [Java] Class PickAnyArgumentHint [Java] Class PickAnyArgumentHint
================================
* groovy.transform.stc.PickAnyArgumentHint
```
public class PickAnyArgumentHint
extends [SingleSignatureClosureHint](singlesignatureclosurehint)
```
Base class for hints which use the type of a parameter of the annotated method as the signature. This can optionally use a generic type of the selected parameter as the hint. For example, imagine the following method:
`void foo(A firstArg, B secondArg, Closure c) {...}` If the *c* closure should be `{ B it `->` ...}`, then we can see that the parameter type should be picked from the second parameter of the foo method, which is what [PickAnyArgumentHint](pickanyargumenthint "PickAnyArgumentHint") lets you do.
Alternatively, the method may look like this:
`void <T> foo(A<T> firstArg, B secondArg, Closure c) {...}` in which case if you want to express the fact that *c* should accept a <T> then you can use the [genericTypeIndex](#genericTypeIndex) value.
This class is extended by several hint providers that make it easier to use as annotation values.
**Since:**
2.3.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[PickAnyArgumentHint](#PickAnyArgumentHint())**()`Creates the an argument picker which extracts the type of the first parameter. |
| `**[PickAnyArgumentHint](#PickAnyArgumentHint(int,%20int))**(int parameterIndex, int genericTypeIndex)`Creates a picker which will extract the parameterIndex-th parameter type, or its genericTypeIndex-th generic type genericTypeIndex is >=0. |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [ClassNode](../../../org/codehaus/groovy/ast/classnode)[]` | `**[getParameterTypes](#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) unit, [ASTNode](../../../org/codehaus/groovy/ast/astnode) usage)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [SingleSignatureClosureHint](singlesignatureclosurehint)` | `[getClosureSignatures](singlesignatureclosurehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [getParameterTypes](singlesignatureclosurehint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [ClosureSignatureHint](closuresignaturehint)` | `[findClassNode](closuresignaturehint#findClassNode(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String)), [getClosureSignatures](closuresignaturehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.ClassNode,%20int)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.MethodNode,%20int,%20int))` |
Constructor Detail
------------------
### public **PickAnyArgumentHint**()
Creates the an argument picker which extracts the type of the first parameter.
### public **PickAnyArgumentHint**(int parameterIndex, int genericTypeIndex)
Creates a picker which will extract the parameterIndex-th parameter type, or its genericTypeIndex-th generic type genericTypeIndex is >=0.
**Parameters:**
`parameterIndex` - the index of the parameter from which to extract the type
`genericTypeIndex` - if >=0, then returns the corresponding generic type instead of the parameter type.
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [ClassNode](../../../org/codehaus/groovy/ast/classnode)[] **getParameterTypes**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) unit, [ASTNode](../../../org/codehaus/groovy/ast/astnode) usage)
groovy [Java] Class SecondParam.FirstGenericType [Java] Class SecondParam.FirstGenericType
=========================================
* groovy.transform.stc.SecondParam.FirstGenericType
```
public static class SecondParam.FirstGenericType
extends [PickAnyArgumentHint](pickanyargumenthint)
```
A hint used to instruct the type checker to pick the first generic type of the second parameter type. For example:
`void <T> doWithElements(String base, List<T> src, @ClosureParams(SecondParam.FirstGenericType.class) Closure c) { ... } }`
**Since:**
2.3.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[FirstGenericType](#FirstGenericType())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [PickAnyArgumentHint](pickanyargumenthint)` | `[getParameterTypes](pickanyargumenthint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [SingleSignatureClosureHint](singlesignatureclosurehint)` | `[getClosureSignatures](singlesignatureclosurehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [getParameterTypes](singlesignatureclosurehint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [ClosureSignatureHint](closuresignaturehint)` | `[findClassNode](closuresignaturehint#findClassNode(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String)), [getClosureSignatures](closuresignaturehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.ClassNode,%20int)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.MethodNode,%20int,%20int))` |
Constructor Detail
------------------
### public **FirstGenericType**()
groovy [Java] Class SimpleType [Java] Class SimpleType
=======================
* groovy.transform.stc.SimpleType
```
public class SimpleType
extends [SingleSignatureClosureHint](singlesignatureclosurehint)
```
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [ClassNode](../../../org/codehaus/groovy/ast/classnode)[]` | `**[getParameterTypes](#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) compilationUnit, [ASTNode](../../../org/codehaus/groovy/ast/astnode) usage)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [SingleSignatureClosureHint](singlesignatureclosurehint)` | `[getClosureSignatures](singlesignatureclosurehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [getParameterTypes](singlesignatureclosurehint#getParameterTypes(org.codehaus.groovy.ast.MethodNode,%20java.lang.String,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20org.codehaus.groovy.ast.ASTNode))` |
| `class [ClosureSignatureHint](closuresignaturehint)` | `[findClassNode](closuresignaturehint#findClassNode(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String)), [getClosureSignatures](closuresignaturehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.ClassNode,%20int)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.MethodNode,%20int,%20int))` |
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [ClassNode](../../../org/codehaus/groovy/ast/classnode)[] **getParameterTypes**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) compilationUnit, [ASTNode](../../../org/codehaus/groovy/ast/astnode) usage)
| programming_docs |
groovy [Java] Class FromString [Java] Class FromString
=======================
* groovy.transform.stc.FromString
```
public class FromString
extends [ClosureSignatureHint](closuresignaturehint)
```
A closure parameter hint class that is convenient if you want to use a String representation of the signature. It makes use of the [option strings](closureparams#options() "option strings"), where each string corresponds to a single signature.
The following example describes a closure as accepting a single signature (List<T> list ->):
`public <T> T apply(T src, @ClosureParams(value=FromString.class, options="List<T>" Closure<T> cl)` The next example describes a closure as accepting two signatures (List<T> list ->) and (T t ->):
`public <T> T apply(T src, @ClosureParams(value=FromString.class, options={"List<T>","T"} Closure<T> cl)` It is advisable not to use this hint as a replacement for the various [FirstParam](firstparam "FirstParam"), [SimpleType](simpletype "SimpleType"), ... hints because it is actually much slower. Using this hint should therefore be limited to cases where it's not possible to express the signature using the existing hints.
**Since:**
2.3.0
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[ClassNode](../../../org/codehaus/groovy/ast/classnode "ClassNode")>` | `**[getClosureSignatures](#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode))**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) compilationUnit, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options, [ASTNode](../../../org/codehaus/groovy/ast/astnode) usage)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [ClosureSignatureHint](closuresignaturehint)` | `[findClassNode](closuresignaturehint#findClassNode(org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String)), [getClosureSignatures](closuresignaturehint#getClosureSignatures(org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.control.SourceUnit,%20org.codehaus.groovy.control.CompilationUnit,%20java.lang.String,%20org.codehaus.groovy.ast.ASTNode)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.ClassNode,%20int)), [pickGenericType](closuresignaturehint#pickGenericType(org.codehaus.groovy.ast.MethodNode,%20int,%20int))` |
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[ClassNode](../../../org/codehaus/groovy/ast/classnode "ClassNode")> **getClosureSignatures**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node, [SourceUnit](../../../org/codehaus/groovy/control/sourceunit) sourceUnit, [CompilationUnit](../../../org/codehaus/groovy/control/compilationunit) compilationUnit, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] options, [ASTNode](../../../org/codehaus/groovy/ast/astnode) usage)
groovy [Java] Class SimpleStrategy [Java] Class SimpleStrategy
===========================
* groovy.transform.builder.SimpleStrategy
```
public class SimpleStrategy
extends [BuilderASTTransformationAbstractBuilderStrategy](../../../builderasttransformationabstractbuilderstrategy)
```
This strategy is used with the [Builder](builder "Builder") AST transform to modify your Groovy objects so that the setter methods for properties return the original object, thus allowing chained usage of the setters. You use it as follows:
```
import groovy.transform.builder.*
@Builder(builderStrategy=SimpleStrategy)
class Person {
String firstName
String lastName
int age
}
def person = new Person().setFirstName("Robert").setLastName("Lewandowski").setAge(21)
assert person.firstName == "Robert"
assert person.lastName == "Lewandowski"
assert person.age == 21
```
The `prefix` annotation attribute can be used to create setters with a different naming convention, e.g. with the prefix set to the empty String, you would use your setters as follows:
```
def p1 = new Person().firstName("Robert").lastName("Lewandowski").age(21)
```
or using a prefix of 'with':
```
def p2 = new Person().withFirstName("Robert").withLastName("Lewandowski").withAge(21)
```
When using the default prefix of "set", Groovy's normal setters will be replaced by the chained versions. When using a custom prefix, Groovy's unchained setters will still be available for use in the normal unchained fashion. The 'useSetters' annotation attribute can be used for writable properties as per the `Builder` transform documentation. The other annotation attributes for the `@Builder` transform for configuring the building process aren't applicable for this strategy. Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[build](#build(org.codehaus.groovy.transform.BuilderASTTransformation,%20org.codehaus.groovy.ast.AnnotatedNode,%20org.codehaus.groovy.ast.AnnotationNode))**([BuilderASTTransformation](../../../org/codehaus/groovy/transform/builderasttransformation) transform, [AnnotatedNode](../../../org/codehaus/groovy/ast/annotatednode) annotatedNode, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno)` |
| | `protected [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[FieldNode](../../../org/codehaus/groovy/ast/fieldnode "FieldNode")>` | `**[getFields](#getFields(org.codehaus.groovy.transform.BuilderASTTransformation,%20org.codehaus.groovy.ast.AnnotationNode,%20org.codehaus.groovy.ast.ClassNode))**([BuilderASTTransformation](../../../org/codehaus/groovy/transform/builderasttransformation) transform, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno, [ClassNode](../../../org/codehaus/groovy/ast/classnode) buildee)` |
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **build**([BuilderASTTransformation](../../../org/codehaus/groovy/transform/builderasttransformation) transform, [AnnotatedNode](../../../org/codehaus/groovy/ast/annotatednode) annotatedNode, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[FieldNode](../../../org/codehaus/groovy/ast/fieldnode "FieldNode")> **getFields**([BuilderASTTransformation](../../../org/codehaus/groovy/transform/builderasttransformation) transform, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno, [ClassNode](../../../org/codehaus/groovy/ast/classnode) buildee)
groovy [Java] Annotation Type Builder [Java] Annotation Type Builder
==============================
* groovy.transform.builder.Builder
```
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.RUNTIME)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ ElementType.TYPE, ElementType.CONSTRUCTOR, ElementType.METHOD})
@[GroovyASTTransformationClass](../../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.codehaus.groovy.transform.BuilderASTTransformation")
public @interface Builder
```
The `@Builder` AST transformation is used to help write classes that can be created using *fluent* api calls. The transform supports multiple building strategies to cover a range of cases and there are a number of configuration options to customize the building process. In addition, a number of annotation attributes let you customise the building process. Not all annotation attributes are supported by all strategies. See the individual strategy documentation for more details. If you're an AST hacker, you can also define your own strategy class. The following strategies are bundled with Groovy:
* [SimpleStrategy](simplestrategy "SimpleStrategy") for creating chained setters
* [ExternalStrategy](externalstrategy "ExternalStrategy") where you annotate an explicit builder class while leaving some buildee class being built untouched
* [DefaultStrategy](defaultstrategy "DefaultStrategy") which creates a nested helper class for instance creation
* [InitializerStrategy](initializerstrategy "InitializerStrategy") which creates a nested helper class for instance creation which when used with `@CompileStatic` allows type-safe object creation
Note that Groovy provides other built-in mechanisms for easy creation of objects, e.g. the named-args constructor:
```
new Person(firstName: "Robert", lastName: "Lewandowski", age: 21)
```
or the with statement:
```
new Person().with {
firstName = "Robert"
lastName = "Lewandowski"
age = 21
}
```
so you might not find value in using the builder transform at all. But if you need Java integration or in some cases improved type safety, the `@Builder` transform might prove very useful.
**See Also:**
[SimpleStrategy](simplestrategy "SimpleStrategy")
[ExternalStrategy](externalstrategy "ExternalStrategy")
[DefaultStrategy](defaultstrategy "DefaultStrategy")
[InitializerStrategy](initializerstrategy "InitializerStrategy")
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**boolean**` | `[allNames](#allNames)`Whether the generated builder should support all properties, including those with names that are considered internal. |
| `**boolean**` | `[allProperties](#allProperties)`Whether to include all properties (as per the JavaBean spec) in the generated builder. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[buildMethodName](#buildMethodName)`For strategies which create a builder helper class that creates the instance, the method name to call to create the instance. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[builderClassName](#builderClassName)`For strategies which create a builder helper class, the class name to use for the helper class. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[builderMethodName](#builderMethodName)`The method name to use for a builder factory method in the source class for easy access of the builder helper class for strategies which create such a helper class. |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<? extends BuilderStrategy>**` | `[builderStrategy](#builderStrategy)`A class capturing the builder strategy
**Default:**
DefaultStrategy.class
|
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[excludes](#excludes)`List of field and/or property names to exclude from generated builder methods. |
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")**` | `[forClass](#forClass)`A class for which builder methods should be created. |
| `**boolean**` | `[force](#force)`Whether to always include helper constructors. |
| `**boolean**` | `[includeSuperProperties](#includeSuperProperties)`Generate builder methods for properties from super classes. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[includes](#includes)`List of field and/or property names to include within the generated builder methods. |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[prefix](#prefix)`The prefix to use when creating the setter methods. |
| `**boolean**` | `[useSetters](#useSetters)`By default, properties are set directly using their respective field. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public boolean **allNames**
Whether the generated builder should support all properties, including those with names that are considered internal.
**Since:**
2.5.0
**Default:**
false
### public boolean **allProperties**
Whether to include all properties (as per the JavaBean spec) in the generated builder. Groovy recognizes any field-like definitions with no explicit visibility as property definitions and always includes them in the `@Builder` generated classes. Groovy also treats any explicitly created getXxx() or isYyy() methods as property getters as per the JavaBean specification. Old versions of Groovy did not. So set this flag to false for the old behavior or if you want to explicitly exclude such properties. Currently only supported by DefaultStrategy and ExternalStrategy.
**Since:**
2.5.0
**Default:**
true
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **buildMethodName**
For strategies which create a builder helper class that creates the instance, the method name to call to create the instance. Default is determined by the strategy, e.g. *build* or *create*.
**Default:**
Undefined.STRING
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **builderClassName**
For strategies which create a builder helper class, the class name to use for the helper class. Not used if using `forClass` since in such cases the builder class is explicitly supplied. Default is determined by the strategy, e.g. *TargetClass* + "Builder" or *TargetClass* + "Initializer".
**Default:**
Undefined.STRING
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **builderMethodName**
The method name to use for a builder factory method in the source class for easy access of the builder helper class for strategies which create such a helper class. Must not be used if using `forClass`. Default is determined by the strategy, e.g. *builder* or *createInitializer*.
**Default:**
Undefined.STRING
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<? extends BuilderStrategy> **builderStrategy**
A class capturing the builder strategy
**Default:**
DefaultStrategy.class
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **excludes**
List of field and/or property names to exclude from generated builder methods. Must not be used if 'includes' is used. For convenience, a String with comma separated names can be used in addition to an array (using Groovy's literal list notation) of String values.
**Default:**
{}
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") **forClass**
A class for which builder methods should be created. It will be an error to leave this attribute with its default value for some strategies.
**Default:**
Undefined.CLASS.class
### public boolean **force**
Whether to always include helper constructors. Currently only supported by InitializerStrategy. By default, the InitializerStrategy only adds a needed helper tuple constructor if no `@TupleConstructor` annotations are present. If such annotations are present, it is assumed they will provide the helper constructor that this strategy needs. If made true, the helper constructor will be generated and it is up to you to make sure this doesn't conflict with any other generated constructors.
**Since:**
2.5.0
**Default:**
false
### public boolean **includeSuperProperties**
Generate builder methods for properties from super classes.
**Since:**
2.5.0
**Default:**
false
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **includes**
List of field and/or property names to include within the generated builder methods. Must not be used if 'excludes' is used. For convenience, a String with comma separated names can be used in addition to an array (using Groovy's literal list notation) of String values. The default value is a special marker value indicating that no includes are defined; all fields are included if includes remains undefined and excludes is explicitly or implicitly an empty list.
**Default:**
{ Undefined.STRING }
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **prefix**
The prefix to use when creating the setter methods. Default is determined by the strategy which might use "" or "set" but you can choose your own, e.g. "with". If non-empty the first letter of the property will be capitalized before being appended to the prefix.
**Default:**
Undefined.STRING
### public boolean **useSetters**
By default, properties are set directly using their respective field. By setting `useSetters=true` then a writable property will be set using its setter. If turning on this flag we recommend that setters that might be called are made null-safe wrt the parameter.
**Since:**
2.5.0
**Default:**
false
groovy [Java] Class InitializerStrategy [Java] Class InitializerStrategy
================================
* groovy.transform.builder.InitializerStrategy
```
public class InitializerStrategy
extends [BuilderASTTransformationAbstractBuilderStrategy](../../../builderasttransformationabstractbuilderstrategy)
```
This strategy is used with the [Builder](builder "Builder") AST transform to create a builder helper class for the fluent and type-safe creation of instances of a specified class. It is modelled roughly on the design outlined here: http://michid.wordpress.com/2008/08/13/type-safe-builder-pattern-in-java/ You define classes which use the type-safe initializer pattern as follows:
```
import groovy.transform.builder.*
import groovy.transform.*
@ToString
@Builder(builderStrategy=InitializerStrategy) class Person {
String firstName
String lastName
int age
}
```
While it isn't required to do so, the benefit of this builder strategy comes in conjunction with static type-checking or static compilation. Typical usage is as follows:
```
@CompileStatic
def main() {
println new Person(Person.createInitializer().firstName("John").lastName("Smith").age(21))
}
```
which prints:
```
Person(John, Smith, 21)
```
If you don't initialise some of the properties, your code won't compile, e.g. if the method body above was changed to this:
```
println new Person(Person.createInitializer().firstName("John").lastName("Smith"))
```
then the following compile-time error would result:
```
[Static type checking] - Cannot find matching method Person#<init>(Person$PersonInitializer <groovy.transform.builder.InitializerStrategy$SET, groovy.transform.builder.InitializerStrategy$SET, groovy.transform.builder.InitializerStrategy$UNSET>). Please check if the declared type is correct and if the method exists.
```
The message is a little cryptic, but it is basically the static compiler telling us that the third parameter, `age` in our case, is unset. You can also add this annotation to your predefined constructors. These will be made private and an initializer will be set up to call your constructor. Any parameters to your constructor become the properties expected by the initializer. If you use such a builder on a constructor as well as on the class or on more than one constructor, then it is up to you to define unique values for 'builderClassName' and 'builderMethodName' for each annotation. Nested Class Summary
--------------------
Nested classes
| Modifiers | Name | Description |
| `**static class**` | `[InitializerStrategy.SET](initializerstrategy.set)` | Internal phantom type used by the `InitializerStrategy` to indicate that a property has been set. |
| `**static class**` | `[InitializerStrategy.UNSET](initializerstrategy.unset)` | Internal phantom type used by the `InitializerStrategy` to indicate that a property remains unset. |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[build](#build(org.codehaus.groovy.transform.BuilderASTTransformation,%20org.codehaus.groovy.ast.AnnotatedNode,%20org.codehaus.groovy.ast.AnnotationNode))**([BuilderASTTransformation](../../../org/codehaus/groovy/transform/builderasttransformation) transform, [AnnotatedNode](../../../org/codehaus/groovy/ast/annotatednode) annotatedNode, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno)` |
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **build**([BuilderASTTransformation](../../../org/codehaus/groovy/transform/builderasttransformation) transform, [AnnotatedNode](../../../org/codehaus/groovy/ast/annotatednode) annotatedNode, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno)
| programming_docs |
groovy [Java] Class InitializerStrategy.UNSET [Java] Class InitializerStrategy.UNSET
======================================
* groovy.transform.builder.InitializerStrategy.UNSET
```
public static abstract class InitializerStrategy.UNSET
```
Internal phantom type used by the `InitializerStrategy` to indicate that a property remains unset. It is used in conjunction with the generated parameterized type helper class.
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
groovy [Java] Class ExternalStrategy [Java] Class ExternalStrategy
=============================
* groovy.transform.builder.ExternalStrategy
```
public class ExternalStrategy
extends [BuilderASTTransformationAbstractBuilderStrategy](../../../builderasttransformationabstractbuilderstrategy)
```
This strategy is used with the [Builder](builder "Builder") AST transform to populate a builder helper class so that it can be used for the fluent creation of instances of a specified class. The specified class is not modified in any way and may be a Java class. You use it by creating and annotating an explicit builder class which will be filled in by during annotation processing with the appropriate build method and setters. An example is shown here:
```
import groovy.transform.builder.*
class Person {
String firstName
String lastName
}
@Builder(builderStrategy=ExternalStrategy, forClass=Person)
class PersonBuilder { }
def person = new PersonBuilder().firstName("Robert").lastName("Lewandowski").build()
assert person.firstName == "Robert"
assert person.lastName == "Lewandowski"
```
The `prefix` annotation attribute, which defaults to the empty String for this strategy, can be used to create setters with a different naming convention, e.g. with the `prefix` changed to 'set', you would use your setters as follows:
```
def p1 = new PersonBuilder().setFirstName("Robert").setLastName("Lewandowski").setAge(21).build()
```
or using a prefix of 'with':
```
def p2 = new PersonBuilder().withFirstName("Robert").withLastName("Lewandowski").withAge(21).build()
```
The properties to use can be filtered using either the 'includes' or 'excludes' annotation attributes for `@Builder`. The `@Builder` 'buildMethodName' annotation attribute can be used for configuring the build method's name, default "build". The `@Builder` 'builderMethodName' and 'builderClassName' annotation attributes aren't applicable for this strategy. The `@Builder` 'useSetters' annotation attribute is ignored by this strategy which always uses setters. Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[build](#build(org.codehaus.groovy.transform.BuilderASTTransformation,%20org.codehaus.groovy.ast.AnnotatedNode,%20org.codehaus.groovy.ast.AnnotationNode))**([BuilderASTTransformation](../../../org/codehaus/groovy/transform/builderasttransformation) transform, [AnnotatedNode](../../../org/codehaus/groovy/ast/annotatednode) annotatedNode, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno)` |
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **build**([BuilderASTTransformation](../../../org/codehaus/groovy/transform/builderasttransformation) transform, [AnnotatedNode](../../../org/codehaus/groovy/ast/annotatednode) annotatedNode, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno)
groovy [Java] Class DefaultStrategy [Java] Class DefaultStrategy
============================
* groovy.transform.builder.DefaultStrategy
```
public class DefaultStrategy
extends [BuilderASTTransformationAbstractBuilderStrategy](../../../builderasttransformationabstractbuilderstrategy)
```
This strategy is used with the [Builder](builder "Builder") AST transform to create a builder helper class for the fluent creation of instances of a specified class. It can be used at the class, static method or constructor levels. You use it as follows:
```
import groovy.transform.builder.*
@Builder
class Person {
String firstName
String lastName
int age
}
def person = Person.builder().firstName("Robert").lastName("Lewandowski").age(21).build()
assert person.firstName == "Robert"
assert person.lastName == "Lewandowski"
assert person.age == 21
```
The `prefix` annotation attribute can be used to create setters with a different naming convention. The default is the empty string but you could change that to "set" as follows:
```
@groovy.transform.builder.Builder(prefix='set')
class Person {
String firstName
String lastName
int age
}
def p2 = Person.builder().setFirstName("Robert").setLastName("Lewandowski").setAge(21).build()
```
or using a prefix of 'with' would result in usage like this:
```
def p3 = Person.builder().withFirstName("Robert").withLastName("Lewandowski").withAge(21).build()
```
You can also use the `@Builder` annotation in combination with this strategy on one or more constructor or static method instead of or in addition to using it at the class level. An example with a constructor follows:
```
import groovy.transform.ToString
import groovy.transform.builder.Builder
@ToString
class Person {
String first, last
int born
@Builder
Person(String roleName) {
if (roleName == 'Jack Sparrow') {
first = 'Johnny'; last = 'Depp'; born = 1963
}
}
}
assert Person.builder().roleName("Jack Sparrow").build().toString() == 'Person(Johnny, Depp, 1963)'
```
In this case, the parameter(s) for the constructor or static method become the properties available in the builder. For the case of a static method, the return type of the static method becomes the class of the instance being created. For static factory methods, this is normally the class containing the static method but in general it can be any class. Note: if using more than one `@Builder` annotation, which is only possible when using static method or constructor variants, it is up to you to ensure that any generated helper classes or builder methods have unique names. E.g. we can modify the previous example to have three builders. At least two of the builders in our case will need to set the 'builderClassName' and 'builderMethodName' annotation attributes to ensure we have unique names. This is shown in the following example:
```
import groovy.transform.builder.*
import groovy.transform.*
@ToString
@Builder
class Person {
String first, last
int born
Person(){} // required to retain no-arg constructor
@Builder(builderClassName='MovieBuilder', builderMethodName='byRoleBuilder')
Person(String roleName) {
if (roleName == 'Jack Sparrow') {
this.first = 'Johnny'; this.last = 'Depp'; this.born = 1963
}
}
@Builder(builderClassName='SplitBuilder', builderMethodName='splitBuilder')
static Person split(String name, int year) {
def parts = name.split(' ')
new Person(first: parts[0], last: parts[1], born: year)
}
}
assert Person.splitBuilder().name("Johnny Depp").year(1963).build().toString() == 'Person(Johnny, Depp, 1963)'
assert Person.byRoleBuilder().roleName("Jack Sparrow").build().toString() == 'Person(Johnny, Depp, 1963)'
assert Person.builder().first("Johnny").last('Depp').born(1963).build().toString() == 'Person(Johnny, Depp, 1963)'
```
The 'forClass' annotation attribute for the `@Builder` transform isn't applicable for this strategy. The 'useSetters' annotation attribute for the `@Builder` transform is ignored by this strategy which always uses setters. Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[build](#build(org.codehaus.groovy.transform.BuilderASTTransformation,%20org.codehaus.groovy.ast.AnnotatedNode,%20org.codehaus.groovy.ast.AnnotationNode))**([BuilderASTTransformation](../../../org/codehaus/groovy/transform/builderasttransformation) transform, [AnnotatedNode](../../../org/codehaus/groovy/ast/annotatednode) annotatedNode, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno)` |
| | `public void` | `**[buildClass](#buildClass(org.codehaus.groovy.transform.BuilderASTTransformation,%20org.codehaus.groovy.ast.ClassNode,%20org.codehaus.groovy.ast.AnnotationNode))**([BuilderASTTransformation](../../../org/codehaus/groovy/transform/builderasttransformation) transform, [ClassNode](../../../org/codehaus/groovy/ast/classnode) buildee, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno)` |
| | `public void` | `**[buildMethod](#buildMethod(org.codehaus.groovy.transform.BuilderASTTransformation,%20org.codehaus.groovy.ast.MethodNode,%20org.codehaus.groovy.ast.AnnotationNode))**([BuilderASTTransformation](../../../org/codehaus/groovy/transform/builderasttransformation) transform, [MethodNode](../../../org/codehaus/groovy/ast/methodnode) mNode, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno)` |
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **build**([BuilderASTTransformation](../../../org/codehaus/groovy/transform/builderasttransformation) transform, [AnnotatedNode](../../../org/codehaus/groovy/ast/annotatednode) annotatedNode, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno)
### public void **buildClass**([BuilderASTTransformation](../../../org/codehaus/groovy/transform/builderasttransformation) transform, [ClassNode](../../../org/codehaus/groovy/ast/classnode) buildee, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno)
### public void **buildMethod**([BuilderASTTransformation](../../../org/codehaus/groovy/transform/builderasttransformation) transform, [MethodNode](../../../org/codehaus/groovy/ast/methodnode) mNode, [AnnotationNode](../../../org/codehaus/groovy/ast/annotationnode) anno)
groovy [Java] Class InitializerStrategy.SET [Java] Class InitializerStrategy.SET
====================================
* groovy.transform.builder.InitializerStrategy.SET
```
public static abstract class InitializerStrategy.SET
```
Internal phantom type used by the `InitializerStrategy` to indicate that a property has been set. It is used in conjunction with the generated parameterized type helper class.
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
groovy [Java] Annotation Type GQ [Java] Annotation Type GQ
=========================
* groovy.ginq.transform.GQ
```
@[Incubating](../../../org/apache/groovy/lang/annotation/incubating "Incubating")
@[Documented](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html "Documented")
@[Retention](https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html "Retention")(RetentionPolicy.SOURCE)
@[Target](https://docs.groovy-lang.org/docs/ant/api/org/apache/tools/ant/Target.html "Target")({ElementType.METHOD})
@[GroovyASTTransformationClass](../../../org/codehaus/groovy/transform/groovyasttransformationclass "GroovyASTTransformationClass")("org.apache.groovy.ginq.transform.GinqASTTransformation")
public @interface GQ
```
Method annotation to make a method call returning GINQ result
**Since:**
4.0.0
Element Summary
---------------
Optional Element Summary
| Type | Name and Description |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[astWalker](#astWalker)`Specify the GINQ AST walker to customize GINQ behaviour
**Default:**
"org.apache.groovy.ginq.provider.collection.GinqAstWalker"
|
| `**boolean**` | `[optimize](#optimize)`Whether to optimize the GINQ AST
**Default:**
true
|
| `**boolean**` | `[parallel](#parallel)`Whether to enable parallel querying
**Default:**
false
|
| `**[Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?>**` | `[value](#value)`Specify the result type
**Default:**
Queryable.class
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Element Detail
--------------
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **astWalker**
Specify the GINQ AST walker to customize GINQ behaviour
**Default:**
"org.apache.groovy.ginq.provider.collection.GinqAstWalker"
### public boolean **optimize**
Whether to optimize the GINQ AST
**Default:**
true
### public boolean **parallel**
Whether to enable parallel querying
**Default:**
false
### public [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> **value**
Specify the result type
**Default:**
Queryable.class
groovy [Groovy] Class TextTreeNodeMaker [Groovy] Class TextTreeNodeMaker
================================
* groovy.console.TextTreeNodeMaker
All Implemented Interfaces and Traits: AstBrowserNodeMaker<[TextNode](textnode "TextNode")>
```
@[CompileStatic](../transform/compilestatic "CompileStatic")
class TextTreeNodeMaker
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements AstBrowserNodeMaker<[TextNode](textnode "TextNode")>
```
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[TextTreeNodeMaker](#TextTreeNodeMaker())**()` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `[TextNode](textnode)` | `**[makeNode](#makeNode(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") userObject)` |
| | `[TextNode](textnode)` | `**[makeNodeWithProperties](#makeNodeWithProperties(java.lang.Object,%20List))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") userObject, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>> properties)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
###
**TextTreeNodeMaker**()
Method Detail
-------------
###
[TextNode](textnode) **makeNode**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") userObject)
###
[TextNode](textnode) **makeNodeWithProperties**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") userObject, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>> properties)
groovy [Groovy] Class TextNode [Groovy] Class TextNode
=======================
* groovy.console.TextNode
```
@[CompileStatic](../transform/compilestatic "CompileStatic")
class TextNode
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Properties Summary
------------------
Properties
| Type | Name and description |
| `**[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")**` | `[children](#children)` |
| `**[TextNode](textnode)**` | `[parent](#parent)` |
| `**[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>>**` | `[properties](#properties)` |
| `**[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")**` | `[userObject](#userObject)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[TextNode](#TextNode(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") userObject)` |
| `**[TextNode](#TextNode(java.lang.Object,%20List))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") userObject, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>> properties)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `void` | `**[add](#add(groovy.console.TextNode))**([TextNode](textnode) child)` |
| | `void` | `**[setParent](#setParent(groovy.console.TextNode))**([TextNode](textnode) newParent)` |
| | `[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Property Detail
---------------
###
[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") **children**
###
[TextNode](textnode) **parent**
###
[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>> **properties**
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **userObject**
Constructor Detail
------------------
###
**TextNode**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") userObject)
###
**TextNode**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") userObject, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>> properties)
Method Detail
-------------
### void **add**([TextNode](textnode) child)
### void **setParent**([TextNode](textnode) newParent)
###
[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
| programming_docs |
groovy [Groovy] Class ObjectBrowser [Groovy] Class ObjectBrowser
============================
* groovy.console.ui.ObjectBrowser
```
class ObjectBrowser
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
A little GUI to show some of the Inspector capabilities. Starting this script opens the ObjectBrowser on "some String". Use it in groovysh or groovyConsole to inspect your object of interest with: `ObjectBrowser.inspect(myObject)` .
Properties Summary
------------------
Properties
| Type | Name and description |
| `**[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")**` | `[fieldTable](#fieldTable)` |
| `**[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")**` | `[frame](#frame)` |
| `**[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")**` | `[inspector](#inspector)` |
| `**[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")**` | `[itemTable](#itemTable)` |
| `**[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")**` | `[mapTable](#mapTable)` |
| `**[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")**` | `[methodTable](#methodTable)` |
| `**[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")**` | `[swing](#swing)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[ObjectBrowser](#ObjectBrowser())**()` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `void` | `**[addSorter](#addSorter(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") table)` |
| | `static void` | `**[inspect](#inspect(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") objectUnderInspection)` |
| | `static void` | `**[main](#main(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)` |
| | `void` | `**[run](#run())**()` |
| | `void` | `**[showAbout](#showAbout(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Property Detail
---------------
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **fieldTable**
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **frame**
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **inspector**
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **itemTable**
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **mapTable**
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **methodTable**
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **swing**
Constructor Detail
------------------
###
**ObjectBrowser**()
Method Detail
-------------
### void **addSorter**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") table)
### static void **inspect**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") objectUnderInspection)
### static void **main**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
### void **run**()
### void **showAbout**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
groovy [Java] Class ConsoleTextEditor [Java] Class ConsoleTextEditor
==============================
* groovy.console.ui.ConsoleTextEditor
```
public class ConsoleTextEditor
extends [JScrollPane](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html "JScrollPane")
```
Component which provides a styled editor for the console.
Inherited fields
| Fields inherited from class | Fields |
| **`class [JScrollPane](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html "JScrollPane")`** | `VIEWPORT, VERTICAL_SCROLLBAR, HORIZONTAL_SCROLLBAR, ROW_HEADER, COLUMN_HEADER, LOWER_LEFT_CORNER, LOWER_RIGHT_CORNER, UPPER_LEFT_CORNER, UPPER_RIGHT_CORNER, LOWER_LEADING_CORNER, LOWER_TRAILING_CORNER, UPPER_LEADING_CORNER, UPPER_TRAILING_CORNER, VERTICAL_SCROLLBAR_POLICY, HORIZONTAL_SCROLLBAR_POLICY, VERTICAL_SCROLLBAR_AS_NEEDED, VERTICAL_SCROLLBAR_NEVER, VERTICAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_ALWAYS, WHEN_FOCUSED, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_WINDOW, UNDEFINED_CONDITION, TOOL_TIP_TEXT_KEY, TOP_ALIGNMENT, CENTER_ALIGNMENT, BOTTOM_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, WIDTH, HEIGHT, PROPERTIES, SOMEBITS, FRAMEBITS, ALLBITS, ERROR, ABORT` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[ConsoleTextEditor](#ConsoleTextEditor())**()`Creates a new instance of ConsoleTextEditor |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[changedUpdate](#changedUpdate(javax.swing.event.DocumentEvent))**([DocumentEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/DocumentEvent.html "DocumentEvent") documentEvent)` |
| | `public boolean` | `**[clipBoardAvailable](#clipBoardAvailable())**()` |
| | `public void` | `**[enableHighLighter](#enableHighLighter(java.lang.Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") clazz)` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getDefaultFamily](#getDefaultFamily())**()` |
| | `public [Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")` | `**[getPrintAction](#getPrintAction())**()` |
| | `public [Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")` | `**[getRedoAction](#getRedoAction())**()` |
| | `public [TextEditor](text/texteditor)` | `**[getTextEditor](#getTextEditor())**()` |
| | `public [Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")` | `**[getUndoAction](#getUndoAction())**()` |
| | `protected void` | `**[initActions](#initActions())**()` |
| | `public void` | `**[insertUpdate](#insertUpdate(javax.swing.event.DocumentEvent))**([DocumentEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/DocumentEvent.html "DocumentEvent") documentEvent)` |
| | `public void` | `**[paintComponent](#paintComponent(java.awt.Graphics))**([Graphics](https://docs.oracle.com/javase/8/docs/api/java/awt/Graphics.html "Graphics") g)` |
| | `public void` | `**[removeUpdate](#removeUpdate(javax.swing.event.DocumentEvent))**([DocumentEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/DocumentEvent.html "DocumentEvent") documentEvent)` |
| | `public void` | `**[setDefaultFamily](#setDefaultFamily(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") defaultFamily)` |
| | `public void` | `**[setEditable](#setEditable(boolean))**(boolean editable)` |
| | `public void` | `**[setShowLineNumbers](#setShowLineNumbers(boolean))**(boolean showLineNumbers)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [JScrollPane](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html "JScrollPane")` | `[setComponentOrientation](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setComponentOrientation(java.awt.ComponentOrientation) "setComponentOrientation"), [setVerticalScrollBarPolicy](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setVerticalScrollBarPolicy(int) "setVerticalScrollBarPolicy"), [setHorizontalScrollBarPolicy](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setHorizontalScrollBarPolicy(int) "setHorizontalScrollBarPolicy"), [setViewport](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setViewport(javax.swing.JViewport) "setViewport"), [createVerticalScrollBar](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#createVerticalScrollBar() "createVerticalScrollBar"), [setVerticalScrollBar](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setVerticalScrollBar(javax.swing.JScrollBar) "setVerticalScrollBar"), [createHorizontalScrollBar](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#createHorizontalScrollBar() "createHorizontalScrollBar"), [setHorizontalScrollBar](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setHorizontalScrollBar(javax.swing.JScrollBar) "setHorizontalScrollBar"), [setViewportView](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setViewportView(java.awt.Component) "setViewportView"), [getColumnHeader](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getColumnHeader() "getColumnHeader"), [getRowHeader](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getRowHeader() "getRowHeader"), [getVerticalScrollBar](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getVerticalScrollBar() "getVerticalScrollBar"), [getHorizontalScrollBar](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getHorizontalScrollBar() "getHorizontalScrollBar"), [isValidateRoot](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isValidateRoot() "isValidateRoot"), [setLayout](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setLayout(java.awt.LayoutManager) "setLayout"), [updateUI](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#updateUI() "updateUI"), [setUI](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setUI(javax.swing.plaf.ScrollPaneUI) "setUI"), [getUI](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getUI() "getUI"), [getUI](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getUI() "getUI"), [getUIClassID](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getUIClassID() "getUIClassID"), [getAccessibleContext](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getAccessibleContext() "getAccessibleContext"), [getViewport](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getViewport() "getViewport"), [setColumnHeaderView](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setColumnHeaderView(java.awt.Component) "setColumnHeaderView"), [getCorner](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getCorner(java.lang.String) "getCorner"), [setCorner](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setCorner(java.lang.String,%20java.awt.Component) "setCorner"), [setRowHeader](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setRowHeader(javax.swing.JViewport) "setRowHeader"), [setColumnHeader](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setColumnHeader(javax.swing.JViewport) "setColumnHeader"), [getVerticalScrollBarPolicy](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getVerticalScrollBarPolicy() "getVerticalScrollBarPolicy"), [getHorizontalScrollBarPolicy](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getHorizontalScrollBarPolicy() "getHorizontalScrollBarPolicy"), [getViewportBorder](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getViewportBorder() "getViewportBorder"), [setViewportBorder](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setViewportBorder(javax.swing.border.Border) "setViewportBorder"), [getViewportBorderBounds](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getViewportBorderBounds() "getViewportBorderBounds"), [setRowHeaderView](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setRowHeaderView(java.awt.Component) "setRowHeaderView"), [isWheelScrollingEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isWheelScrollingEnabled() "isWheelScrollingEnabled"), [setWheelScrollingEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setWheelScrollingEnabled(boolean) "setWheelScrollingEnabled"), [update](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#update(java.awt.Graphics) "update"), [contains](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#contains(int,%20int) "contains"), [getBounds](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getBounds(java.awt.Rectangle) "getBounds"), [getLocation](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getLocation(java.awt.Point) "getLocation"), [print](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#print(java.awt.Graphics) "print"), [getSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getSize(java.awt.Dimension) "getSize"), [setOpaque](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setOpaque(boolean) "setOpaque"), [isOpaque](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isOpaque() "isOpaque"), [enable](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#enable() "enable"), [disable](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#disable() "disable"), [setEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setEnabled(boolean) "setEnabled"), [getVetoableChangeListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getVetoableChangeListeners() "getVetoableChangeListeners"), [removeAncestorListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#removeAncestorListener(javax.swing.event.AncestorListener) "removeAncestorListener"), [getAncestorListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getAncestorListeners() "getAncestorListeners"), [addNotify](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#addNotify() "addNotify"), [removeNotify](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#removeNotify() "removeNotify"), [paintImmediately](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#paintImmediately(int,%20int,%20int,%20int) "paintImmediately"), [paintImmediately](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#paintImmediately(java.awt.Rectangle) "paintImmediately"), [hide](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#hide() "hide"), [setInheritsPopupMenu](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setInheritsPopupMenu(boolean) "setInheritsPopupMenu"), [setComponentPopupMenu](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setComponentPopupMenu(javax.swing.JPopupMenu) "setComponentPopupMenu"), [isPaintingTile](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isPaintingTile() "isPaintingTile"), [isPaintingForPrint](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isPaintingForPrint() "isPaintingForPrint"), [setRequestFocusEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setRequestFocusEnabled(boolean) "setRequestFocusEnabled"), [isRequestFocusEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isRequestFocusEnabled() "isRequestFocusEnabled"), [grabFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#grabFocus() "grabFocus"), [setVerifyInputWhenFocusTarget](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setVerifyInputWhenFocusTarget(boolean) "setVerifyInputWhenFocusTarget"), [getVerifyInputWhenFocusTarget](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getVerifyInputWhenFocusTarget() "getVerifyInputWhenFocusTarget"), [setBorder](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setBorder(javax.swing.border.Border) "setBorder"), [setAlignmentY](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setAlignmentY(float) "setAlignmentY"), [setAlignmentX](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setAlignmentX(float) "setAlignmentX"), [setInputVerifier](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setInputVerifier(javax.swing.InputVerifier) "setInputVerifier"), [getInputVerifier](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getInputVerifier() "getInputVerifier"), [setDebugGraphicsOptions](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setDebugGraphicsOptions(int) "setDebugGraphicsOptions"), [getDebugGraphicsOptions](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getDebugGraphicsOptions() "getDebugGraphicsOptions"), [unregisterKeyboardAction](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#unregisterKeyboardAction(javax.swing.KeyStroke) "unregisterKeyboardAction"), [getRegisteredKeyStrokes](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getRegisteredKeyStrokes() "getRegisteredKeyStrokes"), [getConditionForKeyStroke](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getConditionForKeyStroke(javax.swing.KeyStroke) "getConditionForKeyStroke"), [getActionForKeyStroke](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getActionForKeyStroke(javax.swing.KeyStroke) "getActionForKeyStroke"), [resetKeyboardActions](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#resetKeyboardActions() "resetKeyboardActions"), [requestDefaultFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#requestDefaultFocus() "requestDefaultFocus"), [setToolTipText](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setToolTipText(java.lang.String) "setToolTipText"), [getToolTipLocation](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getToolTipLocation(java.awt.event.MouseEvent) "getToolTipLocation"), [getPopupLocation](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getPopupLocation(java.awt.event.MouseEvent) "getPopupLocation"), [createToolTip](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#createToolTip() "createToolTip"), [getAutoscrolls](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getAutoscrolls() "getAutoscrolls"), [setTransferHandler](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setTransferHandler(javax.swing.TransferHandler) "setTransferHandler"), [getTransferHandler](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getTransferHandler() "getTransferHandler"), [getVisibleRect](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getVisibleRect() "getVisibleRect"), [getTopLevelAncestor](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getTopLevelAncestor() "getTopLevelAncestor"), [setDoubleBuffered](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setDoubleBuffered(boolean) "setDoubleBuffered"), [addAncestorListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#addAncestorListener(javax.swing.event.AncestorListener) "addAncestorListener"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#firePropertyChange(java.lang.String,%20int,%20int) "firePropertyChange"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#firePropertyChange(java.lang.String,%20boolean,%20boolean) "firePropertyChange"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#firePropertyChange(java.lang.String,%20char,%20char) "firePropertyChange"), [getListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getListeners(java.lang.Class) "getListeners"), [getClientProperty](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getClientProperty(java.lang.Object) "getClientProperty"), [getGraphics](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getGraphics() "getGraphics"), [getRootPane](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getRootPane() "getRootPane"), [getInheritsPopupMenu](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getInheritsPopupMenu() "getInheritsPopupMenu"), [getComponentPopupMenu](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getComponentPopupMenu() "getComponentPopupMenu"), [isManagingFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isManagingFocus() "isManagingFocus"), [getDefaultLocale](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getDefaultLocale() "getDefaultLocale"), [repaint](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#repaint(long,%20int,%20int,%20int,%20int) "repaint"), [repaint](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#repaint(java.awt.Rectangle) "repaint"), [putClientProperty](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#putClientProperty(java.lang.Object,%20java.lang.Object) "putClientProperty"), [setFont](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setFont(java.awt.Font) "setFont"), [isOptimizedDrawingEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isOptimizedDrawingEnabled() "isOptimizedDrawingEnabled"), [getWidth](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getWidth() "getWidth"), [getHeight](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getHeight() "getHeight"), [isLightweightComponent](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isLightweightComponent(java.awt.Component) "isLightweightComponent"), [paint](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#paint(java.awt.Graphics) "paint"), [printAll](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#printAll(java.awt.Graphics) "printAll"), [getBorder](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getBorder() "getBorder"), [isDoubleBuffered](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isDoubleBuffered() "isDoubleBuffered"), [getNextFocusableComponent](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getNextFocusableComponent() "getNextFocusableComponent"), [setNextFocusableComponent](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setNextFocusableComponent(java.awt.Component) "setNextFocusableComponent"), [requestFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#requestFocus(boolean) "requestFocus"), [requestFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#requestFocus() "requestFocus"), [requestFocusInWindow](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#requestFocusInWindow() "requestFocusInWindow"), [getFontMetrics](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getFontMetrics(java.awt.Font) "getFontMetrics"), [setPreferredSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setPreferredSize(java.awt.Dimension) "setPreferredSize"), [getPreferredSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getPreferredSize() "getPreferredSize"), [setMaximumSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setMaximumSize(java.awt.Dimension) "setMaximumSize"), [getMaximumSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getMaximumSize() "getMaximumSize"), [setMinimumSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setMinimumSize(java.awt.Dimension) "setMinimumSize"), [getMinimumSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getMinimumSize() "getMinimumSize"), [getInsets](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getInsets() "getInsets"), [getInsets](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getInsets(java.awt.Insets) "getInsets"), [getAlignmentY](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getAlignmentY() "getAlignmentY"), [getAlignmentX](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getAlignmentX() "getAlignmentX"), [getInputMap](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getInputMap(int) "getInputMap"), [getInputMap](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getInputMap() "getInputMap"), [getActionMap](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getActionMap() "getActionMap"), [registerKeyboardAction](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#registerKeyboardAction(java.awt.event.ActionListener,%20javax.swing.KeyStroke,%20int) "registerKeyboardAction"), [registerKeyboardAction](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#registerKeyboardAction(java.awt.event.ActionListener,%20java.lang.String,%20javax.swing.KeyStroke,%20int) "registerKeyboardAction"), [setInputMap](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setInputMap(int,%20javax.swing.InputMap) "setInputMap"), [setActionMap](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setActionMap(javax.swing.ActionMap) "setActionMap"), [getBaseline](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getBaseline(int,%20int) "getBaseline"), [getBaselineResizeBehavior](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getBaselineResizeBehavior() "getBaselineResizeBehavior"), [setForeground](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setForeground(java.awt.Color) "setForeground"), [setBackground](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setBackground(java.awt.Color) "setBackground"), [setDefaultLocale](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setDefaultLocale(java.util.Locale) "setDefaultLocale"), [getToolTipText](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getToolTipText() "getToolTipText"), [getToolTipText](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getToolTipText(java.awt.event.MouseEvent) "getToolTipText"), [scrollRectToVisible](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#scrollRectToVisible(java.awt.Rectangle) "scrollRectToVisible"), [setAutoscrolls](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setAutoscrolls(boolean) "setAutoscrolls"), [setFocusTraversalKeys](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setFocusTraversalKeys(int,%20java.util.Set) "setFocusTraversalKeys"), [reshape](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#reshape(int,%20int,%20int,%20int) "reshape"), [computeVisibleRect](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#computeVisibleRect(java.awt.Rectangle) "computeVisibleRect"), [addVetoableChangeListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#addVetoableChangeListener(java.beans.VetoableChangeListener) "addVetoableChangeListener"), [removeVetoableChangeListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#removeVetoableChangeListener(java.beans.VetoableChangeListener) "removeVetoableChangeListener"), [revalidate](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#revalidate() "revalidate"), [setVisible](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setVisible(boolean) "setVisible"), [getY](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getY() "getY"), [getX](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getX() "getX"), [add](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#add(java.awt.Component) "add"), [add](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#add(java.lang.String,%20java.awt.Component) "add"), [add](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#add(java.awt.Component,%20java.lang.Object) "add"), [add](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#add(java.awt.Component,%20int) "add"), [add](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#add(java.awt.Component,%20java.lang.Object,%20int) "add"), [remove](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#remove(java.awt.Component) "remove"), [remove](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#remove(int) "remove"), [list](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#list(java.io.PrintWriter,%20int) "list"), [list](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#list(java.io.PrintStream,%20int) "list"), [validate](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#validate() "validate"), [removeAll](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#removeAll() "removeAll"), [invalidate](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#invalidate() "invalidate"), [locate](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#locate(int,%20int) "locate"), [getComponent](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getComponent(int) "getComponent"), [layout](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#layout() "layout"), [preferredSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#preferredSize() "preferredSize"), [minimumSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#minimumSize() "minimumSize"), [insets](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#insets() "insets"), [countComponents](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#countComponents() "countComponents"), [getComponentZOrder](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getComponentZOrder(java.awt.Component) "getComponentZOrder"), [doLayout](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#doLayout() "doLayout"), [deliverEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#deliverEvent(java.awt.Event) "deliverEvent"), [findComponentAt](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#findComponentAt(int,%20int) "findComponentAt"), [findComponentAt](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#findComponentAt(java.awt.Point) "findComponentAt"), [isFocusTraversalPolicyProvider](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isFocusTraversalPolicyProvider() "isFocusTraversalPolicyProvider"), [applyComponentOrientation](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#applyComponentOrientation(java.awt.ComponentOrientation) "applyComponentOrientation"), [addContainerListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#addContainerListener(java.awt.event.ContainerListener) "addContainerListener"), [setComponentZOrder](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setComponentZOrder(java.awt.Component,%20int) "setComponentZOrder"), [paintComponents](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#paintComponents(java.awt.Graphics) "paintComponents"), [printComponents](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#printComponents(java.awt.Graphics) "printComponents"), [removeContainerListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#removeContainerListener(java.awt.event.ContainerListener) "removeContainerListener"), [getContainerListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getContainerListeners() "getContainerListeners"), [getMousePosition](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getMousePosition(boolean) "getMousePosition"), [isAncestorOf](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isAncestorOf(java.awt.Component) "isAncestorOf"), [getFocusTraversalKeys](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getFocusTraversalKeys(int) "getFocusTraversalKeys"), [areFocusTraversalKeysSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#areFocusTraversalKeysSet(int) "areFocusTraversalKeysSet"), [isFocusTraversalPolicySet](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isFocusTraversalPolicySet() "isFocusTraversalPolicySet"), [setFocusCycleRoot](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setFocusCycleRoot(boolean) "setFocusCycleRoot"), [setFocusTraversalPolicyProvider](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setFocusTraversalPolicyProvider(boolean) "setFocusTraversalPolicyProvider"), [transferFocusDownCycle](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#transferFocusDownCycle() "transferFocusDownCycle"), [isFocusCycleRoot](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isFocusCycleRoot() "isFocusCycleRoot"), [isFocusCycleRoot](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isFocusCycleRoot(java.awt.Container) "isFocusCycleRoot"), [getFocusTraversalPolicy](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getFocusTraversalPolicy() "getFocusTraversalPolicy"), [setFocusTraversalPolicy](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setFocusTraversalPolicy(java.awt.FocusTraversalPolicy) "setFocusTraversalPolicy"), [getLayout](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getLayout() "getLayout"), [getComponents](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getComponents() "getComponents"), [getComponentCount](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getComponentCount() "getComponentCount"), [getComponentAt](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getComponentAt(int,%20int) "getComponentAt"), [getComponentAt](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getComponentAt(java.awt.Point) "getComponentAt"), [addPropertyChangeListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#addPropertyChangeListener(java.lang.String,%20java.beans.PropertyChangeListener) "addPropertyChangeListener"), [addPropertyChangeListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#addPropertyChangeListener(java.beans.PropertyChangeListener) "addPropertyChangeListener"), [getName](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getName() "getName"), [add](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#add(java.awt.PopupMenu) "add"), [remove](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#remove(java.awt.MenuComponent) "remove"), [toString](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#toString() "toString"), [size](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#size() "size"), [contains](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#contains(java.awt.Point) "contains"), [list](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#list() "list"), [list](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#list(java.io.PrintWriter) "list"), [list](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#list(java.io.PrintStream) "list"), [getBounds](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getBounds() "getBounds"), [bounds](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#bounds() "bounds"), [getLocation](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getLocation() "getLocation"), [getParent](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getParent() "getParent"), [action](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#action(java.awt.Event,%20java.lang.Object) "action"), [setName](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setName(java.lang.String) "setName"), [location](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#location() "location"), [getSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getSize() "getSize"), [resize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#resize(java.awt.Dimension) "resize"), [resize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#resize(int,%20int) "resize"), [move](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#move(int,%20int) "move"), [setSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setSize(int,%20int) "setSize"), [setSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setSize(java.awt.Dimension) "setSize"), [getLocale](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getLocale() "getLocale"), [isEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isEnabled() "isEnabled"), [enable](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#enable(boolean) "enable"), [setLocale](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setLocale(java.util.Locale) "setLocale"), [isValid](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isValid() "isValid"), [dispatchEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#dispatchEvent(java.awt.AWTEvent) "dispatchEvent"), [mouseEnter](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#mouseEnter(java.awt.Event,%20int,%20int) "mouseEnter"), [mouseExit](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#mouseExit(java.awt.Event,%20int,%20int) "mouseExit"), [mouseMove](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#mouseMove(java.awt.Event,%20int,%20int) "mouseMove"), [mouseDown](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#mouseDown(java.awt.Event,%20int,%20int) "mouseDown"), [mouseDrag](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#mouseDrag(java.awt.Event,%20int,%20int) "mouseDrag"), [mouseUp](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#mouseUp(java.awt.Event,%20int,%20int) "mouseUp"), [keyDown](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#keyDown(java.awt.Event,%20int) "keyDown"), [keyUp](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#keyUp(java.awt.Event,%20int) "keyUp"), [gotFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#gotFocus(java.awt.Event,%20java.lang.Object) "gotFocus"), [lostFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#lostFocus(java.awt.Event,%20java.lang.Object) "lostFocus"), [isFocusTraversable](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isFocusTraversable() "isFocusTraversable"), [hasFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#hasFocus() "hasFocus"), [addComponentListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#addComponentListener(java.awt.event.ComponentListener) "addComponentListener"), [addFocusListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#addFocusListener(java.awt.event.FocusListener) "addFocusListener"), [addKeyListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#addKeyListener(java.awt.event.KeyListener) "addKeyListener"), [addMouseListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#addMouseListener(java.awt.event.MouseListener) "addMouseListener"), [addMouseMotionListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#addMouseMotionListener(java.awt.event.MouseMotionListener) "addMouseMotionListener"), [addInputMethodListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#addInputMethodListener(java.awt.event.InputMethodListener) "addInputMethodListener"), [addHierarchyListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#addHierarchyListener(java.awt.event.HierarchyListener) "addHierarchyListener"), [addHierarchyBoundsListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) "addHierarchyBoundsListener"), [addMouseWheelListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#addMouseWheelListener(java.awt.event.MouseWheelListener) "addMouseWheelListener"), [setDropTarget](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setDropTarget(java.awt.dnd.DropTarget) "setDropTarget"), [getDropTarget](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getDropTarget() "getDropTarget"), [enableInputMethods](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#enableInputMethods(boolean) "enableInputMethods"), [isForegroundSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isForegroundSet() "isForegroundSet"), [isBackgroundSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isBackgroundSet() "isBackgroundSet"), [isFontSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isFontSet() "isFontSet"), [setCursor](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setCursor(java.awt.Cursor) "setCursor"), [getCursor](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getCursor() "getCursor"), [isCursorSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isCursorSet() "isCursorSet"), [paintAll](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#paintAll(java.awt.Graphics) "paintAll"), [imageUpdate](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#imageUpdate(java.awt.Image,%20int,%20int,%20int,%20int,%20int) "imageUpdate"), [setIgnoreRepaint](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setIgnoreRepaint(boolean) "setIgnoreRepaint"), [getIgnoreRepaint](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getIgnoreRepaint() "getIgnoreRepaint"), [removeComponentListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#removeComponentListener(java.awt.event.ComponentListener) "removeComponentListener"), [getComponentListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getComponentListeners() "getComponentListeners"), [removeFocusListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#removeFocusListener(java.awt.event.FocusListener) "removeFocusListener"), [getFocusListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getFocusListeners() "getFocusListeners"), [removeHierarchyListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#removeHierarchyListener(java.awt.event.HierarchyListener) "removeHierarchyListener"), [getHierarchyListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getHierarchyListeners() "getHierarchyListeners"), [removeHierarchyBoundsListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) "removeHierarchyBoundsListener"), [getHierarchyBoundsListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getHierarchyBoundsListeners() "getHierarchyBoundsListeners"), [removeKeyListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#removeKeyListener(java.awt.event.KeyListener) "removeKeyListener"), [getKeyListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getKeyListeners() "getKeyListeners"), [removeMouseListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#removeMouseListener(java.awt.event.MouseListener) "removeMouseListener"), [getMouseListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getMouseListeners() "getMouseListeners"), [removeMouseMotionListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#removeMouseMotionListener(java.awt.event.MouseMotionListener) "removeMouseMotionListener"), [getMouseMotionListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getMouseMotionListeners() "getMouseMotionListeners"), [removeMouseWheelListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#removeMouseWheelListener(java.awt.event.MouseWheelListener) "removeMouseWheelListener"), [getMouseWheelListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getMouseWheelListeners() "getMouseWheelListeners"), [removeInputMethodListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#removeInputMethodListener(java.awt.event.InputMethodListener) "removeInputMethodListener"), [getInputMethodListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getInputMethodListeners() "getInputMethodListeners"), [getInputMethodRequests](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getInputMethodRequests() "getInputMethodRequests"), [setFocusable](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setFocusable(boolean) "setFocusable"), [setFocusTraversalKeysEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setFocusTraversalKeysEnabled(boolean) "setFocusTraversalKeysEnabled"), [getFocusTraversalKeysEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getFocusTraversalKeysEnabled() "getFocusTraversalKeysEnabled"), [transferFocusUpCycle](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#transferFocusUpCycle() "transferFocusUpCycle"), [getComponentOrientation](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getComponentOrientation() "getComponentOrientation"), [setMixingCutoutShape](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setMixingCutoutShape(java.awt.Shape) "setMixingCutoutShape"), [setLocation](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setLocation(java.awt.Point) "setLocation"), [setLocation](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setLocation(int,%20int) "setLocation"), [getPropertyChangeListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getPropertyChangeListeners(java.lang.String) "getPropertyChangeListeners"), [getPropertyChangeListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getPropertyChangeListeners() "getPropertyChangeListeners"), [isShowing](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isShowing() "isShowing"), [getGraphicsConfiguration](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getGraphicsConfiguration() "getGraphicsConfiguration"), [isFocusable](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isFocusable() "isFocusable"), [isFocusOwner](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isFocusOwner() "isFocusOwner"), [transferFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#transferFocus() "transferFocus"), [postEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#postEvent(java.awt.Event) "postEvent"), [transferFocusBackward](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#transferFocusBackward() "transferFocusBackward"), [getMousePosition](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getMousePosition() "getMousePosition"), [getToolkit](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getToolkit() "getToolkit"), [getLocationOnScreen](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getLocationOnScreen() "getLocationOnScreen"), [getInputContext](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getInputContext() "getInputContext"), [show](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#show(boolean) "show"), [show](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#show() "show"), [getColorModel](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getColorModel() "getColorModel"), [createImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#createImage(int,%20int) "createImage"), [createImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#createImage(java.awt.image.ImageProducer) "createImage"), [createVolatileImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#createVolatileImage(int,%20int,%20java.awt.ImageCapabilities) "createVolatileImage"), [createVolatileImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#createVolatileImage(int,%20int) "createVolatileImage"), [prepareImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#prepareImage(java.awt.Image,%20int,%20int,%20java.awt.image.ImageObserver) "prepareImage"), [prepareImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#prepareImage(java.awt.Image,%20java.awt.image.ImageObserver) "prepareImage"), [checkImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#checkImage(java.awt.Image,%20int,%20int,%20java.awt.image.ImageObserver) "checkImage"), [checkImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#checkImage(java.awt.Image,%20java.awt.image.ImageObserver) "checkImage"), [inside](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#inside(int,%20int) "inside"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#firePropertyChange(java.lang.String,%20byte,%20byte) "firePropertyChange"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#firePropertyChange(java.lang.String,%20double,%20double) "firePropertyChange"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#firePropertyChange(java.lang.String,%20float,%20float) "firePropertyChange"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#firePropertyChange(java.lang.String,%20long,%20long) "firePropertyChange"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#firePropertyChange(java.lang.String,%20short,%20short) "firePropertyChange"), [removePropertyChangeListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#removePropertyChangeListener(java.lang.String,%20java.beans.PropertyChangeListener) "removePropertyChangeListener"), [removePropertyChangeListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#removePropertyChangeListener(java.beans.PropertyChangeListener) "removePropertyChangeListener"), [repaint](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#repaint(int,%20int,%20int,%20int) "repaint"), [repaint](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#repaint() "repaint"), [repaint](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#repaint(long) "repaint"), [getForeground](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getForeground() "getForeground"), [getFont](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getFont() "getFont"), [getTreeLock](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getTreeLock() "getTreeLock"), [getFocusCycleRootAncestor](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getFocusCycleRootAncestor() "getFocusCycleRootAncestor"), [isDisplayable](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isDisplayable() "isDisplayable"), [nextFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#nextFocus() "nextFocus"), [requestFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#requestFocus(java.awt.event.FocusEvent%24Cause) "requestFocus"), [requestFocusInWindow](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#requestFocusInWindow(java.awt.event.FocusEvent%24Cause) "requestFocusInWindow"), [isPreferredSizeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isPreferredSizeSet() "isPreferredSizeSet"), [isMaximumSizeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isMaximumSizeSet() "isMaximumSizeSet"), [isMinimumSizeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isMinimumSizeSet() "isMinimumSizeSet"), [getBackground](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getBackground() "getBackground"), [isLightweight](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isLightweight() "isLightweight"), [setBounds](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setBounds(int,%20int,%20int,%20int) "setBounds"), [setBounds](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#setBounds(java.awt.Rectangle) "setBounds"), [handleEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#handleEvent(java.awt.Event) "handleEvent"), [isVisible](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#isVisible() "isVisible"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#equals(java.lang.Object) "equals"), [hashCode](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/javax/swing/JScrollPane.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **ConsoleTextEditor**()
Creates a new instance of ConsoleTextEditor
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **changedUpdate**([DocumentEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/DocumentEvent.html "DocumentEvent") documentEvent)
### public boolean **clipBoardAvailable**()
### public void **enableHighLighter**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") clazz)
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getDefaultFamily**()
### public [Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **getPrintAction**()
### public [Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **getRedoAction**()
### public [TextEditor](text/texteditor) **getTextEditor**()
### public [Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **getUndoAction**()
### protected void **initActions**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **insertUpdate**([DocumentEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/DocumentEvent.html "DocumentEvent") documentEvent)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **paintComponent**([Graphics](https://docs.oracle.com/javase/8/docs/api/java/awt/Graphics.html "Graphics") g)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **removeUpdate**([DocumentEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/DocumentEvent.html "DocumentEvent") documentEvent)
### public void **setDefaultFamily**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") defaultFamily)
### public void **setEditable**(boolean editable)
### public void **setShowLineNumbers**(boolean showLineNumbers)
| programming_docs |
groovy [Groovy] Script ConsoleView [Groovy] Script ConsoleView
===========================
* groovy.console.ui.ConsoleView
```
class ConsoleView
extends [Script](../../lang/script)
```
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[ConsoleView](#ConsoleView())**()` |
| `**[ConsoleView](#ConsoleView(groovy.lang.Binding))**([Binding](../../lang/binding) context)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `static void` | `**[main](#main(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)` |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[run](#run())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Script](../../lang/script)` | `[evaluate](../../lang/script#evaluate(java.lang.String)), [evaluate](../../lang/script#evaluate(java.io.File)), [getBinding](../../lang/script#getBinding()), [getProperty](../../lang/script#getProperty(java.lang.String)), [invokeMethod](../../lang/script#invokeMethod(java.lang.String,%20java.lang.Object)), [print](../../lang/script#print(java.lang.Object)), [printf](../../lang/script#printf(java.lang.String,%20java.lang.Object)), [printf](../../lang/script#printf(java.lang.String,%20java.lang.Object)), [println](../../lang/script#println()), [println](../../lang/script#println(java.lang.Object)), [run](../../lang/script#run()), [run](../../lang/script#run(java.io.File,%20java.lang.String)), [setBinding](../../lang/script#setBinding(groovy.lang.Binding)), [setProperty](../../lang/script#setProperty(java.lang.String,%20java.lang.Object))` |
| `class [GroovyObjectSupport](../../lang/groovyobjectsupport)` | `[getMetaClass](../../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
###
**ConsoleView**()
###
**ConsoleView**([Binding](../../lang/binding) context)
Method Detail
-------------
### static void **main**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **run**()
groovy [Groovy] Class AstNodeToScriptAdapter [Groovy] Class AstNodeToScriptAdapter
=====================================
* groovy.console.ui.AstNodeToScriptAdapter
```
@[AutoFinal](../../transform/autofinal "AutoFinal")
@[CompileStatic](../../transform/compilestatic "CompileStatic")
class AstNodeToScriptAdapter
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
This class takes Groovy source code, compiles it to a specific compile phase, and then decompiles it back to the groovy source. It is used by GroovyConsole's AST Browser, but can also be invoked from the command line.
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[AstNodeToScriptAdapter](#AstNodeToScriptAdapter())**()` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[compileToScript](#compileToScript(java.lang.String,%20int,%20java.lang.ClassLoader,%20boolean,%20boolean,%20org.codehaus.groovy.control.CompilerConfiguration))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") script, int compilePhase, [ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") classLoader, boolean showScriptFreeForm, boolean showScriptClass, [CompilerConfiguration](../../../org/codehaus/groovy/control/compilerconfiguration) config)`This method takes source code, compiles it, then reverses it back to source. |
| | `static void` | `**[main](#main(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)`Run this class as a script to compile a groovy file and print out the resulting source. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
###
**AstNodeToScriptAdapter**()
Method Detail
-------------
###
[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **compileToScript**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") script, int compilePhase, [ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") classLoader, boolean showScriptFreeForm, boolean showScriptClass, [CompilerConfiguration](../../../org/codehaus/groovy/control/compilerconfiguration) config)
This method takes source code, compiles it, then reverses it back to source.
**returns:**
the source code from the AST state
**Parameters:**
`script` - the source code to be compiled. If invalid, a compile error occurs
`compilePhase` - the CompilePhase. Must be an int mapped in CompilePhase
`classLoader` - (optional) the classloader to use. If missing/null then the current is used. This parameter enables things like ASTBrowser to invoke this with the correct classpath
`showScriptFreeForm` - Whether or not to show the script portion of the source code
`showScriptClass` - Whether or not to show the Script class from the source code
`config` - optional compiler configuration
### static void **main**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)
Run this class as a script to compile a groovy file and print out the resulting source.
**Parameters:**
`args` - a filename to compile and a CompilePhase to run to
groovy [Java] Class SystemOutputInterceptor [Java] Class SystemOutputInterceptor
====================================
* groovy.console.ui.SystemOutputInterceptor
```
public class SystemOutputInterceptor
extends [FilterOutputStream](https://docs.oracle.com/javase/8/docs/api/java/io/FilterOutputStream.html "FilterOutputStream")
```
Intercepts System.out/System.err. Implementation helper for Console.groovy.
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[SystemOutputInterceptor](#SystemOutputInterceptor(groovy.lang.Closure))**([Closure](../../lang/closure) callback)`Constructor |
| `**[SystemOutputInterceptor](#SystemOutputInterceptor(groovy.lang.Closure,%20boolean))**([Closure](../../lang/closure) callback, boolean output)`Constructor |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `protected [Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer")` | `**[initialValue](#initialValue())**()` |
| | `public void` | `**[removeConsoleId](#removeConsoleId())**()`Threads executing a script should call this method after execution completes in order to unregister the consoleId. |
| | `public void` | `**[setConsoleId](#setConsoleId(int))**(int consoleId)`Threads executing a script should call this method at the start of execution in order to set the id of the console that is hosting the thread of execution. |
| | `public void` | `**[start](#start())**()`Starts intercepting System.out/System.err |
| | `public void` | `**[stop](#stop())**()`Stops intercepting System.out/System.err, sending output to wherever it was going when this interceptor was created. |
| | `public void` | `**[write](#write(byte%5B%5D,%20int,%20int))**(byte[] b, int off, int len)`Intercepts output - more common case of byte[] |
| | `public void` | `**[write](#write(int))**(int b)`Intercepts output - single characters |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [FilterOutputStream](https://docs.oracle.com/javase/8/docs/api/java/io/FilterOutputStream.html "FilterOutputStream")` | `[flush](https://docs.oracle.com/javase/8/docs/api/java/io/FilterOutputStream.html#flush() "flush"), [write](https://docs.oracle.com/javase/8/docs/api/java/io/FilterOutputStream.html#write(%5BB,%20int,%20int) "write"), [write](https://docs.oracle.com/javase/8/docs/api/java/io/FilterOutputStream.html#write(%5BB) "write"), [write](https://docs.oracle.com/javase/8/docs/api/java/io/FilterOutputStream.html#write(int) "write"), [close](https://docs.oracle.com/javase/8/docs/api/java/io/FilterOutputStream.html#close() "close"), [nullOutputStream](https://docs.oracle.com/javase/8/docs/api/java/io/FilterOutputStream.html#nullOutputStream() "nullOutputStream"), [wait](https://docs.oracle.com/javase/8/docs/api/java/io/FilterOutputStream.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/io/FilterOutputStream.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/io/FilterOutputStream.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/io/FilterOutputStream.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/io/FilterOutputStream.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/io/FilterOutputStream.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/io/FilterOutputStream.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/io/FilterOutputStream.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/io/FilterOutputStream.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **SystemOutputInterceptor**([Closure](../../lang/closure) callback)
Constructor
**Parameters:**
`callback` - accepts the id of the target Console instance and a string to be sent to std out and returns a Boolean. If the return value is true, output will be sent to System.out, otherwise it will not.
### public **SystemOutputInterceptor**([Closure](../../lang/closure) callback, boolean output)
Constructor
**Parameters:**
`callback` - accepts the id of the target Console instance and a string to be sent to std out and returns a Boolean. If the return value is true, output will be sent to System.out/System.err, otherwise it will not.
`output` - flag that tells whether System.out needs capturing ot System.err
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected [Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer") **initialValue**()
### public void **removeConsoleId**()
Threads executing a script should call this method after execution completes in order to unregister the consoleId.
### public void **setConsoleId**(int consoleId)
Threads executing a script should call this method at the start of execution in order to set the id of the console that is hosting the thread of execution. This should be called prior to any output that is generated. The consoleId will be passed to the callback.
**Parameters:**
`consoleId` - id of the Console instance executing the script
### public void **start**()
Starts intercepting System.out/System.err
### public void **stop**()
Stops intercepting System.out/System.err, sending output to wherever it was going when this interceptor was created.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **write**(byte[] b, int off, int len)
Intercepts output - more common case of byte[]
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **write**(int b)
Intercepts output - single characters
groovy [Groovy] Class ConsoleIvyPlugin [Groovy] Class ConsoleIvyPlugin
===============================
* groovy.console.ui.ConsoleIvyPlugin
```
class ConsoleIvyPlugin
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Groovy Swing console. Adds Groovy Grape feedback (via an Ivy listener).
Properties Summary
------------------
Properties
| Type | Name and description |
| `**[Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>**` | `[downloadedArtifacts](#downloadedArtifacts)` |
| `**[Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>**` | `[resolvedDependencies](#resolvedDependencies)` |
| `**[Console](console)**` | `[savedConsole](#savedConsole)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[ConsoleIvyPlugin](#ConsoleIvyPlugin())**()` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[addListener](#addListener(groovy.console.ui.Console))**([Console](console) console)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Property Detail
---------------
###
[Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> **downloadedArtifacts**
###
[Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> **resolvedDependencies**
###
[Console](console) **savedConsole**
Constructor Detail
------------------
###
**ConsoleIvyPlugin**()
Method Detail
-------------
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **addListener**([Console](console) console)
groovy [Groovy] Class HistoryRecord [Groovy] Class HistoryRecord
============================
* groovy.console.ui.HistoryRecord
```
@[CompileStatic](../../transform/compilestatic "CompileStatic")
class HistoryRecord
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Properties Summary
------------------
Properties
| Type | Name and description |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[allText](#allText)` |
| `**[Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable")**` | `[exception](#exception)` |
| `**[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")**` | `[result](#result)` |
| `**[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[scriptName](#scriptName)` |
| `**int**` | `[selectionEnd](#selectionEnd)` |
| `**int**` | `[selectionStart](#selectionStart)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[HistoryRecord](#HistoryRecord())**()` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getTextToRun](#getTextToRun(boolean))**(boolean useSelection)` |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getValue](#getValue())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Property Detail
---------------
###
[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **allText**
###
[Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") **exception**
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **result**
###
[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **scriptName**
### int **selectionEnd**
### int **selectionStart**
Constructor Detail
------------------
###
**HistoryRecord**()
Method Detail
-------------
###
[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getTextToRun**(boolean useSelection)
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getValue**()
groovy [Groovy] Script ConsoleActions [Groovy] Script ConsoleActions
==============================
* groovy.console.ui.ConsoleActions
```
class ConsoleActions
extends [Script](../../lang/script)
```
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[ConsoleActions](#ConsoleActions())**()` |
| `**[ConsoleActions](#ConsoleActions(groovy.lang.Binding))**([Binding](../../lang/binding) context)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `static void` | `**[main](#main(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)` |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[run](#run())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Script](../../lang/script)` | `[evaluate](../../lang/script#evaluate(java.lang.String)), [evaluate](../../lang/script#evaluate(java.io.File)), [getBinding](../../lang/script#getBinding()), [getProperty](../../lang/script#getProperty(java.lang.String)), [invokeMethod](../../lang/script#invokeMethod(java.lang.String,%20java.lang.Object)), [print](../../lang/script#print(java.lang.Object)), [printf](../../lang/script#printf(java.lang.String,%20java.lang.Object)), [printf](../../lang/script#printf(java.lang.String,%20java.lang.Object)), [println](../../lang/script#println()), [println](../../lang/script#println(java.lang.Object)), [run](../../lang/script#run()), [run](../../lang/script#run(java.io.File,%20java.lang.String)), [setBinding](../../lang/script#setBinding(groovy.lang.Binding)), [setProperty](../../lang/script#setProperty(java.lang.String,%20java.lang.Object))` |
| `class [GroovyObjectSupport](../../lang/groovyobjectsupport)` | `[getMetaClass](../../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
###
**ConsoleActions**()
###
**ConsoleActions**([Binding](../../lang/binding) context)
Method Detail
-------------
### static void **main**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **run**()
| programming_docs |
groovy [Groovy] Class ButtonOrTextEditor [Groovy] Class ButtonOrTextEditor
=================================
* groovy.console.ui.ButtonOrTextEditor
All Implemented Interfaces and Traits: [TableCellEditor](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/TableCellEditor.html "TableCellEditor")
```
@[CompileStatic](../../transform/compilestatic "CompileStatic")
class ButtonOrTextEditor
extends [AbstractCellEditor](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractCellEditor.html "AbstractCellEditor")
implements [TableCellEditor](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/TableCellEditor.html "TableCellEditor")
```
A table cell editor that will return a button automatically if it is the cell value, a text field if the value exists, or null otherwise (non editable cell). This hack allows to interact with buttons in a cell.
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**protected [JComponent](https://docs.oracle.com/javase/8/docs/api/javax/swing/JComponent.html "JComponent")**` | `[editorComponent](#editorComponent)` | The Swing component being edited. |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[ButtonOrTextEditor](#ButtonOrTextEditor())**()` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getCellEditorValue](#getCellEditorValue())**()` |
| | `[Component](https://docs.oracle.com/javase/8/docs/api/java/awt/Component.html "Component")` | `**[getTableCellEditorComponent](#getTableCellEditorComponent(javax.swing.JTable,%20java.lang.Object,%20boolean,%20int,%20int))**([JTable](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTable.html "JTable") table, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value, boolean isSelected, int row, int column)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [AbstractCellEditor](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractCellEditor.html "AbstractCellEditor")` | `[isCellEditable](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractCellEditor.html#isCellEditable(java.util.EventObject) "isCellEditable"), [stopCellEditing](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractCellEditor.html#stopCellEditing() "stopCellEditing"), [addCellEditorListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractCellEditor.html#addCellEditorListener(javax.swing.event.CellEditorListener) "addCellEditorListener"), [cancelCellEditing](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractCellEditor.html#cancelCellEditing() "cancelCellEditing"), [removeCellEditorListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractCellEditor.html#removeCellEditorListener(javax.swing.event.CellEditorListener) "removeCellEditorListener"), [shouldSelectCell](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractCellEditor.html#shouldSelectCell(java.util.EventObject) "shouldSelectCell"), [getCellEditorListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractCellEditor.html#getCellEditorListeners() "getCellEditorListeners"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractCellEditor.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractCellEditor.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractCellEditor.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractCellEditor.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractCellEditor.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractCellEditor.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractCellEditor.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractCellEditor.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractCellEditor.html#notifyAll() "notifyAll"), [getCellEditorValue](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractCellEditor.html#getCellEditorValue() "getCellEditorValue")` |
Field Detail
------------
### protected [JComponent](https://docs.oracle.com/javase/8/docs/api/javax/swing/JComponent.html "JComponent") **editorComponent**
The Swing component being edited.
Constructor Detail
------------------
###
**ButtonOrTextEditor**()
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getCellEditorValue**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") [Component](https://docs.oracle.com/javase/8/docs/api/java/awt/Component.html "Component") **getTableCellEditorComponent**([JTable](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTable.html "JTable") table, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value, boolean isSelected, int row, int column)
groovy [Groovy] Class Console [Groovy] Class Console
======================
* groovy.console.ui.Console
All Implemented Interfaces and Traits:
[CaretListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/CaretListener.html "CaretListener"), [HyperlinkListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/HyperlinkListener.html "HyperlinkListener"), [ComponentListener](https://docs.oracle.com/javase/8/docs/api/java/awt/event/ComponentListener.html "ComponentListener"), [FocusListener](https://docs.oracle.com/javase/8/docs/api/java/awt/event/FocusListener.html "FocusListener")
```
class Console
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [CaretListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/CaretListener.html "CaretListener"), [HyperlinkListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/HyperlinkListener.html "HyperlinkListener"), [ComponentListener](https://docs.oracle.com/javase/8/docs/api/java/awt/event/ComponentListener.html "ComponentListener"), [FocusListener](https://docs.oracle.com/javase/8/docs/api/java/awt/event/FocusListener.html "FocusListener")
```
Groovy Swing console. Allows user to interactively enter and execute Groovy.
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL")**` | `[ICON\_PATH](#ICON_PATH)` | |
| `**static [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL")**` | `[NODE\_ICON\_PATH](#NODE_ICON_PATH)` | |
Properties Summary
------------------
Properties
| Type | Name and description |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[DEFAULT\_SCRIPT\_NAME\_START](#DEFAULT_SCRIPT_NAME_START)` |
| `**[Closure](../../lang/closure "Closure")**` | `[afterExecution](#afterExecution)` |
| `**boolean**` | `[autoClearOutput](#autoClearOutput)` |
| `**[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[autoClearOutputAction](#autoClearOutputAction)` |
| `**[CompilerConfiguration](../../../org/codehaus/groovy/control/compilerconfiguration)**` | `[baseConfig](#baseConfig)` |
| `**[Closure](../../lang/closure "Closure")**` | `[beforeExecution](#beforeExecution)` |
| `**[Component](https://docs.oracle.com/javase/8/docs/api/java/awt/Component.html "Component")**` | `[blank](#blank)` |
| `**static boolean**` | `[captureStdErr](#captureStdErr)` |
| `**static boolean**` | `[captureStdOut](#captureStdOut)` |
| `**int**` | `[colNum](#colNum)` |
| `**[Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style")**` | `[commandStyle](#commandStyle)` |
| `**[CompilerConfiguration](../../../org/codehaus/groovy/control/compilerconfiguration)**` | `[config](#config)` |
| `**static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")**` | `[consoleControllers](#consoleControllers)` |
| `**[ConsolePreferences](consolepreferences)**` | `[consolePreferences](#consolePreferences)` |
| `**[Component](https://docs.oracle.com/javase/8/docs/api/java/awt/Component.html "Component")**` | `[copyFromComponent](#copyFromComponent)` |
| `**[File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File")**` | `[currentClasspathDir](#currentClasspathDir)` |
| `**[File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File")**` | `[currentClasspathJarDir](#currentClasspathJarDir)` |
| `**[File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File")**` | `[currentFileChooserDir](#currentFileChooserDir)` |
| `**int**` | `[cursorPos](#cursorPos)` |
| `**boolean**` | `[detachedOutput](#detachedOutput)` |
| `**[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[detachedOutputAction](#detachedOutputAction)` |
| `**boolean**` | `[dirty](#dirty)` |
| `**[RootPaneContainer](https://docs.oracle.com/javase/8/docs/api/javax/swing/RootPaneContainer.html "RootPaneContainer")**` | `[frame](#frame)` |
| `**static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")**` | `[frameConsoleDelegates](#frameConsoleDelegates)` |
| `**boolean**` | `[fullStackTraces](#fullStackTraces)` |
| `**[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[fullStackTracesAction](#fullStackTracesAction)` |
| `**static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")**` | `[groovyFileFilter](#groovyFileFilter)` |
| `**[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[hideOutputWindowAction1](#hideOutputWindowAction1)` |
| `**[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[hideOutputWindowAction2](#hideOutputWindowAction2)` |
| `**[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[hideOutputWindowAction3](#hideOutputWindowAction3)` |
| `**[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[hideOutputWindowAction4](#hideOutputWindowAction4)` |
| `**[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")**` | `[history](#history)` |
| `**int**` | `[historyIndex](#historyIndex)` |
| `**[Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style")**` | `[hyperlinkStyle](#hyperlinkStyle)` |
| `**[JTextPane](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html "JTextPane")**` | `[inputArea](#inputArea)` |
| `**int**` | `[inputAreaContentHash](#inputAreaContentHash)` |
| `**[ConsoleTextEditor](consoletexteditor)**` | `[inputEditor](#inputEditor)` |
| `**[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[interruptAction](#interruptAction)` |
| `**boolean**` | `[loopMode](#loopMode)` |
| `**[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[loopModeAction](#loopModeAction)` |
| `**int**` | `[maxHistory](#maxHistory)` |
| `**int**` | `[maxOutputChars](#maxOutputChars)` |
| `**[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[nextHistoryAction](#nextHistoryAction)` |
| `**boolean**` | `[orientationVertical](#orientationVertical)` |
| `**[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[orientationVerticalAction](#orientationVerticalAction)` |
| `**int**` | `[origDividerSize](#origDividerSize)` |
| `**[JTextPane](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html "JTextPane")**` | `[outputArea](#outputArea)` |
| `**[PrintWriter](https://docs.oracle.com/javase/8/docs/api/java/io/PrintWriter.html "PrintWriter")**` | `[outputPrintWriter](#outputPrintWriter)` |
| `**[Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style")**` | `[outputStyle](#outputStyle)` |
| `**[Component](https://docs.oracle.com/javase/8/docs/api/java/awt/Component.html "Component")**` | `[outputWindow](#outputWindow)` |
| `**[HistoryRecord](historyrecord)**` | `[pendingRecord](#pendingRecord)` |
| `**[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[prevHistoryAction](#prevHistoryAction)` |
| `**[Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style")**` | `[promptStyle](#promptStyle)` |
| `**[Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style")**` | `[resultStyle](#resultStyle)` |
| `**[Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element")**` | `[rootElement](#rootElement)` |
| `**int**` | `[rowNum](#rowNum)` |
| `**[JLabel](https://docs.oracle.com/javase/8/docs/api/javax/swing/JLabel.html "JLabel")**` | `[rowNumAndColNum](#rowNumAndColNum)` |
| `**[Thread](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html "Thread")**` | `[runThread](#runThread)` |
| `**[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[saveAction](#saveAction)` |
| `**boolean**` | `[saveOnRun](#saveOnRun)` |
| `**[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[saveOnRunAction](#saveOnRunAction)` |
| `**[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")**` | `[scriptFile](#scriptFile)` |
| `**int**` | `[scriptNameCounter](#scriptNameCounter)` |
| `**boolean**` | `[scriptRunning](#scriptRunning)` |
| `**[Component](https://docs.oracle.com/javase/8/docs/api/java/awt/Component.html "Component")**` | `[scrollArea](#scrollArea)` |
| `**[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[selectPreviousWordAction](#selectPreviousWordAction)` |
| `**[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[selectWordAction](#selectWordAction)` |
| `**[GroovyShell](../../lang/groovyshell "GroovyShell")**` | `[shell](#shell)` |
| `**[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[showOutputWindowAction](#showOutputWindowAction)` |
| `**boolean**` | `[showScriptInOutput](#showScriptInOutput)` |
| `**[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[showScriptInOutputAction](#showScriptInOutputAction)` |
| `**boolean**` | `[showToolbar](#showToolbar)` |
| `**[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[showToolbarAction](#showToolbarAction)` |
| `**static boolean**` | `[smartHighlighter](#smartHighlighter)` |
| `**[JSplitPane](https://docs.oracle.com/javase/8/docs/api/javax/swing/JSplitPane.html "JSplitPane")**` | `[splitPane](#splitPane)` |
| `**boolean**` | `[stackOverFlowError](#stackOverFlowError)` |
| `**[Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style")**` | `[stacktraceStyle](#stacktraceStyle)` |
| `**[JLabel](https://docs.oracle.com/javase/8/docs/api/javax/swing/JLabel.html "JLabel")**` | `[statusLabel](#statusLabel)` |
| `**[SwingBuilder](../../swing/swingbuilder)**` | `[swing](#swing)` |
| `**[SystemOutputInterceptor](systemoutputinterceptor)**` | `[systemErrorInterceptor](#systemErrorInterceptor)` |
| `**[SystemOutputInterceptor](systemoutputinterceptor)**` | `[systemOutInterceptor](#systemOutInterceptor)` |
| `**int**` | `[textSelectionEnd](#textSelectionEnd)` |
| `**int**` | `[textSelectionStart](#textSelectionStart)` |
| `**boolean**` | `[threadInterrupt](#threadInterrupt)` |
| `**[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[threadInterruptAction](#threadInterruptAction)` |
| `**[Component](https://docs.oracle.com/javase/8/docs/api/java/awt/Component.html "Component")**` | `[toolbar](#toolbar)` |
| `**boolean**` | `[useScriptClassLoaderForScriptExecution](#useScriptClassLoaderForScriptExecution)` |
| `**boolean**` | `[visualizeScriptResults](#visualizeScriptResults)` |
| `**[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[visualizeScriptResultsAction](#visualizeScriptResultsAction)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Console](#Console(groovy.lang.Binding))**([Binding](../../lang/binding) binding)` |
| `**[Console](#Console(java.lang.ClassLoader,%20groovy.lang.Binding,%20org.codehaus.groovy.control.CompilerConfiguration))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parent, [Binding](../../lang/binding) binding, [CompilerConfiguration](../../../org/codehaus/groovy/control/compilerconfiguration) baseConfig)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `void` | `**[addClasspathDir](#addClasspathDir(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[addClasspathJar](#addClasspathJar(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[addToHistory](#addToHistory(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") record)` |
| | `void` | `**[appendOutput](#appendOutput(java.lang.String,%20javax.swing.text.AttributeSet))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text, [AttributeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/AttributeSet.html "AttributeSet") style)` |
| | `void` | `**[appendOutput](#appendOutput(java.awt.Window,%20javax.swing.text.AttributeSet))**([Window](https://docs.oracle.com/javase/8/docs/api/java/awt/Window.html "Window") window, [AttributeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/AttributeSet.html "AttributeSet") style)` |
| | `void` | `**[appendOutput](#appendOutput(java.lang.Object,%20javax.swing.text.AttributeSet))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [AttributeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/AttributeSet.html "AttributeSet") style)` |
| | `void` | `**[appendOutput](#appendOutput(java.awt.Component,%20javax.swing.text.AttributeSet))**([Component](https://docs.oracle.com/javase/8/docs/api/java/awt/Component.html "Component") component, [AttributeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/AttributeSet.html "AttributeSet") style)` |
| | `void` | `**[appendOutput](#appendOutput(javax.swing.Icon,%20javax.swing.text.AttributeSet))**([Icon](https://docs.oracle.com/javase/8/docs/api/javax/swing/Icon.html "Icon") icon, [AttributeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/AttributeSet.html "AttributeSet") style)` |
| | `void` | `**[appendOutputLines](#appendOutputLines(java.lang.Object,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") text, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") style)` |
| | `void` | `**[appendOutputNl](#appendOutputNl(java.lang.Object,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") text, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") style)` |
| | `void` | `**[appendStacktrace](#appendStacktrace(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") text)` |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[askToInterruptScript](#askToInterruptScript())**()` |
| | `boolean` | `**[askToSaveFile](#askToSaveFile())**()` |
| | `void` | `**[autoClearOutput](#autoClearOutput(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[beep](#beep())**()` |
| | `void` | `**[bindResults](#bindResults())**()` |
| | `static void` | `**[captureStdErr](#captureStdErr(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `static void` | `**[captureStdOut](#captureStdOut(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[caretUpdate](#caretUpdate(javax.swing.event.CaretEvent))**([CaretEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/CaretEvent.html "CaretEvent") e)` |
| | `void` | `**[clearContext](#clearContext(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[clearOutput](#clearOutput(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[closeOutputPrintWriter](#closeOutputPrintWriter())**()` |
| | `void` | `**[comment](#comment(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[compileAsJava](#compileAsJava(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[compileFinishNormal](#compileFinishNormal())**()` |
| | `void` | `**[compileScript](#compileScript(java.util.EventObject,%20groovy.console.ui.Console.SourceType))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt, [Console.SourceType](console.sourcetype) st)` |
| | `void` | `**[componentHidden](#componentHidden(java.awt.event.ComponentEvent))**([ComponentEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/ComponentEvent.html "ComponentEvent") e)` |
| | `void` | `**[componentMoved](#componentMoved(java.awt.event.ComponentEvent))**([ComponentEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/ComponentEvent.html "ComponentEvent") e)` |
| | `void` | `**[componentResized](#componentResized(java.awt.event.ComponentEvent))**([ComponentEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/ComponentEvent.html "ComponentEvent") e)` |
| | `void` | `**[componentShown](#componentShown(java.awt.event.ComponentEvent))**([ComponentEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/ComponentEvent.html "ComponentEvent") e)` |
| | `void` | `**[copy](#copy(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[createOutputPrintWriter](#createOutputPrintWriter(java.io.File))**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") outputFile)` |
| | `void` | `**[cut](#cut(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[detachedOutput](#detachedOutput(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[doInterrupt](#doInterrupt(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `int` | `**[dot](#dot(javax.swing.event.CaretEvent))**([CaretEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/CaretEvent.html "CaretEvent") e)` |
| | `boolean` | `**[exit](#exit(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[exitDesktop](#exitDesktop(java.util.EventObject,%20java.lang.Object))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") quitResponse)` |
| | `void` | `**[fileNewFile](#fileNewFile(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[fileNewWindow](#fileNewWindow(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[fileOpen](#fileOpen(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `boolean` | `**[fileSave](#fileSave(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `boolean` | `**[fileSaveAs](#fileSaveAs(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[find](#find(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[findNext](#findNext(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[findPrevious](#findPrevious(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[finishException](#finishException(java.lang.Throwable,%20boolean))**([Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") t, boolean executing)` |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[finishNormal](#finishNormal(java.lang.Object,%20java.lang.Long))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") result, [Long](https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html "Long") elapsedTime)` |
| | `void` | `**[focusGained](#focusGained(java.awt.event.FocusEvent))**([FocusEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/FocusEvent.html "FocusEvent") e)` |
| | `void` | `**[focusLost](#focusLost(java.awt.event.FocusEvent))**([FocusEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/FocusEvent.html "FocusEvent") e)` |
| | `void` | `**[fullStackTraces](#fullStackTraces(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `int` | `**[getConsoleId](#getConsoleId())**()` |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getLastResult](#getLastResult())**()` |
| | `void` | `**[hideAndClearOutputWindow](#hideAndClearOutputWindow(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[hideOutputWindow](#hideOutputWindow(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[historyNext](#historyNext(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[historyPrev](#historyPrev(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[hyperlinkUpdate](#hyperlinkUpdate(javax.swing.event.HyperlinkEvent))**([HyperlinkEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/HyperlinkEvent.html "HyperlinkEvent") e)` |
| | `void` | `**[insertString](#insertString(javax.swing.text.Document,%20int,%20java.lang.String,%20javax.swing.text.AttributeSet,%20boolean))**([Document](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Document.html "Document") doc, int offset, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text, [AttributeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/AttributeSet.html "AttributeSet") attributeSet, boolean outputToFile)` |
| | `void` | `**[inspectAst](#inspectAst(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[inspectCst](#inspectCst(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[inspectLast](#inspectLast(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[inspectTokens](#inspectTokens(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[inspectVariables](#inspectVariables(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[installInterceptor](#installInterceptor())**()` |
| | `void` | `**[invokeTextAction](#invokeTextAction(java.lang.Object,%20java.lang.Object,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") evt, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") closure, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") area)` |
| | `void` | `**[largerFont](#largerFont(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[listClasspath](#listClasspath(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `int` | `**[loadMaxOutputChars](#loadMaxOutputChars())**()` |
| | `void` | `**[loadScriptFile](#loadScriptFile(java.io.File))**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file)` |
| | `void` | `**[loopMode](#loopMode(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `static void` | `**[main](#main(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)` |
| | `int` | `**[mark](#mark(javax.swing.event.CaretEvent))**([CaretEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/CaretEvent.html "CaretEvent") e)` |
| | `void` | `**[newScript](#newScript(java.lang.ClassLoader,%20groovy.lang.Binding))**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parent, [Binding](../../lang/binding) binding)` |
| | `static boolean` | `**[notifySystemErr](#notifySystemErr(int,%20java.lang.String))**(int consoleId, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str)` |
| | `static boolean` | `**[notifySystemOut](#notifySystemOut(int,%20java.lang.String))**(int consoleId, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str)` |
| | `void` | `**[orientationVertical](#orientationVertical(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[paste](#paste(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[preferences](#preferences(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[print](#print(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[redo](#redo(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[replace](#replace(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[run](#run())**()` |
| | `void` | `**[run](#run(java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") defaults)` |
| | `void` | `**[runJava](#runJava(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[runScript](#runScript(java.util.EventObject,%20groovy.console.ui.Console.SourceType))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt, [Console.SourceType](console.sourcetype) st)` |
| | `void` | `**[runSelectedJava](#runSelectedJava(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[runSelectedScript](#runSelectedScript(java.util.EventObject,%20groovy.console.ui.Console.SourceType))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt, [Console.SourceType](console.sourcetype) st)` |
| | `void` | `**[saveOnRun](#saveOnRun(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[selectAll](#selectAll(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[selectBlock](#selectBlock(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[selectFilename](#selectFilename(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") name)` |
| | `void` | `**[setDirty](#setDirty(boolean))**(boolean newDirty)` |
| | `void` | `**[setOutputPreferences](#setOutputPreferences(boolean,%20java.io.File))**(boolean useOutputFile, [File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") outputFile)` |
| | `void` | `**[setRowNumAndColNum](#setRowNumAndColNum())**()` |
| | `void` | `**[setVariable](#setVariable(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `void` | `**[showAbout](#showAbout(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[showCompilingMessage](#showCompilingMessage())**()` |
| | `void` | `**[showExecutingMessage](#showExecutingMessage())**()` |
| | `void` | `**[showMessage](#showMessage(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message)` |
| | `void` | `**[showOutputWindow](#showOutputWindow(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[showScriptInOutput](#showScriptInOutput(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[showToolbar](#showToolbar(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[smallerFont](#smallerFont(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[smartHighlighter](#smartHighlighter(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[threadInterruption](#threadInterruption(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[undo](#undo(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[updateTitle](#updateTitle())**()` |
| | `void` | `**[visualizeScriptResults](#visualizeScriptResults(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### public static [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") **ICON\_PATH**
### public static [URL](https://docs.oracle.com/javase/8/docs/api/java/net/URL.html "URL") **NODE\_ICON\_PATH**
Property Detail
---------------
### static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **DEFAULT\_SCRIPT\_NAME\_START**
###
[Closure](../../lang/closure "Closure") **afterExecution**
### boolean **autoClearOutput**
###
[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **autoClearOutputAction**
###
[CompilerConfiguration](../../../org/codehaus/groovy/control/compilerconfiguration) **baseConfig**
###
[Closure](../../lang/closure "Closure") **beforeExecution**
###
[Component](https://docs.oracle.com/javase/8/docs/api/java/awt/Component.html "Component") **blank**
### static boolean **captureStdErr**
### static boolean **captureStdOut**
### int **colNum**
###
[Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style") **commandStyle**
###
[CompilerConfiguration](../../../org/codehaus/groovy/control/compilerconfiguration) **config**
### static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **consoleControllers**
###
[ConsolePreferences](consolepreferences) **consolePreferences**
###
[Component](https://docs.oracle.com/javase/8/docs/api/java/awt/Component.html "Component") **copyFromComponent**
###
[File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") **currentClasspathDir**
###
[File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") **currentClasspathJarDir**
###
[File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") **currentFileChooserDir**
### int **cursorPos**
### boolean **detachedOutput**
###
[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **detachedOutputAction**
### boolean **dirty**
###
[RootPaneContainer](https://docs.oracle.com/javase/8/docs/api/javax/swing/RootPaneContainer.html "RootPaneContainer") **frame**
### static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **frameConsoleDelegates**
### boolean **fullStackTraces**
###
[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **fullStackTracesAction**
### static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **groovyFileFilter**
###
[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **hideOutputWindowAction1**
###
[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **hideOutputWindowAction2**
###
[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **hideOutputWindowAction3**
###
[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **hideOutputWindowAction4**
###
[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") **history**
### int **historyIndex**
###
[Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style") **hyperlinkStyle**
###
[JTextPane](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html "JTextPane") **inputArea**
### int **inputAreaContentHash**
###
[ConsoleTextEditor](consoletexteditor) **inputEditor**
###
[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **interruptAction**
### boolean **loopMode**
###
[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **loopModeAction**
### int **maxHistory**
### int **maxOutputChars**
###
[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **nextHistoryAction**
### boolean **orientationVertical**
###
[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **orientationVerticalAction**
### int **origDividerSize**
###
[JTextPane](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html "JTextPane") **outputArea**
###
[PrintWriter](https://docs.oracle.com/javase/8/docs/api/java/io/PrintWriter.html "PrintWriter") **outputPrintWriter**
###
[Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style") **outputStyle**
###
[Component](https://docs.oracle.com/javase/8/docs/api/java/awt/Component.html "Component") **outputWindow**
###
[HistoryRecord](historyrecord) **pendingRecord**
###
[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **prevHistoryAction**
###
[Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style") **promptStyle**
###
[Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style") **resultStyle**
###
[Element](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Element.html "Element") **rootElement**
### int **rowNum**
###
[JLabel](https://docs.oracle.com/javase/8/docs/api/javax/swing/JLabel.html "JLabel") **rowNumAndColNum**
###
[Thread](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html "Thread") **runThread**
###
[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **saveAction**
### boolean **saveOnRun**
###
[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **saveOnRunAction**
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **scriptFile**
### int **scriptNameCounter**
### boolean **scriptRunning**
###
[Component](https://docs.oracle.com/javase/8/docs/api/java/awt/Component.html "Component") **scrollArea**
###
[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **selectPreviousWordAction**
###
[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **selectWordAction**
###
[GroovyShell](../../lang/groovyshell "GroovyShell") **shell**
###
[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **showOutputWindowAction**
### boolean **showScriptInOutput**
###
[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **showScriptInOutputAction**
### boolean **showToolbar**
###
[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **showToolbarAction**
### static boolean **smartHighlighter**
###
[JSplitPane](https://docs.oracle.com/javase/8/docs/api/javax/swing/JSplitPane.html "JSplitPane") **splitPane**
### boolean **stackOverFlowError**
###
[Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style") **stacktraceStyle**
###
[JLabel](https://docs.oracle.com/javase/8/docs/api/javax/swing/JLabel.html "JLabel") **statusLabel**
###
[SwingBuilder](../../swing/swingbuilder) **swing**
###
[SystemOutputInterceptor](systemoutputinterceptor) **systemErrorInterceptor**
###
[SystemOutputInterceptor](systemoutputinterceptor) **systemOutInterceptor**
### int **textSelectionEnd**
### int **textSelectionStart**
### boolean **threadInterrupt**
###
[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **threadInterruptAction**
###
[Component](https://docs.oracle.com/javase/8/docs/api/java/awt/Component.html "Component") **toolbar**
### boolean **useScriptClassLoaderForScriptExecution**
### boolean **visualizeScriptResults**
###
[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **visualizeScriptResultsAction**
Constructor Detail
------------------
###
**Console**([Binding](../../lang/binding) binding)
###
**Console**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parent, [Binding](../../lang/binding) binding, [CompilerConfiguration](../../../org/codehaus/groovy/control/compilerconfiguration) baseConfig)
Method Detail
-------------
### void **addClasspathDir**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **addClasspathJar**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **addToHistory**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") record)
### void **appendOutput**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text, [AttributeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/AttributeSet.html "AttributeSet") style)
### void **appendOutput**([Window](https://docs.oracle.com/javase/8/docs/api/java/awt/Window.html "Window") window, [AttributeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/AttributeSet.html "AttributeSet") style)
### void **appendOutput**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object, [AttributeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/AttributeSet.html "AttributeSet") style)
### void **appendOutput**([Component](https://docs.oracle.com/javase/8/docs/api/java/awt/Component.html "Component") component, [AttributeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/AttributeSet.html "AttributeSet") style)
### void **appendOutput**([Icon](https://docs.oracle.com/javase/8/docs/api/javax/swing/Icon.html "Icon") icon, [AttributeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/AttributeSet.html "AttributeSet") style)
### void **appendOutputLines**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") text, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") style)
### void **appendOutputNl**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") text, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") style)
### void **appendStacktrace**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") text)
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **askToInterruptScript**()
### boolean **askToSaveFile**()
### void **autoClearOutput**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **beep**()
### void **bindResults**()
### static void **captureStdErr**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### static void **captureStdOut**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **caretUpdate**([CaretEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/CaretEvent.html "CaretEvent") e)
### void **clearContext**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **clearOutput**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **closeOutputPrintWriter**()
### void **comment**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **compileAsJava**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **compileFinishNormal**()
### void **compileScript**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt, [Console.SourceType](console.sourcetype) st)
### void **componentHidden**([ComponentEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/ComponentEvent.html "ComponentEvent") e)
### void **componentMoved**([ComponentEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/ComponentEvent.html "ComponentEvent") e)
### void **componentResized**([ComponentEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/ComponentEvent.html "ComponentEvent") e)
### void **componentShown**([ComponentEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/ComponentEvent.html "ComponentEvent") e)
### void **copy**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **createOutputPrintWriter**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") outputFile)
### void **cut**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **detachedOutput**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **doInterrupt**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### @[CompileStatic](../../transform/compilestatic "CompileStatic") int **dot**([CaretEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/CaretEvent.html "CaretEvent") e)
### boolean **exit**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **exitDesktop**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") quitResponse)
### void **fileNewFile**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **fileNewWindow**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **fileOpen**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### boolean **fileSave**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### boolean **fileSaveAs**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **find**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **findNext**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **findPrevious**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **finishException**([Throwable](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html "Throwable") t, boolean executing)
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **finishNormal**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") result, [Long](https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html "Long") elapsedTime)
### void **focusGained**([FocusEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/FocusEvent.html "FocusEvent") e)
### void **focusLost**([FocusEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/FocusEvent.html "FocusEvent") e)
### void **fullStackTraces**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### int **getConsoleId**()
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getLastResult**()
### void **hideAndClearOutputWindow**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **hideOutputWindow**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **historyNext**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **historyPrev**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **hyperlinkUpdate**([HyperlinkEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/HyperlinkEvent.html "HyperlinkEvent") e)
### void **insertString**([Document](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Document.html "Document") doc, int offset, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text, [AttributeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/AttributeSet.html "AttributeSet") attributeSet, boolean outputToFile)
### void **inspectAst**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### @[CompileStatic](../../transform/compilestatic "CompileStatic") void **inspectCst**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **inspectLast**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **inspectTokens**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **inspectVariables**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **installInterceptor**()
### void **invokeTextAction**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") evt, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") closure, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") area)
### void **largerFont**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **listClasspath**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### int **loadMaxOutputChars**()
### void **loadScriptFile**([File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") file)
### void **loopMode**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### static void **main**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
### @[CompileStatic](../../transform/compilestatic "CompileStatic") int **mark**([CaretEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/CaretEvent.html "CaretEvent") e)
### void **newScript**([ClassLoader](https://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html "ClassLoader") parent, [Binding](../../lang/binding) binding)
### static boolean **notifySystemErr**(int consoleId, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str)
### static boolean **notifySystemOut**(int consoleId, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") str)
### void **orientationVertical**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **paste**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **preferences**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **print**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **redo**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **replace**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **run**()
### void **run**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") defaults)
### void **runJava**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **runScript**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt, [Console.SourceType](console.sourcetype) st)
### void **runSelectedJava**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **runSelectedScript**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt, [Console.SourceType](console.sourcetype) st)
### void **saveOnRun**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **selectAll**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **selectBlock**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **selectFilename**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") name)
### void **setDirty**(boolean newDirty)
### void **setOutputPreferences**(boolean useOutputFile, [File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") outputFile)
### void **setRowNumAndColNum**()
### void **setVariable**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### void **showAbout**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **showCompilingMessage**()
### void **showExecutingMessage**()
### void **showMessage**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") message)
### void **showOutputWindow**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **showScriptInOutput**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **showToolbar**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **smallerFont**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **smartHighlighter**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **threadInterruption**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **undo**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **updateTitle**()
### void **visualizeScriptResults**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
| programming_docs |
groovy [Groovy] Class AstBrowser [Groovy] Class AstBrowser
=========================
* groovy.console.ui.AstBrowser
```
class AstBrowser
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
This object is a GUI for looking at the AST that Groovy generates. Usage: java groovy.console.ui.AstBrowser [filename] where [filename] is an existing Groovy script.
Properties Summary
------------------
Properties
| Type | Name and description |
| `**groovy.console.ui.GeneratedBytecodeAwareGroovyClassLoader**` | `[classLoader](#classLoader)` |
| `**[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")**` | `[frame](#frame)` |
| `**[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")**` | `[prefs](#prefs)` |
| `**[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[refreshAction](#refreshAction)` |
| `**boolean**` | `[showClosureClasses](#showClosureClasses)` |
| `**boolean**` | `[showScriptClass](#showScriptClass)` |
| `**boolean**` | `[showScriptFreeForm](#showScriptFreeForm)` |
| `**boolean**` | `[showTreeView](#showTreeView)` |
| `**[SwingBuilder](../../swing/swingbuilder)**` | `[swing](#swing)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[AstBrowser](#AstBrowser(java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") inputArea, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") rootElement, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") classLoader, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") config)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `void` | `**[compile](#compile(java.lang.Object,%20java.lang.String,%20int))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") jTree, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") script, int compilePhase)` |
| | `void` | `**[decompile](#decompile(java.lang.Object,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") phaseId, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") source)` |
| | `void` | `**[initAuxViews](#initAuxViews())**()` |
| | `void` | `**[largerFont](#largerFont(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `static void` | `**[main](#main(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)` |
| | `void` | `**[run](#run(groovy.lang.Closure))**([Closure](../../lang/closure) script)` |
| | `void` | `**[run](#run(groovy.lang.Closure,%20java.lang.String))**([Closure](../../lang/closure) script, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)` |
| | `void` | `**[showAbout](#showAbout(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[showClosureClasses](#showClosureClasses(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[showScriptClass](#showScriptClass(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[showScriptFreeForm](#showScriptFreeForm(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[showTreeView](#showTreeView(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
| | `void` | `**[smallerFont](#smallerFont(java.util.EventObject))**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Property Detail
---------------
### groovy.console.ui.GeneratedBytecodeAwareGroovyClassLoader **classLoader**
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **frame**
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **prefs**
###
[Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **refreshAction**
### boolean **showClosureClasses**
### boolean **showScriptClass**
### boolean **showScriptFreeForm**
### boolean **showTreeView**
###
[SwingBuilder](../../swing/swingbuilder) **swing**
Constructor Detail
------------------
###
**AstBrowser**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") inputArea, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") rootElement, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") classLoader, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") config)
Method Detail
-------------
### void **compile**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") jTree, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") script, int compilePhase)
### void **decompile**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") phaseId, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") source)
### void **initAuxViews**()
### void **largerFont**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### static void **main**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
### void **run**([Closure](../../lang/closure) script)
### void **run**([Closure](../../lang/closure) script, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name)
### void **showAbout**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **showClosureClasses**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **showScriptClass**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **showScriptFreeForm**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **showTreeView**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
### void **smallerFont**([EventObject](https://docs.oracle.com/javase/8/docs/api/java/util/EventObject.html "EventObject") evt)
groovy [Java] Class ConsoleSupport [Java] Class ConsoleSupport
===========================
* groovy.console.ui.ConsoleSupport
```
public abstract class ConsoleSupport
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Base class for console
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `protected void` | `**[addStylesToDocument](#addStylesToDocument(javax.swing.JTextPane))**([JTextPane](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html "JTextPane") outputArea)` |
| | `protected [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[evaluate](#evaluate(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text)` |
| | `public [Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style")` | `**[getCommandStyle](#getCommandStyle())**()` |
| | `public [Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style")` | `**[getOutputStyle](#getOutputStyle())**()` |
| | `public [Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style")` | `**[getPromptStyle](#getPromptStyle())**()` |
| | `public [GroovyShell](../../lang/groovyshell)` | `**[getShell](#getShell())**()` |
| | `protected abstract void` | `**[handleException](#handleException(java.lang.String,%20java.lang.Exception))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text, [Exception](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html "Exception") e)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### protected void **addStylesToDocument**([JTextPane](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html "JTextPane") outputArea)
### protected [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **evaluate**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text)
### public [Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style") **getCommandStyle**()
### public [Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style") **getOutputStyle**()
### public [Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style") **getPromptStyle**()
### public [GroovyShell](../../lang/groovyshell) **getShell**()
### protected abstract void **handleException**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text, [Exception](https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html "Exception") e)
groovy [Groovy] Class ScriptToTreeNodeAdapter [Groovy] Class ScriptToTreeNodeAdapter
======================================
* groovy.console.ui.ScriptToTreeNodeAdapter
```
class ScriptToTreeNodeAdapter
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
This class controls the conversion from a Groovy script as a String into a tree representation of the AST of that script. The script itself will be a tree node, and each class in the script will be a tree node. The conversion creates tree nodes for any concrete class found within an AST visitor. So, if a tree node should be shown once for each ASTNode and the parent types will not appear as nodes. Custom subclasses of expression types will not appear in the tree. The String label of a tree node is defined by classname in AstBrowserProperties.properties.
Properties Summary
------------------
Properties
| Type | Name and description |
| `**[GroovyClassLoader](../../lang/groovyclassloader "GroovyClassLoader")**` | `[classLoader](#classLoader)` |
| `**static [Properties](https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html "Properties")**` | `[classNameToStringForm](#classNameToStringForm)` |
| `**groovy.console.ui.AstBrowserNodeMaker**` | `[nodeMaker](#nodeMaker)` |
| `**boolean**` | `[showClosureClasses](#showClosureClasses)` |
| `**boolean**` | `[showScriptClass](#showScriptClass)` |
| `**boolean**` | `[showScriptFreeForm](#showScriptFreeForm)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[ScriptToTreeNodeAdapter](#ScriptToTreeNodeAdapter(java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") classLoader, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") showScriptFreeForm, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") showScriptClass, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") showClosureClasses, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") nodeMaker, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") config)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[compile](#compile(java.lang.String,%20int))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") script, int compilePhase)`Performs the conversion from script to TreeNode. |
| | `void` | `**[extendMethodNodePropertyTable](#extendMethodNodePropertyTable(List,%20org.codehaus.groovy.ast.MethodNode))**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>> table, [MethodNode](../../../org/codehaus/groovy/ast/methodnode) node)`Extends the method node property table by adding custom properties. |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[make](#make(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") node)` |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[make](#make(org.codehaus.groovy.ast.MethodNode))**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node)` |
| | `[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Property Detail
---------------
### final [GroovyClassLoader](../../lang/groovyclassloader "GroovyClassLoader") **classLoader**
### static [Properties](https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html "Properties") **classNameToStringForm**
### final groovy.console.ui.AstBrowserNodeMaker **nodeMaker**
### boolean **showClosureClasses**
### boolean **showScriptClass**
### boolean **showScriptFreeForm**
Constructor Detail
------------------
###
**ScriptToTreeNodeAdapter**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") classLoader, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") showScriptFreeForm, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") showScriptClass, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") showClosureClasses, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") nodeMaker, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") config)
Method Detail
-------------
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **compile**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") script, int compilePhase)
Performs the conversion from script to TreeNode.
**Parameters:**
`script` - a Groovy script in String form
`compilePhase` - the int based CompilePhase to compile it to.
### void **extendMethodNodePropertyTable**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>> table, [MethodNode](../../../org/codehaus/groovy/ast/methodnode) node)
Extends the method node property table by adding custom properties.
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **make**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") node)
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **make**([MethodNode](../../../org/codehaus/groovy/ast/methodnode) node)
### @[CompileStatic](../../transform/compilestatic "CompileStatic") [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)
groovy [Groovy] Class ButtonOrDefaultRenderer [Groovy] Class ButtonOrDefaultRenderer
======================================
* groovy.console.ui.ButtonOrDefaultRenderer
```
@[CompileStatic](../../transform/compilestatic "CompileStatic")
class ButtonOrDefaultRenderer
extends [DefaultTableCellRenderer](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html "DefaultTableCellRenderer")
```
A table cell renderer that will return a component instead of drawing it, or call the default in the case of a non component object. This hack allows to render a button shape in a table cell.
Inherited fields
| Fields inherited from class | Fields |
| **`class [DefaultTableCellRenderer](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html "DefaultTableCellRenderer")`** | `CENTER, TOP, LEFT, BOTTOM, RIGHT, NORTH, NORTH_EAST, EAST, SOUTH_EAST, SOUTH, SOUTH_WEST, WEST, NORTH_WEST, HORIZONTAL, VERTICAL, LEADING, TRAILING, NEXT, PREVIOUS, WHEN_FOCUSED, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_WINDOW, UNDEFINED_CONDITION, TOOL_TIP_TEXT_KEY, TOP_ALIGNMENT, CENTER_ALIGNMENT, BOTTOM_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, WIDTH, HEIGHT, PROPERTIES, SOMEBITS, FRAMEBITS, ALLBITS, ERROR, ABORT` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[ButtonOrDefaultRenderer](#ButtonOrDefaultRenderer())**()` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `[Component](https://docs.oracle.com/javase/8/docs/api/java/awt/Component.html "Component")` | `**[getTableCellRendererComponent](#getTableCellRendererComponent(javax.swing.JTable,%20java.lang.Object,%20boolean,%20boolean,%20int,%20int))**([JTable](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTable.html "JTable") table, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value, boolean isSelected, boolean hasFocus, int row, int column)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [DefaultTableCellRenderer](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html "DefaultTableCellRenderer")` | `[validate](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#validate() "validate"), [isOpaque](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isOpaque() "isOpaque"), [invalidate](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#invalidate() "invalidate"), [updateUI](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#updateUI() "updateUI"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#firePropertyChange(java.lang.String,%20boolean,%20boolean) "firePropertyChange"), [repaint](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#repaint(java.awt.Rectangle) "repaint"), [repaint](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#repaint(long,%20int,%20int,%20int,%20int) "repaint"), [repaint](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#repaint() "repaint"), [setForeground](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setForeground(java.awt.Color) "setForeground"), [setBackground](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setBackground(java.awt.Color) "setBackground"), [getTableCellRendererComponent](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getTableCellRendererComponent(javax.swing.JTable,%20java.lang.Object,%20boolean,%20boolean,%20int,%20int) "getTableCellRendererComponent"), [revalidate](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#revalidate() "revalidate"), [getText](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getText() "getText"), [setText](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setText(java.lang.String) "setText"), [imageUpdate](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#imageUpdate(java.awt.Image,%20int,%20int,%20int,%20int,%20int) "imageUpdate"), [getDisabledIcon](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getDisabledIcon() "getDisabledIcon"), [getDisplayedMnemonicIndex](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getDisplayedMnemonicIndex() "getDisplayedMnemonicIndex"), [setDisplayedMnemonicIndex](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setDisplayedMnemonicIndex(int) "setDisplayedMnemonicIndex"), [setUI](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setUI(javax.swing.plaf.LabelUI) "setUI"), [getUI](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getUI() "getUI"), [getUI](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getUI() "getUI"), [getUIClassID](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getUIClassID() "getUIClassID"), [getAccessibleContext](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getAccessibleContext() "getAccessibleContext"), [setHorizontalTextPosition](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setHorizontalTextPosition(int) "setHorizontalTextPosition"), [setVerticalTextPosition](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setVerticalTextPosition(int) "setVerticalTextPosition"), [setIcon](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setIcon(javax.swing.Icon) "setIcon"), [setHorizontalAlignment](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setHorizontalAlignment(int) "setHorizontalAlignment"), [getIcon](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getIcon() "getIcon"), [setDisabledIcon](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setDisabledIcon(javax.swing.Icon) "setDisabledIcon"), [setIconTextGap](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setIconTextGap(int) "setIconTextGap"), [getVerticalAlignment](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getVerticalAlignment() "getVerticalAlignment"), [setVerticalAlignment](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setVerticalAlignment(int) "setVerticalAlignment"), [getHorizontalAlignment](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getHorizontalAlignment() "getHorizontalAlignment"), [getVerticalTextPosition](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getVerticalTextPosition() "getVerticalTextPosition"), [getHorizontalTextPosition](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getHorizontalTextPosition() "getHorizontalTextPosition"), [getIconTextGap](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getIconTextGap() "getIconTextGap"), [getDisplayedMnemonic](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getDisplayedMnemonic() "getDisplayedMnemonic"), [setDisplayedMnemonic](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setDisplayedMnemonic(int) "setDisplayedMnemonic"), [setDisplayedMnemonic](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setDisplayedMnemonic(char) "setDisplayedMnemonic"), [getLabelFor](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getLabelFor() "getLabelFor"), [setLabelFor](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setLabelFor(java.awt.Component) "setLabelFor"), [update](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#update(java.awt.Graphics) "update"), [contains](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#contains(int,%20int) "contains"), [getBounds](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getBounds(java.awt.Rectangle) "getBounds"), [getLocation](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getLocation(java.awt.Point) "getLocation"), [print](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#print(java.awt.Graphics) "print"), [getSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getSize(java.awt.Dimension) "getSize"), [setOpaque](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setOpaque(boolean) "setOpaque"), [enable](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#enable() "enable"), [disable](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#disable() "disable"), [setEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setEnabled(boolean) "setEnabled"), [getVetoableChangeListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getVetoableChangeListeners() "getVetoableChangeListeners"), [removeAncestorListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#removeAncestorListener(javax.swing.event.AncestorListener) "removeAncestorListener"), [getAncestorListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getAncestorListeners() "getAncestorListeners"), [addNotify](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#addNotify() "addNotify"), [removeNotify](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#removeNotify() "removeNotify"), [paintImmediately](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#paintImmediately(int,%20int,%20int,%20int) "paintImmediately"), [paintImmediately](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#paintImmediately(java.awt.Rectangle) "paintImmediately"), [hide](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#hide() "hide"), [setInheritsPopupMenu](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setInheritsPopupMenu(boolean) "setInheritsPopupMenu"), [setComponentPopupMenu](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setComponentPopupMenu(javax.swing.JPopupMenu) "setComponentPopupMenu"), [isPaintingTile](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isPaintingTile() "isPaintingTile"), [isPaintingForPrint](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isPaintingForPrint() "isPaintingForPrint"), [setRequestFocusEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setRequestFocusEnabled(boolean) "setRequestFocusEnabled"), [isRequestFocusEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isRequestFocusEnabled() "isRequestFocusEnabled"), [grabFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#grabFocus() "grabFocus"), [setVerifyInputWhenFocusTarget](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setVerifyInputWhenFocusTarget(boolean) "setVerifyInputWhenFocusTarget"), [getVerifyInputWhenFocusTarget](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getVerifyInputWhenFocusTarget() "getVerifyInputWhenFocusTarget"), [setBorder](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setBorder(javax.swing.border.Border) "setBorder"), [setAlignmentY](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setAlignmentY(float) "setAlignmentY"), [setAlignmentX](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setAlignmentX(float) "setAlignmentX"), [setInputVerifier](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setInputVerifier(javax.swing.InputVerifier) "setInputVerifier"), [getInputVerifier](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getInputVerifier() "getInputVerifier"), [setDebugGraphicsOptions](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setDebugGraphicsOptions(int) "setDebugGraphicsOptions"), [getDebugGraphicsOptions](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getDebugGraphicsOptions() "getDebugGraphicsOptions"), [unregisterKeyboardAction](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#unregisterKeyboardAction(javax.swing.KeyStroke) "unregisterKeyboardAction"), [getRegisteredKeyStrokes](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getRegisteredKeyStrokes() "getRegisteredKeyStrokes"), [getConditionForKeyStroke](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getConditionForKeyStroke(javax.swing.KeyStroke) "getConditionForKeyStroke"), [getActionForKeyStroke](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getActionForKeyStroke(javax.swing.KeyStroke) "getActionForKeyStroke"), [resetKeyboardActions](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#resetKeyboardActions() "resetKeyboardActions"), [requestDefaultFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#requestDefaultFocus() "requestDefaultFocus"), [setToolTipText](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setToolTipText(java.lang.String) "setToolTipText"), [getToolTipLocation](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getToolTipLocation(java.awt.event.MouseEvent) "getToolTipLocation"), [getPopupLocation](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getPopupLocation(java.awt.event.MouseEvent) "getPopupLocation"), [createToolTip](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#createToolTip() "createToolTip"), [getAutoscrolls](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getAutoscrolls() "getAutoscrolls"), [setTransferHandler](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setTransferHandler(javax.swing.TransferHandler) "setTransferHandler"), [getTransferHandler](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getTransferHandler() "getTransferHandler"), [getVisibleRect](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getVisibleRect() "getVisibleRect"), [getTopLevelAncestor](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getTopLevelAncestor() "getTopLevelAncestor"), [isValidateRoot](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isValidateRoot() "isValidateRoot"), [setDoubleBuffered](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setDoubleBuffered(boolean) "setDoubleBuffered"), [addAncestorListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#addAncestorListener(javax.swing.event.AncestorListener) "addAncestorListener"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#firePropertyChange(java.lang.String,%20int,%20int) "firePropertyChange"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#firePropertyChange(java.lang.String,%20char,%20char) "firePropertyChange"), [getListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getListeners(java.lang.Class) "getListeners"), [getClientProperty](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getClientProperty(java.lang.Object) "getClientProperty"), [getGraphics](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getGraphics() "getGraphics"), [getRootPane](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getRootPane() "getRootPane"), [getInheritsPopupMenu](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getInheritsPopupMenu() "getInheritsPopupMenu"), [getComponentPopupMenu](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getComponentPopupMenu() "getComponentPopupMenu"), [isManagingFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isManagingFocus() "isManagingFocus"), [getDefaultLocale](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getDefaultLocale() "getDefaultLocale"), [putClientProperty](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#putClientProperty(java.lang.Object,%20java.lang.Object) "putClientProperty"), [setFont](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setFont(java.awt.Font) "setFont"), [isOptimizedDrawingEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isOptimizedDrawingEnabled() "isOptimizedDrawingEnabled"), [getWidth](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getWidth() "getWidth"), [getHeight](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getHeight() "getHeight"), [isLightweightComponent](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isLightweightComponent(java.awt.Component) "isLightweightComponent"), [paint](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#paint(java.awt.Graphics) "paint"), [printAll](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#printAll(java.awt.Graphics) "printAll"), [getBorder](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getBorder() "getBorder"), [isDoubleBuffered](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isDoubleBuffered() "isDoubleBuffered"), [getNextFocusableComponent](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getNextFocusableComponent() "getNextFocusableComponent"), [setNextFocusableComponent](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setNextFocusableComponent(java.awt.Component) "setNextFocusableComponent"), [requestFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#requestFocus(boolean) "requestFocus"), [requestFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#requestFocus() "requestFocus"), [requestFocusInWindow](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#requestFocusInWindow() "requestFocusInWindow"), [getFontMetrics](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getFontMetrics(java.awt.Font) "getFontMetrics"), [setPreferredSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setPreferredSize(java.awt.Dimension) "setPreferredSize"), [getPreferredSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getPreferredSize() "getPreferredSize"), [setMaximumSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setMaximumSize(java.awt.Dimension) "setMaximumSize"), [getMaximumSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getMaximumSize() "getMaximumSize"), [setMinimumSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setMinimumSize(java.awt.Dimension) "setMinimumSize"), [getMinimumSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getMinimumSize() "getMinimumSize"), [getInsets](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getInsets() "getInsets"), [getInsets](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getInsets(java.awt.Insets) "getInsets"), [getAlignmentY](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getAlignmentY() "getAlignmentY"), [getAlignmentX](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getAlignmentX() "getAlignmentX"), [getInputMap](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getInputMap(int) "getInputMap"), [getInputMap](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getInputMap() "getInputMap"), [getActionMap](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getActionMap() "getActionMap"), [registerKeyboardAction](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#registerKeyboardAction(java.awt.event.ActionListener,%20javax.swing.KeyStroke,%20int) "registerKeyboardAction"), [registerKeyboardAction](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#registerKeyboardAction(java.awt.event.ActionListener,%20java.lang.String,%20javax.swing.KeyStroke,%20int) "registerKeyboardAction"), [setInputMap](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setInputMap(int,%20javax.swing.InputMap) "setInputMap"), [setActionMap](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setActionMap(javax.swing.ActionMap) "setActionMap"), [getBaseline](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getBaseline(int,%20int) "getBaseline"), [getBaselineResizeBehavior](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getBaselineResizeBehavior() "getBaselineResizeBehavior"), [setDefaultLocale](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setDefaultLocale(java.util.Locale) "setDefaultLocale"), [getToolTipText](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getToolTipText() "getToolTipText"), [getToolTipText](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getToolTipText(java.awt.event.MouseEvent) "getToolTipText"), [scrollRectToVisible](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#scrollRectToVisible(java.awt.Rectangle) "scrollRectToVisible"), [setAutoscrolls](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setAutoscrolls(boolean) "setAutoscrolls"), [setFocusTraversalKeys](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setFocusTraversalKeys(int,%20java.util.Set) "setFocusTraversalKeys"), [reshape](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#reshape(int,%20int,%20int,%20int) "reshape"), [computeVisibleRect](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#computeVisibleRect(java.awt.Rectangle) "computeVisibleRect"), [addVetoableChangeListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#addVetoableChangeListener(java.beans.VetoableChangeListener) "addVetoableChangeListener"), [removeVetoableChangeListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#removeVetoableChangeListener(java.beans.VetoableChangeListener) "removeVetoableChangeListener"), [setVisible](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setVisible(boolean) "setVisible"), [getY](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getY() "getY"), [getX](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getX() "getX"), [add](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#add(java.awt.Component) "add"), [add](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#add(java.lang.String,%20java.awt.Component) "add"), [add](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#add(java.awt.Component,%20java.lang.Object) "add"), [add](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#add(java.awt.Component,%20int) "add"), [add](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#add(java.awt.Component,%20java.lang.Object,%20int) "add"), [remove](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#remove(java.awt.Component) "remove"), [remove](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#remove(int) "remove"), [list](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#list(java.io.PrintWriter,%20int) "list"), [list](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#list(java.io.PrintStream,%20int) "list"), [removeAll](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#removeAll() "removeAll"), [locate](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#locate(int,%20int) "locate"), [getComponent](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getComponent(int) "getComponent"), [layout](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#layout() "layout"), [preferredSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#preferredSize() "preferredSize"), [minimumSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#minimumSize() "minimumSize"), [insets](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#insets() "insets"), [countComponents](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#countComponents() "countComponents"), [getComponentZOrder](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getComponentZOrder(java.awt.Component) "getComponentZOrder"), [doLayout](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#doLayout() "doLayout"), [deliverEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#deliverEvent(java.awt.Event) "deliverEvent"), [findComponentAt](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#findComponentAt(int,%20int) "findComponentAt"), [findComponentAt](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#findComponentAt(java.awt.Point) "findComponentAt"), [isFocusTraversalPolicyProvider](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isFocusTraversalPolicyProvider() "isFocusTraversalPolicyProvider"), [applyComponentOrientation](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#applyComponentOrientation(java.awt.ComponentOrientation) "applyComponentOrientation"), [addContainerListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#addContainerListener(java.awt.event.ContainerListener) "addContainerListener"), [setComponentZOrder](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setComponentZOrder(java.awt.Component,%20int) "setComponentZOrder"), [setLayout](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setLayout(java.awt.LayoutManager) "setLayout"), [paintComponents](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#paintComponents(java.awt.Graphics) "paintComponents"), [printComponents](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#printComponents(java.awt.Graphics) "printComponents"), [removeContainerListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#removeContainerListener(java.awt.event.ContainerListener) "removeContainerListener"), [getContainerListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getContainerListeners() "getContainerListeners"), [getMousePosition](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getMousePosition(boolean) "getMousePosition"), [isAncestorOf](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isAncestorOf(java.awt.Component) "isAncestorOf"), [getFocusTraversalKeys](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getFocusTraversalKeys(int) "getFocusTraversalKeys"), [areFocusTraversalKeysSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#areFocusTraversalKeysSet(int) "areFocusTraversalKeysSet"), [isFocusTraversalPolicySet](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isFocusTraversalPolicySet() "isFocusTraversalPolicySet"), [setFocusCycleRoot](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setFocusCycleRoot(boolean) "setFocusCycleRoot"), [setFocusTraversalPolicyProvider](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setFocusTraversalPolicyProvider(boolean) "setFocusTraversalPolicyProvider"), [transferFocusDownCycle](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#transferFocusDownCycle() "transferFocusDownCycle"), [isFocusCycleRoot](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isFocusCycleRoot() "isFocusCycleRoot"), [isFocusCycleRoot](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isFocusCycleRoot(java.awt.Container) "isFocusCycleRoot"), [getFocusTraversalPolicy](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getFocusTraversalPolicy() "getFocusTraversalPolicy"), [setFocusTraversalPolicy](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setFocusTraversalPolicy(java.awt.FocusTraversalPolicy) "setFocusTraversalPolicy"), [getLayout](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getLayout() "getLayout"), [getComponents](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getComponents() "getComponents"), [getComponentCount](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getComponentCount() "getComponentCount"), [getComponentAt](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getComponentAt(int,%20int) "getComponentAt"), [getComponentAt](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getComponentAt(java.awt.Point) "getComponentAt"), [addPropertyChangeListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#addPropertyChangeListener(java.lang.String,%20java.beans.PropertyChangeListener) "addPropertyChangeListener"), [addPropertyChangeListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#addPropertyChangeListener(java.beans.PropertyChangeListener) "addPropertyChangeListener"), [getName](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getName() "getName"), [add](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#add(java.awt.PopupMenu) "add"), [remove](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#remove(java.awt.MenuComponent) "remove"), [toString](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#toString() "toString"), [size](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#size() "size"), [contains](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#contains(java.awt.Point) "contains"), [list](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#list() "list"), [list](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#list(java.io.PrintWriter) "list"), [list](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#list(java.io.PrintStream) "list"), [getBounds](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getBounds() "getBounds"), [bounds](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#bounds() "bounds"), [getLocation](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getLocation() "getLocation"), [getParent](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getParent() "getParent"), [action](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#action(java.awt.Event,%20java.lang.Object) "action"), [setName](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setName(java.lang.String) "setName"), [location](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#location() "location"), [getSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getSize() "getSize"), [resize](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#resize(java.awt.Dimension) "resize"), [resize](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#resize(int,%20int) "resize"), [move](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#move(int,%20int) "move"), [setSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setSize(int,%20int) "setSize"), [setSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setSize(java.awt.Dimension) "setSize"), [getLocale](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getLocale() "getLocale"), [isEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isEnabled() "isEnabled"), [enable](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#enable(boolean) "enable"), [setLocale](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setLocale(java.util.Locale) "setLocale"), [isValid](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isValid() "isValid"), [dispatchEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#dispatchEvent(java.awt.AWTEvent) "dispatchEvent"), [mouseEnter](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#mouseEnter(java.awt.Event,%20int,%20int) "mouseEnter"), [mouseExit](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#mouseExit(java.awt.Event,%20int,%20int) "mouseExit"), [mouseMove](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#mouseMove(java.awt.Event,%20int,%20int) "mouseMove"), [mouseDown](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#mouseDown(java.awt.Event,%20int,%20int) "mouseDown"), [mouseDrag](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#mouseDrag(java.awt.Event,%20int,%20int) "mouseDrag"), [mouseUp](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#mouseUp(java.awt.Event,%20int,%20int) "mouseUp"), [keyDown](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#keyDown(java.awt.Event,%20int) "keyDown"), [keyUp](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#keyUp(java.awt.Event,%20int) "keyUp"), [gotFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#gotFocus(java.awt.Event,%20java.lang.Object) "gotFocus"), [lostFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#lostFocus(java.awt.Event,%20java.lang.Object) "lostFocus"), [isFocusTraversable](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isFocusTraversable() "isFocusTraversable"), [hasFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#hasFocus() "hasFocus"), [addComponentListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#addComponentListener(java.awt.event.ComponentListener) "addComponentListener"), [addFocusListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#addFocusListener(java.awt.event.FocusListener) "addFocusListener"), [addKeyListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#addKeyListener(java.awt.event.KeyListener) "addKeyListener"), [addMouseListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#addMouseListener(java.awt.event.MouseListener) "addMouseListener"), [addMouseMotionListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#addMouseMotionListener(java.awt.event.MouseMotionListener) "addMouseMotionListener"), [addInputMethodListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#addInputMethodListener(java.awt.event.InputMethodListener) "addInputMethodListener"), [addHierarchyListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#addHierarchyListener(java.awt.event.HierarchyListener) "addHierarchyListener"), [addHierarchyBoundsListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) "addHierarchyBoundsListener"), [addMouseWheelListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#addMouseWheelListener(java.awt.event.MouseWheelListener) "addMouseWheelListener"), [setComponentOrientation](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setComponentOrientation(java.awt.ComponentOrientation) "setComponentOrientation"), [setDropTarget](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setDropTarget(java.awt.dnd.DropTarget) "setDropTarget"), [getDropTarget](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getDropTarget() "getDropTarget"), [enableInputMethods](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#enableInputMethods(boolean) "enableInputMethods"), [isForegroundSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isForegroundSet() "isForegroundSet"), [isBackgroundSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isBackgroundSet() "isBackgroundSet"), [isFontSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isFontSet() "isFontSet"), [setCursor](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setCursor(java.awt.Cursor) "setCursor"), [getCursor](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getCursor() "getCursor"), [isCursorSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isCursorSet() "isCursorSet"), [paintAll](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#paintAll(java.awt.Graphics) "paintAll"), [setIgnoreRepaint](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setIgnoreRepaint(boolean) "setIgnoreRepaint"), [getIgnoreRepaint](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getIgnoreRepaint() "getIgnoreRepaint"), [removeComponentListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#removeComponentListener(java.awt.event.ComponentListener) "removeComponentListener"), [getComponentListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getComponentListeners() "getComponentListeners"), [removeFocusListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#removeFocusListener(java.awt.event.FocusListener) "removeFocusListener"), [getFocusListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getFocusListeners() "getFocusListeners"), [removeHierarchyListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#removeHierarchyListener(java.awt.event.HierarchyListener) "removeHierarchyListener"), [getHierarchyListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getHierarchyListeners() "getHierarchyListeners"), [removeHierarchyBoundsListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) "removeHierarchyBoundsListener"), [getHierarchyBoundsListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getHierarchyBoundsListeners() "getHierarchyBoundsListeners"), [removeKeyListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#removeKeyListener(java.awt.event.KeyListener) "removeKeyListener"), [getKeyListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getKeyListeners() "getKeyListeners"), [removeMouseListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#removeMouseListener(java.awt.event.MouseListener) "removeMouseListener"), [getMouseListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getMouseListeners() "getMouseListeners"), [removeMouseMotionListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#removeMouseMotionListener(java.awt.event.MouseMotionListener) "removeMouseMotionListener"), [getMouseMotionListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getMouseMotionListeners() "getMouseMotionListeners"), [removeMouseWheelListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#removeMouseWheelListener(java.awt.event.MouseWheelListener) "removeMouseWheelListener"), [getMouseWheelListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getMouseWheelListeners() "getMouseWheelListeners"), [removeInputMethodListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#removeInputMethodListener(java.awt.event.InputMethodListener) "removeInputMethodListener"), [getInputMethodListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getInputMethodListeners() "getInputMethodListeners"), [getInputMethodRequests](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getInputMethodRequests() "getInputMethodRequests"), [setFocusable](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setFocusable(boolean) "setFocusable"), [setFocusTraversalKeysEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setFocusTraversalKeysEnabled(boolean) "setFocusTraversalKeysEnabled"), [getFocusTraversalKeysEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getFocusTraversalKeysEnabled() "getFocusTraversalKeysEnabled"), [transferFocusUpCycle](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#transferFocusUpCycle() "transferFocusUpCycle"), [getComponentOrientation](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getComponentOrientation() "getComponentOrientation"), [setMixingCutoutShape](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setMixingCutoutShape(java.awt.Shape) "setMixingCutoutShape"), [setLocation](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setLocation(java.awt.Point) "setLocation"), [setLocation](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setLocation(int,%20int) "setLocation"), [getPropertyChangeListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getPropertyChangeListeners(java.lang.String) "getPropertyChangeListeners"), [getPropertyChangeListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getPropertyChangeListeners() "getPropertyChangeListeners"), [isShowing](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isShowing() "isShowing"), [getGraphicsConfiguration](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getGraphicsConfiguration() "getGraphicsConfiguration"), [isFocusable](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isFocusable() "isFocusable"), [isFocusOwner](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isFocusOwner() "isFocusOwner"), [transferFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#transferFocus() "transferFocus"), [postEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#postEvent(java.awt.Event) "postEvent"), [transferFocusBackward](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#transferFocusBackward() "transferFocusBackward"), [getMousePosition](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getMousePosition() "getMousePosition"), [getToolkit](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getToolkit() "getToolkit"), [getLocationOnScreen](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getLocationOnScreen() "getLocationOnScreen"), [getInputContext](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getInputContext() "getInputContext"), [show](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#show(boolean) "show"), [show](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#show() "show"), [getColorModel](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getColorModel() "getColorModel"), [createImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#createImage(int,%20int) "createImage"), [createImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#createImage(java.awt.image.ImageProducer) "createImage"), [createVolatileImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#createVolatileImage(int,%20int,%20java.awt.ImageCapabilities) "createVolatileImage"), [createVolatileImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#createVolatileImage(int,%20int) "createVolatileImage"), [prepareImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#prepareImage(java.awt.Image,%20int,%20int,%20java.awt.image.ImageObserver) "prepareImage"), [prepareImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#prepareImage(java.awt.Image,%20java.awt.image.ImageObserver) "prepareImage"), [checkImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#checkImage(java.awt.Image,%20int,%20int,%20java.awt.image.ImageObserver) "checkImage"), [checkImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#checkImage(java.awt.Image,%20java.awt.image.ImageObserver) "checkImage"), [inside](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#inside(int,%20int) "inside"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#firePropertyChange(java.lang.String,%20byte,%20byte) "firePropertyChange"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#firePropertyChange(java.lang.String,%20double,%20double) "firePropertyChange"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#firePropertyChange(java.lang.String,%20float,%20float) "firePropertyChange"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#firePropertyChange(java.lang.String,%20long,%20long) "firePropertyChange"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#firePropertyChange(java.lang.String,%20short,%20short) "firePropertyChange"), [removePropertyChangeListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#removePropertyChangeListener(java.lang.String,%20java.beans.PropertyChangeListener) "removePropertyChangeListener"), [removePropertyChangeListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#removePropertyChangeListener(java.beans.PropertyChangeListener) "removePropertyChangeListener"), [repaint](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#repaint(int,%20int,%20int,%20int) "repaint"), [repaint](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#repaint(long) "repaint"), [getForeground](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getForeground() "getForeground"), [getFont](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getFont() "getFont"), [getTreeLock](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getTreeLock() "getTreeLock"), [getFocusCycleRootAncestor](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getFocusCycleRootAncestor() "getFocusCycleRootAncestor"), [isDisplayable](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isDisplayable() "isDisplayable"), [nextFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#nextFocus() "nextFocus"), [requestFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#requestFocus(java.awt.event.FocusEvent%24Cause) "requestFocus"), [requestFocusInWindow](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#requestFocusInWindow(java.awt.event.FocusEvent%24Cause) "requestFocusInWindow"), [isPreferredSizeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isPreferredSizeSet() "isPreferredSizeSet"), [isMaximumSizeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isMaximumSizeSet() "isMaximumSizeSet"), [isMinimumSizeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isMinimumSizeSet() "isMinimumSizeSet"), [getBackground](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getBackground() "getBackground"), [isLightweight](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isLightweight() "isLightweight"), [setBounds](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setBounds(int,%20int,%20int,%20int) "setBounds"), [setBounds](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#setBounds(java.awt.Rectangle) "setBounds"), [handleEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#handleEvent(java.awt.Event) "handleEvent"), [isVisible](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#isVisible() "isVisible"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#equals(java.lang.Object) "equals"), [hashCode](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableCellRenderer.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
###
**ButtonOrDefaultRenderer**()
Method Detail
-------------
###
[Component](https://docs.oracle.com/javase/8/docs/api/java/awt/Component.html "Component") **getTableCellRendererComponent**([JTable](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTable.html "JTable") table, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value, boolean isSelected, boolean hasFocus, int row, int column)
| programming_docs |
groovy [Groovy] Class ConsolePreferences [Groovy] Class ConsolePreferences
=================================
* groovy.console.ui.ConsolePreferences
```
class ConsolePreferences
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Properties Summary
------------------
Properties
| Type | Name and description |
| `**static int**` | `[DEFAULT\_LOOP\_MODE\_DELAY\_MILLIS](#DEFAULT_LOOP_MODE_DELAY_MILLIS)` |
| `**static int**` | `[DEFAULT\_MAX\_OUTPUT\_CHARS](#DEFAULT_MAX_OUTPUT_CHARS)` |
| `**int**` | `[loopModeDelay](#loopModeDelay)` |
| `**int**` | `[maxOutputChars](#maxOutputChars)` |
| `**[File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File")**` | `[outputFile](#outputFile)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[ConsolePreferences](#ConsolePreferences(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") console)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `static void` | `**[main](#main(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)` |
| | `void` | `**[show](#show())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Property Detail
---------------
### static int **DEFAULT\_LOOP\_MODE\_DELAY\_MILLIS**
### static int **DEFAULT\_MAX\_OUTPUT\_CHARS**
### @[Bindable](../../beans/bindable "Bindable") int **loopModeDelay**
### @[Bindable](../../beans/bindable "Bindable") int **maxOutputChars**
###
[File](https://docs.oracle.com/javase/8/docs/api/java/io/File.html "File") **outputFile**
Constructor Detail
------------------
###
**ConsolePreferences**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") console)
Method Detail
-------------
### static void **main**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
### void **show**()
groovy [Groovy] Class OutputTransforms [Groovy] Class OutputTransforms
===============================
* groovy.console.ui.OutputTransforms
```
@[CompileStatic](../../transform/compilestatic "CompileStatic")
class OutputTransforms
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Properties Summary
------------------
Properties
| Type | Name and description |
| `**static [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Closure](../../lang/closure "Closure")>**` | `[localTransforms](#localTransforms)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[OutputTransforms](#OutputTransforms())**()` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `static [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Closure](../../lang/closure "Closure")>` | `**[loadOutputTransforms](#loadOutputTransforms())**()` |
| | `static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[transformResult](#transformResult(java.lang.Object,%20List))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") base, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Closure](../../lang/closure "Closure")> transforms)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Property Detail
---------------
### @[Lazy](../../lang/lazy "Lazy") static [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Closure](../../lang/closure "Closure")> **localTransforms**
Constructor Detail
------------------
###
**OutputTransforms**()
Method Detail
-------------
### static [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Closure](../../lang/closure "Closure")> **loadOutputTransforms**()
### static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **transformResult**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") base, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Closure](../../lang/closure "Closure")> transforms)
groovy [Groovy] Script BasicMenuBar [Groovy] Script BasicMenuBar
============================
* groovy.console.ui.view.BasicMenuBar
```
class BasicMenuBar
extends [Script](../../../lang/script)
```
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[BasicMenuBar](#BasicMenuBar())**()` |
| `**[BasicMenuBar](#BasicMenuBar(groovy.lang.Binding))**([Binding](../../../lang/binding) context)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `static void` | `**[main](#main(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)` |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[run](#run())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Script](../../../lang/script)` | `[evaluate](../../../lang/script#evaluate(java.lang.String)), [evaluate](../../../lang/script#evaluate(java.io.File)), [getBinding](../../../lang/script#getBinding()), [getProperty](../../../lang/script#getProperty(java.lang.String)), [invokeMethod](../../../lang/script#invokeMethod(java.lang.String,%20java.lang.Object)), [print](../../../lang/script#print(java.lang.Object)), [printf](../../../lang/script#printf(java.lang.String,%20java.lang.Object)), [printf](../../../lang/script#printf(java.lang.String,%20java.lang.Object)), [println](../../../lang/script#println()), [println](../../../lang/script#println(java.lang.Object)), [run](../../../lang/script#run()), [run](../../../lang/script#run(java.io.File,%20java.lang.String)), [setBinding](../../../lang/script#setBinding(groovy.lang.Binding)), [setProperty](../../../lang/script#setProperty(java.lang.String,%20java.lang.Object))` |
| `class [GroovyObjectSupport](../../../lang/groovyobjectsupport)` | `[getMetaClass](../../../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../../../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
###
**BasicMenuBar**()
###
**BasicMenuBar**([Binding](../../../lang/binding) context)
Method Detail
-------------
### static void **main**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **run**()
groovy [Groovy] Script BasicStatusBar [Groovy] Script BasicStatusBar
==============================
* groovy.console.ui.view.BasicStatusBar
```
class BasicStatusBar
extends [Script](../../../lang/script)
```
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[BasicStatusBar](#BasicStatusBar())**()` |
| `**[BasicStatusBar](#BasicStatusBar(groovy.lang.Binding))**([Binding](../../../lang/binding) context)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `static void` | `**[main](#main(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)` |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[run](#run())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Script](../../../lang/script)` | `[evaluate](../../../lang/script#evaluate(java.lang.String)), [evaluate](../../../lang/script#evaluate(java.io.File)), [getBinding](../../../lang/script#getBinding()), [getProperty](../../../lang/script#getProperty(java.lang.String)), [invokeMethod](../../../lang/script#invokeMethod(java.lang.String,%20java.lang.Object)), [print](../../../lang/script#print(java.lang.Object)), [printf](../../../lang/script#printf(java.lang.String,%20java.lang.Object)), [printf](../../../lang/script#printf(java.lang.String,%20java.lang.Object)), [println](../../../lang/script#println()), [println](../../../lang/script#println(java.lang.Object)), [run](../../../lang/script#run()), [run](../../../lang/script#run(java.io.File,%20java.lang.String)), [setBinding](../../../lang/script#setBinding(groovy.lang.Binding)), [setProperty](../../../lang/script#setProperty(java.lang.String,%20java.lang.Object))` |
| `class [GroovyObjectSupport](../../../lang/groovyobjectsupport)` | `[getMetaClass](../../../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../../../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
###
**BasicStatusBar**()
###
**BasicStatusBar**([Binding](../../../lang/binding) context)
Method Detail
-------------
### static void **main**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **run**()
groovy [Groovy] Script GTKDefaults [Groovy] Script GTKDefaults
===========================
* groovy.console.ui.view.GTKDefaults
```
class GTKDefaults
extends [Script](../../../lang/script)
```
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[GTKDefaults](#GTKDefaults())**()` |
| `**[GTKDefaults](#GTKDefaults(groovy.lang.Binding))**([Binding](../../../lang/binding) context)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `static void` | `**[main](#main(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)` |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[run](#run())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Script](../../../lang/script)` | `[evaluate](../../../lang/script#evaluate(java.lang.String)), [evaluate](../../../lang/script#evaluate(java.io.File)), [getBinding](../../../lang/script#getBinding()), [getProperty](../../../lang/script#getProperty(java.lang.String)), [invokeMethod](../../../lang/script#invokeMethod(java.lang.String,%20java.lang.Object)), [print](../../../lang/script#print(java.lang.Object)), [printf](../../../lang/script#printf(java.lang.String,%20java.lang.Object)), [printf](../../../lang/script#printf(java.lang.String,%20java.lang.Object)), [println](../../../lang/script#println()), [println](../../../lang/script#println(java.lang.Object)), [run](../../../lang/script#run()), [run](../../../lang/script#run(java.io.File,%20java.lang.String)), [setBinding](../../../lang/script#setBinding(groovy.lang.Binding)), [setProperty](../../../lang/script#setProperty(java.lang.String,%20java.lang.Object))` |
| `class [GroovyObjectSupport](../../../lang/groovyobjectsupport)` | `[getMetaClass](../../../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../../../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
###
**GTKDefaults**()
###
**GTKDefaults**([Binding](../../../lang/binding) context)
Method Detail
-------------
### static void **main**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **run**()
groovy [Groovy] Script MacOSXDefaults [Groovy] Script MacOSXDefaults
==============================
* groovy.console.ui.view.MacOSXDefaults
```
class MacOSXDefaults
extends [Script](../../../lang/script)
```
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[MacOSXDefaults](#MacOSXDefaults())**()` |
| `**[MacOSXDefaults](#MacOSXDefaults(groovy.lang.Binding))**([Binding](../../../lang/binding) context)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `static void` | `**[main](#main(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)` |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[run](#run())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Script](../../../lang/script)` | `[evaluate](../../../lang/script#evaluate(java.lang.String)), [evaluate](../../../lang/script#evaluate(java.io.File)), [getBinding](../../../lang/script#getBinding()), [getProperty](../../../lang/script#getProperty(java.lang.String)), [invokeMethod](../../../lang/script#invokeMethod(java.lang.String,%20java.lang.Object)), [print](../../../lang/script#print(java.lang.Object)), [printf](../../../lang/script#printf(java.lang.String,%20java.lang.Object)), [printf](../../../lang/script#printf(java.lang.String,%20java.lang.Object)), [println](../../../lang/script#println()), [println](../../../lang/script#println(java.lang.Object)), [run](../../../lang/script#run()), [run](../../../lang/script#run(java.io.File,%20java.lang.String)), [setBinding](../../../lang/script#setBinding(groovy.lang.Binding)), [setProperty](../../../lang/script#setProperty(java.lang.String,%20java.lang.Object))` |
| `class [GroovyObjectSupport](../../../lang/groovyobjectsupport)` | `[getMetaClass](../../../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../../../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
###
**MacOSXDefaults**()
###
**MacOSXDefaults**([Binding](../../../lang/binding) context)
Method Detail
-------------
### static void **main**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **run**()
groovy [Groovy] Script WindowsDefaults [Groovy] Script WindowsDefaults
===============================
* groovy.console.ui.view.WindowsDefaults
```
class WindowsDefaults
extends [Script](../../../lang/script)
```
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[WindowsDefaults](#WindowsDefaults())**()` |
| `**[WindowsDefaults](#WindowsDefaults(groovy.lang.Binding))**([Binding](../../../lang/binding) context)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `static void` | `**[main](#main(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)` |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[run](#run())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Script](../../../lang/script)` | `[evaluate](../../../lang/script#evaluate(java.lang.String)), [evaluate](../../../lang/script#evaluate(java.io.File)), [getBinding](../../../lang/script#getBinding()), [getProperty](../../../lang/script#getProperty(java.lang.String)), [invokeMethod](../../../lang/script#invokeMethod(java.lang.String,%20java.lang.Object)), [print](../../../lang/script#print(java.lang.Object)), [printf](../../../lang/script#printf(java.lang.String,%20java.lang.Object)), [printf](../../../lang/script#printf(java.lang.String,%20java.lang.Object)), [println](../../../lang/script#println()), [println](../../../lang/script#println(java.lang.Object)), [run](../../../lang/script#run()), [run](../../../lang/script#run(java.io.File,%20java.lang.String)), [setBinding](../../../lang/script#setBinding(groovy.lang.Binding)), [setProperty](../../../lang/script#setProperty(java.lang.String,%20java.lang.Object))` |
| `class [GroovyObjectSupport](../../../lang/groovyobjectsupport)` | `[getMetaClass](../../../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../../../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
###
**WindowsDefaults**()
###
**WindowsDefaults**([Binding](../../../lang/binding) context)
Method Detail
-------------
### static void **main**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **run**()
groovy [Groovy] Script MacOSXMenuBar [Groovy] Script MacOSXMenuBar
=============================
* groovy.console.ui.view.MacOSXMenuBar
```
class MacOSXMenuBar
extends [Script](../../../lang/script)
```
Properties Summary
------------------
Properties
| Type | Name and description |
| `**static [Boolean](https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html "Boolean")**` | `[handlersInstalled](#handlersInstalled)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[MacOSXMenuBar](#MacOSXMenuBar())**()` |
| `**[MacOSXMenuBar](#MacOSXMenuBar(groovy.lang.Binding))**([Binding](../../../lang/binding) context)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[classExists](#classExists(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") className)` |
| | `static void` | `**[main](#main(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)` |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[run](#run())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Script](../../../lang/script)` | `[evaluate](../../../lang/script#evaluate(java.lang.String)), [evaluate](../../../lang/script#evaluate(java.io.File)), [getBinding](../../../lang/script#getBinding()), [getProperty](../../../lang/script#getProperty(java.lang.String)), [invokeMethod](../../../lang/script#invokeMethod(java.lang.String,%20java.lang.Object)), [print](../../../lang/script#print(java.lang.Object)), [printf](../../../lang/script#printf(java.lang.String,%20java.lang.Object)), [printf](../../../lang/script#printf(java.lang.String,%20java.lang.Object)), [println](../../../lang/script#println()), [println](../../../lang/script#println(java.lang.Object)), [run](../../../lang/script#run()), [run](../../../lang/script#run(java.io.File,%20java.lang.String)), [setBinding](../../../lang/script#setBinding(groovy.lang.Binding)), [setProperty](../../../lang/script#setProperty(java.lang.String,%20java.lang.Object))` |
| `class [GroovyObjectSupport](../../../lang/groovyobjectsupport)` | `[getMetaClass](../../../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../../../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Property Detail
---------------
### static [Boolean](https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html "Boolean") **handlersInstalled**
Constructor Detail
------------------
###
**MacOSXMenuBar**()
###
**MacOSXMenuBar**([Binding](../../../lang/binding) context)
Method Detail
-------------
### static [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **classExists**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") className)
### static void **main**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **run**()
| programming_docs |
groovy [Groovy] Script BasicContentPane [Groovy] Script BasicContentPane
================================
* groovy.console.ui.view.BasicContentPane
```
class BasicContentPane
extends [Script](../../../lang/script)
```
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[BasicContentPane](#BasicContentPane())**()` |
| `**[BasicContentPane](#BasicContentPane(groovy.lang.Binding))**([Binding](../../../lang/binding) context)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `static void` | `**[main](#main(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)` |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[run](#run())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Script](../../../lang/script)` | `[evaluate](../../../lang/script#evaluate(java.lang.String)), [evaluate](../../../lang/script#evaluate(java.io.File)), [getBinding](../../../lang/script#getBinding()), [getProperty](../../../lang/script#getProperty(java.lang.String)), [invokeMethod](../../../lang/script#invokeMethod(java.lang.String,%20java.lang.Object)), [print](../../../lang/script#print(java.lang.Object)), [printf](../../../lang/script#printf(java.lang.String,%20java.lang.Object)), [printf](../../../lang/script#printf(java.lang.String,%20java.lang.Object)), [println](../../../lang/script#println()), [println](../../../lang/script#println(java.lang.Object)), [run](../../../lang/script#run()), [run](../../../lang/script#run(java.io.File,%20java.lang.String)), [setBinding](../../../lang/script#setBinding(groovy.lang.Binding)), [setProperty](../../../lang/script#setProperty(java.lang.String,%20java.lang.Object))` |
| `class [GroovyObjectSupport](../../../lang/groovyobjectsupport)` | `[getMetaClass](../../../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../../../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
###
**BasicContentPane**()
###
**BasicContentPane**([Binding](../../../lang/binding) context)
Method Detail
-------------
### static void **main**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **run**()
groovy [Groovy] Script Defaults [Groovy] Script Defaults
========================
* groovy.console.ui.view.Defaults
```
class Defaults
extends [Script](../../../lang/script)
```
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Defaults](#Defaults())**()` |
| `**[Defaults](#Defaults(groovy.lang.Binding))**([Binding](../../../lang/binding) context)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `static void` | `**[main](#main(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)` |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[run](#run())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Script](../../../lang/script)` | `[evaluate](../../../lang/script#evaluate(java.lang.String)), [evaluate](../../../lang/script#evaluate(java.io.File)), [getBinding](../../../lang/script#getBinding()), [getProperty](../../../lang/script#getProperty(java.lang.String)), [invokeMethod](../../../lang/script#invokeMethod(java.lang.String,%20java.lang.Object)), [print](../../../lang/script#print(java.lang.Object)), [printf](../../../lang/script#printf(java.lang.String,%20java.lang.Object)), [printf](../../../lang/script#printf(java.lang.String,%20java.lang.Object)), [println](../../../lang/script#println()), [println](../../../lang/script#println(java.lang.Object)), [run](../../../lang/script#run()), [run](../../../lang/script#run(java.io.File,%20java.lang.String)), [setBinding](../../../lang/script#setBinding(groovy.lang.Binding)), [setProperty](../../../lang/script#setProperty(java.lang.String,%20java.lang.Object))` |
| `class [GroovyObjectSupport](../../../lang/groovyobjectsupport)` | `[getMetaClass](../../../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../../../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
###
**Defaults**()
###
**Defaults**([Binding](../../../lang/binding) context)
Method Detail
-------------
### static void **main**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **run**()
groovy [Groovy] Script BasicToolBar [Groovy] Script BasicToolBar
============================
* groovy.console.ui.view.BasicToolBar
```
class BasicToolBar
extends [Script](../../../lang/script)
```
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[BasicToolBar](#BasicToolBar())**()` |
| `**[BasicToolBar](#BasicToolBar(groovy.lang.Binding))**([Binding](../../../lang/binding) context)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `static void` | `**[main](#main(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)` |
| | `[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[run](#run())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Script](../../../lang/script)` | `[evaluate](../../../lang/script#evaluate(java.lang.String)), [evaluate](../../../lang/script#evaluate(java.io.File)), [getBinding](../../../lang/script#getBinding()), [getProperty](../../../lang/script#getProperty(java.lang.String)), [invokeMethod](../../../lang/script#invokeMethod(java.lang.String,%20java.lang.Object)), [print](../../../lang/script#print(java.lang.Object)), [printf](../../../lang/script#printf(java.lang.String,%20java.lang.Object)), [printf](../../../lang/script#printf(java.lang.String,%20java.lang.Object)), [println](../../../lang/script#println()), [println](../../../lang/script#println(java.lang.Object)), [run](../../../lang/script#run()), [run](../../../lang/script#run(java.io.File,%20java.lang.String)), [setBinding](../../../lang/script#setBinding(groovy.lang.Binding)), [setProperty](../../../lang/script#setProperty(java.lang.String,%20java.lang.Object))` |
| `class [GroovyObjectSupport](../../../lang/groovyobjectsupport)` | `[getMetaClass](../../../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../../../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
###
**BasicToolBar**()
###
**BasicToolBar**([Binding](../../../lang/binding) context)
Method Detail
-------------
### static void **main**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] args)
###
[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **run**()
groovy [Java] Class SmartDocumentFilter [Java] Class SmartDocumentFilter
================================
* groovy.console.ui.text.SmartDocumentFilter
```
public class SmartDocumentFilter
extends [DocumentFilter](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html "DocumentFilter")
```
The document filter based on Parrot's lexer is for highlighting the content of text editor
**Since:**
3.0.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[SmartDocumentFilter](#SmartDocumentFilter(javax.swing.text.DefaultStyledDocument))**([DefaultStyledDocument](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DefaultStyledDocument.html "DefaultStyledDocument") styledDocument)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Token](https://www.antlr.org/api/Java/org/antlr/v4/runtime/Token.html "Token")>` | `**[getLatestTokenList](#getLatestTokenList())**()` |
| | `public [Tuple2](../../../lang/tuple2 "Tuple2")<[Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer"), [Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer")>` | `**[getRenderRange](#getRenderRange())**()` |
| | `public void` | `**[insertString](#insertString(javax.swing.text.DocumentFilter%24FilterBypass,%20int,%20java.lang.String,%20javax.swing.text.AttributeSet))**([DocumentFilter.FilterBypass](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.FilterBypass.html "DocumentFilter.FilterBypass") fb, int offset, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text, [AttributeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/AttributeSet.html "AttributeSet") attrs)` |
| | `public boolean` | `**[isLatest](#isLatest())**()` |
| | `public void` | `**[remove](#remove(javax.swing.text.DocumentFilter%24FilterBypass,%20int,%20int))**([DocumentFilter.FilterBypass](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.FilterBypass.html "DocumentFilter.FilterBypass") fb, int offset, int length)` |
| | `public void` | `**[replace](#replace(javax.swing.text.DocumentFilter%24FilterBypass,%20int,%20int,%20java.lang.String,%20javax.swing.text.AttributeSet))**([DocumentFilter.FilterBypass](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.FilterBypass.html "DocumentFilter.FilterBypass") fb, int offset, int length, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text, [AttributeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/AttributeSet.html "AttributeSet") attrs)` |
| | `public void` | `**[setRenderRange](#setRenderRange(Tuple2))**([Tuple2](../../../lang/tuple2 "Tuple2")<[Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer"), [Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer")> renderRange)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [DocumentFilter](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html "DocumentFilter")` | `[remove](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#remove(javax.swing.text.DocumentFilter%24FilterBypass,%20int,%20int) "remove"), [replace](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#replace(javax.swing.text.DocumentFilter%24FilterBypass,%20int,%20int,%20java.lang.String,%20javax.swing.text.AttributeSet) "replace"), [insertString](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#insertString(javax.swing.text.DocumentFilter%24FilterBypass,%20int,%20java.lang.String,%20javax.swing.text.AttributeSet) "insertString"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **SmartDocumentFilter**([DefaultStyledDocument](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DefaultStyledDocument.html "DefaultStyledDocument") styledDocument)
Method Detail
-------------
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Token](https://www.antlr.org/api/Java/org/antlr/v4/runtime/Token.html "Token")> **getLatestTokenList**()
### public [Tuple2](../../../lang/tuple2 "Tuple2")<[Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer"), [Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer")> **getRenderRange**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **insertString**([DocumentFilter.FilterBypass](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.FilterBypass.html "DocumentFilter.FilterBypass") fb, int offset, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text, [AttributeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/AttributeSet.html "AttributeSet") attrs)
### public boolean **isLatest**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **remove**([DocumentFilter.FilterBypass](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.FilterBypass.html "DocumentFilter.FilterBypass") fb, int offset, int length)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **replace**([DocumentFilter.FilterBypass](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.FilterBypass.html "DocumentFilter.FilterBypass") fb, int offset, int length, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text, [AttributeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/AttributeSet.html "AttributeSet") attrs)
### public void **setRenderRange**([Tuple2](../../../lang/tuple2 "Tuple2")<[Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer"), [Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer")> renderRange)
groovy [Java] Class GroovyFilter [Java] Class GroovyFilter
=========================
* groovy.console.ui.text.GroovyFilter
```
public class GroovyFilter
extends [StructuredSyntaxDocumentFilter](structuredsyntaxdocumentfilter)
```
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[BINARY\_INTEGER\_LITERAL](#BINARY_INTEGER_LITERAL)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[COMMENT](#COMMENT)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[DECIMAL\_FLOATING\_POINT\_LITERAL](#DECIMAL_FLOATING_POINT_LITERAL)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[DECIMAL\_INTEGER\_LITERAL](#DECIMAL_INTEGER_LITERAL)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[DIGIT](#DIGIT)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[HEXADECIMAL\_FLOATING\_POINT\_LITERAL](#HEXADECIMAL_FLOATING_POINT_LITERAL)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[HEX\_INTEGER\_LITERAL](#HEX_INTEGER_LITERAL)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[IDENT](#IDENT)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[LEFT\_PARENS](#LEFT_PARENS)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[OCTAL\_INTEGER\_LITERAL](#OCTAL_INTEGER_LITERAL)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[OPERATION](#OPERATION)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[QUOTES](#QUOTES)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[RESERVED\_WORD](#RESERVED_WORD)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[]**` | `[RESERVED\_WORDS](#RESERVED_WORDS)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[SINGLE\_QUOTES](#SINGLE_QUOTES)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[SLASHY\_QUOTES](#SLASHY_QUOTES)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[SLASH\_SLASH\_COMMENT](#SLASH_SLASH_COMMENT)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[SLASH\_STAR\_COMMENT](#SLASH_STAR_COMMENT)` | |
Inherited fields
| Fields inherited from class | Fields |
| **`class [StructuredSyntaxDocumentFilter](structuredsyntaxdocumentfilter)`** | `[TAB\_REPLACEMENT](structuredsyntaxdocumentfilter#TAB_REPLACEMENT), [lexer](structuredsyntaxdocumentfilter#lexer), [mlTextRunSet](structuredsyntaxdocumentfilter#mlTextRunSet), [styledDocument](structuredsyntaxdocumentfilter#styledDocument)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[GroovyFilter](#GroovyFilter(javax.swing.text.DefaultStyledDocument))**([DefaultStyledDocument](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DefaultStyledDocument.html "DefaultStyledDocument") doc)`Creates a new instance of GroovyFilter |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public static void` | `**[installAutoTabAction](#installAutoTabAction(javax.swing.text.JTextComponent))**([JTextComponent](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/JTextComponent.html "JTextComponent") tComp)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [StructuredSyntaxDocumentFilter](structuredsyntaxdocumentfilter)` | `[createLexerNode](structuredsyntaxdocumentfilter#createLexerNode()), [getRootNode](structuredsyntaxdocumentfilter#getRootNode()), [insertString](structuredsyntaxdocumentfilter#insertString(javax.swing.text.DocumentFilter%24FilterBypass,%20int,%20java.lang.String,%20javax.swing.text.AttributeSet)), [parseDocument](structuredsyntaxdocumentfilter#parseDocument(int,%20int)), [remove](structuredsyntaxdocumentfilter#remove(javax.swing.text.DocumentFilter%24FilterBypass,%20int,%20int)), [replace](structuredsyntaxdocumentfilter#replace(javax.swing.text.DocumentFilter%24FilterBypass,%20int,%20int,%20java.lang.String,%20javax.swing.text.AttributeSet))` |
Field Detail
------------
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **BINARY\_INTEGER\_LITERAL**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **COMMENT**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **DECIMAL\_FLOATING\_POINT\_LITERAL**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **DECIMAL\_INTEGER\_LITERAL**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **DIGIT**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **HEXADECIMAL\_FLOATING\_POINT\_LITERAL**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **HEX\_INTEGER\_LITERAL**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **IDENT**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **LEFT\_PARENS**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **OCTAL\_INTEGER\_LITERAL**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **OPERATION**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **QUOTES**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **RESERVED\_WORD**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] **RESERVED\_WORDS**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **SINGLE\_QUOTES**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **SLASHY\_QUOTES**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **SLASH\_SLASH\_COMMENT**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **SLASH\_STAR\_COMMENT**
Constructor Detail
------------------
### public **GroovyFilter**([DefaultStyledDocument](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DefaultStyledDocument.html "DefaultStyledDocument") doc)
Creates a new instance of GroovyFilter
Method Detail
-------------
### public static void **installAutoTabAction**([JTextComponent](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/JTextComponent.html "JTextComponent") tComp)
| programming_docs |
groovy [Java] Class FindReplaceUtility [Java] Class FindReplaceUtility
===============================
* groovy.console.ui.text.FindReplaceUtility
```
public final class FindReplaceUtility
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[CLOSE\_ACTION\_COMMAND](#CLOSE_ACTION_COMMAND)` | |
| `**static [Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action")**` | `[FIND\_ACTION](#FIND_ACTION)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[FIND\_ACTION\_COMMAND](#FIND_ACTION_COMMAND)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[REPLACE\_ACTION\_COMMAND](#REPLACE_ACTION_COMMAND)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[REPLACE\_ALL\_ACTION\_COMMAND](#REPLACE_ALL_ACTION_COMMAND)` | |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public static void` | `**[addTextListener](#addTextListener(java.awt.event.TextListener))**([TextListener](https://docs.oracle.com/javase/8/docs/api/java/awt/event/TextListener.html "TextListener") tl)` |
| | `public static void` | `**[dispose](#dispose())**()` |
| | `public void` | `**[focusGained](#focusGained(java.awt.event.FocusEvent))**([FocusEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/FocusEvent.html "FocusEvent") fe)` |
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getLastAction](#getLastAction())**()`
**Returns:**
the last action
|
| | `public static int` | `**[getReplacementCount](#getReplacementCount())**()`
**Returns:**
the replacement count
|
| | `public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getSearchText](#getSearchText())**()`
**Returns:**
the search text
|
| | `public void` | `**[keyTyped](#keyTyped(java.awt.event.KeyEvent))**([KeyEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/KeyEvent.html "KeyEvent") ke)` |
| | `public static void` | `**[registerTextComponent](#registerTextComponent(javax.swing.text.JTextComponent))**([JTextComponent](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/JTextComponent.html "JTextComponent") textComponent)`
**Parameters:**
`textComponent` - the text component to listen to
|
| | `public static void` | `**[removeTextListener](#removeTextListener(java.awt.event.TextListener))**([TextListener](https://docs.oracle.com/javase/8/docs/api/java/awt/event/TextListener.html "TextListener") tl)` |
| | `public static void` | `**[showDialog](#showDialog())**()` |
| | `public static void` | `**[showDialog](#showDialog(boolean))**(boolean isReplace)`
**Parameters:**
`isReplace` - show a replace dialog rather than a find dialog if true
|
| | `public static void` | `**[unregisterTextComponent](#unregisterTextComponent(javax.swing.text.JTextComponent))**([JTextComponent](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/JTextComponent.html "JTextComponent") textComponent)`
**Parameters:**
`textComponent` - the text component to stop listening to
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **CLOSE\_ACTION\_COMMAND**
### public static final [Action](https://docs.oracle.com/javase/8/docs/api/javax/swing/Action.html "Action") **FIND\_ACTION**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **FIND\_ACTION\_COMMAND**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **REPLACE\_ACTION\_COMMAND**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **REPLACE\_ALL\_ACTION\_COMMAND**
Method Detail
-------------
### public static void **addTextListener**([TextListener](https://docs.oracle.com/javase/8/docs/api/java/awt/event/TextListener.html "TextListener") tl)
### public static void **dispose**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **focusGained**([FocusEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/FocusEvent.html "FocusEvent") fe)
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getLastAction**()
**Returns:**
the last action
### public static int **getReplacementCount**()
**Returns:**
the replacement count
### public static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getSearchText**()
**Returns:**
the search text
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **keyTyped**([KeyEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/KeyEvent.html "KeyEvent") ke)
### public static void **registerTextComponent**([JTextComponent](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/JTextComponent.html "JTextComponent") textComponent)
**Parameters:**
`textComponent` - the text component to listen to
### public static void **removeTextListener**([TextListener](https://docs.oracle.com/javase/8/docs/api/java/awt/event/TextListener.html "TextListener") tl)
### public static void **showDialog**()
### public static void **showDialog**(boolean isReplace)
**Parameters:**
`isReplace` - show a replace dialog rather than a find dialog if true
### public static void **unregisterTextComponent**([JTextComponent](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/JTextComponent.html "JTextComponent") textComponent)
**Parameters:**
`textComponent` - the text component to stop listening to
groovy [Java] Class StructuredSyntaxDocumentFilter.LexerNode [Java] Class StructuredSyntaxDocumentFilter.LexerNode
=====================================================
* groovy.console.ui.text.StructuredSyntaxDocumentFilter.LexerNode
```
public final class StructuredSyntaxDocumentFilter.LexerNode
```
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style")` | `**[getDefaultStyle](#getDefaultStyle())**()` |
| | `public boolean` | `**[isInitialized](#isInitialized())**()`
**Returns:**
true if initialised
|
| | `public void` | `**[parse](#parse(java.nio.CharBuffer,%20int,%20int))**([CharBuffer](https://docs.oracle.com/javase/8/docs/api/java/nio/CharBuffer.html "CharBuffer") buffer, int offset, int length)`
**Parameters:**
buffer
|
| | `public void` | `**[putChild](#putChild(java.lang.String,%20LexerNode))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") regexp, [LexerNode](../../../../lexernode) node)`
**Parameters:**
regexp
|
| | `public void` | `**[putChild](#putChild(java.lang.String,%20LexerNode))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] regexps, [LexerNode](../../../../lexernode) node)`
**Parameters:**
regexps
|
| | `public void` | `**[putStyle](#putStyle(java.lang.String,%20javax.swing.text.Style))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") regexp, [Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style") style)`
**Parameters:**
regexp
|
| | `public void` | `**[putStyle](#putStyle(java.lang.String,%20javax.swing.text.Style))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] regexps, [Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style") style)`
**Parameters:**
regexps
|
| | `public void` | `**[removeChild](#removeChild(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") regexp)`
**Parameters:**
regexp
|
| | `public void` | `**[removeStyle](#removeStyle(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") regexp)`
**Parameters:**
regexp
|
| | `public void` | `**[removeStyle](#removeStyle(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] regexps)`
**Parameters:**
regexps
|
| | `public void` | `**[setDefaultStyle](#setDefaultStyle(javax.swing.text.Style))**([Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style") style)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Method Detail
-------------
### public [Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style") **getDefaultStyle**()
### public boolean **isInitialized**()
**Returns:**
true if initialised
### public void **parse**([CharBuffer](https://docs.oracle.com/javase/8/docs/api/java/nio/CharBuffer.html "CharBuffer") buffer, int offset, int length)
**throws:**
BadLocationException
**Parameters:**
buffer
offset
length
### public void **putChild**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") regexp, [LexerNode](../../../../lexernode) node)
**Parameters:**
regexp
node
### public void **putChild**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] regexps, [LexerNode](../../../../lexernode) node)
**Parameters:**
regexps
node
### public void **putStyle**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") regexp, [Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style") style)
**Parameters:**
regexp
style
### public void **putStyle**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] regexps, [Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style") style)
**Parameters:**
regexps
style
### public void **removeChild**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") regexp)
**Parameters:**
regexp
### public void **removeStyle**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") regexp)
**Parameters:**
regexp
### public void **removeStyle**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] regexps)
**Parameters:**
regexps
### public void **setDefaultStyle**([Style](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/Style.html "Style") style)
groovy [Java] Class StructuredSyntaxResources [Java] Class StructuredSyntaxResources
======================================
* groovy.console.ui.text.StructuredSyntaxResources
```
public final class StructuredSyntaxResources
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Contains all the basic resources and values used by the utility framework.
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [Font](https://docs.oracle.com/javase/8/docs/api/java/awt/Font.html "Font")**` | `[EDITOR\_FONT](#EDITOR_FONT)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[FIND](#FIND)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[FIND\_NEXT](#FIND_NEXT)` | |
| `**static [Font](https://docs.oracle.com/javase/8/docs/api/java/awt/Font.html "Font")**` | `[LARGE\_FONT](#LARGE_FONT)` | |
| `**static [Font](https://docs.oracle.com/javase/8/docs/api/java/awt/Font.html "Font")**` | `[MEDIUM\_FONT](#MEDIUM_FONT)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[PRINT](#PRINT)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[REDO](#REDO)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[REPLACE](#REPLACE)` | |
| `**static [Font](https://docs.oracle.com/javase/8/docs/api/java/awt/Font.html "Font")**` | `[SMALL\_FONT](#SMALL_FONT)` | |
| `**static [Clipboard](https://docs.oracle.com/javase/8/docs/api/java/awt/datatransfer/Clipboard.html "Clipboard")**` | `[SYSTEM\_CLIPBOARD](#SYSTEM_CLIPBOARD)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[UNDO](#UNDO)` | |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### public static final [Font](https://docs.oracle.com/javase/8/docs/api/java/awt/Font.html "Font") **EDITOR\_FONT**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **FIND**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **FIND\_NEXT**
### public static final [Font](https://docs.oracle.com/javase/8/docs/api/java/awt/Font.html "Font") **LARGE\_FONT**
### public static final [Font](https://docs.oracle.com/javase/8/docs/api/java/awt/Font.html "Font") **MEDIUM\_FONT**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **PRINT**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **REDO**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **REPLACE**
### public static final [Font](https://docs.oracle.com/javase/8/docs/api/java/awt/Font.html "Font") **SMALL\_FONT**
### public static final [Clipboard](https://docs.oracle.com/javase/8/docs/api/java/awt/datatransfer/Clipboard.html "Clipboard") **SYSTEM\_CLIPBOARD**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **UNDO**
groovy [Java] Class TextEditor [Java] Class TextEditor
=======================
* groovy.console.ui.text.TextEditor
All Implemented Interfaces and Traits:
[Pageable](https://docs.oracle.com/javase/8/docs/api/java/awt/print/Pageable.html "Pageable"), [Printable](https://docs.oracle.com/javase/8/docs/api/java/awt/print/Printable.html "Printable")
```
public class TextEditor
extends [JTextPane](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html "JTextPane")
implements [Pageable](https://docs.oracle.com/javase/8/docs/api/java/awt/print/Pageable.html "Pageable"), [Printable](https://docs.oracle.com/javase/8/docs/api/java/awt/print/Printable.html "Printable")
```
A simple text pane that is printable and wrapping is optional.
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[AUTO\_INDENT](#AUTO_INDENT)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[FIND](#FIND)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[FIND\_NEXT](#FIND_NEXT)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[FIND\_PREVIOUS](#FIND_PREVIOUS)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[REPLACE](#REPLACE)` | |
Inherited fields
| Fields inherited from class | Fields |
| **`class [JTextPane](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html "JTextPane")`** | `W3C_LENGTH_UNITS, HONOR_DISPLAY_PROPERTIES, FOCUS_ACCELERATOR_KEY, DEFAULT_KEYMAP, WHEN_FOCUSED, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_WINDOW, UNDEFINED_CONDITION, TOOL_TIP_TEXT_KEY, TOP_ALIGNMENT, CENTER_ALIGNMENT, BOTTOM_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, WIDTH, HEIGHT, PROPERTIES, SOMEBITS, FRAMEBITS, ALLBITS, ERROR, ABORT` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[TextEditor](#TextEditor())**()`Creates a new instance of TextEditor |
| `**[TextEditor](#TextEditor(boolean))**(boolean tabsAsSpaces)`Creates a new instance of TextEditor |
| `**[TextEditor](#TextEditor(boolean,%20boolean))**(boolean tabsAsSpaces, boolean multiLineTab)`Creates a new instance of TextEditor |
| `**[TextEditor](#TextEditor(boolean,%20boolean,%20boolean))**(boolean tabsAsSpaces, boolean multiLineTab, boolean unwrapped)`Creates a new instance of TextEditor |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[addNotify](#addNotify())**()` |
| | `public int` | `**[getNumberOfPages](#getNumberOfPages())**()` |
| | `public [PageFormat](https://docs.oracle.com/javase/8/docs/api/java/awt/print/PageFormat.html "PageFormat")` | `**[getPageFormat](#getPageFormat(int))**(int pageIndex)` |
| | `public [Printable](https://docs.oracle.com/javase/8/docs/api/java/awt/print/Printable.html "Printable")` | `**[getPrintable](#getPrintable(int))**(int param)` |
| | `public boolean` | `**[getScrollableTracksViewportWidth](#getScrollableTracksViewportWidth())**()` |
| | `public boolean` | `**[isMultiLineTabbed](#isMultiLineTabbed())**()`Whether using the tab key indents the selected lines of code |
| | `public void` | `**[isMultiLineTabbed](#isMultiLineTabbed(boolean))**(boolean multiLineTab)`
**Parameters:**
`multiLineTab` - the new multiLine tab value
|
| | `public static boolean` | `**[isOvertypeMode](#isOvertypeMode())**()`
**Returns:**
true if overtype mode is active, false for insert mode
|
| | `public boolean` | `**[isTabsAsSpaces](#isTabsAsSpaces())**()`
**Returns:**
true if tabs are converted to spaces upon typing
|
| | `public void` | `**[isTabsAsSpaces](#isTabsAsSpaces(boolean))**(boolean tabsAsSpaces)`
**Parameters:**
`tabsAsSpaces` - whether tabs are converted to spaces
|
| | `public boolean` | `**[isUnwrapped](#isUnwrapped())**()`
**Returns:**
true if text wrapping is disabled
|
| | `public void` | `**[mouseEntered](#mouseEntered(java.awt.event.MouseEvent))**([MouseEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/MouseEvent.html "MouseEvent") me)` |
| | `public void` | `**[mouseExited](#mouseExited(java.awt.event.MouseEvent))**([MouseEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/MouseEvent.html "MouseEvent") me)` |
| | `public int` | `**[print](#print(java.awt.Graphics,%20java.awt.print.PageFormat,%20int))**([Graphics](https://docs.oracle.com/javase/8/docs/api/java/awt/Graphics.html "Graphics") graphics, [PageFormat](https://docs.oracle.com/javase/8/docs/api/java/awt/print/PageFormat.html "PageFormat") pageFormat, int page)` |
| | `protected void` | `**[processKeyEvent](#processKeyEvent(java.awt.event.KeyEvent))**([KeyEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/KeyEvent.html "KeyEvent") e)` |
| | `public void` | `**[removeNotify](#removeNotify())**()` |
| | `public void` | `**[replaceSelection](#replaceSelection(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text)` |
| | `public void` | `**[setBounds](#setBounds(int,%20int,%20int,%20int))**(int x, int y, int width, int height)` |
| | `public void` | `**[setOvertypeMode](#setOvertypeMode(boolean))**(boolean isOvertypeMode)`Set the caret to use depending on overtype/insert mode |
| | `public void` | `**[setUnwrapped](#setUnwrapped(boolean))**(boolean unwrapped)`
**Parameters:**
`unwrapped` - the new unwrapped value
|
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [JTextPane](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html "JTextPane")` | `[getStyle](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getStyle(java.lang.String) "getStyle"), [setEditorKit](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setEditorKit(javax.swing.text.EditorKit) "setEditorKit"), [setStyledDocument](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setStyledDocument(javax.swing.text.StyledDocument) "setStyledDocument"), [setDocument](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setDocument(javax.swing.text.Document) "setDocument"), [replaceSelection](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#replaceSelection(java.lang.String) "replaceSelection"), [getStyledDocument](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getStyledDocument() "getStyledDocument"), [getInputAttributes](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getInputAttributes() "getInputAttributes"), [addStyle](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#addStyle(java.lang.String,%20javax.swing.text.Style) "addStyle"), [removeStyle](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#removeStyle(java.lang.String) "removeStyle"), [setLogicalStyle](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setLogicalStyle(javax.swing.text.Style) "setLogicalStyle"), [getLogicalStyle](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getLogicalStyle() "getLogicalStyle"), [setCharacterAttributes](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setCharacterAttributes(javax.swing.text.AttributeSet,%20boolean) "setCharacterAttributes"), [setParagraphAttributes](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setParagraphAttributes(javax.swing.text.AttributeSet,%20boolean) "setParagraphAttributes"), [insertComponent](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#insertComponent(java.awt.Component) "insertComponent"), [insertIcon](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#insertIcon(javax.swing.Icon) "insertIcon"), [getCharacterAttributes](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getCharacterAttributes() "getCharacterAttributes"), [getParagraphAttributes](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getParagraphAttributes() "getParagraphAttributes"), [getUIClassID](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getUIClassID() "getUIClassID"), [read](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#read(java.io.InputStream,%20java.lang.Object) "read"), [getText](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getText() "getText"), [setText](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setText(java.lang.String) "setText"), [setContentType](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setContentType(java.lang.String) "setContentType"), [getContentType](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getContentType() "getContentType"), [getEditorKitClassNameForContentType](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getEditorKitClassNameForContentType(java.lang.String) "getEditorKitClassNameForContentType"), [setEditorKitForContentType](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setEditorKitForContentType(java.lang.String,%20javax.swing.text.EditorKit) "setEditorKitForContentType"), [getEditorKit](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getEditorKit() "getEditorKit"), [setPage](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setPage(java.lang.String) "setPage"), [setPage](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setPage(java.net.URL) "setPage"), [getPage](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getPage() "getPage"), [scrollToReference](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#scrollToReference(java.lang.String) "scrollToReference"), [getEditorKitForContentType](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getEditorKitForContentType(java.lang.String) "getEditorKitForContentType"), [createEditorKitForContentType](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#createEditorKitForContentType(java.lang.String) "createEditorKitForContentType"), [registerEditorKitForContentType](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#registerEditorKitForContentType(java.lang.String,%20java.lang.String) "registerEditorKitForContentType"), [registerEditorKitForContentType](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#registerEditorKitForContentType(java.lang.String,%20java.lang.String,%20java.lang.ClassLoader) "registerEditorKitForContentType"), [addHyperlinkListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#addHyperlinkListener(javax.swing.event.HyperlinkListener) "addHyperlinkListener"), [removeHyperlinkListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#removeHyperlinkListener(javax.swing.event.HyperlinkListener) "removeHyperlinkListener"), [getHyperlinkListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getHyperlinkListeners() "getHyperlinkListeners"), [fireHyperlinkUpdate](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#fireHyperlinkUpdate(javax.swing.event.HyperlinkEvent) "fireHyperlinkUpdate"), [getAccessibleContext](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getAccessibleContext() "getAccessibleContext"), [getPreferredSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getPreferredSize() "getPreferredSize"), [getScrollableTracksViewportWidth](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getScrollableTracksViewportWidth() "getScrollableTracksViewportWidth"), [getScrollableTracksViewportHeight](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getScrollableTracksViewportHeight() "getScrollableTracksViewportHeight"), [write](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#write(java.io.Writer) "write"), [read](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#read(java.io.Reader,%20java.lang.Object) "read"), [getActions](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getActions() "getActions"), [print](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#print() "print"), [print](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#print(java.text.MessageFormat,%20java.text.MessageFormat) "print"), [print](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#print(java.text.MessageFormat,%20java.text.MessageFormat,%20boolean,%20javax.print.PrintService,%20javax.print.attribute.PrintRequestAttributeSet,%20boolean) "print"), [copy](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#copy() "copy"), [getText](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getText(int,%20int) "getText"), [getCaret](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getCaret() "getCaret"), [select](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#select(int,%20int) "select"), [addInputMethodListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#addInputMethodListener(java.awt.event.InputMethodListener) "addInputMethodListener"), [setComponentOrientation](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setComponentOrientation(java.awt.ComponentOrientation) "setComponentOrientation"), [getInputMethodRequests](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getInputMethodRequests() "getInputMethodRequests"), [setMargin](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setMargin(java.awt.Insets) "setMargin"), [getMargin](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getMargin() "getMargin"), [getCaretPosition](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getCaretPosition() "getCaretPosition"), [getSelectionStart](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getSelectionStart() "getSelectionStart"), [getSelectionEnd](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getSelectionEnd() "getSelectionEnd"), [modelToView](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#modelToView(int) "modelToView"), [setCaretPosition](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setCaretPosition(int) "setCaretPosition"), [viewToModel](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#viewToModel(java.awt.Point) "viewToModel"), [addKeymap](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#addKeymap(java.lang.String,%20javax.swing.text.Keymap) "addKeymap"), [modelToView2D](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#modelToView2D(int) "modelToView2D"), [viewToModel2D](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#viewToModel2D(java.awt.geom.Point2D) "viewToModel2D"), [moveCaretPosition](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#moveCaretPosition(int) "moveCaretPosition"), [getKeymap](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getKeymap() "getKeymap"), [getKeymap](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getKeymap(java.lang.String) "getKeymap"), [setCaret](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setCaret(javax.swing.text.Caret) "setCaret"), [addCaretListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#addCaretListener(javax.swing.event.CaretListener) "addCaretListener"), [removeCaretListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#removeCaretListener(javax.swing.event.CaretListener) "removeCaretListener"), [getCaretListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getCaretListeners() "getCaretListeners"), [setNavigationFilter](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setNavigationFilter(javax.swing.text.NavigationFilter) "setNavigationFilter"), [getNavigationFilter](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getNavigationFilter() "getNavigationFilter"), [getHighlighter](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getHighlighter() "getHighlighter"), [setHighlighter](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setHighlighter(javax.swing.text.Highlighter) "setHighlighter"), [setKeymap](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setKeymap(javax.swing.text.Keymap) "setKeymap"), [removeKeymap](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#removeKeymap(java.lang.String) "removeKeymap"), [loadKeymap](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#loadKeymap(javax.swing.text.Keymap,%20%5BLjavax.swing.text.JTextComponent%24KeyBinding;,%20%5BLjavax.swing.Action;) "loadKeymap"), [getCaretColor](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getCaretColor() "getCaretColor"), [setCaretColor](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setCaretColor(java.awt.Color) "setCaretColor"), [getSelectionColor](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getSelectionColor() "getSelectionColor"), [setSelectionColor](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setSelectionColor(java.awt.Color) "setSelectionColor"), [getSelectedTextColor](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getSelectedTextColor() "getSelectedTextColor"), [setSelectedTextColor](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setSelectedTextColor(java.awt.Color) "setSelectedTextColor"), [getDisabledTextColor](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getDisabledTextColor() "getDisabledTextColor"), [setDisabledTextColor](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setDisabledTextColor(java.awt.Color) "setDisabledTextColor"), [setFocusAccelerator](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setFocusAccelerator(char) "setFocusAccelerator"), [getFocusAccelerator](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getFocusAccelerator() "getFocusAccelerator"), [setSelectionStart](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setSelectionStart(int) "setSelectionStart"), [setSelectionEnd](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setSelectionEnd(int) "setSelectionEnd"), [removeNotify](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#removeNotify() "removeNotify"), [isEditable](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isEditable() "isEditable"), [updateUI](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#updateUI() "updateUI"), [setUI](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setUI(javax.swing.plaf.TextUI) "setUI"), [getUI](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getUI() "getUI"), [getUI](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getUI() "getUI"), [setEditable](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setEditable(boolean) "setEditable"), [getToolTipText](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getToolTipText(java.awt.event.MouseEvent) "getToolTipText"), [cut](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#cut() "cut"), [paste](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#paste() "paste"), [selectAll](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#selectAll() "selectAll"), [getDocument](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getDocument() "getDocument"), [getPrintable](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getPrintable(java.text.MessageFormat,%20java.text.MessageFormat) "getPrintable"), [setDragEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setDragEnabled(boolean) "setDragEnabled"), [getDragEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getDragEnabled() "getDragEnabled"), [setDropMode](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setDropMode(javax.swing.DropMode) "setDropMode"), [getDropMode](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getDropMode() "getDropMode"), [getDropLocation](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getDropLocation() "getDropLocation"), [getPreferredScrollableViewportSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getPreferredScrollableViewportSize() "getPreferredScrollableViewportSize"), [getScrollableUnitIncrement](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getScrollableUnitIncrement(java.awt.Rectangle,%20int,%20int) "getScrollableUnitIncrement"), [getScrollableBlockIncrement](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getScrollableBlockIncrement(java.awt.Rectangle,%20int,%20int) "getScrollableBlockIncrement"), [getSelectedText](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getSelectedText() "getSelectedText"), [update](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#update(java.awt.Graphics) "update"), [contains](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#contains(int,%20int) "contains"), [getBounds](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getBounds(java.awt.Rectangle) "getBounds"), [getLocation](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getLocation(java.awt.Point) "getLocation"), [print](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#print(java.awt.Graphics) "print"), [getSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getSize(java.awt.Dimension) "getSize"), [setOpaque](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setOpaque(boolean) "setOpaque"), [isOpaque](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isOpaque() "isOpaque"), [enable](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#enable() "enable"), [disable](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#disable() "disable"), [setEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setEnabled(boolean) "setEnabled"), [getVetoableChangeListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getVetoableChangeListeners() "getVetoableChangeListeners"), [removeAncestorListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#removeAncestorListener(javax.swing.event.AncestorListener) "removeAncestorListener"), [getAncestorListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getAncestorListeners() "getAncestorListeners"), [addNotify](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#addNotify() "addNotify"), [paintImmediately](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#paintImmediately(int,%20int,%20int,%20int) "paintImmediately"), [paintImmediately](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#paintImmediately(java.awt.Rectangle) "paintImmediately"), [hide](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#hide() "hide"), [setInheritsPopupMenu](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setInheritsPopupMenu(boolean) "setInheritsPopupMenu"), [setComponentPopupMenu](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setComponentPopupMenu(javax.swing.JPopupMenu) "setComponentPopupMenu"), [isPaintingTile](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isPaintingTile() "isPaintingTile"), [isPaintingForPrint](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isPaintingForPrint() "isPaintingForPrint"), [setRequestFocusEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setRequestFocusEnabled(boolean) "setRequestFocusEnabled"), [isRequestFocusEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isRequestFocusEnabled() "isRequestFocusEnabled"), [grabFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#grabFocus() "grabFocus"), [setVerifyInputWhenFocusTarget](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setVerifyInputWhenFocusTarget(boolean) "setVerifyInputWhenFocusTarget"), [getVerifyInputWhenFocusTarget](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getVerifyInputWhenFocusTarget() "getVerifyInputWhenFocusTarget"), [setBorder](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setBorder(javax.swing.border.Border) "setBorder"), [setAlignmentY](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setAlignmentY(float) "setAlignmentY"), [setAlignmentX](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setAlignmentX(float) "setAlignmentX"), [setInputVerifier](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setInputVerifier(javax.swing.InputVerifier) "setInputVerifier"), [getInputVerifier](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getInputVerifier() "getInputVerifier"), [setDebugGraphicsOptions](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setDebugGraphicsOptions(int) "setDebugGraphicsOptions"), [getDebugGraphicsOptions](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getDebugGraphicsOptions() "getDebugGraphicsOptions"), [unregisterKeyboardAction](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#unregisterKeyboardAction(javax.swing.KeyStroke) "unregisterKeyboardAction"), [getRegisteredKeyStrokes](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getRegisteredKeyStrokes() "getRegisteredKeyStrokes"), [getConditionForKeyStroke](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getConditionForKeyStroke(javax.swing.KeyStroke) "getConditionForKeyStroke"), [getActionForKeyStroke](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getActionForKeyStroke(javax.swing.KeyStroke) "getActionForKeyStroke"), [resetKeyboardActions](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#resetKeyboardActions() "resetKeyboardActions"), [requestDefaultFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#requestDefaultFocus() "requestDefaultFocus"), [setToolTipText](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setToolTipText(java.lang.String) "setToolTipText"), [getToolTipLocation](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getToolTipLocation(java.awt.event.MouseEvent) "getToolTipLocation"), [getPopupLocation](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getPopupLocation(java.awt.event.MouseEvent) "getPopupLocation"), [createToolTip](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#createToolTip() "createToolTip"), [getAutoscrolls](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getAutoscrolls() "getAutoscrolls"), [setTransferHandler](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setTransferHandler(javax.swing.TransferHandler) "setTransferHandler"), [getTransferHandler](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getTransferHandler() "getTransferHandler"), [getVisibleRect](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getVisibleRect() "getVisibleRect"), [getTopLevelAncestor](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getTopLevelAncestor() "getTopLevelAncestor"), [isValidateRoot](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isValidateRoot() "isValidateRoot"), [setDoubleBuffered](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setDoubleBuffered(boolean) "setDoubleBuffered"), [addAncestorListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#addAncestorListener(javax.swing.event.AncestorListener) "addAncestorListener"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#firePropertyChange(java.lang.String,%20int,%20int) "firePropertyChange"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#firePropertyChange(java.lang.String,%20boolean,%20boolean) "firePropertyChange"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#firePropertyChange(java.lang.String,%20char,%20char) "firePropertyChange"), [getListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getListeners(java.lang.Class) "getListeners"), [getClientProperty](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getClientProperty(java.lang.Object) "getClientProperty"), [getGraphics](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getGraphics() "getGraphics"), [getRootPane](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getRootPane() "getRootPane"), [getInheritsPopupMenu](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getInheritsPopupMenu() "getInheritsPopupMenu"), [getComponentPopupMenu](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getComponentPopupMenu() "getComponentPopupMenu"), [isManagingFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isManagingFocus() "isManagingFocus"), [getDefaultLocale](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getDefaultLocale() "getDefaultLocale"), [repaint](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#repaint(long,%20int,%20int,%20int,%20int) "repaint"), [repaint](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#repaint(java.awt.Rectangle) "repaint"), [putClientProperty](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#putClientProperty(java.lang.Object,%20java.lang.Object) "putClientProperty"), [setFont](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setFont(java.awt.Font) "setFont"), [isOptimizedDrawingEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isOptimizedDrawingEnabled() "isOptimizedDrawingEnabled"), [getWidth](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getWidth() "getWidth"), [getHeight](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getHeight() "getHeight"), [isLightweightComponent](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isLightweightComponent(java.awt.Component) "isLightweightComponent"), [paint](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#paint(java.awt.Graphics) "paint"), [printAll](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#printAll(java.awt.Graphics) "printAll"), [getBorder](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getBorder() "getBorder"), [isDoubleBuffered](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isDoubleBuffered() "isDoubleBuffered"), [getNextFocusableComponent](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getNextFocusableComponent() "getNextFocusableComponent"), [setNextFocusableComponent](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setNextFocusableComponent(java.awt.Component) "setNextFocusableComponent"), [requestFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#requestFocus(boolean) "requestFocus"), [requestFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#requestFocus() "requestFocus"), [requestFocusInWindow](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#requestFocusInWindow() "requestFocusInWindow"), [getFontMetrics](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getFontMetrics(java.awt.Font) "getFontMetrics"), [setPreferredSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setPreferredSize(java.awt.Dimension) "setPreferredSize"), [setMaximumSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setMaximumSize(java.awt.Dimension) "setMaximumSize"), [getMaximumSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getMaximumSize() "getMaximumSize"), [setMinimumSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setMinimumSize(java.awt.Dimension) "setMinimumSize"), [getMinimumSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getMinimumSize() "getMinimumSize"), [getInsets](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getInsets() "getInsets"), [getInsets](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getInsets(java.awt.Insets) "getInsets"), [getAlignmentY](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getAlignmentY() "getAlignmentY"), [getAlignmentX](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getAlignmentX() "getAlignmentX"), [getInputMap](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getInputMap(int) "getInputMap"), [getInputMap](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getInputMap() "getInputMap"), [getActionMap](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getActionMap() "getActionMap"), [registerKeyboardAction](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#registerKeyboardAction(java.awt.event.ActionListener,%20javax.swing.KeyStroke,%20int) "registerKeyboardAction"), [registerKeyboardAction](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#registerKeyboardAction(java.awt.event.ActionListener,%20java.lang.String,%20javax.swing.KeyStroke,%20int) "registerKeyboardAction"), [setInputMap](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setInputMap(int,%20javax.swing.InputMap) "setInputMap"), [setActionMap](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setActionMap(javax.swing.ActionMap) "setActionMap"), [getBaseline](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getBaseline(int,%20int) "getBaseline"), [getBaselineResizeBehavior](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getBaselineResizeBehavior() "getBaselineResizeBehavior"), [setForeground](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setForeground(java.awt.Color) "setForeground"), [setBackground](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setBackground(java.awt.Color) "setBackground"), [setDefaultLocale](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setDefaultLocale(java.util.Locale) "setDefaultLocale"), [getToolTipText](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getToolTipText() "getToolTipText"), [scrollRectToVisible](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#scrollRectToVisible(java.awt.Rectangle) "scrollRectToVisible"), [setAutoscrolls](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setAutoscrolls(boolean) "setAutoscrolls"), [setFocusTraversalKeys](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setFocusTraversalKeys(int,%20java.util.Set) "setFocusTraversalKeys"), [reshape](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#reshape(int,%20int,%20int,%20int) "reshape"), [computeVisibleRect](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#computeVisibleRect(java.awt.Rectangle) "computeVisibleRect"), [addVetoableChangeListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#addVetoableChangeListener(java.beans.VetoableChangeListener) "addVetoableChangeListener"), [removeVetoableChangeListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#removeVetoableChangeListener(java.beans.VetoableChangeListener) "removeVetoableChangeListener"), [revalidate](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#revalidate() "revalidate"), [setVisible](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setVisible(boolean) "setVisible"), [getY](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getY() "getY"), [getX](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getX() "getX"), [add](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#add(java.awt.Component) "add"), [add](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#add(java.lang.String,%20java.awt.Component) "add"), [add](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#add(java.awt.Component,%20java.lang.Object) "add"), [add](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#add(java.awt.Component,%20int) "add"), [add](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#add(java.awt.Component,%20java.lang.Object,%20int) "add"), [remove](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#remove(java.awt.Component) "remove"), [remove](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#remove(int) "remove"), [list](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#list(java.io.PrintWriter,%20int) "list"), [list](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#list(java.io.PrintStream,%20int) "list"), [validate](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#validate() "validate"), [removeAll](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#removeAll() "removeAll"), [invalidate](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#invalidate() "invalidate"), [locate](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#locate(int,%20int) "locate"), [getComponent](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getComponent(int) "getComponent"), [layout](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#layout() "layout"), [preferredSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#preferredSize() "preferredSize"), [minimumSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#minimumSize() "minimumSize"), [insets](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#insets() "insets"), [countComponents](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#countComponents() "countComponents"), [getComponentZOrder](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getComponentZOrder(java.awt.Component) "getComponentZOrder"), [doLayout](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#doLayout() "doLayout"), [deliverEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#deliverEvent(java.awt.Event) "deliverEvent"), [findComponentAt](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#findComponentAt(int,%20int) "findComponentAt"), [findComponentAt](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#findComponentAt(java.awt.Point) "findComponentAt"), [isFocusTraversalPolicyProvider](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isFocusTraversalPolicyProvider() "isFocusTraversalPolicyProvider"), [applyComponentOrientation](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#applyComponentOrientation(java.awt.ComponentOrientation) "applyComponentOrientation"), [addContainerListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#addContainerListener(java.awt.event.ContainerListener) "addContainerListener"), [setComponentZOrder](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setComponentZOrder(java.awt.Component,%20int) "setComponentZOrder"), [setLayout](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setLayout(java.awt.LayoutManager) "setLayout"), [paintComponents](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#paintComponents(java.awt.Graphics) "paintComponents"), [printComponents](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#printComponents(java.awt.Graphics) "printComponents"), [removeContainerListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#removeContainerListener(java.awt.event.ContainerListener) "removeContainerListener"), [getContainerListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getContainerListeners() "getContainerListeners"), [getMousePosition](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getMousePosition(boolean) "getMousePosition"), [isAncestorOf](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isAncestorOf(java.awt.Component) "isAncestorOf"), [getFocusTraversalKeys](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getFocusTraversalKeys(int) "getFocusTraversalKeys"), [areFocusTraversalKeysSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#areFocusTraversalKeysSet(int) "areFocusTraversalKeysSet"), [isFocusTraversalPolicySet](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isFocusTraversalPolicySet() "isFocusTraversalPolicySet"), [setFocusCycleRoot](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setFocusCycleRoot(boolean) "setFocusCycleRoot"), [setFocusTraversalPolicyProvider](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setFocusTraversalPolicyProvider(boolean) "setFocusTraversalPolicyProvider"), [transferFocusDownCycle](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#transferFocusDownCycle() "transferFocusDownCycle"), [isFocusCycleRoot](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isFocusCycleRoot() "isFocusCycleRoot"), [isFocusCycleRoot](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isFocusCycleRoot(java.awt.Container) "isFocusCycleRoot"), [getFocusTraversalPolicy](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getFocusTraversalPolicy() "getFocusTraversalPolicy"), [setFocusTraversalPolicy](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setFocusTraversalPolicy(java.awt.FocusTraversalPolicy) "setFocusTraversalPolicy"), [getLayout](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getLayout() "getLayout"), [getComponents](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getComponents() "getComponents"), [getComponentCount](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getComponentCount() "getComponentCount"), [getComponentAt](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getComponentAt(int,%20int) "getComponentAt"), [getComponentAt](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getComponentAt(java.awt.Point) "getComponentAt"), [addPropertyChangeListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#addPropertyChangeListener(java.lang.String,%20java.beans.PropertyChangeListener) "addPropertyChangeListener"), [addPropertyChangeListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#addPropertyChangeListener(java.beans.PropertyChangeListener) "addPropertyChangeListener"), [getName](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getName() "getName"), [add](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#add(java.awt.PopupMenu) "add"), [remove](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#remove(java.awt.MenuComponent) "remove"), [toString](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#toString() "toString"), [size](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#size() "size"), [contains](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#contains(java.awt.Point) "contains"), [list](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#list() "list"), [list](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#list(java.io.PrintWriter) "list"), [list](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#list(java.io.PrintStream) "list"), [getBounds](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getBounds() "getBounds"), [bounds](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#bounds() "bounds"), [getLocation](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getLocation() "getLocation"), [getParent](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getParent() "getParent"), [action](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#action(java.awt.Event,%20java.lang.Object) "action"), [setName](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setName(java.lang.String) "setName"), [location](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#location() "location"), [getSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getSize() "getSize"), [resize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#resize(java.awt.Dimension) "resize"), [resize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#resize(int,%20int) "resize"), [move](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#move(int,%20int) "move"), [setSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setSize(int,%20int) "setSize"), [setSize](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setSize(java.awt.Dimension) "setSize"), [getLocale](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getLocale() "getLocale"), [isEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isEnabled() "isEnabled"), [enable](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#enable(boolean) "enable"), [setLocale](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setLocale(java.util.Locale) "setLocale"), [isValid](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isValid() "isValid"), [dispatchEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#dispatchEvent(java.awt.AWTEvent) "dispatchEvent"), [mouseEnter](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#mouseEnter(java.awt.Event,%20int,%20int) "mouseEnter"), [mouseExit](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#mouseExit(java.awt.Event,%20int,%20int) "mouseExit"), [mouseMove](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#mouseMove(java.awt.Event,%20int,%20int) "mouseMove"), [mouseDown](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#mouseDown(java.awt.Event,%20int,%20int) "mouseDown"), [mouseDrag](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#mouseDrag(java.awt.Event,%20int,%20int) "mouseDrag"), [mouseUp](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#mouseUp(java.awt.Event,%20int,%20int) "mouseUp"), [keyDown](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#keyDown(java.awt.Event,%20int) "keyDown"), [keyUp](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#keyUp(java.awt.Event,%20int) "keyUp"), [gotFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#gotFocus(java.awt.Event,%20java.lang.Object) "gotFocus"), [lostFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#lostFocus(java.awt.Event,%20java.lang.Object) "lostFocus"), [isFocusTraversable](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isFocusTraversable() "isFocusTraversable"), [hasFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#hasFocus() "hasFocus"), [addComponentListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#addComponentListener(java.awt.event.ComponentListener) "addComponentListener"), [addFocusListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#addFocusListener(java.awt.event.FocusListener) "addFocusListener"), [addKeyListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#addKeyListener(java.awt.event.KeyListener) "addKeyListener"), [addMouseListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#addMouseListener(java.awt.event.MouseListener) "addMouseListener"), [addMouseMotionListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#addMouseMotionListener(java.awt.event.MouseMotionListener) "addMouseMotionListener"), [addHierarchyListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#addHierarchyListener(java.awt.event.HierarchyListener) "addHierarchyListener"), [addHierarchyBoundsListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) "addHierarchyBoundsListener"), [addMouseWheelListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#addMouseWheelListener(java.awt.event.MouseWheelListener) "addMouseWheelListener"), [setDropTarget](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setDropTarget(java.awt.dnd.DropTarget) "setDropTarget"), [getDropTarget](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getDropTarget() "getDropTarget"), [enableInputMethods](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#enableInputMethods(boolean) "enableInputMethods"), [isForegroundSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isForegroundSet() "isForegroundSet"), [isBackgroundSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isBackgroundSet() "isBackgroundSet"), [isFontSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isFontSet() "isFontSet"), [setCursor](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setCursor(java.awt.Cursor) "setCursor"), [getCursor](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getCursor() "getCursor"), [isCursorSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isCursorSet() "isCursorSet"), [paintAll](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#paintAll(java.awt.Graphics) "paintAll"), [imageUpdate](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#imageUpdate(java.awt.Image,%20int,%20int,%20int,%20int,%20int) "imageUpdate"), [setIgnoreRepaint](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setIgnoreRepaint(boolean) "setIgnoreRepaint"), [getIgnoreRepaint](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getIgnoreRepaint() "getIgnoreRepaint"), [removeComponentListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#removeComponentListener(java.awt.event.ComponentListener) "removeComponentListener"), [getComponentListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getComponentListeners() "getComponentListeners"), [removeFocusListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#removeFocusListener(java.awt.event.FocusListener) "removeFocusListener"), [getFocusListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getFocusListeners() "getFocusListeners"), [removeHierarchyListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#removeHierarchyListener(java.awt.event.HierarchyListener) "removeHierarchyListener"), [getHierarchyListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getHierarchyListeners() "getHierarchyListeners"), [removeHierarchyBoundsListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) "removeHierarchyBoundsListener"), [getHierarchyBoundsListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getHierarchyBoundsListeners() "getHierarchyBoundsListeners"), [removeKeyListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#removeKeyListener(java.awt.event.KeyListener) "removeKeyListener"), [getKeyListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getKeyListeners() "getKeyListeners"), [removeMouseListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#removeMouseListener(java.awt.event.MouseListener) "removeMouseListener"), [getMouseListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getMouseListeners() "getMouseListeners"), [removeMouseMotionListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#removeMouseMotionListener(java.awt.event.MouseMotionListener) "removeMouseMotionListener"), [getMouseMotionListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getMouseMotionListeners() "getMouseMotionListeners"), [removeMouseWheelListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#removeMouseWheelListener(java.awt.event.MouseWheelListener) "removeMouseWheelListener"), [getMouseWheelListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getMouseWheelListeners() "getMouseWheelListeners"), [removeInputMethodListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#removeInputMethodListener(java.awt.event.InputMethodListener) "removeInputMethodListener"), [getInputMethodListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getInputMethodListeners() "getInputMethodListeners"), [setFocusable](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setFocusable(boolean) "setFocusable"), [setFocusTraversalKeysEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setFocusTraversalKeysEnabled(boolean) "setFocusTraversalKeysEnabled"), [getFocusTraversalKeysEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getFocusTraversalKeysEnabled() "getFocusTraversalKeysEnabled"), [transferFocusUpCycle](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#transferFocusUpCycle() "transferFocusUpCycle"), [getComponentOrientation](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getComponentOrientation() "getComponentOrientation"), [setMixingCutoutShape](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setMixingCutoutShape(java.awt.Shape) "setMixingCutoutShape"), [setLocation](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setLocation(java.awt.Point) "setLocation"), [setLocation](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setLocation(int,%20int) "setLocation"), [getPropertyChangeListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getPropertyChangeListeners(java.lang.String) "getPropertyChangeListeners"), [getPropertyChangeListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getPropertyChangeListeners() "getPropertyChangeListeners"), [isShowing](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isShowing() "isShowing"), [getGraphicsConfiguration](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getGraphicsConfiguration() "getGraphicsConfiguration"), [isFocusable](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isFocusable() "isFocusable"), [isFocusOwner](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isFocusOwner() "isFocusOwner"), [transferFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#transferFocus() "transferFocus"), [postEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#postEvent(java.awt.Event) "postEvent"), [transferFocusBackward](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#transferFocusBackward() "transferFocusBackward"), [getMousePosition](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getMousePosition() "getMousePosition"), [getToolkit](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getToolkit() "getToolkit"), [getLocationOnScreen](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getLocationOnScreen() "getLocationOnScreen"), [getInputContext](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getInputContext() "getInputContext"), [show](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#show(boolean) "show"), [show](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#show() "show"), [getColorModel](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getColorModel() "getColorModel"), [createImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#createImage(int,%20int) "createImage"), [createImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#createImage(java.awt.image.ImageProducer) "createImage"), [createVolatileImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#createVolatileImage(int,%20int,%20java.awt.ImageCapabilities) "createVolatileImage"), [createVolatileImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#createVolatileImage(int,%20int) "createVolatileImage"), [prepareImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#prepareImage(java.awt.Image,%20int,%20int,%20java.awt.image.ImageObserver) "prepareImage"), [prepareImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#prepareImage(java.awt.Image,%20java.awt.image.ImageObserver) "prepareImage"), [checkImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#checkImage(java.awt.Image,%20int,%20int,%20java.awt.image.ImageObserver) "checkImage"), [checkImage](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#checkImage(java.awt.Image,%20java.awt.image.ImageObserver) "checkImage"), [inside](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#inside(int,%20int) "inside"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#firePropertyChange(java.lang.String,%20byte,%20byte) "firePropertyChange"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#firePropertyChange(java.lang.String,%20double,%20double) "firePropertyChange"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#firePropertyChange(java.lang.String,%20float,%20float) "firePropertyChange"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#firePropertyChange(java.lang.String,%20long,%20long) "firePropertyChange"), [firePropertyChange](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#firePropertyChange(java.lang.String,%20short,%20short) "firePropertyChange"), [removePropertyChangeListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#removePropertyChangeListener(java.lang.String,%20java.beans.PropertyChangeListener) "removePropertyChangeListener"), [removePropertyChangeListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#removePropertyChangeListener(java.beans.PropertyChangeListener) "removePropertyChangeListener"), [repaint](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#repaint(int,%20int,%20int,%20int) "repaint"), [repaint](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#repaint() "repaint"), [repaint](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#repaint(long) "repaint"), [getForeground](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getForeground() "getForeground"), [getFont](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getFont() "getFont"), [getTreeLock](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getTreeLock() "getTreeLock"), [getFocusCycleRootAncestor](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getFocusCycleRootAncestor() "getFocusCycleRootAncestor"), [isDisplayable](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isDisplayable() "isDisplayable"), [nextFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#nextFocus() "nextFocus"), [requestFocus](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#requestFocus(java.awt.event.FocusEvent%24Cause) "requestFocus"), [requestFocusInWindow](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#requestFocusInWindow(java.awt.event.FocusEvent%24Cause) "requestFocusInWindow"), [isPreferredSizeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isPreferredSizeSet() "isPreferredSizeSet"), [isMaximumSizeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isMaximumSizeSet() "isMaximumSizeSet"), [isMinimumSizeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isMinimumSizeSet() "isMinimumSizeSet"), [getBackground](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getBackground() "getBackground"), [isLightweight](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isLightweight() "isLightweight"), [setBounds](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setBounds(int,%20int,%20int,%20int) "setBounds"), [setBounds](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#setBounds(java.awt.Rectangle) "setBounds"), [handleEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#handleEvent(java.awt.Event) "handleEvent"), [isVisible](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#isVisible() "isVisible"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#equals(java.lang.Object) "equals"), [hashCode](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html#notifyAll() "notifyAll")` |
Field Detail
------------
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **AUTO\_INDENT**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **FIND**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **FIND\_NEXT**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **FIND\_PREVIOUS**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **REPLACE**
Constructor Detail
------------------
### public **TextEditor**()
Creates a new instance of TextEditor
### public **TextEditor**(boolean tabsAsSpaces)
Creates a new instance of TextEditor
### public **TextEditor**(boolean tabsAsSpaces, boolean multiLineTab)
Creates a new instance of TextEditor
### public **TextEditor**(boolean tabsAsSpaces, boolean multiLineTab, boolean unwrapped)
Creates a new instance of TextEditor
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **addNotify**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getNumberOfPages**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [PageFormat](https://docs.oracle.com/javase/8/docs/api/java/awt/print/PageFormat.html "PageFormat") **getPageFormat**(int pageIndex)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Printable](https://docs.oracle.com/javase/8/docs/api/java/awt/print/Printable.html "Printable") **getPrintable**(int param)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **getScrollableTracksViewportWidth**()
### public boolean **isMultiLineTabbed**()
Whether using the tab key indents the selected lines of code
**Returns:**
true if multiline tabbing is active
### public void **isMultiLineTabbed**(boolean multiLineTab)
**Parameters:**
`multiLineTab` - the new multiLine tab value
### public static boolean **isOvertypeMode**()
**Returns:**
true if overtype mode is active, false for insert mode
### public boolean **isTabsAsSpaces**()
**Returns:**
true if tabs are converted to spaces upon typing
### public void **isTabsAsSpaces**(boolean tabsAsSpaces)
**Parameters:**
`tabsAsSpaces` - whether tabs are converted to spaces
### public boolean **isUnwrapped**()
**Returns:**
true if text wrapping is disabled
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **mouseEntered**([MouseEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/MouseEvent.html "MouseEvent") me)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **mouseExited**([MouseEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/MouseEvent.html "MouseEvent") me)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **print**([Graphics](https://docs.oracle.com/javase/8/docs/api/java/awt/Graphics.html "Graphics") graphics, [PageFormat](https://docs.oracle.com/javase/8/docs/api/java/awt/print/PageFormat.html "PageFormat") pageFormat, int page)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **processKeyEvent**([KeyEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/KeyEvent.html "KeyEvent") e)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **removeNotify**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **replaceSelection**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setBounds**(int x, int y, int width, int height)
### public void **setOvertypeMode**(boolean isOvertypeMode)
Set the caret to use depending on overtype/insert mode
**Parameters:**
`isOvertypeMode` - the new mode; true = overtype
### public void **setUnwrapped**(boolean unwrapped)
**Parameters:**
`unwrapped` - the new unwrapped value
| programming_docs |
groovy [Java] Class TextUndoManager [Java] Class TextUndoManager
============================
* groovy.console.ui.text.TextUndoManager
```
public class TextUndoManager
extends [UndoManager](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html "UndoManager")
```
To use this, simply drop this as an UndoableEditListener into your document, and then create actions to call undo/redo as needed (checking can undo/redo first, of course).
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[TextUndoManager](#TextUndoManager())**()`Creates a new instance of TextUndoManager. |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[addPropertyChangeListener](#addPropertyChangeListener(java.beans.PropertyChangeListener))**([PropertyChangeListener](https://docs.oracle.com/javase/8/docs/api/java/beans/PropertyChangeListener.html "PropertyChangeListener") pcl)` |
| | `public void` | `**[die](#die())**()` |
| | `public void` | `**[discardAllEdits](#discardAllEdits())**()` |
| | `protected void` | `**[firePropertyChangeEvent](#firePropertyChangeEvent(java.lang.String,%20boolean,%20boolean))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, boolean oldValue, boolean newValue)` |
| | `public boolean` | `**[hasChanged](#hasChanged())**()` |
| | `public void` | `**[redo](#redo())**()` |
| | `protected void` | `**[redoTo](#redoTo(javax.swing.undo.UndoableEdit))**([UndoableEdit](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoableEdit.html "UndoableEdit") edit)` |
| | `public void` | `**[removePropertyChangeListener](#removePropertyChangeListener(java.beans.PropertyChangeListener))**([PropertyChangeListener](https://docs.oracle.com/javase/8/docs/api/java/beans/PropertyChangeListener.html "PropertyChangeListener") pcl)` |
| | `public void` | `**[reset](#reset())**()` |
| | `protected void` | `**[trimEdits](#trimEdits(int,%20int))**(int from, int to)` |
| | `public void` | `**[undo](#undo())**()` |
| | `public void` | `**[undoableEditHappened](#undoableEditHappened(javax.swing.event.UndoableEditEvent))**([UndoableEditEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/UndoableEditEvent.html "UndoableEditEvent") uee)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [UndoManager](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html "UndoManager")` | `[toString](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#toString() "toString"), [end](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#end() "end"), [getLimit](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#getLimit() "getLimit"), [setLimit](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#setLimit(int) "setLimit"), [addEdit](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#addEdit(javax.swing.undo.UndoableEdit) "addEdit"), [undoableEditHappened](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#undoableEditHappened(javax.swing.event.UndoableEditEvent) "undoableEditHappened"), [undo](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#undo() "undo"), [canUndo](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#canUndo() "canUndo"), [redo](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#redo() "redo"), [canRedo](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#canRedo() "canRedo"), [getUndoPresentationName](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#getUndoPresentationName() "getUndoPresentationName"), [getRedoPresentationName](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#getRedoPresentationName() "getRedoPresentationName"), [discardAllEdits](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#discardAllEdits() "discardAllEdits"), [undoOrRedo](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#undoOrRedo() "undoOrRedo"), [canUndoOrRedo](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#canUndoOrRedo() "canUndoOrRedo"), [getUndoOrRedoPresentationName](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#getUndoOrRedoPresentationName() "getUndoOrRedoPresentationName"), [die](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#die() "die"), [isSignificant](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#isSignificant() "isSignificant"), [getPresentationName](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#getPresentationName() "getPresentationName"), [isInProgress](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#isInProgress() "isInProgress"), [replaceEdit](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#replaceEdit(javax.swing.undo.UndoableEdit) "replaceEdit"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#equals(java.lang.Object) "equals"), [hashCode](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoManager.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **TextUndoManager**()
Creates a new instance of TextUndoManager.
Method Detail
-------------
### public void **addPropertyChangeListener**([PropertyChangeListener](https://docs.oracle.com/javase/8/docs/api/java/beans/PropertyChangeListener.html "PropertyChangeListener") pcl)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **die**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **discardAllEdits**()
### protected void **firePropertyChangeEvent**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, boolean oldValue, boolean newValue)
### public boolean **hasChanged**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **redo**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **redoTo**([UndoableEdit](https://docs.oracle.com/javase/8/docs/api/javax/swing/undo/UndoableEdit.html "UndoableEdit") edit)
### public void **removePropertyChangeListener**([PropertyChangeListener](https://docs.oracle.com/javase/8/docs/api/java/beans/PropertyChangeListener.html "PropertyChangeListener") pcl)
### public void **reset**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **trimEdits**(int from, int to)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **undo**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **undoableEditHappened**([UndoableEditEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/UndoableEditEvent.html "UndoableEditEvent") uee)
groovy [Java] Class StructuredSyntaxHandler [Java] Class StructuredSyntaxHandler
====================================
* groovy.console.ui.text.StructuredSyntaxHandler
```
public class StructuredSyntaxHandler
extends [DefaultHandler](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html "DefaultHandler")
```
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[ALIGNMENT](#ALIGNMENT)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[ALIGN\_CENTER](#ALIGN_CENTER)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[ALIGN\_JUSTIFIED](#ALIGN_JUSTIFIED)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[ALIGN\_LEFT](#ALIGN_LEFT)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[ALIGN\_RIGHT](#ALIGN_RIGHT)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[BACKGROUND](#BACKGROUND)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[BIDI\_LEVEL](#BIDI_LEVEL)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[BOLD](#BOLD)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[COMPONENT\_ATTRIBUTE](#COMPONENT_ATTRIBUTE)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[COMPONENT\_ELEMENT\_NAME](#COMPONENT_ELEMENT_NAME)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[COMPOSED\_TEXT\_ATTRIBUTE](#COMPOSED_TEXT_ATTRIBUTE)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[FIRST\_LINE\_INDENT](#FIRST_LINE_INDENT)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[FONT\_FAMILY](#FONT_FAMILY)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[FONT\_SIZE](#FONT_SIZE)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[FOREGROUND](#FOREGROUND)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[ICON\_ATTRIBUTE](#ICON_ATTRIBUTE)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[ICON\_ELEMENT\_NAME](#ICON_ELEMENT_NAME)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[ITALIC](#ITALIC)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[LEFT\_INDENT](#LEFT_INDENT)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[LINE\_SPACING](#LINE_SPACING)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[MODEL\_ATTRIBUTE](#MODEL_ATTRIBUTE)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[NAME\_ATTRIBUTE](#NAME_ATTRIBUTE)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[ORIENTATION](#ORIENTATION)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[REGEXP](#REGEXP)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[RESOLVE\_ATTRIBUTE](#RESOLVE_ATTRIBUTE)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[RIGHT\_INDENT](#RIGHT_INDENT)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[SPACE\_ABOVE](#SPACE_ABOVE)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[SPACE\_BELOW](#SPACE_BELOW)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[STRIKE\_THROUGH](#STRIKE_THROUGH)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[STYLE](#STYLE)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[SUBSCRIPT](#SUBSCRIPT)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[SUPERSCRIPT](#SUPERSCRIPT)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[TAB\_SET](#TAB_SET)` | |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[UNDERLINE](#UNDERLINE)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[StructuredSyntaxHandler](#StructuredSyntaxHandler(groovy.console.ui.text.StructuredSyntaxDocumentFilter))**([StructuredSyntaxDocumentFilter](structuredsyntaxdocumentfilter) filter)`Creates a new instance of MasterFrameHandler |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[characters](#characters(char%5B%5D,%20int,%20int))**(char[] ch, int start, int length)` |
| | `public void` | `**[endDocument](#endDocument())**()` |
| | `public void` | `**[endElement](#endElement(java.lang.String,%20java.lang.String,%20java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") uri, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") localName, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") qName)` |
| | `public void` | `**[error](#error(org.xml.sax.SAXParseException))**([SAXParseException](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/SAXParseException.html "SAXParseException") e)` |
| | `public void` | `**[startDocument](#startDocument())**()` |
| | `public void` | `**[startElement](#startElement(java.lang.String,%20java.lang.String,%20java.lang.String,%20org.xml.sax.Attributes))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") uri, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") localName, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") qName, [Attributes](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/Attributes.html "Attributes") attributes)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [DefaultHandler](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html "DefaultHandler")` | `[error](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#error(org.xml.sax.SAXParseException) "error"), [warning](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#warning(org.xml.sax.SAXParseException) "warning"), [unparsedEntityDecl](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#unparsedEntityDecl(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String) "unparsedEntityDecl"), [notationDecl](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#notationDecl(java.lang.String,%20java.lang.String,%20java.lang.String) "notationDecl"), [setDocumentLocator](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#setDocumentLocator(org.xml.sax.Locator) "setDocumentLocator"), [startDocument](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#startDocument() "startDocument"), [endDocument](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#endDocument() "endDocument"), [startPrefixMapping](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#startPrefixMapping(java.lang.String,%20java.lang.String) "startPrefixMapping"), [endPrefixMapping](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#endPrefixMapping(java.lang.String) "endPrefixMapping"), [startElement](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#startElement(java.lang.String,%20java.lang.String,%20java.lang.String,%20org.xml.sax.Attributes) "startElement"), [endElement](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#endElement(java.lang.String,%20java.lang.String,%20java.lang.String) "endElement"), [characters](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#characters(%5BC,%20int,%20int) "characters"), [ignorableWhitespace](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#ignorableWhitespace(%5BC,%20int,%20int) "ignorableWhitespace"), [processingInstruction](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#processingInstruction(java.lang.String,%20java.lang.String) "processingInstruction"), [skippedEntity](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#skippedEntity(java.lang.String) "skippedEntity"), [resolveEntity](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#resolveEntity(java.lang.String,%20java.lang.String) "resolveEntity"), [fatalError](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#fatalError(org.xml.sax.SAXParseException) "fatalError"), [wait](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#notifyAll() "notifyAll"), [declaration](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/DefaultHandler.html#declaration(java.lang.String,%20java.lang.String,%20java.lang.String) "declaration")` |
Field Detail
------------
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **ALIGNMENT**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **ALIGN\_CENTER**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **ALIGN\_JUSTIFIED**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **ALIGN\_LEFT**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **ALIGN\_RIGHT**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **BACKGROUND**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **BIDI\_LEVEL**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **BOLD**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **COMPONENT\_ATTRIBUTE**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **COMPONENT\_ELEMENT\_NAME**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **COMPOSED\_TEXT\_ATTRIBUTE**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **FIRST\_LINE\_INDENT**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **FONT\_FAMILY**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **FONT\_SIZE**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **FOREGROUND**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **ICON\_ATTRIBUTE**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **ICON\_ELEMENT\_NAME**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **ITALIC**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **LEFT\_INDENT**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **LINE\_SPACING**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **MODEL\_ATTRIBUTE**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **NAME\_ATTRIBUTE**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **ORIENTATION**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **REGEXP**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **RESOLVE\_ATTRIBUTE**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **RIGHT\_INDENT**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **SPACE\_ABOVE**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **SPACE\_BELOW**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **STRIKE\_THROUGH**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **STYLE**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **SUBSCRIPT**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **SUPERSCRIPT**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **TAB\_SET**
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **UNDERLINE**
Constructor Detail
------------------
### public **StructuredSyntaxHandler**([StructuredSyntaxDocumentFilter](structuredsyntaxdocumentfilter) filter)
Creates a new instance of MasterFrameHandler
**Parameters:**
filter
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **characters**(char[] ch, int start, int length)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **endDocument**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **endElement**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") uri, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") localName, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") qName)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **error**([SAXParseException](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/SAXParseException.html "SAXParseException") e)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **startDocument**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **startElement**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") uri, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") localName, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") qName, [Attributes](https://docs.oracle.com/javase/8/docs/api/org/xml/sax/Attributes.html "Attributes") attributes)
| programming_docs |
groovy [Groovy] Class AutoIndentAction [Groovy] Class AutoIndentAction
===============================
* groovy.console.ui.text.AutoIndentAction
```
@[CompileStatic](../../../transform/compilestatic "CompileStatic")
class AutoIndentAction
extends [AbstractAction](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractAction.html "AbstractAction")
```
Inherited fields
| Fields inherited from class | Fields |
| **`class [AbstractAction](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractAction.html "AbstractAction")`** | `DEFAULT, NAME, SHORT_DESCRIPTION, LONG_DESCRIPTION, SMALL_ICON, ACTION_COMMAND_KEY, ACCELERATOR_KEY, MNEMONIC_KEY, SELECTED_KEY, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY` |
Properties Summary
------------------
Properties
| Type | Name and description |
| `**[AttributeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/AttributeSet.html "AttributeSet")**` | `[simpleAttributeSet](#simpleAttributeSet)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[AutoIndentAction](#AutoIndentAction())**()` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `void` | `**[actionPerformed](#actionPerformed(java.awt.event.ActionEvent))**([ActionEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/ActionEvent.html "ActionEvent") evt)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [AbstractAction](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractAction.html "AbstractAction")` | `[getValue](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractAction.html#getValue(java.lang.String) "getValue"), [getKeys](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractAction.html#getKeys() "getKeys"), [putValue](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractAction.html#putValue(java.lang.String,%20java.lang.Object) "putValue"), [isEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractAction.html#isEnabled() "isEnabled"), [setEnabled](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractAction.html#setEnabled(boolean) "setEnabled"), [getPropertyChangeListeners](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractAction.html#getPropertyChangeListeners() "getPropertyChangeListeners"), [removePropertyChangeListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractAction.html#removePropertyChangeListener(java.beans.PropertyChangeListener) "removePropertyChangeListener"), [addPropertyChangeListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractAction.html#addPropertyChangeListener(java.beans.PropertyChangeListener) "addPropertyChangeListener"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractAction.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractAction.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractAction.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractAction.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractAction.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractAction.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractAction.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractAction.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractAction.html#notifyAll() "notifyAll"), [accept](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractAction.html#accept(java.lang.Object) "accept"), [actionPerformed](https://docs.oracle.com/javase/8/docs/api/javax/swing/AbstractAction.html#actionPerformed(java.awt.event.ActionEvent) "actionPerformed")` |
Property Detail
---------------
###
[AttributeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/AttributeSet.html "AttributeSet") **simpleAttributeSet**
Constructor Detail
------------------
###
**AutoIndentAction**()
Method Detail
-------------
### void **actionPerformed**([ActionEvent](https://docs.oracle.com/javase/8/docs/api/java/awt/event/ActionEvent.html "ActionEvent") evt)
groovy [Java] Class MatchingHighlighter [Java] Class MatchingHighlighter
================================
* groovy.console.ui.text.MatchingHighlighter
All Implemented Interfaces and Traits: [CaretListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/CaretListener.html "CaretListener")
```
public class MatchingHighlighter
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [CaretListener](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/CaretListener.html "CaretListener")
```
Represents highlighter to highlight matched parentheses, brackets and curly braces when caret touching them
**Since:**
3.0.0
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[MatchingHighlighter](#MatchingHighlighter(groovy.console.ui.text.SmartDocumentFilter,%20javax.swing.JTextPane))**([SmartDocumentFilter](smartdocumentfilter) smartDocumentFilter, [JTextPane](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html "JTextPane") textEditor)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[caretUpdate](#caretUpdate(javax.swing.event.CaretEvent))**([CaretEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/CaretEvent.html "CaretEvent") e)` |
| | `public void` | `**[highlight](#highlight())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **MatchingHighlighter**([SmartDocumentFilter](smartdocumentfilter) smartDocumentFilter, [JTextPane](https://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html "JTextPane") textEditor)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **caretUpdate**([CaretEvent](https://docs.oracle.com/javase/8/docs/api/javax/swing/event/CaretEvent.html "CaretEvent") e)
### public void **highlight**()
groovy [Java] Class StructuredSyntaxDocumentFilter.MultiLineRun [Java] Class StructuredSyntaxDocumentFilter.MultiLineRun
========================================================
* groovy.console.ui.text.StructuredSyntaxDocumentFilter.MultiLineRun
```
protected class StructuredSyntaxDocumentFilter.MultiLineRun
```
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[MultiLineRun](#MultiLineRun(int,%20int))**(int start, int end)` |
| `**[MultiLineRun](#MultiLineRun(int,%20int,%20int))**(int start, int end, int delimeterSize)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public int` | `**[end](#end())**()` |
| | `public int` | `**[getDelimeterSize](#getDelimeterSize())**()` |
| | `public int` | `**[length](#length())**()` |
| | `public int` | `**[start](#start())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **MultiLineRun**(int start, int end)
### public **MultiLineRun**(int start, int end, int delimeterSize)
Method Detail
-------------
### public int **end**()
### public int **getDelimeterSize**()
### public int **length**()
### public int **start**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
groovy [Java] Class StructuredSyntaxDocumentFilter [Java] Class StructuredSyntaxDocumentFilter
===========================================
* groovy.console.ui.text.StructuredSyntaxDocumentFilter
```
public class StructuredSyntaxDocumentFilter
extends [DocumentFilter](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html "DocumentFilter")
```
Nested Class Summary
--------------------
Nested classes
| Modifiers | Name | Description |
| `**class**` | `[StructuredSyntaxDocumentFilter.LexerNode](structuredsyntaxdocumentfilter.lexernode)` | |
| `**protected class**` | `[StructuredSyntaxDocumentFilter.MultiLineRun](structuredsyntaxdocumentfilter.multilinerun)` | |
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[TAB\_REPLACEMENT](#TAB_REPLACEMENT)` | |
| `**protected [LexerNode](../../../../lexernode)**` | `[lexer](#lexer)` | The root of the lexical parsing tree. |
| `**protected [SortedSet](https://docs.oracle.com/javase/8/docs/api/java/util/SortedSet.html "SortedSet")**` | `[mlTextRunSet](#mlTextRunSet)` | The position tree of multi-line comments. |
| `**protected [DefaultStyledDocument](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DefaultStyledDocument.html "DefaultStyledDocument")**` | `[styledDocument](#styledDocument)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[StructuredSyntaxDocumentFilter](#StructuredSyntaxDocumentFilter(javax.swing.text.DefaultStyledDocument))**([DefaultStyledDocument](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DefaultStyledDocument.html "DefaultStyledDocument") document)`Creates a new instance of StructuredSyntaxDocumentFilter |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [LexerNode](../../../../lexernode)` | `**[createLexerNode](#createLexerNode())**()`Create a new LexerNode for adding to root. |
| | `public [LexerNode](../../../../lexernode)` | `**[getRootNode](#getRootNode())**()`Get the root node for lexing the document. |
| | `public void` | `**[insertString](#insertString(javax.swing.text.DocumentFilter%24FilterBypass,%20int,%20java.lang.String,%20javax.swing.text.AttributeSet))**([DocumentFilter.FilterBypass](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.FilterBypass.html "DocumentFilter.FilterBypass") fb, int offset, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text, [AttributeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/AttributeSet.html "AttributeSet") attrs)`Insert a string into the document, and then parse it if the parser has been set. |
| | `protected void` | `**[parseDocument](#parseDocument(int,%20int))**(int offset, int length)`Parse the Document to update the character styles given an initial start position. |
| | `public void` | `**[remove](#remove(javax.swing.text.DocumentFilter%24FilterBypass,%20int,%20int))**([DocumentFilter.FilterBypass](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.FilterBypass.html "DocumentFilter.FilterBypass") fb, int offset, int length)`Remove a string from the document, and then parse it if the parser has been set. |
| | `public void` | `**[replace](#replace(javax.swing.text.DocumentFilter%24FilterBypass,%20int,%20int,%20java.lang.String,%20javax.swing.text.AttributeSet))**([DocumentFilter.FilterBypass](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.FilterBypass.html "DocumentFilter.FilterBypass") fb, int offset, int length, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text, [AttributeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/AttributeSet.html "AttributeSet") attrs)`Replace a string in the document, and then parse it if the parser has been set. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [DocumentFilter](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html "DocumentFilter")` | `[remove](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#remove(javax.swing.text.DocumentFilter%24FilterBypass,%20int,%20int) "remove"), [replace](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#replace(javax.swing.text.DocumentFilter%24FilterBypass,%20int,%20int,%20java.lang.String,%20javax.swing.text.AttributeSet) "replace"), [insertString](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#insertString(javax.swing.text.DocumentFilter%24FilterBypass,%20int,%20java.lang.String,%20javax.swing.text.AttributeSet) "insertString"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.html#notifyAll() "notifyAll")` |
Field Detail
------------
### public static final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **TAB\_REPLACEMENT**
### protected [LexerNode](../../../../lexernode) **lexer**
The root of the lexical parsing tree.
### protected [SortedSet](https://docs.oracle.com/javase/8/docs/api/java/util/SortedSet.html "SortedSet") **mlTextRunSet**
The position tree of multi-line comments.
### protected [DefaultStyledDocument](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DefaultStyledDocument.html "DefaultStyledDocument") **styledDocument**
Constructor Detail
------------------
### public **StructuredSyntaxDocumentFilter**([DefaultStyledDocument](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DefaultStyledDocument.html "DefaultStyledDocument") document)
Creates a new instance of StructuredSyntaxDocumentFilter
**Parameters:**
`document` - the styled document to parse
Method Detail
-------------
### public [LexerNode](../../../../lexernode) **createLexerNode**()
Create a new LexerNode for adding to root.
**Returns:**
a new LexerNode
### public [LexerNode](../../../../lexernode) **getRootNode**()
Get the root node for lexing the document. Children can be added such that matching patterns can be further parsed if required.
**Returns:**
the root lexing node.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **insertString**([DocumentFilter.FilterBypass](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.FilterBypass.html "DocumentFilter.FilterBypass") fb, int offset, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text, [AttributeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/AttributeSet.html "AttributeSet") attrs)
Insert a string into the document, and then parse it if the parser has been set.
**throws:**
BadLocationException
**Parameters:**
fb
offset
text
attrs
### protected void **parseDocument**(int offset, int length)
Parse the Document to update the character styles given an initial start position. Called by the filter after it has updated the text.
**throws:**
BadLocationException
**Parameters:**
offset
length
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **remove**([DocumentFilter.FilterBypass](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.FilterBypass.html "DocumentFilter.FilterBypass") fb, int offset, int length)
Remove a string from the document, and then parse it if the parser has been set.
**throws:**
BadLocationException
**Parameters:**
fb
offset
length
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **replace**([DocumentFilter.FilterBypass](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/DocumentFilter.FilterBypass.html "DocumentFilter.FilterBypass") fb, int offset, int length, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") text, [AttributeSet](https://docs.oracle.com/javase/8/docs/api/javax/swing/text/AttributeSet.html "AttributeSet") attrs)
Replace a string in the document, and then parse it if the parser has been set.
**throws:**
BadLocationException
**Parameters:**
fb
offset
length
text
attrs
groovy [Java] Class DataSet [Java] Class DataSet
====================
* groovy.sql.DataSet
```
public class DataSet
extends [Sql](sql)
```
An enhancement of Groovy's Sql class providing support for accessing and querying databases using POGO fields and operators rather than JDBC-level API calls and RDBMS column names. So, instead of a query like:
```
def db = // an instance of groovy.sql.Sql
def sql = '''select * from Person
where (purchaseCount > ? and birthMonth = ?)
and (lastName < ? or lastName > ?)
and age < ? and age > ? and firstName != ?
order by firstName DESC, age'''
def params = [10, "January", "Zulu", "Alpha", 99, 5, "Bert"]
def sortedPeopleOfInterest = db.rows(sql, params)
```
You can write code like this:
```
def person = new DataSet(db, 'Person') // or db.dataSet('Person'), or db.dataSet(Person)
def janFrequentBuyers = person.findAll { it.purchaseCount > 10 && it.lastName == "January"
def sortedPeopleOfInterest = janFrequentBuyers.
findAll{ it.lastName < 'Zulu' || it.lastName > 'Alpha' }.
findAll{ it.age < 99 }.
findAll{ it.age > 5 }.
sort{ it.firstName }.
reverse().
findAll{ it.firstName != 'Bert' }.
sort{ it.age }
}
```
Currently, the Groovy source code for any accessed POGO must be on the classpath at runtime. Also, at the moment, the expressions (or nested expressions) can only contain references to fields of the POGO or literals (i.e. constant Strings or numbers). This limitation may be removed in a future version of Groovy.
Inherited fields
| Fields inherited from class | Fields |
| **`class [Sql](sql)`** | `[ALL\_RESULT\_SETS](sql#ALL_RESULT_SETS), [ARRAY](sql#ARRAY), [BIGINT](sql#BIGINT), [BINARY](sql#BINARY), [BIT](sql#BIT), [BLOB](sql#BLOB), [BOOLEAN](sql#BOOLEAN), [CHAR](sql#CHAR), [CLOB](sql#CLOB), [DATALINK](sql#DATALINK), [DATE](sql#DATE), [DECIMAL](sql#DECIMAL), [DISTINCT](sql#DISTINCT), [DOUBLE](sql#DOUBLE), [FIRST\_RESULT\_SET](sql#FIRST_RESULT_SET), [FLOAT](sql#FLOAT), [INTEGER](sql#INTEGER), [JAVA\_OBJECT](sql#JAVA_OBJECT), [LOG](sql#LOG), [LONGVARBINARY](sql#LONGVARBINARY), [LONGVARCHAR](sql#LONGVARCHAR), [NO\_RESULT\_SETS](sql#NO_RESULT_SETS), [NULL](sql#NULL), [NUMERIC](sql#NUMERIC), [OTHER](sql#OTHER), [REAL](sql#REAL), [REF](sql#REF), [SMALLINT](sql#SMALLINT), [STRUCT](sql#STRUCT), [TIME](sql#TIME), [TIMESTAMP](sql#TIMESTAMP), [TINYINT](sql#TINYINT), [VARBINARY](sql#VARBINARY), [VARCHAR](sql#VARCHAR)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[DataSet](#DataSet(groovy.sql.Sql,%20java.lang.Class))**([Sql](sql) sql, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type)` |
| `**[DataSet](#DataSet(groovy.sql.Sql,%20java.lang.String))**([Sql](sql) sql, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") table)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[add](#add(Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> map)`Adds the provided map of key-value pairs as a new row in the table represented by this DataSet. |
| | `public void` | `**[cacheConnection](#cacheConnection(groovy.lang.Closure))**([Closure](../lang/closure) closure)` |
| | `public void` | `**[close](#close())**()` |
| | `protected void` | `**[closeResources](#closeResources(java.sql.Connection,%20java.sql.Statement,%20java.sql.ResultSet))**([Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection") connection, [Statement](https://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html "Statement") statement, [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet") results)` |
| | `protected void` | `**[closeResources](#closeResources(java.sql.Connection,%20java.sql.Statement))**([Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection") connection, [Statement](https://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html "Statement") statement)` |
| | `public void` | `**[commit](#commit())**()` |
| | `protected [Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection")` | `**[createConnection](#createConnection())**()` |
| | `public [DataSet](dataset)` | `**[createView](#createView(groovy.lang.Closure))**([Closure](../lang/closure) criteria)` |
| | `public void` | `**[doCall](#doCall(groovy.sql.BatchingPreparedStatementWrapper))**([BatchingPreparedStatementWrapper](batchingpreparedstatementwrapper) stmt)` |
| | `public void` | `**[each](#each(groovy.lang.Closure))**([Closure](../lang/closure) closure)`Calls the provided closure for each of the rows of the table represented by this DataSet. |
| | `public void` | `**[each](#each(int,%20int,%20groovy.lang.Closure))**(int offset, int maxRows, [Closure](../lang/closure) closure)`Calls the provided closure for a "page" of rows from the table represented by this DataSet. |
| | `public [DataSet](dataset)` | `**[findAll](#findAll(groovy.lang.Closure))**([Closure](../lang/closure) where)`Return a lazy-implemented filtered view of this DataSet. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[firstRow](#firstRow())**()`Returns the first row from a DataSet's underlying table |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")>` | `**[getParameters](#getParameters())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getSql](#getSql())**()` |
| | `protected [SqlOrderByVisitor](sqlorderbyvisitor)` | `**[getSqlOrderByVisitor](#getSqlOrderByVisitor())**()` |
| | `protected [SqlWhereVisitor](sqlwherevisitor)` | `**[getSqlWhereVisitor](#getSqlWhereVisitor())**()` |
| | `public [DataSet](dataset)` | `**[reverse](#reverse())**()`Return a lazy-implemented reverse-ordered view of this DataSet. |
| | `public void` | `**[rollback](#rollback())**()` |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")` | `**[rows](#rows())**()`Returns a List of all of the rows from the table a DataSet represents. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")` | `**[rows](#rows(int,%20int))**(int offset, int maxRows)`Returns a "page" of the rows from the table a DataSet represents. |
| | `public [DataSet](dataset)` | `**[sort](#sort(groovy.lang.Closure))**([Closure](../lang/closure) sort)`Return a lazy-implemented re-ordered view of this DataSet. |
| | `public int[]` | `**[withBatch](#withBatch(groovy.lang.Closure))**([Closure](../lang/closure) closure)`Performs the closure (containing batch operations) within a batch. |
| | `public int[]` | `**[withBatch](#withBatch(int,%20groovy.lang.Closure))**(int batchSize, [Closure](../lang/closure) closure)`Performs the closure (containing batch operations) within a batch. |
| | `public void` | `**[withTransaction](#withTransaction(groovy.lang.Closure))**([Closure](../lang/closure) closure)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Sql](sql)` | `[ARRAY](sql#ARRAY(java.lang.Object)), [BIGINT](sql#BIGINT(java.lang.Object)), [BINARY](sql#BINARY(java.lang.Object)), [BIT](sql#BIT(java.lang.Object)), [BLOB](sql#BLOB(java.lang.Object)), [BOOLEAN](sql#BOOLEAN(java.lang.Object)), [CHAR](sql#CHAR(java.lang.Object)), [CLOB](sql#CLOB(java.lang.Object)), [DATALINK](sql#DATALINK(java.lang.Object)), [DATE](sql#DATE(java.lang.Object)), [DECIMAL](sql#DECIMAL(java.lang.Object)), [DISTINCT](sql#DISTINCT(java.lang.Object)), [DOUBLE](sql#DOUBLE(java.lang.Object)), [FLOAT](sql#FLOAT(java.lang.Object)), [INTEGER](sql#INTEGER(java.lang.Object)), [JAVA\_OBJECT](sql#JAVA_OBJECT(java.lang.Object)), [LONGVARBINARY](sql#LONGVARBINARY(java.lang.Object)), [LONGVARCHAR](sql#LONGVARCHAR(java.lang.Object)), [NULL](sql#NULL(java.lang.Object)), [NUMERIC](sql#NUMERIC(java.lang.Object)), [OTHER](sql#OTHER(java.lang.Object)), [REAL](sql#REAL(java.lang.Object)), [REF](sql#REF(java.lang.Object)), [SMALLINT](sql#SMALLINT(java.lang.Object)), [STRUCT](sql#STRUCT(java.lang.Object)), [TIME](sql#TIME(java.lang.Object)), [TIMESTAMP](sql#TIMESTAMP(java.lang.Object)), [TINYINT](sql#TINYINT(java.lang.Object)), [VARBINARY](sql#VARBINARY(java.lang.Object)), [VARCHAR](sql#VARCHAR(java.lang.Object)), [asList](sql#asList(java.lang.String,%20java.sql.ResultSet)), [asList](sql#asList(java.lang.String,%20java.sql.ResultSet,%20groovy.lang.Closure)), [asList](sql#asList(java.lang.String,%20java.sql.ResultSet,%20int,%20int,%20groovy.lang.Closure)), [asSql](sql#asSql(groovy.lang.GString,%20List)), [buildSqlWithIndexedProps](sql#buildSqlWithIndexedProps(java.lang.String)), [cacheConnection](sql#cacheConnection(groovy.lang.Closure)), [cacheStatements](sql#cacheStatements(groovy.lang.Closure)), [call](sql#call(java.lang.String)), [call](sql#call(groovy.lang.GString)), [call](sql#call(java.lang.String,%20List)), [call](sql#call(java.lang.String,%20java.lang.Object)), [call](sql#call(java.lang.String,%20List,%20groovy.lang.Closure)), [call](sql#call(groovy.lang.GString,%20groovy.lang.Closure)), [callWithAllRows](sql#callWithAllRows(groovy.lang.GString,%20groovy.lang.Closure)), [callWithAllRows](sql#callWithAllRows(java.lang.String,%20List,%20groovy.lang.Closure)), [callWithRows](sql#callWithRows(groovy.lang.GString,%20groovy.lang.Closure)), [callWithRows](sql#callWithRows(java.lang.String,%20List,%20groovy.lang.Closure)), [callWithRows](sql#callWithRows(java.lang.String,%20List,%20int,%20groovy.lang.Closure)), [checkForNamedParams](sql#checkForNamedParams(java.lang.String,%20List)), [close](sql#close()), [closeResources](sql#closeResources(java.sql.Connection,%20java.sql.Statement,%20java.sql.ResultSet)), [closeResources](sql#closeResources(java.sql.Connection,%20java.sql.Statement)), [closeResources](sql#closeResources(java.sql.Connection)), [commit](sql#commit()), [configure](sql#configure(java.sql.Statement)), [createConnection](sql#createConnection()), [createPreparedQueryCommand](sql#createPreparedQueryCommand(java.lang.String,%20List)), [createQueryCommand](sql#createQueryCommand(java.lang.String)), [dataSet](sql#dataSet(java.lang.String)), [dataSet](sql#dataSet(Class)), [eachRow](sql#eachRow(java.lang.String,%20groovy.lang.Closure)), [eachRow](sql#eachRow(java.lang.String,%20int,%20int,%20groovy.lang.Closure)), [eachRow](sql#eachRow(java.lang.String,%20groovy.lang.Closure,%20groovy.lang.Closure)), [eachRow](sql#eachRow(java.lang.String,%20groovy.lang.Closure,%20int,%20int,%20groovy.lang.Closure)), [eachRow](sql#eachRow(java.lang.String,%20List,%20groovy.lang.Closure,%20int,%20int,%20groovy.lang.Closure)), [eachRow](sql#eachRow(java.lang.String,%20java.util.Map,%20groovy.lang.Closure,%20int,%20int,%20groovy.lang.Closure)), [eachRow](sql#eachRow(java.util.Map,%20java.lang.String,%20groovy.lang.Closure,%20int,%20int,%20groovy.lang.Closure)), [eachRow](sql#eachRow(java.lang.String,%20List,%20groovy.lang.Closure,%20groovy.lang.Closure)), [eachRow](sql#eachRow(java.lang.String,%20java.util.Map,%20groovy.lang.Closure,%20groovy.lang.Closure)), [eachRow](sql#eachRow(java.util.Map,%20java.lang.String,%20groovy.lang.Closure,%20groovy.lang.Closure)), [eachRow](sql#eachRow(java.lang.String,%20List,%20groovy.lang.Closure)), [eachRow](sql#eachRow(java.lang.String,%20java.util.Map,%20groovy.lang.Closure)), [eachRow](sql#eachRow(java.util.Map,%20java.lang.String,%20groovy.lang.Closure)), [eachRow](sql#eachRow(java.lang.String,%20List,%20int,%20int,%20groovy.lang.Closure)), [eachRow](sql#eachRow(java.lang.String,%20java.util.Map,%20int,%20int,%20groovy.lang.Closure)), [eachRow](sql#eachRow(java.util.Map,%20java.lang.String,%20int,%20int,%20groovy.lang.Closure)), [eachRow](sql#eachRow(groovy.lang.GString,%20groovy.lang.Closure,%20groovy.lang.Closure)), [eachRow](sql#eachRow(groovy.lang.GString,%20groovy.lang.Closure,%20int,%20int,%20groovy.lang.Closure)), [eachRow](sql#eachRow(groovy.lang.GString,%20int,%20int,%20groovy.lang.Closure)), [eachRow](sql#eachRow(groovy.lang.GString,%20groovy.lang.Closure)), [execute](sql#execute(java.lang.String)), [execute](sql#execute(java.lang.String,%20groovy.lang.Closure)), [execute](sql#execute(java.lang.String,%20List)), [execute](sql#execute(java.lang.String,%20List,%20groovy.lang.Closure)), [execute](sql#execute(java.util.Map,%20java.lang.String)), [execute](sql#execute(java.util.Map,%20java.lang.String,%20groovy.lang.Closure)), [execute](sql#execute(java.lang.String,%20java.lang.Object)), [execute](sql#execute(java.lang.String,%20java.lang.Object,%20groovy.lang.Closure)), [execute](sql#execute(groovy.lang.GString)), [execute](sql#execute(groovy.lang.GString,%20groovy.lang.Closure)), [executeInsert](sql#executeInsert(java.lang.String)), [executeInsert](sql#executeInsert(java.lang.String,%20List)), [executeInsert](sql#executeInsert(java.lang.String,%20List,%20List)), [executeInsert](sql#executeInsert(java.util.Map,%20java.lang.String)), [executeInsert](sql#executeInsert(java.util.Map,%20java.lang.String,%20List)), [executeInsert](sql#executeInsert(java.lang.String,%20java.lang.Object)), [executeInsert](sql#executeInsert(java.lang.String,%20java.lang.String)), [executeInsert](sql#executeInsert(java.lang.String,%20java.lang.String,%20java.lang.Object)), [executeInsert](sql#executeInsert(groovy.lang.GString)), [executeInsert](sql#executeInsert(groovy.lang.GString,%20List)), [executePreparedQuery](sql#executePreparedQuery(java.lang.String,%20List)), [executeQuery](sql#executeQuery(java.lang.String)), [executeUpdate](sql#executeUpdate(java.lang.String)), [executeUpdate](sql#executeUpdate(java.lang.String,%20List)), [executeUpdate](sql#executeUpdate(java.util.Map,%20java.lang.String)), [executeUpdate](sql#executeUpdate(java.lang.String,%20java.lang.Object)), [executeUpdate](sql#executeUpdate(groovy.lang.GString)), [expand](sql#expand(java.lang.Object)), [findWhereKeyword](sql#findWhereKeyword(java.lang.String)), [firstRow](sql#firstRow(java.lang.String)), [firstRow](sql#firstRow(groovy.lang.GString)), [firstRow](sql#firstRow(java.lang.String,%20List)), [firstRow](sql#firstRow(java.util.Map,%20java.lang.String)), [firstRow](sql#firstRow(java.lang.String,%20java.lang.Object)), [getConnection](sql#getConnection()), [getDataSource](sql#getDataSource()), [getObject](sql#getObject()), [getParameters](sql#getParameters(groovy.lang.GString)), [getResultSetConcurrency](sql#getResultSetConcurrency()), [getResultSetHoldability](sql#getResultSetHoldability()), [getResultSetType](sql#getResultSetType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getType](sql#getType()), [getUpdateCount](sql#getUpdateCount()), [getUpdatedParams](sql#getUpdatedParams(List,%20List)), [getValue](sql#getValue()), [getValue](sql#getValue()), [in](sql#in(int,%20java.lang.Object)), [inout](sql#inout(groovy.sql.InParameter)), [isCacheNamedQueries](sql#isCacheNamedQueries()), [isCacheStatements](sql#isCacheStatements()), [isEnableNamedQueries](sql#isEnableNamedQueries()), [isWithinBatch](sql#isWithinBatch()), [loadDriver](sql#loadDriver(java.lang.String)), [newInstance](sql#newInstance(java.lang.String)), [newInstance](sql#newInstance(java.lang.String,%20java.util.Properties)), [newInstance](sql#newInstance(java.lang.String,%20java.util.Properties,%20java.lang.String)), [newInstance](sql#newInstance(java.lang.String,%20java.lang.String,%20java.lang.String)), [newInstance](sql#newInstance(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String)), [newInstance](sql#newInstance(java.lang.String,%20java.lang.String)), [newInstance](sql#newInstance(Map)), [nullify](sql#nullify(java.lang.String)), [out](sql#out(int)), [preCheckForNamedParams](sql#preCheckForNamedParams(java.lang.String)), [query](sql#query(java.lang.String,%20groovy.lang.Closure)), [query](sql#query(java.lang.String,%20List,%20groovy.lang.Closure)), [query](sql#query(java.lang.String,%20java.util.Map,%20groovy.lang.Closure)), [query](sql#query(java.util.Map,%20java.lang.String,%20groovy.lang.Closure)), [query](sql#query(groovy.lang.GString,%20groovy.lang.Closure)), [resultSet](sql#resultSet(int)), [rollback](sql#rollback()), [rows](sql#rows(java.lang.String)), [rows](sql#rows(java.lang.String,%20int,%20int)), [rows](sql#rows(java.lang.String,%20groovy.lang.Closure)), [rows](sql#rows(java.lang.String,%20int,%20int,%20groovy.lang.Closure)), [rows](sql#rows(java.lang.String,%20List)), [rows](sql#rows(java.util.Map,%20java.lang.String)), [rows](sql#rows(java.lang.String,%20List,%20int,%20int)), [rows](sql#rows(java.lang.String,%20java.util.Map,%20int,%20int)), [rows](sql#rows(java.util.Map,%20java.lang.String,%20int,%20int)), [rows](sql#rows(java.lang.String,%20java.lang.Object)), [rows](sql#rows(java.lang.String,%20java.lang.Object,%20int,%20int)), [rows](sql#rows(java.lang.String,%20List,%20groovy.lang.Closure)), [rows](sql#rows(java.lang.String,%20java.util.Map,%20groovy.lang.Closure)), [rows](sql#rows(java.util.Map,%20java.lang.String,%20groovy.lang.Closure)), [rows](sql#rows(java.lang.String,%20List,%20int,%20int,%20groovy.lang.Closure)), [rows](sql#rows(java.lang.String,%20java.util.Map,%20int,%20int,%20groovy.lang.Closure)), [rows](sql#rows(java.util.Map,%20java.lang.String,%20int,%20int,%20groovy.lang.Closure)), [rows](sql#rows(groovy.lang.GString,%20int,%20int)), [rows](sql#rows(groovy.lang.GString)), [rows](sql#rows(groovy.lang.GString,%20groovy.lang.Closure)), [rows](sql#rows(groovy.lang.GString,%20int,%20int,%20groovy.lang.Closure)), [run](sql#run()), [setCacheNamedQueries](sql#setCacheNamedQueries(boolean)), [setCacheStatements](sql#setCacheStatements(boolean)), [setEnableNamedQueries](sql#setEnableNamedQueries(boolean)), [setInternalConnection](sql#setInternalConnection(java.sql.Connection)), [setObject](sql#setObject(java.sql.PreparedStatement,%20int,%20java.lang.Object)), [setParameters](sql#setParameters(List,%20java.sql.PreparedStatement)), [setResultSetConcurrency](sql#setResultSetConcurrency(int)), [setResultSetHoldability](sql#setResultSetHoldability(int)), [setResultSetType](sql#setResultSetType(int)), [withBatch](sql#withBatch(groovy.lang.Closure)), [withBatch](sql#withBatch(int,%20groovy.lang.Closure)), [withBatch](sql#withBatch(java.lang.String,%20groovy.lang.Closure)), [withBatch](sql#withBatch(int,%20java.lang.String,%20groovy.lang.Closure)), [withInstance](sql#withInstance(java.lang.String,%20groovy.lang.Closure)), [withInstance](sql#withInstance(java.lang.String,%20java.util.Properties,%20groovy.lang.Closure)), [withInstance](sql#withInstance(java.lang.String,%20java.util.Properties,%20java.lang.String,%20groovy.lang.Closure)), [withInstance](sql#withInstance(java.lang.String,%20java.lang.String,%20java.lang.String,%20groovy.lang.Closure)), [withInstance](sql#withInstance(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20groovy.lang.Closure)), [withInstance](sql#withInstance(java.lang.String,%20java.lang.String,%20groovy.lang.Closure)), [withInstance](sql#withInstance(Map,%20groovy.lang.Closure)), [withStatement](sql#withStatement(groovy.lang.Closure)), [withTransaction](sql#withTransaction(groovy.lang.Closure))` |
Constructor Detail
------------------
### public **DataSet**([Sql](sql) sql, [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class") type)
### public **DataSet**([Sql](sql) sql, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") table)
Method Detail
-------------
### public void **add**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> map)
Adds the provided map of key-value pairs as a new row in the table represented by this DataSet.
**throws:**
SQLException if a database error occurs
**Parameters:**
`map` - the key (column-name), value pairs to add as a new row
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **cacheConnection**([Closure](../lang/closure) closure)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **close**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **closeResources**([Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection") connection, [Statement](https://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html "Statement") statement, [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet") results)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected void **closeResources**([Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection") connection, [Statement](https://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html "Statement") statement)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **commit**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") protected [Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection") **createConnection**()
### public [DataSet](dataset) **createView**([Closure](../lang/closure) criteria)
### public void **doCall**([BatchingPreparedStatementWrapper](batchingpreparedstatementwrapper) stmt)
### public void **each**(@[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.GroovyResultSet") [Closure](../lang/closure) closure)
Calls the provided closure for each of the rows of the table represented by this DataSet.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`closure` - called for each row with a GroovyResultSet
**See Also:**
[Sql.eachRow](sql#eachRow(String,%20java.util.List,%20groovy.lang.Closure) "Sql.eachRow")
### public void **each**(int offset, int maxRows, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.GroovyResultSet") [Closure](../lang/closure) closure)
Calls the provided closure for a "page" of rows from the table represented by this DataSet. A page is defined as starting at a 1-based offset, and containing a maximum number of rows.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
`closure` - called for each row with a GroovyResultSet
**See Also:**
[Sql.eachRow](sql#eachRow(String,%20java.util.List,%20int,%20int,%20groovy.lang.Closure) "Sql.eachRow")
### public [DataSet](dataset) **findAll**([Closure](../lang/closure) where)
Return a lazy-implemented filtered view of this DataSet.
**Parameters:**
`where` - the filtering Closure
**Returns:**
the view DataSet
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **firstRow**()
Returns the first row from a DataSet's underlying table
**throws:**
SQLException if a database error occurs
**Returns:**
Returns the first GroovyRowResult object from the dataset
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> **getParameters**()
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getSql**()
### protected [SqlOrderByVisitor](sqlorderbyvisitor) **getSqlOrderByVisitor**()
### protected [SqlWhereVisitor](sqlwherevisitor) **getSqlWhereVisitor**()
### public [DataSet](dataset) **reverse**()
Return a lazy-implemented reverse-ordered view of this DataSet.
**Returns:**
the view DataSet
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **rollback**()
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") **rows**()
Returns a List of all of the rows from the table a DataSet represents.
**throws:**
SQLException if a database error occurs
**Returns:**
Returns a list of GroovyRowResult objects from the dataset
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List") **rows**(int offset, int maxRows)
Returns a "page" of the rows from the table a DataSet represents. A page is defined as starting at a 1-based offset, and containing a maximum number of rows.
**throws:**
SQLException if a database error occurs
**Parameters:**
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
**Returns:**
a list of GroovyRowResult objects from the dataset
### public [DataSet](dataset) **sort**([Closure](../lang/closure) sort)
Return a lazy-implemented re-ordered view of this DataSet.
**Parameters:**
`sort` - the ordering Closure
**Returns:**
the view DataSet
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int[] **withBatch**([Closure](../lang/closure) closure)
Performs the closure (containing batch operations) within a batch. Uses a batch size of zero, i.e. no automatic partitioning of batches.
**throws:**
SQLException if a database access error occurs, or this method is called on a closed `Statement`, or the driver does not support batch statements. Throws [BatchUpdateException](https://docs.oracle.com/javase/8/docs/api/java/sql/BatchUpdateException.html "BatchUpdateException") (a subclass of `SQLException`) if one of the commands sent to the database fails to execute properly or attempts to return a result set.
**Parameters:**
`closure` - the closure containing batch and optionally other statements
**Returns:**
an array of update counts containing one element for each command in the batch. The elements of the array are ordered according to the order in which commands were added to the batch.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int[] **withBatch**(int batchSize, [Closure](../lang/closure) closure)
Performs the closure (containing batch operations) within a batch. For example:
```
dataSet.withBatch(3) {
add(anint: 1, astring: "Groovy")
add(anint: 2, astring: "rocks")
add(anint: 3, astring: "the")
add(anint: 4, astring: "casbah")
}
```
**throws:**
SQLException if a database access error occurs, or the driver does not support batch statements. Throws [BatchUpdateException](https://docs.oracle.com/javase/8/docs/api/java/sql/BatchUpdateException.html "BatchUpdateException") (a subclass of `SQLException`) if one of the commands sent to the database fails to execute properly.
**Parameters:**
`batchSize` - partition the batch into batchSize pieces, i.e. after batchSize `addBatch()` invocations, call `executeBatch()` automatically; 0 means manual calls to executeBatch are required
`closure` - the closure containing batch and optionally other statements
**Returns:**
an array of update counts containing one element for each command in the batch. The elements of the array are ordered according to the order in which commands were added to the batch.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **withTransaction**([Closure](../lang/closure) closure)
| programming_docs |
groovy [Java] Class BatchingStatementWrapper [Java] Class BatchingStatementWrapper
=====================================
* groovy.sql.BatchingStatementWrapper
All Implemented Interfaces and Traits: [AutoCloseable](https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html "AutoCloseable")
```
public class BatchingStatementWrapper
extends [GroovyObjectSupport](../lang/groovyobjectsupport)
implements [AutoCloseable](https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html "AutoCloseable")
```
Class which delegates to a Statement but keeps track of a batch count size. If the batch count reaches the predefined number, this Statement does an executeBatch() automatically. If batchSize is zero, then no batching is performed.
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**protected int**` | `[batchCount](#batchCount)` | |
| `**protected int**` | `[batchSize](#batchSize)` | |
| `**protected [Logger](https://docs.oracle.com/javase/8/docs/api/java/util/logging/Logger.html "Logger")**` | `[log](#log)` | |
| `**protected [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer")>**` | `[results](#results)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[BatchingStatementWrapper](#BatchingStatementWrapper(java.sql.Statement,%20int,%20java.util.logging.Logger))**([Statement](https://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html "Statement") delegate, int batchSize, [Logger](https://docs.oracle.com/javase/8/docs/api/java/util/logging/Logger.html "Logger") log)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[addBatch](#addBatch(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)` |
| | `public void` | `**[clearBatch](#clearBatch())**()` |
| | `public void` | `**[close](#close())**()` |
| | `public int[]` | `**[executeBatch](#executeBatch())**()` |
| | `protected void` | `**[incrementBatchCount](#incrementBatchCount())**()`Increments batch count (after addBatch(..) has been called) and execute `delegate.executeBatch()` if batchSize has been reached. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)` |
| | `protected void` | `**[processResult](#processResult(int%5B%5D))**(int[] lastResult)` |
| | `protected void` | `**[reset](#reset())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyObjectSupport](../lang/groovyobjectsupport)` | `[getMetaClass](../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Field Detail
------------
### protected int **batchCount**
### protected int **batchSize**
### protected [Logger](https://docs.oracle.com/javase/8/docs/api/java/util/logging/Logger.html "Logger") **log**
### protected [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Integer](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html "Integer")> **results**
Constructor Detail
------------------
### public **BatchingStatementWrapper**([Statement](https://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html "Statement") delegate, int batchSize, [Logger](https://docs.oracle.com/javase/8/docs/api/java/util/logging/Logger.html "Logger") log)
Method Detail
-------------
### public void **addBatch**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)
### public void **clearBatch**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **close**()
### public int[] **executeBatch**()
### protected void **incrementBatchCount**()
Increments batch count (after addBatch(..) has been called) and execute `delegate.executeBatch()` if batchSize has been reached.
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
### protected void **processResult**(int[] lastResult)
### protected void **reset**()
groovy [Java] Interface InOutParameter [Java] Interface InOutParameter
===============================
* groovy.sql.OutParameter
All Superinterfaces:
[InParameter](inparameter), [OutParameter](outparameter)
```
public interface InOutParameter
extends [InParameter](inparameter), [OutParameter](outparameter)
```
A typed parameter passed to, and returned from a CallableStatement.
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `interface [InParameter](inparameter)` | `[getType](inparameter#getType()), [getValue](inparameter#getValue())` |
| `interface [OutParameter](outparameter)` | `[getType](outparameter#getType())` |
groovy [Java] Class Sql.AbstractQueryCommand [Java] Class Sql.AbstractQueryCommand
=====================================
* groovy.sql.Sql.AbstractQueryCommand
```
protected abstract class Sql.AbstractQueryCommand
```
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**protected [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")**` | `[sql](#sql)` | |
| `**protected [Statement](https://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html "Statement")**` | `[statement](#statement)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `protected **[AbstractQueryCommand](#AbstractQueryCommand(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `protected final void` | `**[closeResources](#closeResources())**()`After performing the execute operation and making use of its return, it's necessary to free the resources allocated for the statement. |
| | `protected final void` | `**[closeResources](#closeResources(java.sql.ResultSet))**([ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet") rs)`After performing the execute operation and making use of its return, it's necessary to free the resources allocated for the statement. |
| | `protected final [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet")` | `**[execute](#execute())**()`Execute the command that's defined by the subclass following the Command pattern. |
| | `protected int` | `**[getMaxRows](#getMaxRows())**()`Get the maximum number of rows to return in the ResultSet |
| | `protected abstract [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet")` | `**[runQuery](#runQuery(java.sql.Connection))**([Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection") connection)`Perform the query. |
| | `protected void` | `**[setMaxRows](#setMaxRows(int))**(int maxRows)`Set the maximum number of rows to return in the ResultSet |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### protected final [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **sql**
### protected [Statement](https://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html "Statement") **statement**
Constructor Detail
------------------
### protected **AbstractQueryCommand**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)
Method Detail
-------------
### protected final void **closeResources**()
After performing the execute operation and making use of its return, it's necessary to free the resources allocated for the statement.
### protected final void **closeResources**([ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet") rs)
After performing the execute operation and making use of its return, it's necessary to free the resources allocated for the statement.
**Parameters:**
`rs` - allows the caller to conveniently close its resource as well
### protected final [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet") **execute**()
Execute the command that's defined by the subclass following the Command pattern. Specialized parameters are held in the command instances.
**throws:**
SQLException if a database error occurs
**Returns:**
ResultSet from executing a query
### protected int **getMaxRows**()
Get the maximum number of rows to return in the ResultSet
**Returns:**
the maximum number of rows
### protected abstract [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet") **runQuery**([Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection") connection)
Perform the query. Must set statement field so that the main ([execute()](#execute())) method can clean up. This is the method that encloses the variant part of the code.
**throws:**
SQLException if a database error occurs
**Parameters:**
`connection` - the connection to use
**Returns:**
ResultSet from an executeQuery method.
### protected void **setMaxRows**(int maxRows)
Set the maximum number of rows to return in the ResultSet
**Parameters:**
`maxRows` - the maximum number of rows
groovy [Java] Class Sql [Java] Class Sql
================
* groovy.sql.Sql
All Implemented Interfaces and Traits: [AutoCloseable](https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html "AutoCloseable")
```
public class Sql
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [AutoCloseable](https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html "AutoCloseable")
```
A facade over Java's normal JDBC APIs providing greatly simplified resource management and result set handling. Under the covers the facade hides away details associated with getting connections, constructing and configuring statements, interacting with the connection, closing resources and logging errors. Special features of the facade include using closures to iterate through result sets, a special GString syntax for representing prepared statements and treating result sets like collections of maps with the normal Groovy collection methods available.
### Typical usage
First you need to set up your sql instance. There are several constructors and a few `newInstance` factory methods available to do this. In simple cases, you can just provide the necessary details to set up a connection (e.g. for hsqldb):
```
def db = [url:'jdbc:hsqldb:mem:testDB', user:'sa', password:'', driver:'org.hsqldb.jdbc.JDBCDriver']
def sql = Sql.newInstance(db.url, db.user, db.password, db.driver)
```
or if you have an existing connection (perhaps from a connection pool) or a datasource use one of the constructors:
```
def sql = new Sql(datasource)
```
Now you can invoke sql, e.g. to create a table:
```
sql.execute '''
create table PROJECT (
id integer not null,
name varchar(50),
url varchar(100),
)
'''
```
Or insert a row using JDBC PreparedStatement inspired syntax:
```
def params = [10, 'Groovy', 'http://groovy.codehaus.org']
sql.execute 'insert into PROJECT (id, name, url) values (?, ?, ?)', params
```
Or insert a row using GString syntax:
```
def map = [id:20, name:'Grails', url:'http://grails.codehaus.org']
sql.execute "insert into PROJECT (id, name, url) values ($map.id, $map.name, $map.url)"
```
Or a row update:
```
def newUrl = 'http://grails.org'
def project = 'Grails'
sql.executeUpdate "update PROJECT set url=$newUrl where name=$project"
```
Now try a query using `eachRow`:
```
println 'Some GR8 projects:'
sql.eachRow('select * from PROJECT') { row ->
println "${row.name.padRight(10)} ($row.url)"
}
```
Which will produce something like this:
```
Some GR8 projects:
Groovy (http://groovy.codehaus.org)
Grails (http://grails.org)
Griffon (http://griffon.codehaus.org)
Gradle (http://gradle.org)
```
Now try a query using `rows`:
```
def rows = sql.rows("select * from PROJECT where name like 'Gra%'")
assert rows.size() == 2
println rows.join('\n')
```
with output like this:
```
[ID:20, NAME:Grails, URL:http://grails.org]
[ID:40, NAME:Gradle, URL:http://gradle.org]
```
Also, `eachRow` and `rows` support paging. Here's an example:
```
sql.eachRow('select * from PROJECT', 2, 2) { row ->
println "${row.name.padRight(10)} ($row.url)"
}
```
Which will start at the second row and return a maximum of 2 rows. Here's an example result:
```
Grails (http://grails.org)
Griffon (http://griffon.codehaus.org)
```
Finally, we should clean up:
```
sql.close()
```
If we are using a DataSource and we haven't enabled statement caching, then strictly speaking the final `close()` method isn't required - as all connection handling is performed transparently on our behalf; however, it doesn't hurt to have it there as it will return silently in that case. If instead of `newInstance` you use `withInstance`, then `close()` will be called automatically for you.
### Avoiding SQL injection
If you find yourself creating queries based on any kind of input from the user or a 3rd party application you might wish to avoid the pure string method variants in this class. While this is safe: `sql.firstRow('select * from PersonTable')` This example is potentially at risk of SQL injection: `sql.firstRow('select * from PersonTable where SurnameColumn = ' + userInput)` This in turn will be fine if '`userInput`' is something like 'Smith' but maybe not so fine if '`userInput`' is something like 'Smith; DROP table PersonTable'. Instead, use one of the variants with parameters and placeholders: `sql.firstRow("select * from PersonTable where SurnameColumn = ?", [userInput])` or the GString variants which will be converted to the placeholder variants under the covers: `sql.firstRow("select * from PersonTable where SurnameColumn = $userInput")` or the named parameter variants discussed next. ### Named and named ordinal parameters
Several of the methods in this class (ones which have a String-based sql query and params in a List<Object> or Object[] or Map) support *named* or *named ordinal* parameters. These methods are useful for queries with large numbers of parameters - though the GString variations are often preferred in such cases too. Reminder: when you see a variant with Object[] as the type of the last parameter, Groovy allows vararg style parameters so you don't explicitly need to create an Object[] and if the first parameter is of type Map, Groovy supports named arguments - examples of both are contained in the examples below. Named parameter queries use placeholder values in the query String. Two forms are supported ':propname1' and '?.propname2'. For these variations, a single *model* object is supplied in the parameter list/array/map. The propname refers to a property of that model object. The model object could be a map, Expando or domain class instance. Here are some examples:
```
// using rows() with a named parameter with the parameter supplied in a map
println sql.rows('select * from PROJECT where name=:foo', [foo:'Gradle'])
// as above for eachRow()
sql.eachRow('select * from PROJECT where name=:foo', [foo:'Gradle']) {
// process row
}
// an example using both the ':' and '?.' variants of the notation
println sql.rows('select * from PROJECT where name=:foo and id=?.bar', [foo:'Gradle', bar:40])
// as above but using Groovy's named arguments instead of an explicit map
println sql.rows('select * from PROJECT where name=:foo and id=?.bar', foo:'Gradle', bar:40)
// an example showing rows() with a domain object instead of a map
class MyDomainClass { def baz = 'Griffon' }
println sql.rows('select * from PROJECT where name=?.baz', new MyDomainClass())
// as above for eachRow() with the domain object supplied in a list
sql.eachRow('select * from PROJECT where name=?.baz', [new MyDomainClass()]) {
// process row
}
```
Named ordinal parameter queries have multiple model objects with the index number (starting at 1) also supplied in the placeholder. Only the question mark variation of placeholder is supported. Here are some examples:
```
// an example showing the model objects as vararg style parameters (since rows() has an Object[] variant)
println sql.rows("select * from PROJECT where name=?1.baz and id=?2.num", new MyDomainClass(), [num:30])
// an example showing the model objects (one domain class and one map) provided in a list
sql.eachRow("select * from PROJECT where name=?1.baz and id=?2.num", [new MyDomainClass(), [num:30]]) {
// do something with row
}
```
### More details
See the method and constructor JavaDoc for more details. For advanced usage, the class provides numerous extension points for overriding the facade behavior associated with the various aspects of managing the interaction with the underlying database.
This class is **not** thread-safe.
Nested Class Summary
--------------------
Nested classes
| Modifiers | Name | Description |
| `**protected class**` | `[Sql.AbstractQueryCommand](sql.abstractquerycommand)` | |
Field Summary
-------------
Fields
| Modifiers | Name | Description |
| `**static int**` | `[ALL\_RESULT\_SETS](#ALL_RESULT_SETS)` | |
| `**static [OutParameter](outparameter)**` | `[ARRAY](#ARRAY)` | |
| `**static [OutParameter](outparameter)**` | `[BIGINT](#BIGINT)` | |
| `**static [OutParameter](outparameter)**` | `[BINARY](#BINARY)` | |
| `**static [OutParameter](outparameter)**` | `[BIT](#BIT)` | |
| `**static [OutParameter](outparameter)**` | `[BLOB](#BLOB)` | |
| `**static [OutParameter](outparameter)**` | `[BOOLEAN](#BOOLEAN)` | |
| `**static [OutParameter](outparameter)**` | `[CHAR](#CHAR)` | |
| `**static [OutParameter](outparameter)**` | `[CLOB](#CLOB)` | |
| `**static [OutParameter](outparameter)**` | `[DATALINK](#DATALINK)` | |
| `**static [OutParameter](outparameter)**` | `[DATE](#DATE)` | |
| `**static [OutParameter](outparameter)**` | `[DECIMAL](#DECIMAL)` | |
| `**static [OutParameter](outparameter)**` | `[DISTINCT](#DISTINCT)` | |
| `**static [OutParameter](outparameter)**` | `[DOUBLE](#DOUBLE)` | |
| `**static int**` | `[FIRST\_RESULT\_SET](#FIRST_RESULT_SET)` | |
| `**static [OutParameter](outparameter)**` | `[FLOAT](#FLOAT)` | |
| `**static [OutParameter](outparameter)**` | `[INTEGER](#INTEGER)` | |
| `**static [OutParameter](outparameter)**` | `[JAVA\_OBJECT](#JAVA_OBJECT)` | |
| `**protected static [Logger](https://docs.oracle.com/javase/8/docs/api/java/util/logging/Logger.html "Logger")**` | `[LOG](#LOG)` | Hook to allow derived classes to access the log |
| `**static [OutParameter](outparameter)**` | `[LONGVARBINARY](#LONGVARBINARY)` | |
| `**static [OutParameter](outparameter)**` | `[LONGVARCHAR](#LONGVARCHAR)` | |
| `**static int**` | `[NO\_RESULT\_SETS](#NO_RESULT_SETS)` | |
| `**static [OutParameter](outparameter)**` | `[NULL](#NULL)` | |
| `**static [OutParameter](outparameter)**` | `[NUMERIC](#NUMERIC)` | |
| `**static [OutParameter](outparameter)**` | `[OTHER](#OTHER)` | |
| `**static [OutParameter](outparameter)**` | `[REAL](#REAL)` | |
| `**static [OutParameter](outparameter)**` | `[REF](#REF)` | |
| `**static [OutParameter](outparameter)**` | `[SMALLINT](#SMALLINT)` | |
| `**static [OutParameter](outparameter)**` | `[STRUCT](#STRUCT)` | |
| `**static [OutParameter](outparameter)**` | `[TIME](#TIME)` | |
| `**static [OutParameter](outparameter)**` | `[TIMESTAMP](#TIMESTAMP)` | |
| `**static [OutParameter](outparameter)**` | `[TINYINT](#TINYINT)` | |
| `**static [OutParameter](outparameter)**` | `[VARBINARY](#VARBINARY)` | |
| `**static [OutParameter](outparameter)**` | `[VARCHAR](#VARCHAR)` | |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[Sql](#Sql(javax.sql.DataSource))**([DataSource](https://docs.oracle.com/javase/8/docs/api/javax/sql/DataSource.html "DataSource") dataSource)`Constructs an SQL instance using the given DataSource. |
| `**[Sql](#Sql(java.sql.Connection))**([Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection") connection)`Constructs an SQL instance using the given Connection. |
| `**[Sql](#Sql(groovy.sql.Sql))**([Sql](sql) parent)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public static [InParameter](inparameter)` | `**[ARRAY](#ARRAY(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[BIGINT](#BIGINT(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[BINARY](#BINARY(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[BIT](#BIT(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[BLOB](#BLOB(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[BOOLEAN](#BOOLEAN(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[CHAR](#CHAR(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[CLOB](#CLOB(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[DATALINK](#DATALINK(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[DATE](#DATE(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[DECIMAL](#DECIMAL(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[DISTINCT](#DISTINCT(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[DOUBLE](#DOUBLE(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[FLOAT](#FLOAT(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[INTEGER](#INTEGER(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[JAVA\_OBJECT](#JAVA_OBJECT(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[LONGVARBINARY](#LONGVARBINARY(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[LONGVARCHAR](#LONGVARCHAR(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[NULL](#NULL(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[NUMERIC](#NUMERIC(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[OTHER](#OTHER(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[REAL](#REAL(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[REF](#REF(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[SMALLINT](#SMALLINT(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[STRUCT](#STRUCT(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[TIME](#TIME(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[TIMESTAMP](#TIMESTAMP(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[TINYINT](#TINYINT(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[VARBINARY](#VARBINARY(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public static [InParameter](inparameter)` | `**[VARCHAR](#VARCHAR(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `protected [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[asList](#asList(java.lang.String,%20java.sql.ResultSet))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet") rs)`Hook to allow derived classes to override list of result collection behavior. |
| | `protected [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[asList](#asList(java.lang.String,%20java.sql.ResultSet,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet") rs, [Closure](../lang/closure) metaClosure)`Hook to allow derived classes to override list of result collection behavior. |
| | `protected [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[asList](#asList(java.lang.String,%20java.sql.ResultSet,%20int,%20int,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet") rs, int offset, int maxRows, [Closure](../lang/closure) metaClosure)` |
| | `protected [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[asSql](#asSql(groovy.lang.GString,%20List))**([GString](../lang/gstring) gstring, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> values)`Hook to allow derived classes to override sql generation from GStrings. |
| | `protected [SqlWithParams](sqlwithparams)` | `**[buildSqlWithIndexedProps](#buildSqlWithIndexedProps(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)`Hook to allow derived classes to override behavior associated with the parsing and indexing of parameters from a given sql statement. |
| | `public void` | `**[cacheConnection](#cacheConnection(groovy.lang.Closure))**([Closure](../lang/closure) closure)`Caches the connection used while the closure is active. |
| | `public void` | `**[cacheStatements](#cacheStatements(groovy.lang.Closure))**([Closure](../lang/closure) closure)`Caches every created preparedStatement in Closure *closure* Every cached preparedStatement is closed after closure has been called. |
| | `public int` | `**[call](#call(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)`Performs a stored procedure call. |
| | `public int` | `**[call](#call(groovy.lang.GString))**([GString](../lang/gstring) gstring)`Performs a stored procedure call with the given embedded parameters. |
| | `public int` | `**[call](#call(java.lang.String,%20List))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params)`Performs a stored procedure call with the given parameters. |
| | `public int` | `**[call](#call(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] params)`Performs a stored procedure call with the given parameters. |
| | `public void` | `**[call](#call(java.lang.String,%20List,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, [Closure](../lang/closure) closure)`Performs a stored procedure call with the given parameters. |
| | `public void` | `**[call](#call(groovy.lang.GString,%20groovy.lang.Closure))**([GString](../lang/gstring) gstring, [Closure](../lang/closure) closure)`Performs a stored procedure call with the given parameters, calling the closure once with all result objects. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>>` | `**[callWithAllRows](#callWithAllRows(groovy.lang.GString,%20groovy.lang.Closure))**([GString](../lang/gstring) gstring, [Closure](../lang/closure) closure)`Performs a stored procedure call with the given parameters, calling the closure once with all result objects, and also returning a list of lists with the rows of the ResultSet(s). |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>>` | `**[callWithAllRows](#callWithAllRows(java.lang.String,%20List,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, [Closure](../lang/closure) closure)`Performs a stored procedure call with the given parameters, calling the closure once with all result objects, and also returning a list of lists with the rows of the ResultSet(s). |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[callWithRows](#callWithRows(groovy.lang.GString,%20groovy.lang.Closure))**([GString](../lang/gstring) gstring, [Closure](../lang/closure) closure)`Performs a stored procedure call with the given parameters, calling the closure once with all result objects, and also returning the rows of the ResultSet. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[callWithRows](#callWithRows(java.lang.String,%20List,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, [Closure](../lang/closure) closure)`Performs a stored procedure call with the given parameters, calling the closure once with all result objects, and also returning the rows of the ResultSet. |
| | `protected [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>>` | `**[callWithRows](#callWithRows(java.lang.String,%20List,%20int,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, int processResultsSets, [Closure](../lang/closure) closure)`Base internal method for call(), callWithRows(), and callWithAllRows() style of methods. |
| | `public [SqlWithParams](sqlwithparams)` | `**[checkForNamedParams](#checkForNamedParams(java.lang.String,%20List))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params)` |
| | `public void` | `**[close](#close())**()`If this SQL object was created with a Connection then this method closes the connection. |
| | `protected void` | `**[closeResources](#closeResources(java.sql.Connection,%20java.sql.Statement,%20java.sql.ResultSet))**([Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection") connection, [Statement](https://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html "Statement") statement, [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet") results)`An extension point allowing derived classes to change the behavior of resource closing. |
| | `protected void` | `**[closeResources](#closeResources(java.sql.Connection,%20java.sql.Statement))**([Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection") connection, [Statement](https://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html "Statement") statement)`An extension point allowing the behavior of resource closing to be overridden in derived classes. |
| | `protected void` | `**[closeResources](#closeResources(java.sql.Connection))**([Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection") connection)`An extension point allowing the behavior of resource closing to be overridden in derived classes. |
| | `public void` | `**[commit](#commit())**()`If this SQL object was created with a Connection then this method commits the connection. |
| | `protected void` | `**[configure](#configure(java.sql.Statement))**([Statement](https://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html "Statement") statement)`Provides a hook for derived classes to be able to configure JDBC statements. |
| | `protected [Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection")` | `**[createConnection](#createConnection())**()`An extension point allowing derived classes to change the behavior of connection creation. |
| | `protected [AbstractQueryCommand](../../abstractquerycommand)` | `**[createPreparedQueryCommand](#createPreparedQueryCommand(java.lang.String,%20List))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> queryParams)`Factory for the PreparedQueryCommand command pattern object allows subclass to supply implementations of the command class. |
| | `protected [AbstractQueryCommand](../../abstractquerycommand)` | `**[createQueryCommand](#createQueryCommand(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)`Factory for the QueryCommand command pattern object allows subclasses to supply implementations of the command class. |
| | `public [DataSet](dataset)` | `**[dataSet](#dataSet(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") table)` |
| | `public [DataSet](dataset)` | `**[dataSet](#dataSet(Class))**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> type)` |
| | `public void` | `**[eachRow](#eachRow(java.lang.String,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Closure](../lang/closure) closure)`Performs the given SQL query calling the given Closure with each row of the result set. |
| | `public void` | `**[eachRow](#eachRow(java.lang.String,%20int,%20int,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, int offset, int maxRows, [Closure](../lang/closure) closure)`Performs the given SQL query calling the given `closure` with each row of the result set starting at the provided `offset`, and including up to `maxRows` number of rows. |
| | `public void` | `**[eachRow](#eachRow(java.lang.String,%20groovy.lang.Closure,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Closure](../lang/closure) metaClosure, [Closure](../lang/closure) rowClosure)`Performs the given SQL query calling the given `rowClosure` with each row of the result set. |
| | `public void` | `**[eachRow](#eachRow(java.lang.String,%20groovy.lang.Closure,%20int,%20int,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Closure](../lang/closure) metaClosure, int offset, int maxRows, [Closure](../lang/closure) rowClosure)`Performs the given SQL query calling the given `rowClosure` with each row of the result set starting at the provided `offset`, and including up to `maxRows` number of rows. |
| | `public void` | `**[eachRow](#eachRow(java.lang.String,%20List,%20groovy.lang.Closure,%20int,%20int,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, [Closure](../lang/closure) metaClosure, int offset, int maxRows, [Closure](../lang/closure) rowClosure)`Performs the given SQL query calling the given `rowClosure` with each row of the result set starting at the provided `offset`, and including up to `maxRows` number of rows. |
| | `public void` | `**[eachRow](#eachRow(java.lang.String,%20java.util.Map,%20groovy.lang.Closure,%20int,%20int,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") map, [Closure](../lang/closure) metaClosure, int offset, int maxRows, [Closure](../lang/closure) rowClosure)`A variant of [eachRow(String, java.util.List, groovy.lang.Closure, int, int, groovy.lang.Closure)](#eachRow(java.lang.String,%20java.util.List,%20groovy.lang.Closure,%20int,%20int,%20groovy.lang.Closure)) allowing the named parameters to be supplied in a map. |
| | `public void` | `**[eachRow](#eachRow(java.util.Map,%20java.lang.String,%20groovy.lang.Closure,%20int,%20int,%20groovy.lang.Closure))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") map, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Closure](../lang/closure) metaClosure, int offset, int maxRows, [Closure](../lang/closure) rowClosure)`A variant of [eachRow(String, java.util.List, groovy.lang.Closure, int, int, groovy.lang.Closure)](#eachRow(java.lang.String,%20java.util.List,%20groovy.lang.Closure,%20int,%20int,%20groovy.lang.Closure)) allowing the named parameters to be supplied as named arguments. |
| | `public void` | `**[eachRow](#eachRow(java.lang.String,%20List,%20groovy.lang.Closure,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, [Closure](../lang/closure) metaClosure, [Closure](../lang/closure) rowClosure)`Performs the given SQL query calling the given Closure with each row of the result set. |
| | `public void` | `**[eachRow](#eachRow(java.lang.String,%20java.util.Map,%20groovy.lang.Closure,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [Closure](../lang/closure) metaClosure, [Closure](../lang/closure) rowClosure)`A variant of [eachRow(String, java.util.List, groovy.lang.Closure, groovy.lang.Closure)](#eachRow(java.lang.String,%20java.util.List,%20groovy.lang.Closure,%20groovy.lang.Closure)) useful when providing the named parameters as a map. |
| | `public void` | `**[eachRow](#eachRow(java.util.Map,%20java.lang.String,%20groovy.lang.Closure,%20groovy.lang.Closure))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Closure](../lang/closure) metaClosure, [Closure](../lang/closure) rowClosure)`A variant of [eachRow(String, java.util.List, groovy.lang.Closure, groovy.lang.Closure)](#eachRow(java.lang.String,%20java.util.List,%20groovy.lang.Closure,%20groovy.lang.Closure)) useful when providing the named parameters as named arguments. |
| | `public void` | `**[eachRow](#eachRow(java.lang.String,%20List,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, [Closure](../lang/closure) closure)`Performs the given SQL query calling the given Closure with each row of the result set. |
| | `public void` | `**[eachRow](#eachRow(java.lang.String,%20java.util.Map,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [Closure](../lang/closure) closure)`A variant of [eachRow(String, java.util.List, groovy.lang.Closure)](#eachRow(java.lang.String,%20java.util.List,%20groovy.lang.Closure)) useful when providing the named parameters as a map. |
| | `public void` | `**[eachRow](#eachRow(java.util.Map,%20java.lang.String,%20groovy.lang.Closure))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Closure](../lang/closure) closure)`A variant of [eachRow(String, java.util.List, groovy.lang.Closure)](#eachRow(java.lang.String,%20java.util.List,%20groovy.lang.Closure)) useful when providing the named parameters as named arguments. |
| | `public void` | `**[eachRow](#eachRow(java.lang.String,%20List,%20int,%20int,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, int offset, int maxRows, [Closure](../lang/closure) closure)`Performs the given SQL query calling the given `closure` with each row of the result set starting at the provided `offset`, and including up to `maxRows` number of rows. |
| | `public void` | `**[eachRow](#eachRow(java.lang.String,%20java.util.Map,%20int,%20int,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, int offset, int maxRows, [Closure](../lang/closure) closure)`A variant of [eachRow(String, java.util.List, int, int, groovy.lang.Closure)](#eachRow(java.lang.String,%20java.util.List,%20int,%20int,%20groovy.lang.Closure)) useful when providing the named parameters as a map. |
| | `public void` | `**[eachRow](#eachRow(java.util.Map,%20java.lang.String,%20int,%20int,%20groovy.lang.Closure))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, int offset, int maxRows, [Closure](../lang/closure) closure)`A variant of [eachRow(String, java.util.List, int, int, groovy.lang.Closure)](#eachRow(java.lang.String,%20java.util.List,%20int,%20int,%20groovy.lang.Closure)) useful when providing the named parameters as named arguments. |
| | `public void` | `**[eachRow](#eachRow(groovy.lang.GString,%20groovy.lang.Closure,%20groovy.lang.Closure))**([GString](../lang/gstring) gstring, [Closure](../lang/closure) metaClosure, [Closure](../lang/closure) rowClosure)`Performs the given SQL query calling the given Closure with each row of the result set. |
| | `public void` | `**[eachRow](#eachRow(groovy.lang.GString,%20groovy.lang.Closure,%20int,%20int,%20groovy.lang.Closure))**([GString](../lang/gstring) gstring, [Closure](../lang/closure) metaClosure, int offset, int maxRows, [Closure](../lang/closure) rowClosure)`Performs the given SQL query calling the given `closure` with each row of the result set starting at the provided `offset`, and including up to `maxRows` number of rows. |
| | `public void` | `**[eachRow](#eachRow(groovy.lang.GString,%20int,%20int,%20groovy.lang.Closure))**([GString](../lang/gstring) gstring, int offset, int maxRows, [Closure](../lang/closure) closure)`Performs the given SQL query calling the given `closure` with each row of the result set starting at the provided `offset`, and including up to `maxRows` number of rows. |
| | `public void` | `**[eachRow](#eachRow(groovy.lang.GString,%20groovy.lang.Closure))**([GString](../lang/gstring) gstring, [Closure](../lang/closure) closure)`Performs the given SQL query calling the given Closure with each row of the result set. |
| | `public boolean` | `**[execute](#execute(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)`Executes the given piece of SQL. |
| | `public void` | `**[execute](#execute(java.lang.String,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Closure](../lang/closure) processResults)`Executes the given piece of SQL. |
| | `public boolean` | `**[execute](#execute(java.lang.String,%20List))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params)`Executes the given piece of SQL with parameters. |
| | `public void` | `**[execute](#execute(java.lang.String,%20List,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, [Closure](../lang/closure) processResults)`Executes the given piece of SQL with parameters. |
| | `public boolean` | `**[execute](#execute(java.util.Map,%20java.lang.String))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)`A variant of [execute(String, java.util.List)](#execute(java.lang.String,%20java.util.List)) useful when providing the named parameters as named arguments. |
| | `public void` | `**[execute](#execute(java.util.Map,%20java.lang.String,%20groovy.lang.Closure))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Closure](../lang/closure) processResults)`A variant of [execute(String, java.util.List, Closure)](#execute(java.lang.String,%20java.util.List,%20groovy.lang.Closure)) useful when providing the named parameters as named arguments. |
| | `public boolean` | `**[execute](#execute(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] params)`Executes the given piece of SQL with parameters. |
| | `public void` | `**[execute](#execute(java.lang.String,%20java.lang.Object,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] params, [Closure](../lang/closure) processResults)`Executes the given piece of SQL with parameters. |
| | `public boolean` | `**[execute](#execute(groovy.lang.GString))**([GString](../lang/gstring) gstring)`Executes the given SQL with embedded expressions inside. |
| | `public void` | `**[execute](#execute(groovy.lang.GString,%20groovy.lang.Closure))**([GString](../lang/gstring) gstring, [Closure](../lang/closure) processResults)`Executes the given SQL with embedded expressions inside. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")>>` | `**[executeInsert](#executeInsert(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)`Executes the given SQL statement (typically an INSERT statement). |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")>>` | `**[executeInsert](#executeInsert(java.lang.String,%20List))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params)`Executes the given SQL statement (typically an INSERT statement). |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[executeInsert](#executeInsert(java.lang.String,%20List,%20List))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> keyColumnNames)`Executes the given SQL statement (typically an INSERT statement). |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")>>` | `**[executeInsert](#executeInsert(java.util.Map,%20java.lang.String))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)`A variant of [executeInsert(String, java.util.List)](#executeInsert(java.lang.String,%20java.util.List)) useful when providing the named parameters as named arguments. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[executeInsert](#executeInsert(java.util.Map,%20java.lang.String,%20List))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> keyColumnNames)`A variant of [executeInsert(String, List, List)](#executeInsert(java.lang.String,%20java.util.List,%20java.util.List)) useful when providing the named parameters as named arguments. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")>>` | `**[executeInsert](#executeInsert(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] params)`Executes the given SQL statement (typically an INSERT statement). |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[executeInsert](#executeInsert(java.lang.String,%20java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] keyColumnNames)`Executes the given SQL statement (typically an INSERT statement). |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[executeInsert](#executeInsert(java.lang.String,%20java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] keyColumnNames, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] params)`Executes the given SQL statement (typically an INSERT statement). |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")>>` | `**[executeInsert](#executeInsert(groovy.lang.GString))**([GString](../lang/gstring) gstring)`Executes the given SQL statement (typically an INSERT statement). |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[executeInsert](#executeInsert(groovy.lang.GString,%20List))**([GString](../lang/gstring) gstring, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> keyColumnNames)`Executes the given SQL statement (typically an INSERT statement). |
| | `protected final [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet")` | `**[executePreparedQuery](#executePreparedQuery(java.lang.String,%20List))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params)`Useful helper method which handles resource management when executing a prepared query which returns a result set. |
| | `protected final [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet")` | `**[executeQuery](#executeQuery(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)`Useful helper method which handles resource management when executing a query which returns a result set. |
| | `public int` | `**[executeUpdate](#executeUpdate(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)`Executes the given SQL update. |
| | `public int` | `**[executeUpdate](#executeUpdate(java.lang.String,%20List))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params)`Executes the given SQL update with parameters. |
| | `public int` | `**[executeUpdate](#executeUpdate(java.util.Map,%20java.lang.String))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)`A variant of [executeUpdate(String, java.util.List)](#executeUpdate(java.lang.String,%20java.util.List)) useful when providing the named parameters as named arguments. |
| | `public int` | `**[executeUpdate](#executeUpdate(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] params)`Executes the given SQL update with parameters. |
| | `public int` | `**[executeUpdate](#executeUpdate(groovy.lang.GString))**([GString](../lang/gstring) gstring)`Executes the given SQL update with embedded expressions inside. |
| | `public static [ExpandedVariable](expandedvariable)` | `**[expand](#expand(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object)`When using GString SQL queries, allows a variable to be expanded in the Sql string rather than representing an sql parameter. |
| | `protected int` | `**[findWhereKeyword](#findWhereKeyword(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)`Hook to allow derived classes to override where clause sniffing. |
| | `public [GroovyRowResult](groovyrowresult)` | `**[firstRow](#firstRow(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)`Performs the given SQL query and return the first row of the result set. |
| | `public [GroovyRowResult](groovyrowresult)` | `**[firstRow](#firstRow(groovy.lang.GString))**([GString](../lang/gstring) gstring)`Performs the given SQL query and return the first row of the result set. |
| | `public [GroovyRowResult](groovyrowresult)` | `**[firstRow](#firstRow(java.lang.String,%20List))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params)`Performs the given SQL query and return the first row of the result set. |
| | `public [GroovyRowResult](groovyrowresult)` | `**[firstRow](#firstRow(java.util.Map,%20java.lang.String))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)`A variant of [firstRow(String, java.util.List)](#firstRow(java.lang.String,%20java.util.List)) useful when providing the named parameters as named arguments. |
| | `public [GroovyRowResult](groovyrowresult)` | `**[firstRow](#firstRow(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] params)`Performs the given SQL query and return the first row of the result set. |
| | `public [Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection")` | `**[getConnection](#getConnection())**()`If this instance was created with a single Connection then the connection is returned. |
| | `public [DataSource](https://docs.oracle.com/javase/8/docs/api/javax/sql/DataSource.html "DataSource")` | `**[getDataSource](#getDataSource())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getObject](#getObject())**()` |
| | `protected [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")>` | `**[getParameters](#getParameters(groovy.lang.GString))**([GString](../lang/gstring) gstring)`Hook to allow derived classes to override behavior associated with extracting params from a GString. |
| | `public int` | `**[getResultSetConcurrency](#getResultSetConcurrency())**()`Gets the resultSetConcurrency for statements created using the connection. |
| | `public int` | `**[getResultSetHoldability](#getResultSetHoldability())**()`Gets the resultSetHoldability for statements created using the connection. |
| | `public int` | `**[getResultSetType](#getResultSetType())**()`Gets the resultSetType for statements created using the connection. |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getType](#getType())**()` |
| | `public int` | `**[getUpdateCount](#getUpdateCount())**()`
**Returns:**
Returns the updateCount.
|
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")>` | `**[getUpdatedParams](#getUpdatedParams(List,%20List))**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Tuple](../lang/tuple "Tuple")> indexPropList)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getValue](#getValue())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getValue](#getValue())**()` |
| | `public static [InParameter](inparameter)` | `**[in](#in(int,%20java.lang.Object))**(int type, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)`Create a new InParameter |
| | `public static [InOutParameter](inoutparameter)` | `**[inout](#inout(groovy.sql.InParameter))**([InParameter](inparameter) in)`Create an inout parameter using this in parameter. |
| | `public boolean` | `**[isCacheNamedQueries](#isCacheNamedQueries())**()`
**Returns:**
boolean true if caching is enabled (the default is true)
|
| | `public boolean` | `**[isCacheStatements](#isCacheStatements())**()`
**Returns:**
boolean true if cache is enabled (default is false)
|
| | `public boolean` | `**[isEnableNamedQueries](#isEnableNamedQueries())**()`
**Returns:**
boolean true if named query processing is enabled (the default is true)
|
| | `public boolean` | `**[isWithinBatch](#isWithinBatch())**()`Returns true if the current Sql object is currently executing a withBatch method call. |
| | `public static void` | `**[loadDriver](#loadDriver(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") driverClassName)`Attempts to load the JDBC driver on the thread, current or system class loaders |
| | `public static [Sql](sql)` | `**[newInstance](#newInstance(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url)`Creates a new Sql instance given a JDBC connection URL. |
| | `public static [Sql](sql)` | `**[newInstance](#newInstance(java.lang.String,%20java.util.Properties))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url, [Properties](https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html "Properties") properties)`Creates a new Sql instance given a JDBC connection URL and some properties. |
| | `public static [Sql](sql)` | `**[newInstance](#newInstance(java.lang.String,%20java.util.Properties,%20java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url, [Properties](https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html "Properties") properties, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") driverClassName)`Creates a new Sql instance given a JDBC connection URL, some properties and a driver class name. |
| | `public static [Sql](sql)` | `**[newInstance](#newInstance(java.lang.String,%20java.lang.String,%20java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") user, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") password)`Creates a new Sql instance given a JDBC connection URL, a username and a password. |
| | `public static [Sql](sql)` | `**[newInstance](#newInstance(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") user, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") password, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") driverClassName)`Creates a new Sql instance given a JDBC connection URL, a username, a password and a driver class name. |
| | `public static [Sql](sql)` | `**[newInstance](#newInstance(java.lang.String,%20java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") driverClassName)`Creates a new Sql instance given a JDBC connection URL and a driver class name. |
| | `public static [Sql](sql)` | `**[newInstance](#newInstance(Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> args)`Creates a new Sql instance given parameters in a Map. |
| | `protected [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[nullify](#nullify(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)`Hook to allow derived classes to override null handling. |
| | `public static [OutParameter](outparameter)` | `**[out](#out(int))**(int type)`Create a new OutParameter |
| | `public [SqlWithParams](sqlwithparams)` | `**[preCheckForNamedParams](#preCheckForNamedParams(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)`
**deprecated:**
Use [buildSqlWithIndexedProps(String)](#buildSqlWithIndexedProps(java.lang.String)) instead
|
| | `public void` | `**[query](#query(java.lang.String,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Closure](../lang/closure) closure)`Performs the given SQL query, which should return a single `ResultSet` object. |
| | `public void` | `**[query](#query(java.lang.String,%20List,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, [Closure](../lang/closure) closure)`Performs the given SQL query, which should return a single `ResultSet` object. |
| | `public void` | `**[query](#query(java.lang.String,%20java.util.Map,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") map, [Closure](../lang/closure) closure)`A variant of [query(String, java.util.List, groovy.lang.Closure)](#query(java.lang.String,%20java.util.List,%20groovy.lang.Closure)) useful when providing the named parameters as a map. |
| | `public void` | `**[query](#query(java.util.Map,%20java.lang.String,%20groovy.lang.Closure))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") map, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Closure](../lang/closure) closure)`A variant of [query(String, java.util.List, groovy.lang.Closure)](#query(java.lang.String,%20java.util.List,%20groovy.lang.Closure)) useful when providing the named parameters as named arguments. |
| | `public void` | `**[query](#query(groovy.lang.GString,%20groovy.lang.Closure))**([GString](../lang/gstring) gstring, [Closure](../lang/closure) closure)`Performs the given SQL query, which should return a single `ResultSet` object. |
| | `public static [ResultSetOutParameter](resultsetoutparameter)` | `**[resultSet](#resultSet(int))**(int type)`Create a new ResultSetOutParameter |
| | `public void` | `**[rollback](#rollback())**()`If this SQL object was created with a Connection then this method rolls back the connection. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[rows](#rows(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)`Performs the given SQL query and return the rows of the result set. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[rows](#rows(java.lang.String,%20int,%20int))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, int offset, int maxRows)`Performs the given SQL query and return a "page" of rows from the result set. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[rows](#rows(java.lang.String,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Closure](../lang/closure) metaClosure)`Performs the given SQL query and return the rows of the result set. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[rows](#rows(java.lang.String,%20int,%20int,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, int offset, int maxRows, [Closure](../lang/closure) metaClosure)`Performs the given SQL query and return a "page" of rows from the result set. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[rows](#rows(java.lang.String,%20List))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params)`Performs the given SQL query and return the rows of the result set. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[rows](#rows(java.util.Map,%20java.lang.String))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)`A variant of [rows(String, java.util.List)](#rows(java.lang.String,%20java.util.List)) useful when providing the named parameters as named arguments. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[rows](#rows(java.lang.String,%20List,%20int,%20int))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, int offset, int maxRows)`Performs the given SQL query and return a "page" of rows from the result set. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[rows](#rows(java.lang.String,%20java.util.Map,%20int,%20int))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, int offset, int maxRows)`A variant of [rows(String, java.util.List, int, int)](#rows(java.lang.String,%20java.util.List,%20int,%20int)) useful when providing the named parameters as a map. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[rows](#rows(java.util.Map,%20java.lang.String,%20int,%20int))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, int offset, int maxRows)`A variant of [rows(String, java.util.List, int, int)](#rows(java.lang.String,%20java.util.List,%20int,%20int)) useful when providing the named parameters as named arguments. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[rows](#rows(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] params)`Performs the given SQL query and return the rows of the result set. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[rows](#rows(java.lang.String,%20java.lang.Object,%20int,%20int))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] params, int offset, int maxRows)`Performs the given SQL query and return the rows of the result set. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[rows](#rows(java.lang.String,%20List,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, [Closure](../lang/closure) metaClosure)`Performs the given SQL query and return the rows of the result set. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[rows](#rows(java.lang.String,%20java.util.Map,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [Closure](../lang/closure) metaClosure)`A variant of [rows(String, java.util.List, groovy.lang.Closure)](#rows(java.lang.String,%20java.util.List,%20groovy.lang.Closure)) useful when providing the named parameters as a map. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[rows](#rows(java.util.Map,%20java.lang.String,%20groovy.lang.Closure))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Closure](../lang/closure) metaClosure)`A variant of [rows(String, java.util.List, groovy.lang.Closure)](#rows(java.lang.String,%20java.util.List,%20groovy.lang.Closure)) useful when providing the named parameters as named arguments. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[rows](#rows(java.lang.String,%20List,%20int,%20int,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, int offset, int maxRows, [Closure](../lang/closure) metaClosure)`Performs the given SQL query and return a "page" of rows from the result set. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[rows](#rows(java.lang.String,%20java.util.Map,%20int,%20int,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, int offset, int maxRows, [Closure](../lang/closure) metaClosure)`A variant of [rows(String, java.util.List, int, int, groovy.lang.Closure)](#rows(java.lang.String,%20java.util.List,%20int,%20int,%20groovy.lang.Closure)) useful when providing the named parameters as a map. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[rows](#rows(java.util.Map,%20java.lang.String,%20int,%20int,%20groovy.lang.Closure))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, int offset, int maxRows, [Closure](../lang/closure) metaClosure)`A variant of [rows(String, java.util.List, int, int, groovy.lang.Closure)](#rows(java.lang.String,%20java.util.List,%20int,%20int,%20groovy.lang.Closure)) useful when providing the named parameters as named arguments. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[rows](#rows(groovy.lang.GString,%20int,%20int))**([GString](../lang/gstring) sql, int offset, int maxRows)`Performs the given SQL query and return a "page" of rows from the result set. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[rows](#rows(groovy.lang.GString))**([GString](../lang/gstring) gstring)`Performs the given SQL query and return the rows of the result set. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[rows](#rows(groovy.lang.GString,%20groovy.lang.Closure))**([GString](../lang/gstring) gstring, [Closure](../lang/closure) metaClosure)`Performs the given SQL query and return the rows of the result set. |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>` | `**[rows](#rows(groovy.lang.GString,%20int,%20int,%20groovy.lang.Closure))**([GString](../lang/gstring) gstring, int offset, int maxRows, [Closure](../lang/closure) metaClosure)`Performs the given SQL query and return a "page" of rows from the result set. |
| | `public [Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection")` | `**[run](#run())**()` |
| | `public void` | `**[setCacheNamedQueries](#setCacheNamedQueries(boolean))**(boolean cacheNamedQueries)`Enables named query caching. |
| | `public void` | `**[setCacheStatements](#setCacheStatements(boolean))**(boolean cacheStatements)`Enables statement caching. |
| | `public void` | `**[setEnableNamedQueries](#setEnableNamedQueries(boolean))**(boolean enableNamedQueries)`Enables named query support: * if *enableNamedQueries* is true, queries with ':propname' and '?
|
| | `protected void` | `**[setInternalConnection](#setInternalConnection(java.sql.Connection))**([Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection") conn)`Stub needed for testing. |
| | `protected void` | `**[setObject](#setObject(java.sql.PreparedStatement,%20int,%20java.lang.Object))**([PreparedStatement](https://docs.oracle.com/javase/8/docs/api/java/sql/PreparedStatement.html "PreparedStatement") statement, int i, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)`Strategy method allowing derived classes to handle types differently such as for CLOBs etc. |
| | `protected void` | `**[setParameters](#setParameters(List,%20java.sql.PreparedStatement))**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, [PreparedStatement](https://docs.oracle.com/javase/8/docs/api/java/sql/PreparedStatement.html "PreparedStatement") statement)`Hook to allow derived classes to override behavior associated with setting params for a prepared statement. |
| | `public void` | `**[setResultSetConcurrency](#setResultSetConcurrency(int))**(int resultSetConcurrency)`Sets the resultSetConcurrency for statements created using the connection. |
| | `public void` | `**[setResultSetHoldability](#setResultSetHoldability(int))**(int resultSetHoldability)`Sets the resultSetHoldability for statements created using the connection. |
| | `public void` | `**[setResultSetType](#setResultSetType(int))**(int resultSetType)`Sets the resultSetType for statements created using the connection. |
| | `public int[]` | `**[withBatch](#withBatch(groovy.lang.Closure))**([Closure](../lang/closure) closure)`Performs the closure (containing batch operations) within a batch. |
| | `public int[]` | `**[withBatch](#withBatch(int,%20groovy.lang.Closure))**(int batchSize, [Closure](../lang/closure) closure)`Performs the closure (containing batch operations) within a batch using a given batch size. |
| | `public int[]` | `**[withBatch](#withBatch(java.lang.String,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Closure](../lang/closure) closure)`Performs the closure (containing batch operations specific to an associated prepared statement) within a batch. |
| | `public int[]` | `**[withBatch](#withBatch(int,%20java.lang.String,%20groovy.lang.Closure))**(int batchSize, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Closure](../lang/closure) closure)`Performs the closure (containing batch operations specific to an associated prepared statement) within a batch using a given batch size. |
| | `public static void` | `**[withInstance](#withInstance(java.lang.String,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url, [Closure](../lang/closure) c)`Invokes a closure passing it a new Sql instance created from the given JDBC connection URL. |
| | `public static void` | `**[withInstance](#withInstance(java.lang.String,%20java.util.Properties,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url, [Properties](https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html "Properties") properties, [Closure](../lang/closure) c)`Invokes a closure passing it a new Sql instance created from the given JDBC connection URL and properties. |
| | `public static void` | `**[withInstance](#withInstance(java.lang.String,%20java.util.Properties,%20java.lang.String,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url, [Properties](https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html "Properties") properties, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") driverClassName, [Closure](../lang/closure) c)`Invokes a closure passing it a new Sql instance created from the given JDBC connection URL, properties and driver classname. |
| | `public static void` | `**[withInstance](#withInstance(java.lang.String,%20java.lang.String,%20java.lang.String,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") user, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") password, [Closure](../lang/closure) c)`Invokes a closure passing it a new Sql instance created from the given JDBC connection URL, user and password. |
| | `public static void` | `**[withInstance](#withInstance(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") user, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") password, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") driverClassName, [Closure](../lang/closure) c)`Invokes a closure passing it a new Sql instance created from the given JDBC connection URL. |
| | `public static void` | `**[withInstance](#withInstance(java.lang.String,%20java.lang.String,%20groovy.lang.Closure))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") driverClassName, [Closure](../lang/closure) c)`Invokes a closure passing it a new Sql instance created from the given JDBC connection URL. |
| | `public static void` | `**[withInstance](#withInstance(Map,%20groovy.lang.Closure))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> args, [Closure](../lang/closure) c)`Invokes a closure passing it a new Sql instance created from the given map of arguments. |
| | `public void` | `**[withStatement](#withStatement(groovy.lang.Closure))**([Closure](../lang/closure) configureStatement)`Allows a closure to be passed in to configure the JDBC statements before they are executed. |
| | `public void` | `**[withTransaction](#withTransaction(groovy.lang.Closure))**([Closure](../lang/closure) closure)`Performs the closure within a transaction using a cached connection. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Field Detail
------------
### public static final int **ALL\_RESULT\_SETS**
### public static final [OutParameter](outparameter) **ARRAY**
### public static final [OutParameter](outparameter) **BIGINT**
### public static final [OutParameter](outparameter) **BINARY**
### public static final [OutParameter](outparameter) **BIT**
### public static final [OutParameter](outparameter) **BLOB**
### public static final [OutParameter](outparameter) **BOOLEAN**
### public static final [OutParameter](outparameter) **CHAR**
### public static final [OutParameter](outparameter) **CLOB**
### public static final [OutParameter](outparameter) **DATALINK**
### public static final [OutParameter](outparameter) **DATE**
### public static final [OutParameter](outparameter) **DECIMAL**
### public static final [OutParameter](outparameter) **DISTINCT**
### public static final [OutParameter](outparameter) **DOUBLE**
### public static final int **FIRST\_RESULT\_SET**
### public static final [OutParameter](outparameter) **FLOAT**
### public static final [OutParameter](outparameter) **INTEGER**
### public static final [OutParameter](outparameter) **JAVA\_OBJECT**
### protected static final [Logger](https://docs.oracle.com/javase/8/docs/api/java/util/logging/Logger.html "Logger") **LOG**
Hook to allow derived classes to access the log
### public static final [OutParameter](outparameter) **LONGVARBINARY**
### public static final [OutParameter](outparameter) **LONGVARCHAR**
### public static final int **NO\_RESULT\_SETS**
### public static final [OutParameter](outparameter) **NULL**
### public static final [OutParameter](outparameter) **NUMERIC**
### public static final [OutParameter](outparameter) **OTHER**
### public static final [OutParameter](outparameter) **REAL**
### public static final [OutParameter](outparameter) **REF**
### public static final [OutParameter](outparameter) **SMALLINT**
### public static final [OutParameter](outparameter) **STRUCT**
### public static final [OutParameter](outparameter) **TIME**
### public static final [OutParameter](outparameter) **TIMESTAMP**
### public static final [OutParameter](outparameter) **TINYINT**
### public static final [OutParameter](outparameter) **VARBINARY**
### public static final [OutParameter](outparameter) **VARCHAR**
Constructor Detail
------------------
### public **Sql**([DataSource](https://docs.oracle.com/javase/8/docs/api/javax/sql/DataSource.html "DataSource") dataSource)
Constructs an SQL instance using the given DataSource. Each operation will use a Connection from the DataSource pool and close it when the operation is completed putting it back into the pool.
**Parameters:**
`dataSource` - the DataSource to use
### public **Sql**([Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection") connection)
Constructs an SQL instance using the given Connection. It is the caller's responsibility to close the Connection after the Sql instance has been used. Depending on which features you are using, you may be able to do this on the connection object directly but the preferred approach is to call the [close()](#close()) method which will close the connection but also free any cached resources.
**Parameters:**
`connection` - the Connection to use
### public **Sql**([Sql](sql) parent)
Method Detail
-------------
### public static [InParameter](inparameter) **ARRAY**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **BIGINT**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **BINARY**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **BIT**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **BLOB**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **BOOLEAN**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **CHAR**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **CLOB**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **DATALINK**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **DATE**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **DECIMAL**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **DISTINCT**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **DOUBLE**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **FLOAT**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **INTEGER**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **JAVA\_OBJECT**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **LONGVARBINARY**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **LONGVARCHAR**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **NULL**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **NUMERIC**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **OTHER**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **REAL**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **REF**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **SMALLINT**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **STRUCT**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **TIME**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **TIMESTAMP**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **TINYINT**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **VARBINARY**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### public static [InParameter](inparameter) **VARCHAR**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### protected [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **asList**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet") rs)
Hook to allow derived classes to override list of result collection behavior. The default behavior is to return a list of GroovyRowResult objects corresponding to each row in the ResultSet.
**throws:**
SQLException if a database error occurs
**Parameters:**
`sql` - query to execute
`rs` - the ResultSet to process
**Returns:**
the resulting list of rows
### protected [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **asList**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet") rs, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSetMetaData") [Closure](../lang/closure) metaClosure)
Hook to allow derived classes to override list of result collection behavior. The default behavior is to return a list of GroovyRowResult objects corresponding to each row in the ResultSet.
**throws:**
SQLException if a database error occurs
**Parameters:**
`sql` - query to execute
`rs` - the ResultSet to process
`metaClosure` - called for meta data (only once after sql execution)
**Returns:**
the resulting list of rows
### protected [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **asList**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet") rs, int offset, int maxRows, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSetMetaData") [Closure](../lang/closure) metaClosure)
### protected [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **asSql**([GString](../lang/gstring) gstring, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> values)
Hook to allow derived classes to override sql generation from GStrings.
**Parameters:**
`gstring` - a GString containing the SQL query with embedded params
`values` - the values to embed
**Returns:**
the SQL version of the given query using ? instead of any parameter
**See Also:**
[expand(Object)](#expand(java.lang.Object))
### protected [SqlWithParams](sqlwithparams) **buildSqlWithIndexedProps**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)
Hook to allow derived classes to override behavior associated with the parsing and indexing of parameters from a given sql statement.
**Parameters:**
`sql` - the sql statement to process
**Returns:**
a [SqlWithParams](sqlwithparams "SqlWithParams") instance containing the parsed sql and parameters containing the indexed location and property name of parameters or `null` if no parsing of the sql was performed.
### public void **cacheConnection**(@[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.Connection") [Closure](../lang/closure) closure)
Caches the connection used while the closure is active. If the closure takes a single argument, it will be called with the connection, otherwise it will be called with no arguments.
**throws:**
SQLException if a database error occurs
**Parameters:**
`closure` - the given closure
### public void **cacheStatements**(@[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.Connection") [Closure](../lang/closure) closure)
Caches every created preparedStatement in Closure *closure* Every cached preparedStatement is closed after closure has been called. If the closure takes a single argument, it will be called with the connection, otherwise it will be called with no arguments.
**throws:**
SQLException if a database error occurs
**Parameters:**
`closure` - the given closure
**See Also:**
[setCacheStatements(boolean)](#setCacheStatements(boolean))
### public int **call**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)
Performs a stored procedure call.
Example usage (tested with MySQL) - suppose we have the following stored procedure:
```
sql.execute """
CREATE PROCEDURE HouseSwap(_first1 VARCHAR(50), _first2 VARCHAR(50))
BEGIN
DECLARE _loc1 INT;
DECLARE _loc2 INT;
SELECT location_id into _loc1 FROM PERSON where firstname = _first1;
SELECT location_id into _loc2 FROM PERSON where firstname = _first2;
UPDATE PERSON
set location_id = case firstname
when _first1 then _loc2
when _first2 then _loc1
end
where (firstname = _first1 OR firstname = _first2);
END
"""
```
then you can invoke the procedure as follows:
```
def rowsChanged = sql.call("{call HouseSwap('Guillaume', 'Paul')}")
assert rowsChanged == 2
```
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
**Returns:**
the number of rows updated or 0 for SQL statements that return nothing
### public int **call**([GString](../lang/gstring) gstring)
Performs a stored procedure call with the given embedded parameters.
Example usage - see [call(String)](#call(java.lang.String)) for more details about creating a `HouseSwap(IN name1, IN name2)` stored procedure. Once created, it can be called like this:
```
def p1 = 'Paul'
def p2 = 'Guillaume'
def rowsChanged = sql.call("{call HouseSwap($p1, $p2)}")
assert rowsChanged == 2
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`gstring` - a GString containing the SQL query with embedded params
**Returns:**
the number of rows updated or 0 for SQL statements that return nothing
**See Also:**
[expand(Object)](#expand(java.lang.Object))
[call(String)](#call(java.lang.String))
### public int **call**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params)
Performs a stored procedure call with the given parameters.
Example usage - see [call(String)](#call(java.lang.String)) for more details about creating a `HouseSwap(IN name1, IN name2)` stored procedure. Once created, it can be called like this:
```
def rowsChanged = sql.call("{call HouseSwap(?, ?)}", ['Guillaume', 'Paul'])
assert rowsChanged == 2
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`params` - a list of parameters
**Returns:**
the number of rows updated or 0 for SQL statements that return nothing
**See Also:**
[call(String)](#call(java.lang.String))
### public int **call**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] params)
Performs a stored procedure call with the given parameters.
An Object array variant of [call(String, List)](#call(java.lang.String,%20java.util.List)).
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`params` - an array of parameters
**Returns:**
the number of rows updated or 0 for SQL statements that return nothing
**See Also:**
[call(String)](#call(java.lang.String))
### public void **call**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.lang.Object[]") [Closure](../lang/closure) closure)
Performs a stored procedure call with the given parameters. The closure is called once with all the out parameters.
Example usage - suppose we create a stored procedure (ignore its simplistic implementation):
```
// Tested with MySql 5.0.75
sql.execute """
CREATE PROCEDURE Hemisphere(
IN p_firstname VARCHAR(50),
IN p_lastname VARCHAR(50),
OUT ans VARCHAR(50))
BEGIN
DECLARE loc INT;
SELECT location_id into loc FROM PERSON where firstname = p_firstname and lastname = p_lastname;
CASE loc
WHEN 40 THEN
SET ans = 'Southern Hemisphere';
ELSE
SET ans = 'Northern Hemisphere';
END CASE;
END;
"""
```
we can now call the stored procedure as follows:
```
sql.call '{call Hemisphere(?, ?, ?)}', ['Guillaume', 'Laforge', Sql.VARCHAR], { dwells ->
println dwells
}
```
which will output '`Northern Hemisphere`'. We can also access stored functions with scalar return values where the return value will be treated as an OUT parameter. Here are examples for various databases for creating such a procedure:
```
// Tested with MySql 5.0.75
sql.execute """
create function FullName(p_firstname VARCHAR(40)) returns VARCHAR(80)
begin
declare ans VARCHAR(80);
SELECT CONCAT(firstname, ' ', lastname) INTO ans FROM PERSON WHERE firstname = p_firstname;
return ans;
end
"""
// Tested with MS SQLServer Express 2008
sql.execute """
create function FullName(@firstname VARCHAR(40)) returns VARCHAR(80)
begin
declare @ans VARCHAR(80)
SET @ans = (SELECT firstname + ' ' + lastname FROM PERSON WHERE firstname = @firstname)
return @ans
end
"""
// Tested with Oracle XE 10g
sql.execute """
create function FullName(p_firstname VARCHAR) return VARCHAR is
ans VARCHAR(80);
begin
SELECT CONCAT(CONCAT(firstname, ' '), lastname) INTO ans FROM PERSON WHERE firstname = p_firstname;
return ans;
end;
"""
```
and here is how you access the stored function for all databases:
```
sql.call("{? = call FullName(?)}", [Sql.VARCHAR, 'Sam']) { name ->
assert name == 'Sam Pullara'
}
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the sql statement
`params` - a list of parameters
`closure` - called for each row with a GroovyResultSet
### public void **call**([GString](../lang/gstring) gstring, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.lang.Object[]") [Closure](../lang/closure) closure)
Performs a stored procedure call with the given parameters, calling the closure once with all result objects.
See [call(String, List, Closure)](#call(java.lang.String,%20java.util.List,%20groovy.lang.Closure)) for more details about creating a `Hemisphere(IN first, IN last, OUT dwells)` stored procedure. Once created, it can be called like this:
```
def first = 'Scott'
def last = 'Davis'
sql.call "{call Hemisphere($first, $last, ${Sql.VARCHAR})}", { dwells ->
println dwells
}
```
As another example, see [call(String, List, Closure)](#call(java.lang.String,%20java.util.List,%20groovy.lang.Closure)) for more details about creating a `FullName(IN first)` stored function. Once created, it can be called like this:
```
def first = 'Sam'
sql.call("{$Sql.VARCHAR = call FullName($first)}") { name ->
assert name == 'Sam Pullara'
}
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`gstring` - a GString containing the SQL query with embedded params
`closure` - called for each row with a GroovyResultSet
**See Also:**
[call(String, List, Closure)](#call(java.lang.String,%20java.util.List,%20groovy.lang.Closure))
[expand(Object)](#expand(java.lang.Object))
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>> **callWithAllRows**([GString](../lang/gstring) gstring, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.lang.Object[]") [Closure](../lang/closure) closure)
Performs a stored procedure call with the given parameters, calling the closure once with all result objects, and also returning a list of lists with the rows of the ResultSet(s).
Use this when calling a stored procedure that utilizes both output parameters and returns multiple ResultSets.
Once created, the stored procedure can be called like this:
```
def first = 'Jeff'
def last = 'Sheets'
def rowsList = sql.callWithAllRows "{call Hemisphere2($first, $last, ${Sql.VARCHAR})}", { dwells ->
println dwells
}
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`gstring` - a GString containing the SQL query with embedded params
`closure` - called once with all out parameter results
**Returns:**
a list containing lists of GroovyRowResult objects
**See Also:**
[callWithAllRows(String, List, Closure)](#callWithAllRows(java.lang.String,%20java.util.List,%20groovy.lang.Closure))
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>> **callWithAllRows**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.lang.Object[]") [Closure](../lang/closure) closure)
Performs a stored procedure call with the given parameters, calling the closure once with all result objects, and also returning a list of lists with the rows of the ResultSet(s).
Use this when calling a stored procedure that utilizes both output parameters and returns multiple ResultSets.
Once created, the stored procedure can be called like this:
```
def rowsList = sql.callWithAllRows '{call Hemisphere2(?, ?, ?)}', ['Guillaume', 'Laforge', Sql.VARCHAR], { dwells ->
println dwells
}
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the sql statement
`params` - a list of parameters
`closure` - called once with all out parameter results
**Returns:**
a list containing lists of GroovyRowResult objects
**See Also:**
[callWithRows(GString, Closure)](#callWithRows(groovy.lang.GString,%20groovy.lang.Closure))
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **callWithRows**([GString](../lang/gstring) gstring, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.lang.Object[]") [Closure](../lang/closure) closure)
Performs a stored procedure call with the given parameters, calling the closure once with all result objects, and also returning the rows of the ResultSet.
Use this when calling a stored procedure that utilizes both output parameters and returns a single ResultSet.
Once created, the stored procedure can be called like this:
```
def first = 'Jeff'
def last = 'Sheets'
def rows = sql.callWithRows "{call Hemisphere2($first, $last, ${Sql.VARCHAR})}", { dwells ->
println dwells
}
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`gstring` - a GString containing the SQL query with embedded params
`closure` - called once with all out parameter results
**Returns:**
a list of GroovyRowResult objects
**See Also:**
[callWithRows(String, List, Closure)](#callWithRows(java.lang.String,%20java.util.List,%20groovy.lang.Closure))
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **callWithRows**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.lang.Object[]") [Closure](../lang/closure) closure)
Performs a stored procedure call with the given parameters, calling the closure once with all result objects, and also returning the rows of the ResultSet.
Use this when calling a stored procedure that utilizes both output parameters and returns a single ResultSet.
Once created, the stored procedure can be called like this:
```
def rows = sql.callWithRows '{call Hemisphere2(?, ?, ?)}', ['Guillaume', 'Laforge', Sql.VARCHAR], { dwells ->
println dwells
}
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the sql statement
`params` - a list of parameters
`closure` - called once with all out parameter results
**Returns:**
a list of GroovyRowResult objects
**See Also:**
[callWithRows(GString, Closure)](#callWithRows(groovy.lang.GString,%20groovy.lang.Closure))
### protected [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")>> **callWithRows**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, int processResultsSets, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.lang.Object[]") [Closure](../lang/closure) closure)
Base internal method for call(), callWithRows(), and callWithAllRows() style of methods.
Performs a stored procedure call with the given parameters, calling the closure once with all result objects, and also returning the rows of the ResultSet(s) (if processResultSets is set to Sql.FIRST\_RESULT\_SET, Sql.ALL\_RESULT\_SETS)
Main purpose of processResultSets param is to retain original call() method performance when this is set to Sql.NO\_RESULT\_SETS
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the sql statement
`params` - a list of parameters
`processResultsSets` - the result sets to process, either Sql.NO\_RESULT\_SETS, Sql.FIRST\_RESULT\_SET, or Sql.ALL\_RESULT\_SETS
`closure` - called once with all out parameter results
**Returns:**
a list of GroovyRowResult objects
**See Also:**
[callWithRows(String, List, Closure)](#callWithRows(java.lang.String,%20java.util.List,%20groovy.lang.Closure))
### public [SqlWithParams](sqlwithparams) **checkForNamedParams**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **close**()
If this SQL object was created with a Connection then this method closes the connection. If this SQL object was created from a DataSource then this method only frees any cached objects (statements in particular).
### protected void **closeResources**([Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection") connection, [Statement](https://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html "Statement") statement, [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet") results)
An extension point allowing derived classes to change the behavior of resource closing.
**Parameters:**
`connection` - the connection to close
`statement` - the statement to close
`results` - the results to close
### protected void **closeResources**([Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection") connection, [Statement](https://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html "Statement") statement)
An extension point allowing the behavior of resource closing to be overridden in derived classes.
**Parameters:**
`connection` - the connection to close
`statement` - the statement to close
### protected void **closeResources**([Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection") connection)
An extension point allowing the behavior of resource closing to be overridden in derived classes.
**Parameters:**
`connection` - the connection to close
### public void **commit**()
If this SQL object was created with a Connection then this method commits the connection. If this SQL object was created from a DataSource then this method does nothing.
**throws:**
SQLException if a database access error occurs
### protected void **configure**([Statement](https://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html "Statement") statement)
Provides a hook for derived classes to be able to configure JDBC statements. Default behavior is to call a previously saved closure, if any, using the statement as a parameter.
**Parameters:**
`statement` - the statement to configure
### protected [Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection") **createConnection**()
An extension point allowing derived classes to change the behavior of connection creation. The default behavior is to either use the supplied connection or obtain it from the supplied datasource.
**throws:**
java.sql.SQLException if a SQL error occurs
**Returns:**
the connection associated with this Sql
### protected [AbstractQueryCommand](../../abstractquerycommand) **createPreparedQueryCommand**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> queryParams)
Factory for the PreparedQueryCommand command pattern object allows subclass to supply implementations of the command class.
**Parameters:**
`sql` - statement to be executed, including optional parameter placeholders (?)
`queryParams` - List of parameter values corresponding to parameter placeholders
**Returns:**
a command - invoke its execute() and closeResource() methods
**See Also:**
[createQueryCommand(String)](#createQueryCommand(java.lang.String))
### protected [AbstractQueryCommand](../../abstractquerycommand) **createQueryCommand**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)
Factory for the QueryCommand command pattern object allows subclasses to supply implementations of the command class. The factory will be used in a pattern similar to:
```
AbstractQueryCommand q = createQueryCommand("update TABLE set count = 0) where count is null");
try {
ResultSet rs = q.execute();
return asList(rs);
} finally {
q.closeResources();
}
```
**Parameters:**
`sql` - statement to be executed
**Returns:**
a command - invoke its execute() and closeResource() methods
### public [DataSet](dataset) **dataSet**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") table)
### public [DataSet](dataset) **dataSet**([Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html "Class")<?> type)
### public void **eachRow**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.GroovyResultSet") [Closure](../lang/closure) closure)
Performs the given SQL query calling the given Closure with each row of the result set. The row will be a `GroovyResultSet` which is a `ResultSet` that supports accessing the fields using property style notation and ordinal index values.
Example usages:
```
sql.eachRow("select * from PERSON where firstname like 'S%'") { row ->
println "$row.firstname ${row[2]}}"
}
sql.eachRow "call my_stored_proc_returning_resultset()", {
println it.firstname
}
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the sql statement
`closure` - called for each row with a GroovyResultSet
### public void **eachRow**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, int offset, int maxRows, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.GroovyResultSet") [Closure](../lang/closure) closure)
Performs the given SQL query calling the given `closure` with each row of the result set starting at the provided `offset`, and including up to `maxRows` number of rows. The row will be a `GroovyResultSet` which is a `ResultSet` that supports accessing the fields using property style notation and ordinal index values.
Note that the underlying implementation is based on either invoking `ResultSet.absolute()`, or if the ResultSet type is `ResultSet.TYPE_FORWARD_ONLY`, the `ResultSet.next()` method is invoked equivalently. The first row of a ResultSet is 1, so passing in an offset of 1 or less has no effect on the initial positioning within the result set.
Note that different database and JDBC driver implementations may work differently with respect to this method. Specifically, one should expect that `ResultSet.TYPE_FORWARD_ONLY` may be less efficient than a "scrollable" type.
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the sql statement
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
`closure` - called for each row with a GroovyResultSet
### public void **eachRow**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSetMetaData") [Closure](../lang/closure) metaClosure, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.GroovyResultSet") [Closure](../lang/closure) rowClosure)
Performs the given SQL query calling the given `rowClosure` with each row of the result set. The row will be a `GroovyResultSet` which is a `ResultSet` that supports accessing the fields using property style notation and ordinal index values. In addition, the `metaClosure` will be called once passing in the `ResultSetMetaData` as argument.
Example usage:
```
def printColNames = { meta ->
(1..meta.columnCount).each {
print meta.getColumnLabel(it).padRight(20)
}
println()
}
def printRow = { row ->
row.toRowResult().values().each{ print it.toString().padRight(20) }
println()
}
sql.eachRow("select * from PERSON", printColNames, printRow)
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the sql statement
`metaClosure` - called for meta data (only once after sql execution)
`rowClosure` - called for each row with a GroovyResultSet
### public void **eachRow**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSetMetaData") [Closure](../lang/closure) metaClosure, int offset, int maxRows, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.GroovyResultSet") [Closure](../lang/closure) rowClosure)
Performs the given SQL query calling the given `rowClosure` with each row of the result set starting at the provided `offset`, and including up to `maxRows` number of rows. The row will be a `GroovyResultSet` which is a `ResultSet` that supports accessing the fields using property style notation and ordinal index values.
In addition, the `metaClosure` will be called once passing in the `ResultSetMetaData` as argument.
Note that the underlying implementation is based on either invoking `ResultSet.absolute()`, or if the ResultSet type is `ResultSet.TYPE_FORWARD_ONLY`, the `ResultSet.next()` method is invoked equivalently. The first row of a ResultSet is 1, so passing in an offset of 1 or less has no effect on the initial positioning within the result set.
Note that different database and JDBC driver implementations may work differently with respect to this method. Specifically, one should expect that `ResultSet.TYPE_FORWARD_ONLY` may be less efficient than a "scrollable" type.
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the sql statement
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
`metaClosure` - called for meta data (only once after sql execution)
`rowClosure` - called for each row with a GroovyResultSet
### public void **eachRow**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSetMetaData") [Closure](../lang/closure) metaClosure, int offset, int maxRows, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.GroovyResultSet") [Closure](../lang/closure) rowClosure)
Performs the given SQL query calling the given `rowClosure` with each row of the result set starting at the provided `offset`, and including up to `maxRows` number of rows. The row will be a `GroovyResultSet` which is a `ResultSet` that supports accessing the fields using property style notation and ordinal index values.
In addition, the `metaClosure` will be called once passing in the `ResultSetMetaData` as argument. The query may contain placeholder question marks which match the given list of parameters.
Note that the underlying implementation is based on either invoking `ResultSet.absolute()`, or if the ResultSet type is `ResultSet.TYPE_FORWARD_ONLY`, the `ResultSet.next()` method is invoked equivalently. The first row of a ResultSet is 1, so passing in an offset of 1 or less has no effect on the initial positioning within the result set.
Note that different database and JDBC driver implementations may work differently with respect to this method. Specifically, one should expect that `ResultSet.TYPE_FORWARD_ONLY` may be less efficient than a "scrollable" type.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the sql statement
`params` - a list of parameters
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
`metaClosure` - called for meta data (only once after sql execution)
`rowClosure` - called for each row with a GroovyResultSet
### public void **eachRow**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") map, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSetMetaData") [Closure](../lang/closure) metaClosure, int offset, int maxRows, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.GroovyResultSet") [Closure](../lang/closure) rowClosure)
A variant of [eachRow(String, java.util.List, groovy.lang.Closure, int, int, groovy.lang.Closure)](#eachRow(java.lang.String,%20java.util.List,%20groovy.lang.Closure,%20int,%20int,%20groovy.lang.Closure)) allowing the named parameters to be supplied in a map.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the sql statement
`map` - a map containing the named parameters
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
`metaClosure` - called for meta data (only once after sql execution)
`rowClosure` - called for each row with a GroovyResultSet
**Since:**
1.8.7
### public void **eachRow**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") map, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSetMetaData") [Closure](../lang/closure) metaClosure, int offset, int maxRows, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.GroovyResultSet") [Closure](../lang/closure) rowClosure)
A variant of [eachRow(String, java.util.List, groovy.lang.Closure, int, int, groovy.lang.Closure)](#eachRow(java.lang.String,%20java.util.List,%20groovy.lang.Closure,%20int,%20int,%20groovy.lang.Closure)) allowing the named parameters to be supplied as named arguments.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`map` - a map containing the named parameters
`sql` - the sql statement
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
`metaClosure` - called for meta data (only once after sql execution)
`rowClosure` - called for each row with a GroovyResultSet
**Since:**
1.8.7
### public void **eachRow**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSetMetaData") [Closure](../lang/closure) metaClosure, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.GroovyResultSet") [Closure](../lang/closure) rowClosure)
Performs the given SQL query calling the given Closure with each row of the result set. The row will be a `GroovyResultSet` which is a `ResultSet` that supports accessing the fields using property style notation and ordinal index values. In addition, the `metaClosure` will be called once passing in the `ResultSetMetaData` as argument. The query may contain placeholder question marks which match the given list of parameters.
Example usage:
```
def printColNames = { meta ->
(1..meta.columnCount).each {
print meta.getColumnLabel(it).padRight(20)
}
println()
}
def printRow = { row ->
row.toRowResult().values().each{ print it.toString().padRight(20) }
println()
}
sql.eachRow("select * from PERSON where lastname like ?", ['%a%'], printColNames, printRow)
```
This method supports named and named ordinal parameters. See the class Javadoc for more details.
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the sql statement
`params` - a list of parameters
`metaClosure` - called for meta data (only once after sql execution)
`rowClosure` - called for each row with a GroovyResultSet
### public void **eachRow**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSetMetaData") [Closure](../lang/closure) metaClosure, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.GroovyResultSet") [Closure](../lang/closure) rowClosure)
A variant of [eachRow(String, java.util.List, groovy.lang.Closure, groovy.lang.Closure)](#eachRow(java.lang.String,%20java.util.List,%20groovy.lang.Closure,%20groovy.lang.Closure)) useful when providing the named parameters as a map.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the sql statement
`params` - a map of named parameters
`metaClosure` - called for meta data (only once after sql execution)
`rowClosure` - called for each row with a GroovyResultSet
**Since:**
1.8.7
### public void **eachRow**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSetMetaData") [Closure](../lang/closure) metaClosure, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.GroovyResultSet") [Closure](../lang/closure) rowClosure)
A variant of [eachRow(String, java.util.List, groovy.lang.Closure, groovy.lang.Closure)](#eachRow(java.lang.String,%20java.util.List,%20groovy.lang.Closure,%20groovy.lang.Closure)) useful when providing the named parameters as named arguments.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`params` - a map of named parameters
`sql` - the sql statement
`metaClosure` - called for meta data (only once after sql execution)
`rowClosure` - called for each row with a GroovyResultSet
**Since:**
1.8.7
### public void **eachRow**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.GroovyResultSet") [Closure](../lang/closure) closure)
Performs the given SQL query calling the given Closure with each row of the result set. The row will be a `GroovyResultSet` which is a `ResultSet` that supports accessing the fields using property style notation and ordinal index values. The query may contain placeholder question marks which match the given list of parameters.
Example usage:
```
sql.eachRow("select * from PERSON where lastname like ?", ['%a%']) { row ->
println "${row[1]} $row.lastname"
}
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the sql statement
`params` - a list of parameters
`closure` - called for each row with a GroovyResultSet
### public void **eachRow**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.GroovyResultSet") [Closure](../lang/closure) closure)
A variant of [eachRow(String, java.util.List, groovy.lang.Closure)](#eachRow(java.lang.String,%20java.util.List,%20groovy.lang.Closure)) useful when providing the named parameters as a map.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the sql statement
`params` - a map of named parameters
`closure` - called for each row with a GroovyResultSet
**Since:**
1.8.7
### public void **eachRow**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.GroovyResultSet") [Closure](../lang/closure) closure)
A variant of [eachRow(String, java.util.List, groovy.lang.Closure)](#eachRow(java.lang.String,%20java.util.List,%20groovy.lang.Closure)) useful when providing the named parameters as named arguments.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`params` - a map of named parameters
`sql` - the sql statement
`closure` - called for each row with a GroovyResultSet
**Since:**
1.8.7
### public void **eachRow**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, int offset, int maxRows, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.GroovyResultSet") [Closure](../lang/closure) closure)
Performs the given SQL query calling the given `closure` with each row of the result set starting at the provided `offset`, and including up to `maxRows` number of rows. The row will be a `GroovyResultSet` which is a `ResultSet` that supports accessing the fields using property style notation and ordinal index values. The query may contain placeholder question marks which match the given list of parameters.
Note that the underlying implementation is based on either invoking `ResultSet.absolute()`, or if the ResultSet type is `ResultSet.TYPE_FORWARD_ONLY`, the `ResultSet.next()` method is invoked equivalently. The first row of a ResultSet is 1, so passing in an offset of 1 or less has no effect on the initial positioning within the result set.
Note that different database and JDBC driver implementations may work differently with respect to this method. Specifically, one should expect that `ResultSet.TYPE_FORWARD_ONLY` may be less efficient than a "scrollable" type.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the sql statement
`params` - a list of parameters
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
`closure` - called for each row with a GroovyResultSet
### public void **eachRow**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, int offset, int maxRows, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.GroovyResultSet") [Closure](../lang/closure) closure)
A variant of [eachRow(String, java.util.List, int, int, groovy.lang.Closure)](#eachRow(java.lang.String,%20java.util.List,%20int,%20int,%20groovy.lang.Closure)) useful when providing the named parameters as a map.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the sql statement
`params` - a map of named parameters
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
`closure` - called for each row with a GroovyResultSet
**Since:**
1.8.7
### public void **eachRow**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, int offset, int maxRows, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.GroovyResultSet") [Closure](../lang/closure) closure)
A variant of [eachRow(String, java.util.List, int, int, groovy.lang.Closure)](#eachRow(java.lang.String,%20java.util.List,%20int,%20int,%20groovy.lang.Closure)) useful when providing the named parameters as named arguments.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`params` - a map of named parameters
`sql` - the sql statement
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
`closure` - called for each row with a GroovyResultSet
**Since:**
1.8.7
### public void **eachRow**([GString](../lang/gstring) gstring, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSetMetaData") [Closure](../lang/closure) metaClosure, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.GroovyResultSet") [Closure](../lang/closure) rowClosure)
Performs the given SQL query calling the given Closure with each row of the result set. The row will be a `GroovyResultSet` which is a `ResultSet` that supports accessing the fields using property style notation and ordinal index values.
In addition, the `metaClosure` will be called once passing in the `ResultSetMetaData` as argument. The query may contain GString expressions.
Example usage:
```
def location = 25
def printColNames = { meta ->
(1..meta.columnCount).each {
print meta.getColumnLabel(it).padRight(20)
}
println()
}
def printRow = { row ->
row.toRowResult().values().each{ print it.toString().padRight(20) }
println()
}
sql.eachRow("select * from PERSON where location_id < $location", printColNames, printRow)
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`gstring` - a GString containing the SQL query with embedded params
`metaClosure` - called for meta data (only once after sql execution)
`rowClosure` - called for each row with a GroovyResultSet
**See Also:**
[expand(Object)](#expand(java.lang.Object))
### public void **eachRow**([GString](../lang/gstring) gstring, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSetMetaData") [Closure](../lang/closure) metaClosure, int offset, int maxRows, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.GroovyResultSet") [Closure](../lang/closure) rowClosure)
Performs the given SQL query calling the given `closure` with each row of the result set starting at the provided `offset`, and including up to `maxRows` number of rows. The row will be a `GroovyResultSet` which is a `ResultSet` that supports accessing the fields using property style notation and ordinal index values. In addition, the `metaClosure` will be called once passing in the `ResultSetMetaData` as argument. The query may contain GString expressions.
Note that the underlying implementation is based on either invoking `ResultSet.absolute()`, or if the ResultSet type is `ResultSet.TYPE_FORWARD_ONLY`, the `ResultSet.next()` method is invoked equivalently. The first row of a ResultSet is 1, so passing in an offset of 1 or less has no effect on the initial positioning within the result set.
Note that different database and JDBC driver implementations may work differently with respect to this method. Specifically, one should expect that `ResultSet.TYPE_FORWARD_ONLY` may be less efficient than a "scrollable" type.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`gstring` - a GString containing the SQL query with embedded params
`metaClosure` - called for meta data (only once after sql execution)
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
`rowClosure` - called for each row with a GroovyResultSet
### public void **eachRow**([GString](../lang/gstring) gstring, int offset, int maxRows, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.GroovyResultSet") [Closure](../lang/closure) closure)
Performs the given SQL query calling the given `closure` with each row of the result set starting at the provided `offset`, and including up to `maxRows` number of rows. The row will be a `GroovyResultSet` which is a `ResultSet` that supports accessing the fields using property style notation and ordinal index values. The query may contain GString expressions.
Note that the underlying implementation is based on either invoking `ResultSet.absolute()`, or if the ResultSet type is `ResultSet.TYPE_FORWARD_ONLY`, the `ResultSet.next()` method is invoked equivalently. The first row of a ResultSet is 1, so passing in an offset of 1 or less has no effect on the initial positioning within the result set.
Note that different database and JDBC driver implementations may work differently with respect to this method. Specifically, one should expect that `ResultSet.TYPE_FORWARD_ONLY` may be less efficient than a "scrollable" type.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`gstring` - a GString containing the SQL query with embedded params
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
`closure` - called for each row with a GroovyResultSet
### public void **eachRow**([GString](../lang/gstring) gstring, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.GroovyResultSet") [Closure](../lang/closure) closure)
Performs the given SQL query calling the given Closure with each row of the result set. The row will be a `GroovyResultSet` which is a `ResultSet` that supports accessing the fields using property style notation and ordinal index values. The query may contain GString expressions.
Example usage:
```
def location = 25
sql.eachRow("select * from PERSON where location_id < $location") { row ->
println row.firstname
}
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`gstring` - a GString containing the SQL query with embedded params
`closure` - called for each row with a GroovyResultSet
**See Also:**
[expand(Object)](#expand(java.lang.Object))
### public boolean **execute**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)
Executes the given piece of SQL. Also saves the updateCount, if any, for subsequent examination.
Example usages:
```
sql.execute "DROP TABLE IF EXISTS person"
sql.execute """
CREATE TABLE person (
id INTEGER NOT NULL,
firstname VARCHAR(100),
lastname VARCHAR(100),
location_id INTEGER
)
"""
sql.execute """
INSERT INTO person (id, firstname, lastname, location_id) VALUES (4, 'Paul', 'King', 40)
"""
assert sql.updateCount == 1
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL to execute
**Returns:**
`true` if the first result is a `ResultSet` object; `false` if it is an update count or there are no results
### public void **execute**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=FromString.class, options={"boolean,java.util.List", "boolean,int"}) [Closure](../lang/closure) processResults)
Executes the given piece of SQL. Also calls the provided processResults Closure to process any ResultSet or UpdateCount results that executing the SQL might produce.
Example usages:
```
boolean first = true
sql.execute "{call FindAllByFirst('J')}", { isResultSet, result ->
if (first) {
first = false
assert !isResultSet && result == 0
} else {
assert isResultSet && result == [[ID:1, FIRSTNAME:'James', LASTNAME:'Strachan'], [ID:4, FIRSTNAME:'Jean', LASTNAME:'Gabin']]
}
}
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL to execute
`processResults` - a Closure which will be passed two parameters: either `true` plus a list of GroovyRowResult values derived from `statement.getResultSet()` or `false` plus the update count from `statement.getUpdateCount()`. The closure will be called for each result produced from executing the SQL.
**Since:**
2.3.2
### public boolean **execute**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params)
Executes the given piece of SQL with parameters. Also saves the updateCount, if any, for subsequent examination.
Example usage:
```
sql.execute """
insert into PERSON (id, firstname, lastname, location_id) values (?, ?, ?, ?)
""", [1, "Guillaume", "Laforge", 10]
assert sql.updateCount == 1
```
This method supports named and named ordinal parameters. See the class Javadoc for more details.
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`params` - a list of parameters
**Returns:**
`true` if the first result is a `ResultSet` object; `false` if it is an update count or there are no results
### public void **execute**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=FromString.class, options={"boolean,java.util.List", "boolean,int"}) [Closure](../lang/closure) processResults)
Executes the given piece of SQL with parameters. Also calls the provided processResults Closure to process any ResultSet or UpdateCount results that executing the SQL might produce.
This method supports named and named ordinal parameters. See the class Javadoc for more details.
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`params` - a list of parameters
`processResults` - a Closure which will be passed two parameters: either `true` plus a list of GroovyRowResult values derived from `statement.getResultSet()` or `false` plus the update count from `statement.getUpdateCount()`. The closure will be called for each result produced from executing the SQL.
**See Also:**
[execute(String, Closure)](#execute(java.lang.String,%20groovy.lang.Closure))
**Since:**
2.3.2
### public boolean **execute**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)
A variant of [execute(String, java.util.List)](#execute(java.lang.String,%20java.util.List)) useful when providing the named parameters as named arguments.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`params` - a map containing the named parameters
`sql` - the SQL statement
**Returns:**
`true` if the first result is a `ResultSet` object; `false` if it is an update count or there are no results
**Since:**
1.8.7
### public void **execute**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=FromString.class, options={"boolean,java.util.List", "boolean,int"}) [Closure](../lang/closure) processResults)
A variant of [execute(String, java.util.List, Closure)](#execute(java.lang.String,%20java.util.List,%20groovy.lang.Closure)) useful when providing the named parameters as named arguments.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`params` - a map containing the named parameters
`sql` - the SQL statement
`processResults` - a Closure which will be passed two parameters: either `true` plus a list of GroovyRowResult values derived from `statement.getResultSet()` or `false` plus the update count from `statement.getUpdateCount()`. The closure will be called for each result produced from executing the SQL.
**Since:**
2.3.2
### public boolean **execute**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] params)
Executes the given piece of SQL with parameters.
An Object array variant of [execute(String, List)](#execute(java.lang.String,%20java.util.List)).
This method supports named and named ordinal parameters by supplying such parameters in the `params` array. See the class Javadoc for more details.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`params` - an array of parameters
**Returns:**
`true` if the first result is a `ResultSet` object; `false` if it is an update count or there are no results
### public void **execute**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] params, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=FromString.class, options={"boolean,java.util.List", "boolean,int"}) [Closure](../lang/closure) processResults)
Executes the given piece of SQL with parameters.
An Object array variant of [execute(String, List, Closure)](#execute(java.lang.String,%20java.util.List,%20groovy.lang.Closure)).
This method supports named and named ordinal parameters by supplying such parameters in the `params` array. See the class Javadoc for more details.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`params` - an array of parameters
`processResults` - a Closure which will be passed two parameters: either `true` plus a list of GroovyRowResult values derived from `statement.getResultSet()` or `false` plus the update count from `statement.getUpdateCount()`. The closure will be called for each result produced from executing the SQL.
**See Also:**
[execute(String, List, Closure)](#execute(java.lang.String,%20java.util.List,%20groovy.lang.Closure))
**Since:**
2.3.2
### public boolean **execute**([GString](../lang/gstring) gstring)
Executes the given SQL with embedded expressions inside. Also saves the updateCount, if any, for subsequent examination.
Example usage:
```
def scott = [firstname: "Scott", lastname: "Davis", id: 5, location_id: 50]
sql.execute """
insert into PERSON (id, firstname, lastname, location_id) values ($scott.id, $scott.firstname, $scott.lastname, $scott.location_id)
"""
assert sql.updateCount == 1
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`gstring` - a GString containing the SQL query with embedded params
**Returns:**
`true` if the first result is a `ResultSet` object; `false` if it is an update count or there are no results
**See Also:**
[expand(Object)](#expand(java.lang.Object))
### public void **execute**([GString](../lang/gstring) gstring, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=FromString.class, options={"boolean,java.util.List", "boolean,int"}) [Closure](../lang/closure) processResults)
Executes the given SQL with embedded expressions inside. Also calls the provided processResults Closure to process any ResultSet or UpdateCount results that executing the SQL might produce. Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`gstring` - a GString containing the SQL query with embedded params
`processResults` - a Closure which will be passed two parameters: either `true` plus a list of GroovyRowResult values derived from `statement.getResultSet()` or `false` plus the update count from `statement.getUpdateCount()`. The closure will be called for each result produced from executing the SQL.
**See Also:**
[expand(Object)](#expand(java.lang.Object))
[execute(String, List, Closure)](#execute(java.lang.String,%20java.util.List,%20groovy.lang.Closure))
**Since:**
2.3.2
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")>> **executeInsert**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)
Executes the given SQL statement (typically an INSERT statement). Use this variant when you want to receive the values of any auto-generated columns, such as an autoincrement ID field. See [executeInsert(GString)](#executeInsert(groovy.lang.GString)) for more details.
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - The SQL statement to execute
**Returns:**
A list of the auto-generated column values for each inserted row (typically auto-generated keys)
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")>> **executeInsert**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params)
Executes the given SQL statement (typically an INSERT statement). Use this variant when you want to receive the values of any auto-generated columns, such as an autoincrement ID field. The query may contain placeholder question marks which match the given list of parameters. See [executeInsert(GString)](#executeInsert(groovy.lang.GString)) for more details.
This method supports named and named ordinal parameters. See the class Javadoc for more details.
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - The SQL statement to execute
`params` - The parameter values that will be substituted into the SQL statement's parameter slots
**Returns:**
A list of the auto-generated column values for each inserted row (typically auto-generated keys)
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **executeInsert**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> keyColumnNames)
Executes the given SQL statement (typically an INSERT statement). Use this variant when you want to receive the values of any auto-generated columns, such as an autoincrement ID field (or fields) and you know the column name(s) of the ID field(s). The query may contain placeholder question marks which match the given list of parameters. See [executeInsert(GString)](#executeInsert(groovy.lang.GString)) for more details.
This method supports named and named ordinal parameters. See the class Javadoc for more details.
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - The SQL statement to execute
`params` - The parameter values that will be substituted into the SQL statement's parameter slots
`keyColumnNames` - a list of column names indicating the columns that should be returned from the inserted row or rows (some drivers may be case sensitive, e.g. may require uppercase names)
**Returns:**
A list of the auto-generated row results for each inserted row (typically auto-generated keys)
**See Also:**
[Connection.prepareStatement](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html#prepareStatement(java.lang.String,%20java.lang.String) "Connection.prepareStatement")
**Since:**
2.3.2
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")>> **executeInsert**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)
A variant of [executeInsert(String, java.util.List)](#executeInsert(java.lang.String,%20java.util.List)) useful when providing the named parameters as named arguments.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`params` - a map containing the named parameters
`sql` - The SQL statement to execute
**Returns:**
A list of the auto-generated column values for each inserted row (typically auto-generated keys)
**Since:**
1.8.7
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **executeInsert**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> keyColumnNames)
A variant of [executeInsert(String, List, List)](#executeInsert(java.lang.String,%20java.util.List,%20java.util.List)) useful when providing the named parameters as named arguments. This variant allows you to receive the values of any auto-generated columns, such as an autoincrement ID field (or fields) when you know the column name(s) of the ID field(s).
**throws:**
SQLException if a database access error occurs
**Parameters:**
`params` - a map containing the named parameters
`sql` - The SQL statement to execute
`keyColumnNames` - a list of column names indicating the columns that should be returned from the inserted row or rows (some drivers may be case sensitive, e.g. may require uppercase names)
**Returns:**
A list of the auto-generated row results for each inserted row (typically auto-generated keys)
**See Also:**
[Connection.prepareStatement](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html#prepareStatement(java.lang.String,%20java.lang.String) "Connection.prepareStatement")
**Since:**
2.3.2
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")>> **executeInsert**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] params)
Executes the given SQL statement (typically an INSERT statement).
An Object array variant of [executeInsert(String, List)](#executeInsert(java.lang.String,%20java.util.List)).
This method supports named and named ordinal parameters by supplying such parameters in the `params` array. See the class Javadoc for more details.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - The SQL statement to execute
`params` - The parameter values that will be substituted into the SQL statement's parameter slots
**Returns:**
A list of the auto-generated column values for each inserted row (typically auto-generated keys)
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **executeInsert**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] keyColumnNames)
Executes the given SQL statement (typically an INSERT statement). This variant allows you to receive the values of any auto-generated columns, such as an autoincrement ID field (or fields) when you know the column name(s) of the ID field(s).
This method supports named and named ordinal parameters by supplying such parameters in the `params` array. See the class Javadoc for more details.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - The SQL statement to execute
`keyColumnNames` - an array of column names indicating the columns that should be returned from the inserted row or rows (some drivers may be case sensitive, e.g. may require uppercase names)
**Returns:**
A list of the auto-generated row results for each inserted row (typically auto-generated keys)
**Since:**
2.3.2
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **executeInsert**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")[] keyColumnNames, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] params)
Executes the given SQL statement (typically an INSERT statement). This variant allows you to receive the values of any auto-generated columns, such as an autoincrement ID field (or fields) when you know the column name(s) of the ID field(s).
An array variant of [executeInsert(String, List, List)](#executeInsert(java.lang.String,%20java.util.List,%20java.util.List)).
This method supports named and named ordinal parameters by supplying such parameters in the `params` array. See the class Javadoc for more details.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - The SQL statement to execute
`keyColumnNames` - an array of column names indicating the columns that should be returned from the inserted row or rows (some drivers may be case sensitive, e.g. may require uppercase names)
`params` - The parameter values that will be substituted into the SQL statement's parameter slots
**Returns:**
A list of the auto-generated row results for each inserted row (typically auto-generated keys)
**Since:**
2.3.2
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")>> **executeInsert**([GString](../lang/gstring) gstring)
Executes the given SQL statement (typically an INSERT statement). Use this variant when you want to receive the values of any auto-generated columns, such as an autoincrement ID field. The query may contain GString expressions.
Generated key values can be accessed using array notation. For example, to return the second auto-generated column value of the third row, use `keys[3][1]`. The method is designed to be used with SQL INSERT statements, but is not limited to them.
The standard use for this method is when a table has an autoincrement ID column and you want to know what the ID is for a newly inserted row. In this example, we insert a single row into a table in which the first column contains the autoincrement ID:
```
def sql = Sql.newInstance("jdbc:mysql://localhost:3306/groovy",
"user",
"password",
"com.mysql.jdbc.Driver")
def keys = sql.executeInsert("insert into test_table (INT_DATA, STRING_DATA) "
+ "VALUES (1, 'Key Largo')")
def id = keys[0][0]
// 'id' now contains the value of the new row's ID column.
// It can be used to update an object representation's
// id attribute for example.
...
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`gstring` - a GString containing the SQL query with embedded params
**Returns:**
A list of the auto-generated column values for each inserted row (typically auto-generated keys)
**See Also:**
[expand(Object)](#expand(java.lang.Object))
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **executeInsert**([GString](../lang/gstring) gstring, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> keyColumnNames)
Executes the given SQL statement (typically an INSERT statement). Use this variant when you want to receive the values of any auto-generated columns, such as an autoincrement ID field (or fields) and you know the column name(s) of the ID field(s).
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`gstring` - a GString containing the SQL query with embedded params
`keyColumnNames` - a list of column names indicating the columns that should be returned from the inserted row or rows (some drivers may be case sensitive, e.g. may require uppercase names)
**Returns:**
A list of the auto-generated row results for each inserted row (typically auto-generated keys)
**See Also:**
[Connection.prepareStatement](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html#prepareStatement(java.lang.String,%20java.lang.String) "Connection.prepareStatement")
[expand(Object)](#expand(java.lang.Object))
**Since:**
2.3.2
### protected final [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet") **executePreparedQuery**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params)
Useful helper method which handles resource management when executing a prepared query which returns a result set. Derived classes of Sql can override "createPreparedQueryCommand" and then call this method to access the ResultSet returned from the provided query.
**throws:**
SQLException if a database error occurs
**Parameters:**
`sql` - query to execute
`params` - parameters matching question mark placeholders in the query
**Returns:**
the resulting ResultSet
### protected final [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet") **executeQuery**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)
Useful helper method which handles resource management when executing a query which returns a result set. Derived classes of Sql can override "createQueryCommand" and then call this method to access the ResultSet returned from the provided query or alternatively can use the higher-level method of Sql which return result sets which are funnelled through this method, e.g. eachRow, query.
**throws:**
SQLException if a database error occurs
**Parameters:**
`sql` - query to execute
**Returns:**
the resulting ResultSet
### public int **executeUpdate**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)
Executes the given SQL update.
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL to execute
**Returns:**
the number of rows updated or 0 for SQL statements that return nothing
### public int **executeUpdate**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params)
Executes the given SQL update with parameters.
This method supports named and named ordinal parameters. See the class Javadoc for more details.
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`params` - a list of parameters
**Returns:**
the number of rows updated or 0 for SQL statements that return nothing
### public int **executeUpdate**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)
A variant of [executeUpdate(String, java.util.List)](#executeUpdate(java.lang.String,%20java.util.List)) useful when providing the named parameters as named arguments.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`params` - a map containing the named parameters
`sql` - the SQL statement
**Returns:**
the number of rows updated or 0 for SQL statements that return nothing
**Since:**
1.8.7
### public int **executeUpdate**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] params)
Executes the given SQL update with parameters.
An Object array variant of [executeUpdate(String, List)](#executeUpdate(java.lang.String,%20java.util.List)).
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`params` - an array of parameters
**Returns:**
the number of rows updated or 0 for SQL statements that return nothing
### public int **executeUpdate**([GString](../lang/gstring) gstring)
Executes the given SQL update with embedded expressions inside.
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`gstring` - a GString containing the SQL query with embedded params
**Returns:**
the number of rows updated or 0 for SQL statements that return nothing
**See Also:**
[expand(Object)](#expand(java.lang.Object))
### public static [ExpandedVariable](expandedvariable) **expand**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") object)
When using GString SQL queries, allows a variable to be expanded in the Sql string rather than representing an sql parameter.
Example usage:
```
def fieldName = 'firstname'
def fieldOp = Sql.expand('like')
def fieldVal = '%a%'
sql.query "select * from PERSON where ${Sql.expand(fieldName)} $fieldOp ${fieldVal}", { ResultSet rs ->
while (rs.next()) println rs.getString('firstname')
}
// query will be 'select * from PERSON where firstname like ?'
// params will be [fieldVal]
```
**Parameters:**
`object` - the object of interest
**Returns:**
the expanded variable
**See Also:**
[expand(Object)](#expand(java.lang.Object))
### protected int **findWhereKeyword**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)
Hook to allow derived classes to override where clause sniffing. Default behavior is to find the first 'where' keyword in the sql doing simple avoidance of the word 'where' within quotes.
**Parameters:**
`sql` - the SQL statement
**Returns:**
the index of the found keyword or -1 if not found
### public [GroovyRowResult](groovyrowresult) **firstRow**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)
Performs the given SQL query and return the first row of the result set.
Example usage:
```
def ans = sql.firstRow("select * from PERSON where firstname like 'S%'")
println ans.firstname
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
**Returns:**
a GroovyRowResult object or `null` if no row is found
### public [GroovyRowResult](groovyrowresult) **firstRow**([GString](../lang/gstring) gstring)
Performs the given SQL query and return the first row of the result set. The query may contain GString expressions.
Example usage:
```
def location = 25
def ans = sql.firstRow("select * from PERSON where location_id < $location")
println ans.firstname
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`gstring` - a GString containing the SQL query with embedded params
**Returns:**
a GroovyRowResult object or `null` if no row is found
**See Also:**
[expand(Object)](#expand(java.lang.Object))
### public [GroovyRowResult](groovyrowresult) **firstRow**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params)
Performs the given SQL query and return the first row of the result set. The query may contain placeholder question marks which match the given list of parameters.
Example usages:
```
def ans = sql.firstRow("select * from PERSON where lastname like ?", ['%a%'])
println ans.firstname
```
If your database returns scalar functions as ResultSets, you can also use firstRow to gain access to stored procedure results, e.g. using hsqldb 1.9 RC4:
```
sql.execute """
create function FullName(p_firstname VARCHAR(40)) returns VARCHAR(80)
BEGIN atomic
DECLARE ans VARCHAR(80);
SET ans = (SELECT firstname || ' ' || lastname FROM PERSON WHERE firstname = p_firstname);
RETURN ans;
END
"""
assert sql.firstRow("{call FullName(?)}", ['Sam'])[0] == 'Sam Pullara'
```
This method supports named and named ordinal parameters by supplying such parameters in the `params` list. See the class Javadoc for more details.
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`params` - a list of parameters
**Returns:**
a GroovyRowResult object or `null` if no row is found
### public [GroovyRowResult](groovyrowresult) **firstRow**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)
A variant of [firstRow(String, java.util.List)](#firstRow(java.lang.String,%20java.util.List)) useful when providing the named parameters as named arguments.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`params` - a map containing the named parameters
`sql` - the SQL statement
**Returns:**
a GroovyRowResult object or `null` if no row is found
**Since:**
1.8.7
### public [GroovyRowResult](groovyrowresult) **firstRow**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] params)
Performs the given SQL query and return the first row of the result set.
An Object array variant of [firstRow(String, List)](#firstRow(java.lang.String,%20java.util.List)).
This method supports named and named ordinal parameters by supplying such parameters in the `params` array. See the class Javadoc for more details.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`params` - an array of parameters
**Returns:**
a GroovyRowResult object or `null` if no row is found
### public [Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection") **getConnection**()
If this instance was created with a single Connection then the connection is returned. Otherwise if this instance was created with a DataSource then this method returns null
**Returns:**
the connection wired into this object, or null if this object uses a DataSource
### public [DataSource](https://docs.oracle.com/javase/8/docs/api/javax/sql/DataSource.html "DataSource") **getDataSource**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getObject**()
### protected [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> **getParameters**([GString](../lang/gstring) gstring)
Hook to allow derived classes to override behavior associated with extracting params from a GString.
**Parameters:**
`gstring` - a GString containing the SQL query with embedded params
**Returns:**
extracts the parameters from the expression as a List
**See Also:**
[expand(Object)](#expand(java.lang.Object))
### public int **getResultSetConcurrency**()
Gets the resultSetConcurrency for statements created using the connection.
**Returns:**
the current resultSetConcurrency value
**Since:**
1.5.2
### public int **getResultSetHoldability**()
Gets the resultSetHoldability for statements created using the connection.
**Returns:**
the current resultSetHoldability value or -1 if not set
**Since:**
1.5.2
### public int **getResultSetType**()
Gets the resultSetType for statements created using the connection.
**Returns:**
the current resultSetType value
**Since:**
1.5.2
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **getType**()
### public int **getUpdateCount**()
**Returns:**
Returns the updateCount.
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> **getUpdatedParams**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Tuple](../lang/tuple "Tuple")> indexPropList)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getValue**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getValue**()
### public static [InParameter](inparameter) **in**(int type, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
Create a new InParameter
**Parameters:**
`type` - the JDBC data type
`value` - the object value
**Returns:**
an InParameter
### public static [InOutParameter](inoutparameter) **inout**([InParameter](inparameter) in)
Create an inout parameter using this in parameter.
**Parameters:**
`in` - the InParameter of interest
**Returns:**
the resulting InOutParameter
### public boolean **isCacheNamedQueries**()
**Returns:**
boolean true if caching is enabled (the default is true)
### public boolean **isCacheStatements**()
**Returns:**
boolean true if cache is enabled (default is false)
### public boolean **isEnableNamedQueries**()
**Returns:**
boolean true if named query processing is enabled (the default is true)
### public boolean **isWithinBatch**()
Returns true if the current Sql object is currently executing a withBatch method call.
**Returns:**
true if a withBatch call is currently being executed.
### public static void **loadDriver**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") driverClassName)
Attempts to load the JDBC driver on the thread, current or system class loaders
**throws:**
ClassNotFoundException if the class cannot be found or loaded
**Parameters:**
`driverClassName` - the fully qualified class name of the driver class
### public static [Sql](sql) **newInstance**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url)
Creates a new Sql instance given a JDBC connection URL.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`url` - a database url of the form `jdbc:*subprotocol*:*subname*`
**Returns:**
a new Sql instance with a connection
### public static [Sql](sql) **newInstance**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url, [Properties](https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html "Properties") properties)
Creates a new Sql instance given a JDBC connection URL and some properties.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`url` - a database url of the form `jdbc:*subprotocol*:*subname*`
`properties` - a list of arbitrary string tag/value pairs as connection arguments; normally at least a "user" and "password" property should be included
**Returns:**
a new Sql instance with a connection
### public static [Sql](sql) **newInstance**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url, [Properties](https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html "Properties") properties, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") driverClassName)
Creates a new Sql instance given a JDBC connection URL, some properties and a driver class name.
**throws:**
SQLException if a database access error occurs
**throws:**
ClassNotFoundException if the driver class cannot be found or loaded
**Parameters:**
`url` - a database url of the form `jdbc:*subprotocol*:*subname*`
`properties` - a list of arbitrary string tag/value pairs as connection arguments; normally at least a "user" and "password" property should be included
`driverClassName` - the fully qualified class name of the driver class
**Returns:**
a new Sql instance with a connection
### public static [Sql](sql) **newInstance**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") user, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") password)
Creates a new Sql instance given a JDBC connection URL, a username and a password.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`url` - a database url of the form `jdbc:*subprotocol*:*subname*`
`user` - the database user on whose behalf the connection is being made
`password` - the user's password
**Returns:**
a new Sql instance with a connection
### public static [Sql](sql) **newInstance**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") user, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") password, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") driverClassName)
Creates a new Sql instance given a JDBC connection URL, a username, a password and a driver class name.
**throws:**
SQLException if a database access error occurs
**throws:**
ClassNotFoundException if the driver class cannot be found or loaded
**Parameters:**
`url` - a database url of the form `jdbc:*subprotocol*:*subname*`
`user` - the database user on whose behalf the connection is being made
`password` - the user's password
`driverClassName` - the fully qualified class name of the driver class
**Returns:**
a new Sql instance with a connection
### public static [Sql](sql) **newInstance**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") driverClassName)
Creates a new Sql instance given a JDBC connection URL and a driver class name.
**throws:**
SQLException if a database access error occurs
**throws:**
ClassNotFoundException if the driver class cannot be found or loaded
**Parameters:**
`url` - a database url of the form `jdbc:*subprotocol*:*subname*`
`driverClassName` - the fully qualified class name of the driver class
**Returns:**
a new Sql instance with a connection
### public static [Sql](sql) **newInstance**(@[NamedParam](../transform/namedparam "NamedParam")(value = "url", type = String.class, required = true) @[NamedParam](../transform/namedparam "NamedParam")(value = "properties", type = Properties.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "driverClassName", type = String.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "driver", type = String.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "user", type = String.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "password", type = String.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "cacheNamedQueries", type = Boolean.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "cacheStatements", type = Boolean.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "enableNamedQueries", type = Boolean.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "resultSetConcurrency", type = Integer.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "resultSetHoldability", type = Integer.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "resultSetType", type = Integer.class) [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> args)
Creates a new Sql instance given parameters in a Map. Recognized keys for the Map include:
```
driverClassName the fully qualified class name of the driver class
driver a synonym for driverClassName
url a database url of the form: jdbc:*subprotocol*:*subname*
user the database user on whose behalf the connection is being made
password the user's password
properties a list of arbitrary string tag/value pairs as connection arguments;
normally at least a "user" and "password" property should be included
*other* any of the public setter methods of this class may be used with property notation
e.g. *cacheStatements: true, resultSetConcurrency: ResultSet.CONCUR\_READ\_ONLY*
```
Of these, '`url`' is required. Others may be needed depending on your database.
If '`properties`' is supplied, neither '`user`' nor '`password`' should be supplied.
If one of '`user`' or '`password`' is supplied, both should be supplied. Example usage:
```
import groovy.sql.Sql
import static java.sql.ResultSet.*
def sql = Sql.newInstance(
url:'jdbc:hsqldb:mem:testDB',
user:'sa',
password:'',
driver:'org.hsqldb.jdbc.JDBCDriver',
cacheStatements: true,
resultSetConcurrency: CONCUR_READ_ONLY
)
```
**throws:**
SQLException if a database access error occurs
**throws:**
ClassNotFoundException if the driver class cannot be found or loaded
**Parameters:**
`args` - a Map contain further arguments
**Returns:**
a new Sql instance with a connection
### protected [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **nullify**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)
Hook to allow derived classes to override null handling. Default behavior is to replace ?'"? references with NULLish
**Parameters:**
`sql` - the SQL statement
**Returns:**
the modified SQL String
### public static [OutParameter](outparameter) **out**(int type)
Create a new OutParameter
**Parameters:**
`type` - the JDBC data type.
**Returns:**
an OutParameter
### @[Deprecated](https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html "Deprecated") public [SqlWithParams](sqlwithparams) **preCheckForNamedParams**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)
**deprecated:**
Use [buildSqlWithIndexedProps(String)](#buildSqlWithIndexedProps(java.lang.String)) instead
### public void **query**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSet") [Closure](../lang/closure) closure)
Performs the given SQL query, which should return a single `ResultSet` object. The given closure is called with the `ResultSet` as its argument.
Example usages:
```
sql.query("select * from PERSON where firstname like 'S%'") { ResultSet rs ->
while (rs.next()) println rs.getString('firstname') + ' ' + rs.getString(3)
}
sql.query("call get_people_places()") { ResultSet rs ->
while (rs.next()) println rs.toRowResult().firstname
}
```
All resources including the ResultSet are closed automatically after the closure is called.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the sql statement
`closure` - called for each row with a `ResultSet`
### public void **query**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSet") [Closure](../lang/closure) closure)
Performs the given SQL query, which should return a single `ResultSet` object. The given closure is called with the `ResultSet` as its argument. The query may contain placeholder question marks which match the given list of parameters.
Example usage:
```
sql.query('select * from PERSON where lastname like ?', ['%a%']) { ResultSet rs ->
while (rs.next()) println rs.getString('lastname')
}
```
This method supports named and named ordinal parameters. See the class Javadoc for more details.
All resources including the ResultSet are closed automatically after the closure is called.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the sql statement
`params` - a list of parameters
`closure` - called for each row with a `ResultSet`
### public void **query**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") map, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSet") [Closure](../lang/closure) closure)
A variant of [query(String, java.util.List, groovy.lang.Closure)](#query(java.lang.String,%20java.util.List,%20groovy.lang.Closure)) useful when providing the named parameters as a map.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the sql statement
`map` - a map containing the named parameters
`closure` - called for each row with a `ResultSet`
**Since:**
1.8.7
### public void **query**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") map, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSet") [Closure](../lang/closure) closure)
A variant of [query(String, java.util.List, groovy.lang.Closure)](#query(java.lang.String,%20java.util.List,%20groovy.lang.Closure)) useful when providing the named parameters as named arguments.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`map` - a map containing the named parameters
`sql` - the sql statement
`closure` - called for each row with a `ResultSet`
**Since:**
1.8.7
### public void **query**([GString](../lang/gstring) gstring, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSet") [Closure](../lang/closure) closure)
Performs the given SQL query, which should return a single `ResultSet` object. The given closure is called with the `ResultSet` as its argument. The query may contain GString expressions.
Example usage:
```
def location = 25
sql.query "select * from PERSON where location_id < $location", { ResultSet rs ->
while (rs.next()) println rs.getString('firstname')
}
```
All resources including the ResultSet are closed automatically after the closure is called.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`gstring` - a GString containing the SQL query with embedded params
`closure` - called for each row with a `ResultSet`
**See Also:**
[expand(Object)](#expand(java.lang.Object))
### public static [ResultSetOutParameter](resultsetoutparameter) **resultSet**(int type)
Create a new ResultSetOutParameter
**Parameters:**
`type` - the JDBC data type.
**Returns:**
a ResultSetOutParameter
### public void **rollback**()
If this SQL object was created with a Connection then this method rolls back the connection. If this SQL object was created from a DataSource then this method does nothing.
**throws:**
SQLException if a database access error occurs
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **rows**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)
Performs the given SQL query and return the rows of the result set.
Example usage:
```
def ans = sql.rows("select * from PERSON where firstname like 'S%'")
println "Found ${ans.size()} rows"
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
**Returns:**
a list of GroovyRowResult objects
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **rows**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, int offset, int maxRows)
Performs the given SQL query and return a "page" of rows from the result set. A page is defined as starting at a 1-based offset, and containing a maximum number of rows.
Note that the underlying implementation is based on either invoking `ResultSet.absolute()`, or if the ResultSet type is `ResultSet.TYPE_FORWARD_ONLY`, the `ResultSet.next()` method is invoked equivalently. The first row of a ResultSet is 1, so passing in an offset of 1 or less has no effect on the initial positioning within the result set.
Note that different database and JDBC driver implementations may work differently with respect to this method. Specifically, one should expect that `ResultSet.TYPE_FORWARD_ONLY` may be less efficient than a "scrollable" type.
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
**Returns:**
a list of GroovyRowResult objects
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **rows**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSetMetaData") [Closure](../lang/closure) metaClosure)
Performs the given SQL query and return the rows of the result set. In addition, the `metaClosure` will be called once passing in the `ResultSetMetaData` as argument.
Example usage:
```
def printNumCols = { meta -> println "Found $meta.columnCount columns" }
def ans = sql.rows("select * from PERSON", printNumCols)
println "Found ${ans.size()} rows"
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`metaClosure` - called with meta data of the ResultSet
**Returns:**
a list of GroovyRowResult objects
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **rows**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, int offset, int maxRows, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSetMetaData") [Closure](../lang/closure) metaClosure)
Performs the given SQL query and return a "page" of rows from the result set. A page is defined as starting at a 1-based offset, and containing a maximum number of rows. In addition, the `metaClosure` will be called once passing in the `ResultSetMetaData` as argument.
Note that the underlying implementation is based on either invoking `ResultSet.absolute()`, or if the ResultSet type is `ResultSet.TYPE_FORWARD_ONLY`, the `ResultSet.next()` method is invoked equivalently. The first row of a ResultSet is 1, so passing in an offset of 1 or less has no effect on the initial positioning within the result set.
Note that different database and JDBC driver implementations may work differently with respect to this method. Specifically, one should expect that `ResultSet.TYPE_FORWARD_ONLY` may be less efficient than a "scrollable" type.
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
`metaClosure` - called for meta data (only once after sql execution)
**Returns:**
a list of GroovyRowResult objects
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **rows**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params)
Performs the given SQL query and return the rows of the result set. The query may contain placeholder question marks which match the given list of parameters.
Example usage:
```
def ans = sql.rows("select * from PERSON where lastname like ?", ['%a%'])
println "Found ${ans.size()} rows"
```
This method supports named and named ordinal parameters by supplying such parameters in the `params` list. See the class Javadoc for more details.
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`params` - a list of parameters
**Returns:**
a list of GroovyRowResult objects
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **rows**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql)
A variant of [rows(String, java.util.List)](#rows(java.lang.String,%20java.util.List)) useful when providing the named parameters as named arguments.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`params` - a map containing the named parameters
`sql` - the SQL statement
**Returns:**
a list of GroovyRowResult objects
**Since:**
1.8.7
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **rows**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, int offset, int maxRows)
Performs the given SQL query and return a "page" of rows from the result set. A page is defined as starting at a 1-based offset, and containing a maximum number of rows. The query may contain placeholder question marks which match the given list of parameters.
Note that the underlying implementation is based on either invoking `ResultSet.absolute()`, or if the ResultSet type is `ResultSet.TYPE_FORWARD_ONLY`, the `ResultSet.next()` method is invoked equivalently. The first row of a ResultSet is 1, so passing in an offset of 1 or less has no effect on the initial positioning within the result set.
Note that different database and JDBC driver implementations may work differently with respect to this method. Specifically, one should expect that `ResultSet.TYPE_FORWARD_ONLY` may be less efficient than a "scrollable" type.
This method supports named and named ordinal parameters by supplying such parameters in the `params` list. See the class Javadoc for more details.
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`params` - a list of parameters
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
**Returns:**
a list of GroovyRowResult objects
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **rows**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, int offset, int maxRows)
A variant of [rows(String, java.util.List, int, int)](#rows(java.lang.String,%20java.util.List,%20int,%20int)) useful when providing the named parameters as a map.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`params` - a map of named parameters
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
**Returns:**
a list of GroovyRowResult objects
**Since:**
1.8.7
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **rows**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, int offset, int maxRows)
A variant of [rows(String, java.util.List, int, int)](#rows(java.lang.String,%20java.util.List,%20int,%20int)) useful when providing the named parameters as named arguments.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`params` - a map of named parameters
`sql` - the SQL statement
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
**Returns:**
a list of GroovyRowResult objects
**Since:**
1.8.7
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **rows**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] params)
Performs the given SQL query and return the rows of the result set.
This method supports named and named ordinal parameters by supplying such parameters in the `params` array. See the class Javadoc for more details.
An Object array variant of [rows(String, List)](#rows(java.lang.String,%20java.util.List)).
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`params` - an array of parameters
**Returns:**
a list of GroovyRowResult objects
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **rows**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] params, int offset, int maxRows)
Performs the given SQL query and return the rows of the result set.
This method supports named and named ordinal parameters by supplying such parameters in the `params` array. See the class Javadoc for more details.
An Object array variant of [rows(String, List, int, int)](#rows(java.lang.String,%20java.util.List,%20int,%20int)).
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`params` - an array of parameters
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
**Returns:**
a list of GroovyRowResult objects
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **rows**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSetMetaData") [Closure](../lang/closure) metaClosure)
Performs the given SQL query and return the rows of the result set. In addition, the `metaClosure` will be called once passing in the `ResultSetMetaData` as argument. The query may contain placeholder question marks which match the given list of parameters.
Example usage:
```
def printNumCols = { meta -> println "Found $meta.columnCount columns" }
def ans = sql.rows("select * from PERSON where lastname like ?", ['%a%'], printNumCols)
println "Found ${ans.size()} rows"
```
This method supports named and named ordinal parameters by supplying such parameters in the `params` list. Here is an example:
```
def printNumCols = { meta -> println "Found $meta.columnCount columns" }
def mapParam = [foo: 'Smith']
def domainParam = new MyDomainClass(bar: 'John')
def qry = 'select * from PERSON where lastname=?1.foo and firstname=?2.bar'
def ans = sql.rows(qry, [mapParam, domainParam], printNumCols)
println "Found ${ans.size()} rows"
def qry2 = 'select * from PERSON where firstname=:first and lastname=:last'
def ans2 = sql.rows(qry2, [[last:'Smith', first:'John']], printNumCols)
println "Found ${ans2.size()} rows"
```
See the class Javadoc for more details. Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`params` - a list of parameters
`metaClosure` - called for meta data (only once after sql execution)
**Returns:**
a list of GroovyRowResult objects
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **rows**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSetMetaData") [Closure](../lang/closure) metaClosure)
A variant of [rows(String, java.util.List, groovy.lang.Closure)](#rows(java.lang.String,%20java.util.List,%20groovy.lang.Closure)) useful when providing the named parameters as a map.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`params` - a map of named parameters
`metaClosure` - called for meta data (only once after sql execution)
**Returns:**
a list of GroovyRowResult objects
**Since:**
1.8.7
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **rows**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSetMetaData") [Closure](../lang/closure) metaClosure)
A variant of [rows(String, java.util.List, groovy.lang.Closure)](#rows(java.lang.String,%20java.util.List,%20groovy.lang.Closure)) useful when providing the named parameters as named arguments.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`params` - a map of named parameters
`sql` - the SQL statement
`metaClosure` - called for meta data (only once after sql execution)
**Returns:**
a list of GroovyRowResult objects
**Since:**
1.8.7
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **rows**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, int offset, int maxRows, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSetMetaData") [Closure](../lang/closure) metaClosure)
Performs the given SQL query and return a "page" of rows from the result set. A page is defined as starting at a 1-based offset, and containing a maximum number of rows. In addition, the `metaClosure` will be called once passing in the `ResultSetMetaData` as argument. The query may contain placeholder question marks which match the given list of parameters.
Note that the underlying implementation is based on either invoking `ResultSet.absolute()`, or if the ResultSet type is `ResultSet.TYPE_FORWARD_ONLY`, the `ResultSet.next()` method is invoked equivalently. The first row of a ResultSet is 1, so passing in an offset of 1 or less has no effect on the initial positioning within the result set.
Note that different database and JDBC driver implementations may work differently with respect to this method. Specifically, one should expect that `ResultSet.TYPE_FORWARD_ONLY` may be less efficient than a "scrollable" type.
This method supports named and named ordinal parameters by supplying such parameters in the `params` list. See the class Javadoc for more details.
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`params` - a list of parameters
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
`metaClosure` - called for meta data (only once after sql execution)
**Returns:**
a list of GroovyRowResult objects
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **rows**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, int offset, int maxRows, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSetMetaData") [Closure](../lang/closure) metaClosure)
A variant of [rows(String, java.util.List, int, int, groovy.lang.Closure)](#rows(java.lang.String,%20java.util.List,%20int,%20int,%20groovy.lang.Closure)) useful when providing the named parameters as a map.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`params` - a map of named parameters
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
`metaClosure` - called for meta data (only once after sql execution)
**Returns:**
a list of GroovyRowResult objects
**Since:**
1.8.7
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **rows**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") params, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, int offset, int maxRows, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSetMetaData") [Closure](../lang/closure) metaClosure)
A variant of [rows(String, java.util.List, int, int, groovy.lang.Closure)](#rows(java.lang.String,%20java.util.List,%20int,%20int,%20groovy.lang.Closure)) useful when providing the named parameters as named arguments.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`params` - a map of named parameters
`sql` - the SQL statement
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
`metaClosure` - called for meta data (only once after sql execution)
**Returns:**
a list of GroovyRowResult objects
**Since:**
1.8.7
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **rows**([GString](../lang/gstring) sql, int offset, int maxRows)
Performs the given SQL query and return a "page" of rows from the result set. A page is defined as starting at a 1-based offset, and containing a maximum number of rows. The query may contain GString expressions.
Note that the underlying implementation is based on either invoking `ResultSet.absolute()`, or if the ResultSet type is `ResultSet.TYPE_FORWARD_ONLY`, the `ResultSet.next()` method is invoked equivalently. The first row of a ResultSet is 1, so passing in an offset of 1 or less has no effect on the initial positioning within the result set.
Note that different database and JDBC driver implementations may work differently with respect to this method. Specifically, one should expect that `ResultSet.TYPE_FORWARD_ONLY` may be less efficient than a "scrollable" type.
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`sql` - the SQL statement
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
**Returns:**
a list of GroovyRowResult objects
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **rows**([GString](../lang/gstring) gstring)
Performs the given SQL query and return the rows of the result set. The query may contain GString expressions.
Example usage:
```
def location = 25
def ans = sql.rows("select * from PERSON where location_id < $location")
println "Found ${ans.size()} rows"
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`gstring` - a GString containing the SQL query with embedded params
**Returns:**
a list of GroovyRowResult objects
**See Also:**
[expand(Object)](#expand(java.lang.Object))
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **rows**([GString](../lang/gstring) gstring, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSetMetaData") [Closure](../lang/closure) metaClosure)
Performs the given SQL query and return the rows of the result set. In addition, the `metaClosure` will be called once passing in the `ResultSetMetaData` as argument. The query may contain GString expressions.
Example usage:
```
def location = 25
def printNumCols = { meta -> println "Found $meta.columnCount columns" }
def ans = sql.rows("select * from PERSON where location_id < $location", printNumCols)
println "Found ${ans.size()} rows"
```
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`gstring` - a GString containing the SQL query with embedded params
`metaClosure` - called with meta data of the ResultSet
**Returns:**
a list of GroovyRowResult objects
**See Also:**
[expand(Object)](#expand(java.lang.Object))
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[GroovyRowResult](groovyrowresult "GroovyRowResult")> **rows**([GString](../lang/gstring) gstring, int offset, int maxRows, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.ResultSetMetaData") [Closure](../lang/closure) metaClosure)
Performs the given SQL query and return a "page" of rows from the result set. A page is defined as starting at a 1-based offset, and containing a maximum number of rows. In addition, the `metaClosure` will be called once passing in the `ResultSetMetaData` as argument. The query may contain GString expressions.
Note that the underlying implementation is based on either invoking `ResultSet.absolute()`, or if the ResultSet type is `ResultSet.TYPE_FORWARD_ONLY`, the `ResultSet.next()` method is invoked equivalently. The first row of a ResultSet is 1, so passing in an offset of 1 or less has no effect on the initial positioning within the result set.
Note that different database and JDBC driver implementations may work differently with respect to this method. Specifically, one should expect that `ResultSet.TYPE_FORWARD_ONLY` may be less efficient than a "scrollable" type.
Resource handling is performed automatically where appropriate.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`gstring` - the SQL statement
`offset` - the 1-based offset for the first row to be processed
`maxRows` - the maximum number of rows to be processed
`metaClosure` - called for meta data (only once after sql execution)
**Returns:**
a list of GroovyRowResult objects
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection") **run**()
### public void **setCacheNamedQueries**(boolean cacheNamedQueries)
Enables named query caching.
if *cacheNamedQueries* is true, cache is created and processed named queries will be cached. if *cacheNamedQueries* is false, no caching will occur saving memory at the cost of additional processing time.
**Parameters:**
`cacheNamedQueries` - the new value
### public void **setCacheStatements**(boolean cacheStatements)
Enables statement caching.
if *cacheStatements* is true, cache is created and all created prepared statements will be cached. if *cacheStatements* is false, all cached statements will be properly closed.
**Parameters:**
`cacheStatements` - the new value
### public void **setEnableNamedQueries**(boolean enableNamedQueries)
Enables named query support:
* if *enableNamedQueries* is true, queries with ':propname' and '?1.propname' style placeholders will be processed.
* if *enableNamedQueries* is false, this feature will be turned off.
**Parameters:**
`enableNamedQueries` - the new value
### protected void **setInternalConnection**([Connection](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html "Connection") conn)
Stub needed for testing. Called when a connection is opened by one of the command-pattern classes so that a test case can monitor the state of the connection through its subclass.
**Parameters:**
`conn` - the connection that is about to be used by a command
### protected void **setObject**([PreparedStatement](https://docs.oracle.com/javase/8/docs/api/java/sql/PreparedStatement.html "PreparedStatement") statement, int i, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
Strategy method allowing derived classes to handle types differently such as for CLOBs etc.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`statement` - the statement of interest
`i` - the index of the object of interest
`value` - the new object value
### protected void **setParameters**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params, [PreparedStatement](https://docs.oracle.com/javase/8/docs/api/java/sql/PreparedStatement.html "PreparedStatement") statement)
Hook to allow derived classes to override behavior associated with setting params for a prepared statement. Default behavior is to append the parameters to the given statement using `setObject`.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`params` - the parameters to append
`statement` - the statement
### public void **setResultSetConcurrency**(int resultSetConcurrency)
Sets the resultSetConcurrency for statements created using the connection. May cause SQLFeatureNotSupportedException exceptions to occur if the underlying database doesn't support the requested concurrency value.
**Parameters:**
`resultSetConcurrency` - one of the following `ResultSet` constants: `ResultSet.CONCUR_READ_ONLY` or `ResultSet.CONCUR_UPDATABLE`
**Since:**
1.5.2
### public void **setResultSetHoldability**(int resultSetHoldability)
Sets the resultSetHoldability for statements created using the connection. May cause SQLFeatureNotSupportedException exceptions to occur if the underlying database doesn't support the requested holdability value.
**Parameters:**
`resultSetHoldability` - one of the following `ResultSet` constants: `ResultSet.HOLD_CURSORS_OVER_COMMIT` or `ResultSet.CLOSE_CURSORS_AT_COMMIT`
**Since:**
1.5.2
### public void **setResultSetType**(int resultSetType)
Sets the resultSetType for statements created using the connection. May cause SQLFeatureNotSupportedException exceptions to occur if the underlying database doesn't support the requested type value.
**Parameters:**
`resultSetType` - one of the following `ResultSet` constants: `ResultSet.TYPE_FORWARD_ONLY`, `ResultSet.TYPE_SCROLL_INSENSITIVE`, or `ResultSet.TYPE_SCROLL_SENSITIVE`
**Since:**
1.5.2
### public int[] **withBatch**(@[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.BatchingStatementWrapper") [Closure](../lang/closure) closure)
Performs the closure (containing batch operations) within a batch. Uses a batch size of zero, i.e. no automatic partitioning of batches.
This means that `executeBatch()` will be called automatically after the `withBatch` closure has finished but may be called explicitly if desired as well for more fine-grained partitioning of the batch.
The closure will be called with a single argument; the database statement (actually a `BatchingStatementWrapper` helper object) associated with this batch.
Use it like this:
```
def updateCounts = sql.withBatch { stmt ->
stmt.addBatch("insert into TABLENAME ...")
stmt.addBatch("insert into TABLENAME ...")
stmt.addBatch("insert into TABLENAME ...")
...
}
```
For integrity and performance reasons, you may wish to consider executing your batch command(s) within a transaction:
```
sql.withTransaction {
def result1 = sql.withBatch { ... }
...
}
```
**throws:**
SQLException if a database access error occurs, or this method is called on a closed `Statement`, or the driver does not support batch statements. Throws [BatchUpdateException](https://docs.oracle.com/javase/8/docs/api/java/sql/BatchUpdateException.html "BatchUpdateException") (a subclass of `SQLException`) if one of the commands sent to the database fails to execute properly or attempts to return a result set.
**Parameters:**
`closure` - the closure containing batch and optionally other statements
**Returns:**
an array of update counts containing one element for each command in the batch. The elements of the array are ordered according to the order in which commands were added to the batch.
**See Also:**
[withBatch(int, Closure)](#withBatch(int,%20groovy.lang.Closure))
### public int[] **withBatch**(int batchSize, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.BatchingStatementWrapper") [Closure](../lang/closure) closure)
Performs the closure (containing batch operations) within a batch using a given batch size.
After every `batchSize` `addBatch(sqlBatchOperation)` operations, automatically calls an `executeBatch()` operation to "chunk" up the database operations into partitions. Though not normally needed, you can also explicitly call `executeBatch()` which after executing the current batch, resets the batch count back to zero.
The closure will be called with a single argument; the database statement (actually a `BatchingStatementWrapper` helper object) associated with this batch.
Use it like this for batchSize of 20:
```
def updateCounts = sql.withBatch(20) { stmt ->
stmt.addBatch("insert into TABLENAME ...")
stmt.addBatch("insert into TABLENAME ...")
stmt.addBatch("insert into TABLENAME ...")
...
}
```
For integrity and performance reasons, you may wish to consider executing your batch command(s) within a transaction:
```
sql.withTransaction {
def result1 = sql.withBatch { ... }
...
}
```
**throws:**
SQLException if a database access error occurs, or this method is called on a closed `Statement`, or the driver does not support batch statements. Throws [BatchUpdateException](https://docs.oracle.com/javase/8/docs/api/java/sql/BatchUpdateException.html "BatchUpdateException") (a subclass of `SQLException`) if one of the commands sent to the database fails to execute properly or attempts to return a result set.
**Parameters:**
`batchSize` - partition the batch into batchSize pieces, i.e. after batchSize `addBatch()` invocations, call `executeBatch()` automatically; 0 means manual calls to executeBatch are required
`closure` - the closure containing batch and optionally other statements
**Returns:**
an array of update counts containing one element for each command in the batch. The elements of the array are ordered according to the order in which commands were added to the batch.
**See Also:**
[withBatch(Closure)](#withBatch(groovy.lang.Closure))
[BatchingStatementWrapper](batchingstatementwrapper "BatchingStatementWrapper")
[Statement](https://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html "Statement")
### public int[] **withBatch**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.BatchingPreparedStatementWrapper") [Closure](../lang/closure) closure)
Performs the closure (containing batch operations specific to an associated prepared statement) within a batch. Uses a batch size of zero, i.e. no automatic partitioning of batches.
This means that `executeBatch()` will be called automatically after the `withBatch` closure has finished but may be called explicitly if desired as well for more fine-grained partitioning of the batch.
The closure will be called with a single argument; the prepared statement (actually a `BatchingPreparedStatementWrapper` helper object) associated with this batch.
An example:
```
def updateCounts = sql.withBatch('insert into TABLENAME(a, b, c) values (?, ?, ?)') { ps ->
ps.addBatch([10, 12, 5])
ps.addBatch([7, 3, 98])
ps.addBatch(22, 67, 11)
def partialUpdateCounts = ps.executeBatch() // optional interim batching
ps.addBatch(30, 40, 50)
...
}
```
For integrity and performance reasons, you may wish to consider executing your batch command(s) within a transaction:
```
sql.withTransaction {
def result1 = sql.withBatch { ... }
...
}
```
**throws:**
SQLException if a database access error occurs, or this method is called on a closed `Statement`, or the driver does not support batch statements. Throws [BatchUpdateException](https://docs.oracle.com/javase/8/docs/api/java/sql/BatchUpdateException.html "BatchUpdateException") (a subclass of `SQLException`) if one of the commands sent to the database fails to execute properly or attempts to return a result set.
**Parameters:**
`sql` - batch update statement
`closure` - the closure containing batch statements (to bind parameters) and optionally other statements
**Returns:**
an array of update counts containing one element for each binding in the batch. The elements of the array are ordered according to the order in which commands were executed.
**See Also:**
[withBatch(int, String, Closure)](#withBatch(int,%20java.lang.String,%20groovy.lang.Closure))
[BatchingPreparedStatementWrapper](batchingpreparedstatementwrapper "BatchingPreparedStatementWrapper")
[PreparedStatement](https://docs.oracle.com/javase/8/docs/api/java/sql/PreparedStatement.html "PreparedStatement")
### public int[] **withBatch**(int batchSize, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.BatchingPreparedStatementWrapper") [Closure](../lang/closure) closure)
Performs the closure (containing batch operations specific to an associated prepared statement) within a batch using a given batch size.
After every `batchSize` `addBatch(params)` operations, automatically calls an `executeBatch()` operation to "chunk" up the database operations into partitions. Though not normally needed, you can also explicitly call `executeBatch()` which after executing the current batch, resets the batch count back to zero.
The closure will be called with a single argument; the prepared statement (actually a `BatchingPreparedStatementWrapper` helper object) associated with this batch.
Below is an example using a batchSize of 20:
```
def updateCounts = sql.withBatch(20, 'insert into TABLENAME(a, b, c) values (?, ?, ?)') { ps ->
ps.addBatch(10, 12, 5) // varargs style
ps.addBatch([7, 3, 98]) // list
ps.addBatch([22, 67, 11])
...
}
```
Named parameters (into maps or domain objects) are also supported:
```
def updateCounts = sql.withBatch(20, 'insert into TABLENAME(a, b, c) values (:foo, :bar, :baz)') { ps ->
ps.addBatch([foo:10, bar:12, baz:5]) // map
ps.addBatch(foo:7, bar:3, baz:98) // Groovy named args allow outer brackets to be dropped
...
}
```
Named ordinal parameters (into maps or domain objects) are also supported:
```
def updateCounts = sql.withBatch(20, 'insert into TABLENAME(a, b, c) values (?1.foo, ?2.bar, ?2.baz)') { ps ->
ps.addBatch([[foo:22], [bar:67, baz:11]]) // list of maps or domain objects
ps.addBatch([foo:10], [bar:12, baz:5]) // varargs allows outer brackets to be dropped
ps.addBatch([foo:7], [bar:3, baz:98])
...
}
// swap to batch size of 5 and illustrate simple and domain object cases ...
class Person { String first, last }
def updateCounts2 = sql.withBatch(5, 'insert into PERSON(id, first, last) values (?1, ?2.first, ?2.last)') { ps ->
ps.addBatch(1, new Person(first:'Peter', last:'Pan'))
ps.addBatch(2, new Person(first:'Snow', last:'White'))
...
}
```
For integrity and performance reasons, you may wish to consider executing your batch command(s) within a transaction:
```
sql.withTransaction {
def result1 = sql.withBatch { ... }
...
}
```
**throws:**
SQLException if a database access error occurs, or this method is called on a closed `Statement`, or the driver does not support batch statements. Throws [BatchUpdateException](https://docs.oracle.com/javase/8/docs/api/java/sql/BatchUpdateException.html "BatchUpdateException") (a subclass of `SQLException`) if one of the commands sent to the database fails to execute properly or attempts to return a result set.
**Parameters:**
`batchSize` - partition the batch into batchSize pieces, i.e. after batchSize `addBatch()` invocations, call `executeBatch()` automatically; 0 means manual calls to executeBatch are required if additional partitioning of the batch is required
`sql` - batch update statement
`closure` - the closure containing batch statements (to bind parameters) and optionally other statements
**Returns:**
an array of update counts containing one element for each binding in the batch. The elements of the array are ordered according to the order in which commands were executed.
**See Also:**
[BatchingPreparedStatementWrapper](batchingpreparedstatementwrapper "BatchingPreparedStatementWrapper")
[PreparedStatement](https://docs.oracle.com/javase/8/docs/api/java/sql/PreparedStatement.html "PreparedStatement")
### public static void **withInstance**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.Sql") [Closure](../lang/closure) c)
Invokes a closure passing it a new Sql instance created from the given JDBC connection URL. The created connection will be closed if required.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`url` - a database url of the form `jdbc:*subprotocol*:*subname*`
`c` - the Closure to call
**See Also:**
[newInstance(String)](#newInstance(java.lang.String))
### public static void **withInstance**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url, [Properties](https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html "Properties") properties, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.Sql") [Closure](../lang/closure) c)
Invokes a closure passing it a new Sql instance created from the given JDBC connection URL and properties. The created connection will be closed if required.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`url` - a database url of the form `jdbc:*subprotocol*:*subname*`
`properties` - a list of arbitrary string tag/value pairs as connection arguments; normally at least a "user" and "password" property should be included
`c` - the Closure to call
**See Also:**
[newInstance(String, java.util.Properties)](#newInstance(java.lang.String,%20java.util.Properties))
### public static void **withInstance**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url, [Properties](https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html "Properties") properties, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") driverClassName, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.Sql") [Closure](../lang/closure) c)
Invokes a closure passing it a new Sql instance created from the given JDBC connection URL, properties and driver classname. The created connection will be closed if required.
**throws:**
SQLException if a database access error occurs
**throws:**
ClassNotFoundException if the driver class cannot be found or loaded
**Parameters:**
`url` - a database url of the form `jdbc:*subprotocol*:*subname*`
`properties` - a list of arbitrary string tag/value pairs as connection arguments; normally at least a "user" and "password" property should be included
`driverClassName` - the fully qualified class name of the driver class
`c` - the Closure to call
**See Also:**
[newInstance(String, java.util.Properties, String)](#newInstance(java.lang.String,%20java.util.Properties,%20java.lang.String))
### public static void **withInstance**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") user, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") password, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.Sql") [Closure](../lang/closure) c)
Invokes a closure passing it a new Sql instance created from the given JDBC connection URL, user and password. The created connection will be closed if required.
**throws:**
SQLException if a database access error occurs
**Parameters:**
`url` - a database url of the form `jdbc:*subprotocol*:*subname*`
`user` - the database user on whose behalf the connection is being made
`password` - the user's password
`c` - the Closure to call
**See Also:**
[newInstance(String, String, String)](#newInstance(java.lang.String,%20java.lang.String,%20java.lang.String))
### public static void **withInstance**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") user, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") password, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") driverClassName, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.Sql") [Closure](../lang/closure) c)
Invokes a closure passing it a new Sql instance created from the given JDBC connection URL. The created connection will be closed if required.
**throws:**
SQLException if a database access error occurs
**throws:**
ClassNotFoundException if the driver class cannot be found or loaded
**Parameters:**
`url` - a database url of the form `jdbc:*subprotocol*:*subname*`
`user` - the database user on whose behalf the connection is being made
`password` - the user's password
`driverClassName` - the fully qualified class name of the driver class
`c` - the Closure to call
**See Also:**
[newInstance(String, String, String, String)](#newInstance(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String))
### public static void **withInstance**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") url, [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") driverClassName, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.Sql") [Closure](../lang/closure) c)
Invokes a closure passing it a new Sql instance created from the given JDBC connection URL. The created connection will be closed if required.
**throws:**
SQLException if a database access error occurs
**throws:**
ClassNotFoundException if the driver class cannot be found or loaded
**Parameters:**
`url` - a database url of the form `jdbc:*subprotocol*:*subname*`
`driverClassName` - the fully qualified class name of the driver class
`c` - the Closure to call
**See Also:**
[newInstance(String, String)](#newInstance(java.lang.String,%20java.lang.String))
### public static void **withInstance**(@[NamedParam](../transform/namedparam "NamedParam")(value = "url", type = String.class, required = true) @[NamedParam](../transform/namedparam "NamedParam")(value = "properties", type = Properties.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "driverClassName", type = String.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "driver", type = String.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "user", type = String.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "password", type = String.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "cacheNamedQueries", type = Boolean.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "cacheStatements", type = Boolean.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "enableNamedQueries", type = Boolean.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "resultSetConcurrency", type = Integer.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "resultSetHoldability", type = Integer.class) @[NamedParam](../transform/namedparam "NamedParam")(value = "resultSetType", type = Integer.class) [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> args, @[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="groovy.sql.Sql") [Closure](../lang/closure) c)
Invokes a closure passing it a new Sql instance created from the given map of arguments. The created connection will be closed if required.
**throws:**
SQLException if a database access error occurs
**throws:**
ClassNotFoundException if the driver class cannot be found or loaded
**Parameters:**
`args` - a Map contain further arguments
`c` - the Closure to call
**See Also:**
[newInstance(java.util.Map)](#newInstance(java.util.Map))
### public void **withStatement**(@[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.Statement") [Closure](../lang/closure) configureStatement)
Allows a closure to be passed in to configure the JDBC statements before they are executed. It can be used to do things like set the query size etc. When this method is invoked, the supplied closure is saved. Statements subsequently created from other methods will then be configured using this closure. The statement being configured is passed into the closure as its single argument, e.g.:
```
sql.withStatement{ stmt -> stmt.maxRows = 10 }
def firstTenRows = sql.rows("select * from table")
```
**Parameters:**
`configureStatement` - the closure
### public void **withTransaction**(@[ClosureParams](../transform/stc/closureparams "ClosureParams")(value=SimpleType.class, options="java.sql.Connection") [Closure](../lang/closure) closure)
Performs the closure within a transaction using a cached connection. If the closure takes a single argument, it will be called with the connection, otherwise it will be called with no arguments.
**throws:**
SQLException if a database error occurs
**Parameters:**
`closure` - the given closure
| programming_docs |
groovy [Java] Interface GroovyResultSet [Java] Interface GroovyResultSet
================================
* groovy.lang.GroovyObject
All Superinterfaces: [GroovyObject](../lang/groovyobject)
```
public interface GroovyResultSet
extends [GroovyObject](../lang/groovyobject), [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet")
```
Represents an extent of objects
Inherited fields
| Fields inherited from class | Fields |
| **`interface [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet")`** | `FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE, CONCUR_READ_ONLY, CONCUR_UPDATABLE, HOLD_CURSORS_OVER_COMMIT, CLOSE_CURSORS_AT_COMMIT` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[add](#add(java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") values)`Adds a new row to this result set |
| | `public void` | `**[eachRow](#eachRow(groovy.lang.Closure))**([Closure](../lang/closure) closure)`Call the closure once for each row in the result set. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getAt](#getAt(int))**(int index)`Supports integer-based subscript operators for accessing at numbered columns starting at zero. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getAt](#getAt(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") columnName)`Gets the value of the designated column in the current row as an `Object`. |
| | `public void` | `**[putAt](#putAt(int,%20java.lang.Object))**(int index, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`Supports integer based subscript operators for updating the values of numbered columns starting at zero. |
| | `public void` | `**[putAt](#putAt(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") columnName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`Updates the designated column with an `Object` value. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `interface [GroovyObject](../lang/groovyobject)` | `[getMetaClass](../lang/groovyobject#getMetaClass()), [getProperty](../lang/groovyobject#getProperty(java.lang.String)), [invokeMethod](../lang/groovyobject#invokeMethod(java.lang.String,%20java.lang.Object)), [setMetaClass](../lang/groovyobject#setMetaClass(groovy.lang.MetaClass)), [setProperty](../lang/groovyobject#setProperty(java.lang.String,%20java.lang.Object))` |
| `interface [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet")` | `[updateBytes](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateBytes(int,%20%5BB) "updateBytes"), [updateBytes](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateBytes(java.lang.String,%20%5BB) "updateBytes"), [getBoolean](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getBoolean(java.lang.String) "getBoolean"), [getBoolean](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getBoolean(int) "getBoolean"), [getByte](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getByte(java.lang.String) "getByte"), [getByte](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getByte(int) "getByte"), [getShort](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getShort(java.lang.String) "getShort"), [getShort](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getShort(int) "getShort"), [getInt](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getInt(int) "getInt"), [getInt](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getInt(java.lang.String) "getInt"), [getLong](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getLong(java.lang.String) "getLong"), [getLong](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getLong(int) "getLong"), [getFloat](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getFloat(java.lang.String) "getFloat"), [getFloat](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getFloat(int) "getFloat"), [getDouble](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getDouble(int) "getDouble"), [getDouble](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getDouble(java.lang.String) "getDouble"), [getBytes](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getBytes(java.lang.String) "getBytes"), [getBytes](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getBytes(int) "getBytes"), [next](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#next() "next"), [last](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#last() "last"), [first](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#first() "first"), [close](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#close() "close"), [getType](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getType() "getType"), [getObject](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getObject(java.lang.String) "getObject"), [getObject](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getObject(java.lang.String,%20java.lang.Class) "getObject"), [getObject](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getObject(int) "getObject"), [getObject](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getObject(int,%20java.lang.Class) "getObject"), [getObject](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getObject(int,%20java.util.Map) "getObject"), [getObject](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getObject(java.lang.String,%20java.util.Map) "getObject"), [getRef](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getRef(int) "getRef"), [getRef](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getRef(java.lang.String) "getRef"), [previous](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#previous() "previous"), [getArray](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getArray(int) "getArray"), [getArray](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getArray(java.lang.String) "getArray"), [absolute](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#absolute(int) "absolute"), [getTime](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getTime(java.lang.String,%20java.util.Calendar) "getTime"), [getTime](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getTime(java.lang.String) "getTime"), [getTime](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getTime(int) "getTime"), [getTime](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getTime(int,%20java.util.Calendar) "getTime"), [getTimestamp](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getTimestamp(int,%20java.util.Calendar) "getTimestamp"), [getTimestamp](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getTimestamp(int) "getTimestamp"), [getTimestamp](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getTimestamp(java.lang.String,%20java.util.Calendar) "getTimestamp"), [getTimestamp](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getTimestamp(java.lang.String) "getTimestamp"), [getString](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getString(int) "getString"), [getString](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getString(java.lang.String) "getString"), [getURL](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getURL(int) "getURL"), [getURL](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getURL(java.lang.String) "getURL"), [updateTime](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateTime(java.lang.String,%20java.sql.Time) "updateTime"), [updateTime](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateTime(int,%20java.sql.Time) "updateTime"), [relative](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#relative(int) "relative"), [getBigDecimal](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getBigDecimal(int,%20int) "getBigDecimal"), [getBigDecimal](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getBigDecimal(java.lang.String) "getBigDecimal"), [getBigDecimal](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getBigDecimal(int) "getBigDecimal"), [getBigDecimal](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getBigDecimal(java.lang.String,%20int) "getBigDecimal"), [getDate](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getDate(int,%20java.util.Calendar) "getDate"), [getDate](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getDate(java.lang.String,%20java.util.Calendar) "getDate"), [getDate](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getDate(int) "getDate"), [getDate](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getDate(java.lang.String) "getDate"), [getCharacterStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getCharacterStream(java.lang.String) "getCharacterStream"), [getCharacterStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getCharacterStream(int) "getCharacterStream"), [isClosed](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#isClosed() "isClosed"), [wasNull](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#wasNull() "wasNull"), [isFirst](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#isFirst() "isFirst"), [getMetaData](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getMetaData() "getMetaData"), [updateNCharacterStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateNCharacterStream(int,%20java.io.Reader) "updateNCharacterStream"), [updateNCharacterStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateNCharacterStream(java.lang.String,%20java.io.Reader) "updateNCharacterStream"), [updateNCharacterStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateNCharacterStream(int,%20java.io.Reader,%20long) "updateNCharacterStream"), [updateNCharacterStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateNCharacterStream(java.lang.String,%20java.io.Reader,%20long) "updateNCharacterStream"), [updateCharacterStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateCharacterStream(int,%20java.io.Reader) "updateCharacterStream"), [updateCharacterStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateCharacterStream(int,%20java.io.Reader,%20int) "updateCharacterStream"), [updateCharacterStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateCharacterStream(java.lang.String,%20java.io.Reader,%20long) "updateCharacterStream"), [updateCharacterStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateCharacterStream(java.lang.String,%20java.io.Reader,%20int) "updateCharacterStream"), [updateCharacterStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateCharacterStream(java.lang.String,%20java.io.Reader) "updateCharacterStream"), [updateCharacterStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateCharacterStream(int,%20java.io.Reader,%20long) "updateCharacterStream"), [getNCharacterStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getNCharacterStream(java.lang.String) "getNCharacterStream"), [getNCharacterStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getNCharacterStream(int) "getNCharacterStream"), [isAfterLast](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#isAfterLast() "isAfterLast"), [isLast](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#isLast() "isLast"), [afterLast](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#afterLast() "afterLast"), [getRow](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getRow() "getRow"), [setFetchSize](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#setFetchSize(int) "setFetchSize"), [beforeFirst](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#beforeFirst() "beforeFirst"), [getAsciiStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getAsciiStream(java.lang.String) "getAsciiStream"), [getAsciiStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getAsciiStream(int) "getAsciiStream"), [getFetchSize](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getFetchSize() "getFetchSize"), [getConcurrency](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getConcurrency() "getConcurrency"), [findColumn](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#findColumn(java.lang.String) "findColumn"), [getWarnings](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getWarnings() "getWarnings"), [isBeforeFirst](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#isBeforeFirst() "isBeforeFirst"), [getCursorName](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getCursorName() "getCursorName"), [clearWarnings](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#clearWarnings() "clearWarnings"), [setFetchDirection](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#setFetchDirection(int) "setFetchDirection"), [getFetchDirection](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getFetchDirection() "getFetchDirection"), [getUnicodeStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getUnicodeStream(java.lang.String) "getUnicodeStream"), [getUnicodeStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getUnicodeStream(int) "getUnicodeStream"), [getBinaryStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getBinaryStream(java.lang.String) "getBinaryStream"), [getBinaryStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getBinaryStream(int) "getBinaryStream"), [updateNull](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateNull(int) "updateNull"), [updateNull](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateNull(java.lang.String) "updateNull"), [updateFloat](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateFloat(java.lang.String,%20float) "updateFloat"), [updateFloat](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateFloat(int,%20float) "updateFloat"), [updateDouble](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateDouble(java.lang.String,%20double) "updateDouble"), [updateDouble](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateDouble(int,%20double) "updateDouble"), [updateAsciiStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateAsciiStream(int,%20java.io.InputStream,%20int) "updateAsciiStream"), [updateAsciiStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateAsciiStream(java.lang.String,%20java.io.InputStream) "updateAsciiStream"), [updateAsciiStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateAsciiStream(java.lang.String,%20java.io.InputStream,%20int) "updateAsciiStream"), [updateAsciiStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateAsciiStream(int,%20java.io.InputStream) "updateAsciiStream"), [updateAsciiStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateAsciiStream(int,%20java.io.InputStream,%20long) "updateAsciiStream"), [updateAsciiStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateAsciiStream(java.lang.String,%20java.io.InputStream,%20long) "updateAsciiStream"), [updateDate](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateDate(int,%20java.sql.Date) "updateDate"), [updateDate](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateDate(java.lang.String,%20java.sql.Date) "updateDate"), [rowUpdated](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#rowUpdated() "rowUpdated"), [updateShort](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateShort(java.lang.String,%20short) "updateShort"), [updateShort](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateShort(int,%20short) "updateShort"), [rowInserted](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#rowInserted() "rowInserted"), [updateString](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateString(int,%20java.lang.String) "updateString"), [updateString](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateString(java.lang.String,%20java.lang.String) "updateString"), [updateBinaryStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateBinaryStream(java.lang.String,%20java.io.InputStream) "updateBinaryStream"), [updateBinaryStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateBinaryStream(int,%20java.io.InputStream,%20int) "updateBinaryStream"), [updateBinaryStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateBinaryStream(int,%20java.io.InputStream) "updateBinaryStream"), [updateBinaryStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateBinaryStream(int,%20java.io.InputStream,%20long) "updateBinaryStream"), [updateBinaryStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateBinaryStream(java.lang.String,%20java.io.InputStream,%20int) "updateBinaryStream"), [updateBinaryStream](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateBinaryStream(java.lang.String,%20java.io.InputStream,%20long) "updateBinaryStream"), [insertRow](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#insertRow() "insertRow"), [updateRow](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateRow() "updateRow"), [updateBigDecimal](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateBigDecimal(java.lang.String,%20java.math.BigDecimal) "updateBigDecimal"), [updateBigDecimal](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateBigDecimal(int,%20java.math.BigDecimal) "updateBigDecimal"), [updateTimestamp](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateTimestamp(int,%20java.sql.Timestamp) "updateTimestamp"), [updateTimestamp](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateTimestamp(java.lang.String,%20java.sql.Timestamp) "updateTimestamp"), [deleteRow](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#deleteRow() "deleteRow"), [updateByte](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateByte(java.lang.String,%20byte) "updateByte"), [updateByte](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateByte(int,%20byte) "updateByte"), [updateLong](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateLong(int,%20long) "updateLong"), [updateLong](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateLong(java.lang.String,%20long) "updateLong"), [rowDeleted](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#rowDeleted() "rowDeleted"), [updateObject](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateObject(java.lang.String,%20java.lang.Object,%20java.sql.SQLType) "updateObject"), [updateObject](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateObject(java.lang.String,%20java.lang.Object) "updateObject"), [updateObject](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateObject(java.lang.String,%20java.lang.Object,%20int) "updateObject"), [updateObject](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateObject(int,%20java.lang.Object,%20java.sql.SQLType) "updateObject"), [updateObject](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateObject(java.lang.String,%20java.lang.Object,%20java.sql.SQLType,%20int) "updateObject"), [updateObject](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateObject(int,%20java.lang.Object,%20java.sql.SQLType,%20int) "updateObject"), [updateObject](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateObject(int,%20java.lang.Object,%20int) "updateObject"), [updateObject](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateObject(int,%20java.lang.Object) "updateObject"), [updateInt](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateInt(int,%20int) "updateInt"), [updateInt](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateInt(java.lang.String,%20int) "updateInt"), [updateBoolean](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateBoolean(java.lang.String,%20boolean) "updateBoolean"), [updateBoolean](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateBoolean(int,%20boolean) "updateBoolean"), [updateRowId](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateRowId(java.lang.String,%20java.sql.RowId) "updateRowId"), [updateRowId](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateRowId(int,%20java.sql.RowId) "updateRowId"), [moveToCurrentRow](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#moveToCurrentRow() "moveToCurrentRow"), [getHoldability](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getHoldability() "getHoldability"), [updateRef](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateRef(java.lang.String,%20java.sql.Ref) "updateRef"), [updateRef](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateRef(int,%20java.sql.Ref) "updateRef"), [getClob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getClob(int) "getClob"), [getClob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getClob(java.lang.String) "getClob"), [cancelRowUpdates](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#cancelRowUpdates() "cancelRowUpdates"), [updateClob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateClob(int,%20java.sql.Clob) "updateClob"), [updateClob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateClob(java.lang.String,%20java.io.Reader,%20long) "updateClob"), [updateClob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateClob(int,%20java.io.Reader,%20long) "updateClob"), [updateClob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateClob(java.lang.String,%20java.sql.Clob) "updateClob"), [updateClob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateClob(java.lang.String,%20java.io.Reader) "updateClob"), [updateClob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateClob(int,%20java.io.Reader) "updateClob"), [updateBlob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateBlob(java.lang.String,%20java.io.InputStream,%20long) "updateBlob"), [updateBlob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateBlob(int,%20java.io.InputStream,%20long) "updateBlob"), [updateBlob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateBlob(int,%20java.sql.Blob) "updateBlob"), [updateBlob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateBlob(java.lang.String,%20java.io.InputStream) "updateBlob"), [updateBlob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateBlob(int,%20java.io.InputStream) "updateBlob"), [updateBlob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateBlob(java.lang.String,%20java.sql.Blob) "updateBlob"), [moveToInsertRow](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#moveToInsertRow() "moveToInsertRow"), [getStatement](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getStatement() "getStatement"), [getBlob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getBlob(int) "getBlob"), [getBlob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getBlob(java.lang.String) "getBlob"), [updateArray](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateArray(int,%20java.sql.Array) "updateArray"), [updateArray](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateArray(java.lang.String,%20java.sql.Array) "updateArray"), [getRowId](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getRowId(int) "getRowId"), [getRowId](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getRowId(java.lang.String) "getRowId"), [refreshRow](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#refreshRow() "refreshRow"), [updateNClob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateNClob(int,%20java.sql.NClob) "updateNClob"), [updateNClob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateNClob(int,%20java.io.Reader) "updateNClob"), [updateNClob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateNClob(java.lang.String,%20java.sql.NClob) "updateNClob"), [updateNClob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateNClob(int,%20java.io.Reader,%20long) "updateNClob"), [updateNClob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateNClob(java.lang.String,%20java.io.Reader,%20long) "updateNClob"), [updateNClob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateNClob(java.lang.String,%20java.io.Reader) "updateNClob"), [getNClob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getNClob(java.lang.String) "getNClob"), [getNClob](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getNClob(int) "getNClob"), [updateNString](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateNString(java.lang.String,%20java.lang.String) "updateNString"), [updateNString](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateNString(int,%20java.lang.String) "updateNString"), [getNString](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getNString(int) "getNString"), [getNString](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getNString(java.lang.String) "getNString"), [getSQLXML](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getSQLXML(int) "getSQLXML"), [getSQLXML](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getSQLXML(java.lang.String) "getSQLXML"), [updateSQLXML](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateSQLXML(int,%20java.sql.SQLXML) "updateSQLXML"), [updateSQLXML](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#updateSQLXML(java.lang.String,%20java.sql.SQLXML) "updateSQLXML"), [unwrap](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#unwrap(java.lang.Class) "unwrap"), [isWrapperFor](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#isWrapperFor(java.lang.Class) "isWrapperFor")` |
Method Detail
-------------
### public void **add**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") values)
Adds a new row to this result set
**throws:**
SQLException if a database error occurs
**Parameters:**
`values` - the new values to add
### public void **eachRow**([Closure](../lang/closure) closure)
Call the closure once for each row in the result set.
**throws:**
SQLException if a database error occurs
**Parameters:**
`closure` - the closure to call for each row
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getAt**(int index)
Supports integer-based subscript operators for accessing at numbered columns starting at zero. Negative indices are supported, they will count from the last column backwards.
**throws:**
SQLException if a database error occurs
**Parameters:**
`index` - is the number of the column to look at starting at 1
**Returns:**
the object for this index in the current result set
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getAt**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") columnName)
Gets the value of the designated column in the current row as an `Object`.
**throws:**
groovy.lang.MissingPropertyException if an SQLException happens while getting the object
**Parameters:**
`columnName` - the SQL name of the column
**Returns:**
the returned column value
### public void **putAt**(int index, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
Supports integer based subscript operators for updating the values of numbered columns starting at zero. Negative indices are supported, they will count from the last column backwards.
**throws:**
SQLException if a database error occurs
**Parameters:**
`index` - is the number of the column to look at starting at 1
`newValue` - the new value for this index
### public void **putAt**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") columnName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
Updates the designated column with an `Object` value.
**throws:**
groovy.lang.MissingPropertyException if an SQLException happens while setting the new value
**Parameters:**
`columnName` - the SQL name of the column
`newValue` - the updated value
| programming_docs |
groovy [Java] Interface ResultSetOutParameter [Java] Interface ResultSetOutParameter
======================================
* groovy.sql.OutParameter
All Superinterfaces: [OutParameter](outparameter)
```
public interface ResultSetOutParameter
extends [OutParameter](outparameter)
```
A ResultSet out parameter.
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `interface [OutParameter](outparameter)` | `[getType](outparameter#getType())` |
groovy [Java] Class SqlWithParams [Java] Class SqlWithParams
==========================
* groovy.sql.SqlWithParams
```
public class SqlWithParams
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
```
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[SqlWithParams](#SqlWithParams(java.lang.String,%20List))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")>` | `**[getParams](#getParams())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getSql](#getSql())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **SqlWithParams**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") sql, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> params)
Method Detail
-------------
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> **getParams**()
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getSql**()
groovy [Java] Class GroovyResultSetExtension [Java] Class GroovyResultSetExtension
=====================================
* groovy.sql.GroovyResultSetExtension
```
public class GroovyResultSetExtension
extends [GroovyObjectSupport](../lang/groovyobjectsupport)
```
GroovyResultSetExtension implements additional logic for ResultSet. Due to the version incompatibility between java6 and java5 this methods are moved here from the original GroovyResultSet class. The methods in this class are used by the proxy GroovyResultSetProxy, which will try to invoke methods on this class before invoking it on ResultSet.
**This class is not intended to be used directly. Should be used through GroovyResultSetProxy only!**
**See Also:**
[GroovyResultSet](groovyresultset "GroovyResultSet")
[GroovyResultSetProxy](groovyresultsetproxy "GroovyResultSetProxy")
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[GroovyResultSetExtension](#GroovyResultSetExtension(java.sql.ResultSet))**([ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet") set)`Creates a GroovyResultSet implementation. |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[add](#add(java.util.Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") values)`Adds a new row to the result set |
| | `public void` | `**[eachRow](#eachRow(groovy.lang.Closure))**([Closure](../lang/closure) closure)`Call the closure once for each row in the result set. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getAt](#getAt(int))**(int index)`Supports integer based subscript operators for accessing at numbered columns starting at zero. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") columnName)`Gets the value of the designated column in the current row of as an `Object`. |
| | `protected [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet")` | `**[getResultSet](#getResultSet())**()`Gets the current result set. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)` |
| | `public boolean` | `**[next](#next())**()`Moves the cursor down one row from its current position. |
| | `protected int` | `**[normalizeIndex](#normalizeIndex(int))**(int index)`Takes a zero based index and convert it into an SQL based 1 based index. |
| | `public boolean` | `**[previous](#previous())**()`Moves the cursor to the previous row in this `getResultSet()` object. |
| | `public void` | `**[putAt](#putAt(int,%20java.lang.Object))**(int index, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`Supports integer based subscript operators for updating the values of numbered columns starting at zero. |
| | `public void` | `**[setProperty](#setProperty(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") columnName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)`Updates the designated column with an `Object` value. |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyObjectSupport](../lang/groovyobjectsupport)` | `[getMetaClass](../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
### public **GroovyResultSetExtension**([ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet") set)
Creates a GroovyResultSet implementation.
**Parameters:**
`set` - the result set
Method Detail
-------------
### public void **add**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map") values)
Adds a new row to the result set
**throws:**
java.sql.SQLException if something goes wrong
**Parameters:**
`values` - a map containing the mappings for column names and values
**See Also:**
[ResultSet.insertRow](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#insertRow() "ResultSet.insertRow")
ResultSet#updateObject(java.lang.String, java.lang.Object)
[ResultSet.moveToInsertRow](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#moveToInsertRow() "ResultSet.moveToInsertRow")
### public void **eachRow**([Closure](../lang/closure) closure)
Call the closure once for each row in the result set.
**throws:**
SQLException if something goes wrong
**Parameters:**
`closure` - the closure to perform on each row
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getAt**(int index)
Supports integer based subscript operators for accessing at numbered columns starting at zero. Negative indices are supported, they will count from the last column backwards.
**throws:**
java.sql.SQLException if something goes wrong
**Parameters:**
`index` - is the number of the column to look at starting at 1
**Returns:**
the returned column value
**See Also:**
[ResultSet.getObject](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getObject(int) "ResultSet.getObject")
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") columnName)
Gets the value of the designated column in the current row of as an `Object`.
**throws:**
MissingPropertyException if an SQLException happens while getting the object
**Parameters:**
`columnName` - the SQL name of the column
**Returns:**
the returned column value
**See Also:**
[GroovyObject.getProperty](../lang/groovyobject#getProperty(java.lang.String) "GroovyObject.getProperty")
ResultSet#getObject(java.lang.String)
### protected [ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet") **getResultSet**()
Gets the current result set.
**throws:**
SQLException if the result set can not be returned
**Returns:**
the result set
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
### public boolean **next**()
Moves the cursor down one row from its current position. A `getResultSet()` cursor is initially positioned before the first row; the first call to the method `next` makes the first row the current row; the second call makes the second row the current row, and so on.
If an input stream is open for the current row, a call to the method `next` will implicitly close it. A `getResultSet()` object's warning chain is cleared when a new row is read.
**throws:**
SQLException if a database access error occurs
**Returns:**
`true` if the new current row is valid; `false` if there are no more rows
### protected int **normalizeIndex**(int index)
Takes a zero based index and convert it into an SQL based 1 based index. A negative index will count backwards from the last column.
**throws:**
SQLException if some exception occurs finding out the column count
**Parameters:**
`index` - the raw requested index (may be negative)
**Returns:**
a JDBC index
### public boolean **previous**()
Moves the cursor to the previous row in this `getResultSet()` object.
**throws:**
SQLException if a database access error occurs or the result set type is `TYPE_FORWARD_ONLY`
**Returns:**
`true` if the cursor is on a valid row; `false` if it is off the result set
**Since:**
1.2
### public void **putAt**(int index, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
Supports integer based subscript operators for updating the values of numbered columns starting at zero. Negative indices are supported, they will count from the last column backwards.
**throws:**
java.sql.SQLException if something goes wrong
**Parameters:**
`index` - is the number of the column to look at starting at 1
`newValue` - the updated value
**See Also:**
ResultSet#updateObject(java.lang.String, java.lang.Object)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") columnName, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
Updates the designated column with an `Object` value.
**throws:**
MissingPropertyException if an SQLException happens while setting the new value
**Parameters:**
`columnName` - the SQL name of the column
`newValue` - the updated value
**See Also:**
[GroovyObject.setProperty](../lang/groovyobject#setProperty(java.lang.String,%20java.lang.Object) "GroovyObject.setProperty")
ResultSet#updateObject(java.lang.String, java.lang.Object)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
groovy [Java] Interface ExpandedVariable [Java] Interface ExpandedVariable
=================================
```
public interface ExpandedVariable
```
Identifies a variable to be expanded into the sql string rather than representing a placeholder.
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getObject](#getObject())**()` |
Method Detail
-------------
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getObject**()
groovy [Java] Interface OutParameter [Java] Interface OutParameter
=============================
```
public interface OutParameter
```
A parameter to be returned from a CallableStatement.
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public int` | `**[getType](#getType())**()`Get the JDBC datatype for this parameter. |
Method Detail
-------------
### public int **getType**()
Get the JDBC datatype for this parameter.
**Returns:**
the type
groovy [Java] Class ResultSetMetaDataWrapper [Java] Class ResultSetMetaDataWrapper
=====================================
* groovy.sql.ResultSetMetaDataWrapper
```
public class ResultSetMetaDataWrapper
extends [GroovyObjectSupport](../lang/groovyobjectsupport)
```
This class defines a wrapper for accessing a specific column in `ResultSetMetaData`. This allows iteration over columns using idiomatic Groovy, e.g.:
```
meta.each {col ->
println col.columnName
}
```
All `ResultSetMetaData` column methods taking a column index are available on a column either as a no-arg getter or via a property. This wrapper is created by an iterator invoked for `ResultSetMetaData`.
**See Also:**
[SqlExtensions](../../org/apache/groovy/sql/extensions/sqlextensions "SqlExtensions")
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[ResultSetMetaDataWrapper](#ResultSetMetaDataWrapper(java.sql.ResultSetMetaData,%20int))**([ResultSetMetaData](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSetMetaData.html "ResultSetMetaData") target, int index)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invokeMethod](#invokeMethod(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)` |
| | `public void` | `**[setProperty](#setProperty(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyObjectSupport](../lang/groovyobjectsupport)` | `[getMetaClass](../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
### public **ResultSetMetaDataWrapper**([ResultSetMetaData](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSetMetaData.html "ResultSetMetaData") target, int index)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invokeMethod**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") name, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") args)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **setProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") newValue)
groovy [Java] Interface InParameter [Java] Interface InParameter
============================
```
public interface InParameter
```
A typed parameter to pass to a query
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public int` | `**[getType](#getType())**()`The JDBC data type. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getValue](#getValue())**()`The object holding the data value. |
Method Detail
-------------
### public int **getType**()
The JDBC data type.
**Returns:**
the type
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getValue**()
The object holding the data value.
**Returns:**
the value
groovy [Java] Class GroovyResultSetProxy [Java] Class GroovyResultSetProxy
=================================
* groovy.sql.GroovyResultSetProxy
All Implemented Interfaces and Traits: [InvocationHandler](https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/InvocationHandler.html "InvocationHandler")
```
public final class GroovyResultSetProxy
extends [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")
implements [InvocationHandler](https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/InvocationHandler.html "InvocationHandler")
```
GroovyResultSetProxy is used to create a proxy for GroovyResultSet. Due to the version incompatibility between java 6 and older versions methods with additional logic were moved into an extension class. When getting properties or calling methods, the runtime will try to first execute these on the extension and then on the ResultSet itself. This way it is possible to replace and add methods. To overload methods from ResultSet all methods have to be implemented on the extension class.
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[GroovyResultSetProxy](#GroovyResultSetProxy(java.sql.ResultSet))**([ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet") set)`Creates a new proxy instance. |
| `**[GroovyResultSetProxy](#GroovyResultSetProxy(groovy.sql.GroovyResultSetExtension))**([GroovyResultSetExtension](groovyresultsetextension) ext)`Creates a new proxy instance with a custom extension. |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [GroovyResultSet](groovyresultset)` | `**[getImpl](#getImpl())**()`Gets a proxy instance that can be used as GroovyResultSet. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[invoke](#invoke(java.lang.Object,%20java.lang.reflect.Method,%20java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") proxy, [Method](https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html "Method") method, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)`Invokes a method for the GroovyResultSet. |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `[wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,%20int) "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait() "wait"), [wait](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long) "wait"), [equals](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object) "equals"), [toString](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString() "toString"), [hashCode](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode() "hashCode"), [getClass](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass() "getClass"), [notify](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify() "notify"), [notifyAll](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll() "notifyAll")` |
Constructor Detail
------------------
### public **GroovyResultSetProxy**([ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet") set)
Creates a new proxy instance. This will create the extension automatically using GroovyResultSetExtension
**Parameters:**
`set` - the result set to delegate to
**See Also:**
[GroovyResultSetExtension](groovyresultsetextension "GroovyResultSetExtension")
### public **GroovyResultSetProxy**([GroovyResultSetExtension](groovyresultsetextension) ext)
Creates a new proxy instance with a custom extension.
**Parameters:**
`ext` - the extension
**See Also:**
[GroovyResultSetExtension](groovyresultsetextension "GroovyResultSetExtension")
Method Detail
-------------
### public [GroovyResultSet](groovyresultset) **getImpl**()
Gets a proxy instance that can be used as GroovyResultSet.
**Returns:**
the proxy
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **invoke**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") proxy, [Method](https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html "Method") method, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] args)
Invokes a method for the GroovyResultSet. This will try to invoke the given method first on the extension and then on the result set given as proxy parameter.
**Parameters:**
`proxy` - the result set
`method` - the method name of this method will be used to make a call on the extension. If this fails the call will be done on the proxy instead
`args` - for the call
**See Also:**
[ResultSet](https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html "ResultSet")
[InvocationHandler.invoke](https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/InvocationHandler.html#invoke(java.lang.Object,%20java.lang.reflect.Method,%20java.lang.Object%5B%5D) "InvocationHandler.invoke")
| programming_docs |
groovy [Java] Class SqlOrderByVisitor [Java] Class SqlOrderByVisitor
==============================
* groovy.sql.SqlOrderByVisitor
```
public class SqlOrderByVisitor
extends [CodeVisitorSupport](../../org/codehaus/groovy/ast/codevisitorsupport)
```
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getOrderBy](#getOrderBy())**()` |
| | `public void` | `**[visitPropertyExpression](#visitPropertyExpression(org.codehaus.groovy.ast.expr.PropertyExpression))**([PropertyExpression](../../org/codehaus/groovy/ast/expr/propertyexpression) expression)` |
| | `public void` | `**[visitReturnStatement](#visitReturnStatement(org.codehaus.groovy.ast.stmt.ReturnStatement))**([ReturnStatement](../../org/codehaus/groovy/ast/stmt/returnstatement) statement)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [CodeVisitorSupport](../../org/codehaus/groovy/ast/codevisitorsupport)` | `[afterSwitchConditionExpressionVisited](../../org/codehaus/groovy/ast/codevisitorsupport#afterSwitchConditionExpressionVisited(org.codehaus.groovy.ast.stmt.SwitchStatement)), [visitArgumentlistExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitArgumentlistExpression(org.codehaus.groovy.ast.expr.ArgumentListExpression)), [visitArrayExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitArrayExpression(org.codehaus.groovy.ast.expr.ArrayExpression)), [visitAssertStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitAssertStatement(org.codehaus.groovy.ast.stmt.AssertStatement)), [visitAttributeExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitAttributeExpression(org.codehaus.groovy.ast.expr.AttributeExpression)), [visitBinaryExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitBinaryExpression(org.codehaus.groovy.ast.expr.BinaryExpression)), [visitBitwiseNegationExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitBitwiseNegationExpression(org.codehaus.groovy.ast.expr.BitwiseNegationExpression)), [visitBlockStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitBlockStatement(org.codehaus.groovy.ast.stmt.BlockStatement)), [visitBooleanExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitBooleanExpression(org.codehaus.groovy.ast.expr.BooleanExpression)), [visitBreakStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitBreakStatement(org.codehaus.groovy.ast.stmt.BreakStatement)), [visitBytecodeExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitBytecodeExpression(org.codehaus.groovy.classgen.BytecodeExpression)), [visitCaseStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitCaseStatement(org.codehaus.groovy.ast.stmt.CaseStatement)), [visitCastExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitCastExpression(org.codehaus.groovy.ast.expr.CastExpression)), [visitCatchStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitCatchStatement(org.codehaus.groovy.ast.stmt.CatchStatement)), [visitClassExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitClassExpression(org.codehaus.groovy.ast.expr.ClassExpression)), [visitClosureExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitClosureExpression(org.codehaus.groovy.ast.expr.ClosureExpression)), [visitClosureListExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitClosureListExpression(org.codehaus.groovy.ast.expr.ClosureListExpression)), [visitConstantExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitConstantExpression(org.codehaus.groovy.ast.expr.ConstantExpression)), [visitConstructorCallExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitConstructorCallExpression(org.codehaus.groovy.ast.expr.ConstructorCallExpression)), [visitContinueStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitContinueStatement(org.codehaus.groovy.ast.stmt.ContinueStatement)), [visitDeclarationExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitDeclarationExpression(org.codehaus.groovy.ast.expr.DeclarationExpression)), [visitDoWhileLoop](../../org/codehaus/groovy/ast/codevisitorsupport#visitDoWhileLoop(org.codehaus.groovy.ast.stmt.DoWhileStatement)), [visitEmptyStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitEmptyStatement(org.codehaus.groovy.ast.stmt.EmptyStatement)), [visitExpressionStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitExpressionStatement(org.codehaus.groovy.ast.stmt.ExpressionStatement)), [visitFieldExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitFieldExpression(org.codehaus.groovy.ast.expr.FieldExpression)), [visitForLoop](../../org/codehaus/groovy/ast/codevisitorsupport#visitForLoop(org.codehaus.groovy.ast.stmt.ForStatement)), [visitGStringExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitGStringExpression(org.codehaus.groovy.ast.expr.GStringExpression)), [visitIfElse](../../org/codehaus/groovy/ast/codevisitorsupport#visitIfElse(org.codehaus.groovy.ast.stmt.IfStatement)), [visitLambdaExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitLambdaExpression(org.codehaus.groovy.ast.expr.LambdaExpression)), [visitListExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitListExpression(org.codehaus.groovy.ast.expr.ListExpression)), [visitMapEntryExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitMapEntryExpression(org.codehaus.groovy.ast.expr.MapEntryExpression)), [visitMapExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitMapExpression(org.codehaus.groovy.ast.expr.MapExpression)), [visitMethodCallExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitMethodCallExpression(org.codehaus.groovy.ast.expr.MethodCallExpression)), [visitMethodPointerExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitMethodPointerExpression(org.codehaus.groovy.ast.expr.MethodPointerExpression)), [visitMethodReferenceExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitMethodReferenceExpression(org.codehaus.groovy.ast.expr.MethodReferenceExpression)), [visitNotExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitNotExpression(org.codehaus.groovy.ast.expr.NotExpression)), [visitPostfixExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitPostfixExpression(org.codehaus.groovy.ast.expr.PostfixExpression)), [visitPrefixExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitPrefixExpression(org.codehaus.groovy.ast.expr.PrefixExpression)), [visitPropertyExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitPropertyExpression(org.codehaus.groovy.ast.expr.PropertyExpression)), [visitRangeExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitRangeExpression(org.codehaus.groovy.ast.expr.RangeExpression)), [visitReturnStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitReturnStatement(org.codehaus.groovy.ast.stmt.ReturnStatement)), [visitShortTernaryExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitShortTernaryExpression(org.codehaus.groovy.ast.expr.ElvisOperatorExpression)), [visitSpreadExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitSpreadExpression(org.codehaus.groovy.ast.expr.SpreadExpression)), [visitSpreadMapExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitSpreadMapExpression(org.codehaus.groovy.ast.expr.SpreadMapExpression)), [visitStaticMethodCallExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitStaticMethodCallExpression(org.codehaus.groovy.ast.expr.StaticMethodCallExpression)), [visitSwitch](../../org/codehaus/groovy/ast/codevisitorsupport#visitSwitch(org.codehaus.groovy.ast.stmt.SwitchStatement)), [visitSynchronizedStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitSynchronizedStatement(org.codehaus.groovy.ast.stmt.SynchronizedStatement)), [visitTernaryExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitTernaryExpression(org.codehaus.groovy.ast.expr.TernaryExpression)), [visitThrowStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitThrowStatement(org.codehaus.groovy.ast.stmt.ThrowStatement)), [visitTryCatchFinally](../../org/codehaus/groovy/ast/codevisitorsupport#visitTryCatchFinally(org.codehaus.groovy.ast.stmt.TryCatchStatement)), [visitTupleExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitTupleExpression(org.codehaus.groovy.ast.expr.TupleExpression)), [visitUnaryMinusExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitUnaryMinusExpression(org.codehaus.groovy.ast.expr.UnaryMinusExpression)), [visitUnaryPlusExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitUnaryPlusExpression(org.codehaus.groovy.ast.expr.UnaryPlusExpression)), [visitVariableExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitVariableExpression(org.codehaus.groovy.ast.expr.VariableExpression)), [visitWhileLoop](../../org/codehaus/groovy/ast/codevisitorsupport#visitWhileLoop(org.codehaus.groovy.ast.stmt.WhileStatement))` |
Method Detail
-------------
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getOrderBy**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **visitPropertyExpression**([PropertyExpression](../../org/codehaus/groovy/ast/expr/propertyexpression) expression)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **visitReturnStatement**([ReturnStatement](../../org/codehaus/groovy/ast/stmt/returnstatement) statement)
groovy [Java] Class SqlWhereVisitor [Java] Class SqlWhereVisitor
============================
* groovy.sql.SqlWhereVisitor
```
public class SqlWhereVisitor
extends [CodeVisitorSupport](../../org/codehaus/groovy/ast/codevisitorsupport)
```
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")>` | `**[getParameters](#getParameters())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[getWhere](#getWhere())**()` |
| | `protected [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[tokenAsSql](#tokenAsSql(org.codehaus.groovy.syntax.Token))**([Token](../../org/codehaus/groovy/syntax/token) token)` |
| | `public void` | `**[visitBinaryExpression](#visitBinaryExpression(org.codehaus.groovy.ast.expr.BinaryExpression))**([BinaryExpression](../../org/codehaus/groovy/ast/expr/binaryexpression) expression)` |
| | `public void` | `**[visitBooleanExpression](#visitBooleanExpression(org.codehaus.groovy.ast.expr.BooleanExpression))**([BooleanExpression](../../org/codehaus/groovy/ast/expr/booleanexpression) expression)` |
| | `public void` | `**[visitConstantExpression](#visitConstantExpression(org.codehaus.groovy.ast.expr.ConstantExpression))**([ConstantExpression](../../org/codehaus/groovy/ast/expr/constantexpression) expression)` |
| | `public void` | `**[visitPropertyExpression](#visitPropertyExpression(org.codehaus.groovy.ast.expr.PropertyExpression))**([PropertyExpression](../../org/codehaus/groovy/ast/expr/propertyexpression) expression)` |
| | `public void` | `**[visitReturnStatement](#visitReturnStatement(org.codehaus.groovy.ast.stmt.ReturnStatement))**([ReturnStatement](../../org/codehaus/groovy/ast/stmt/returnstatement) statement)` |
| | `public void` | `**[visitVariableExpression](#visitVariableExpression(org.codehaus.groovy.ast.expr.VariableExpression))**([VariableExpression](../../org/codehaus/groovy/ast/expr/variableexpression) expression)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [CodeVisitorSupport](../../org/codehaus/groovy/ast/codevisitorsupport)` | `[afterSwitchConditionExpressionVisited](../../org/codehaus/groovy/ast/codevisitorsupport#afterSwitchConditionExpressionVisited(org.codehaus.groovy.ast.stmt.SwitchStatement)), [visitArgumentlistExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitArgumentlistExpression(org.codehaus.groovy.ast.expr.ArgumentListExpression)), [visitArrayExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitArrayExpression(org.codehaus.groovy.ast.expr.ArrayExpression)), [visitAssertStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitAssertStatement(org.codehaus.groovy.ast.stmt.AssertStatement)), [visitAttributeExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitAttributeExpression(org.codehaus.groovy.ast.expr.AttributeExpression)), [visitBinaryExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitBinaryExpression(org.codehaus.groovy.ast.expr.BinaryExpression)), [visitBitwiseNegationExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitBitwiseNegationExpression(org.codehaus.groovy.ast.expr.BitwiseNegationExpression)), [visitBlockStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitBlockStatement(org.codehaus.groovy.ast.stmt.BlockStatement)), [visitBooleanExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitBooleanExpression(org.codehaus.groovy.ast.expr.BooleanExpression)), [visitBreakStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitBreakStatement(org.codehaus.groovy.ast.stmt.BreakStatement)), [visitBytecodeExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitBytecodeExpression(org.codehaus.groovy.classgen.BytecodeExpression)), [visitCaseStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitCaseStatement(org.codehaus.groovy.ast.stmt.CaseStatement)), [visitCastExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitCastExpression(org.codehaus.groovy.ast.expr.CastExpression)), [visitCatchStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitCatchStatement(org.codehaus.groovy.ast.stmt.CatchStatement)), [visitClassExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitClassExpression(org.codehaus.groovy.ast.expr.ClassExpression)), [visitClosureExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitClosureExpression(org.codehaus.groovy.ast.expr.ClosureExpression)), [visitClosureListExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitClosureListExpression(org.codehaus.groovy.ast.expr.ClosureListExpression)), [visitConstantExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitConstantExpression(org.codehaus.groovy.ast.expr.ConstantExpression)), [visitConstructorCallExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitConstructorCallExpression(org.codehaus.groovy.ast.expr.ConstructorCallExpression)), [visitContinueStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitContinueStatement(org.codehaus.groovy.ast.stmt.ContinueStatement)), [visitDeclarationExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitDeclarationExpression(org.codehaus.groovy.ast.expr.DeclarationExpression)), [visitDoWhileLoop](../../org/codehaus/groovy/ast/codevisitorsupport#visitDoWhileLoop(org.codehaus.groovy.ast.stmt.DoWhileStatement)), [visitEmptyStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitEmptyStatement(org.codehaus.groovy.ast.stmt.EmptyStatement)), [visitExpressionStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitExpressionStatement(org.codehaus.groovy.ast.stmt.ExpressionStatement)), [visitFieldExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitFieldExpression(org.codehaus.groovy.ast.expr.FieldExpression)), [visitForLoop](../../org/codehaus/groovy/ast/codevisitorsupport#visitForLoop(org.codehaus.groovy.ast.stmt.ForStatement)), [visitGStringExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitGStringExpression(org.codehaus.groovy.ast.expr.GStringExpression)), [visitIfElse](../../org/codehaus/groovy/ast/codevisitorsupport#visitIfElse(org.codehaus.groovy.ast.stmt.IfStatement)), [visitLambdaExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitLambdaExpression(org.codehaus.groovy.ast.expr.LambdaExpression)), [visitListExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitListExpression(org.codehaus.groovy.ast.expr.ListExpression)), [visitMapEntryExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitMapEntryExpression(org.codehaus.groovy.ast.expr.MapEntryExpression)), [visitMapExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitMapExpression(org.codehaus.groovy.ast.expr.MapExpression)), [visitMethodCallExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitMethodCallExpression(org.codehaus.groovy.ast.expr.MethodCallExpression)), [visitMethodPointerExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitMethodPointerExpression(org.codehaus.groovy.ast.expr.MethodPointerExpression)), [visitMethodReferenceExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitMethodReferenceExpression(org.codehaus.groovy.ast.expr.MethodReferenceExpression)), [visitNotExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitNotExpression(org.codehaus.groovy.ast.expr.NotExpression)), [visitPostfixExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitPostfixExpression(org.codehaus.groovy.ast.expr.PostfixExpression)), [visitPrefixExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitPrefixExpression(org.codehaus.groovy.ast.expr.PrefixExpression)), [visitPropertyExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitPropertyExpression(org.codehaus.groovy.ast.expr.PropertyExpression)), [visitRangeExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitRangeExpression(org.codehaus.groovy.ast.expr.RangeExpression)), [visitReturnStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitReturnStatement(org.codehaus.groovy.ast.stmt.ReturnStatement)), [visitShortTernaryExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitShortTernaryExpression(org.codehaus.groovy.ast.expr.ElvisOperatorExpression)), [visitSpreadExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitSpreadExpression(org.codehaus.groovy.ast.expr.SpreadExpression)), [visitSpreadMapExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitSpreadMapExpression(org.codehaus.groovy.ast.expr.SpreadMapExpression)), [visitStaticMethodCallExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitStaticMethodCallExpression(org.codehaus.groovy.ast.expr.StaticMethodCallExpression)), [visitSwitch](../../org/codehaus/groovy/ast/codevisitorsupport#visitSwitch(org.codehaus.groovy.ast.stmt.SwitchStatement)), [visitSynchronizedStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitSynchronizedStatement(org.codehaus.groovy.ast.stmt.SynchronizedStatement)), [visitTernaryExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitTernaryExpression(org.codehaus.groovy.ast.expr.TernaryExpression)), [visitThrowStatement](../../org/codehaus/groovy/ast/codevisitorsupport#visitThrowStatement(org.codehaus.groovy.ast.stmt.ThrowStatement)), [visitTryCatchFinally](../../org/codehaus/groovy/ast/codevisitorsupport#visitTryCatchFinally(org.codehaus.groovy.ast.stmt.TryCatchStatement)), [visitTupleExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitTupleExpression(org.codehaus.groovy.ast.expr.TupleExpression)), [visitUnaryMinusExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitUnaryMinusExpression(org.codehaus.groovy.ast.expr.UnaryMinusExpression)), [visitUnaryPlusExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitUnaryPlusExpression(org.codehaus.groovy.ast.expr.UnaryPlusExpression)), [visitVariableExpression](../../org/codehaus/groovy/ast/codevisitorsupport#visitVariableExpression(org.codehaus.groovy.ast.expr.VariableExpression)), [visitWhileLoop](../../org/codehaus/groovy/ast/codevisitorsupport#visitWhileLoop(org.codehaus.groovy.ast.stmt.WhileStatement))` |
Method Detail
-------------
### public [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> **getParameters**()
### public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **getWhere**()
### protected [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **tokenAsSql**([Token](../../org/codehaus/groovy/syntax/token) token)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **visitBinaryExpression**([BinaryExpression](../../org/codehaus/groovy/ast/expr/binaryexpression) expression)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **visitBooleanExpression**([BooleanExpression](../../org/codehaus/groovy/ast/expr/booleanexpression) expression)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **visitConstantExpression**([ConstantExpression](../../org/codehaus/groovy/ast/expr/constantexpression) expression)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **visitPropertyExpression**([PropertyExpression](../../org/codehaus/groovy/ast/expr/propertyexpression) expression)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **visitReturnStatement**([ReturnStatement](../../org/codehaus/groovy/ast/stmt/returnstatement) statement)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **visitVariableExpression**([VariableExpression](../../org/codehaus/groovy/ast/expr/variableexpression) expression)
| programming_docs |
groovy [Java] Class BatchingPreparedStatementWrapper [Java] Class BatchingPreparedStatementWrapper
=============================================
* groovy.sql.BatchingPreparedStatementWrapper
```
public class BatchingPreparedStatementWrapper
extends [BatchingStatementWrapper](batchingstatementwrapper)
```
Class which delegates to a PreparedStatement but keeps track of a batch count size. If the batch count reaches the predefined number, this Statement does an executeBatch() automatically. If batchSize is zero, then no batching is performed.
Inherited fields
| Fields inherited from class | Fields |
| **`class [BatchingStatementWrapper](batchingstatementwrapper)`** | `[batchCount](batchingstatementwrapper#batchCount), [batchSize](batchingstatementwrapper#batchSize), [log](batchingstatementwrapper#log), [results](batchingstatementwrapper#results)` |
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[BatchingPreparedStatementWrapper](#BatchingPreparedStatementWrapper(java.sql.PreparedStatement,%20List,%20int,%20java.util.logging.Logger,%20groovy.sql.Sql))**([PreparedStatement](https://docs.oracle.com/javase/8/docs/api/java/sql/PreparedStatement.html "PreparedStatement") delegate, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Tuple](../lang/tuple "Tuple")> indexPropList, int batchSize, [Logger](https://docs.oracle.com/javase/8/docs/api/java/util/logging/Logger.html "Logger") log, [Sql](sql) sql)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[addBatch](#addBatch(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] parameters)` |
| | `public void` | `**[addBatch](#addBatch(List))**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> parameters)` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [BatchingStatementWrapper](batchingstatementwrapper)` | `[addBatch](batchingstatementwrapper#addBatch(java.lang.String)), [clearBatch](batchingstatementwrapper#clearBatch()), [close](batchingstatementwrapper#close()), [executeBatch](batchingstatementwrapper#executeBatch()), [incrementBatchCount](batchingstatementwrapper#incrementBatchCount()), [invokeMethod](batchingstatementwrapper#invokeMethod(java.lang.String,%20java.lang.Object)), [processResult](batchingstatementwrapper#processResult(int%5B%5D)), [reset](batchingstatementwrapper#reset())` |
| `class [GroovyObjectSupport](../lang/groovyobjectsupport)` | `[getMetaClass](../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
### public **BatchingPreparedStatementWrapper**([PreparedStatement](https://docs.oracle.com/javase/8/docs/api/java/sql/PreparedStatement.html "PreparedStatement") delegate, [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Tuple](../lang/tuple "Tuple")> indexPropList, int batchSize, [Logger](https://docs.oracle.com/javase/8/docs/api/java/util/logging/Logger.html "Logger") log, [Sql](sql) sql)
Method Detail
-------------
### public void **addBatch**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")[] parameters)
### public void **addBatch**([List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "List")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> parameters)
groovy [Java] Class GroovyRowResult [Java] Class GroovyRowResult
============================
* groovy.sql.GroovyRowResult
All Implemented Interfaces and Traits: [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")
```
public class GroovyRowResult
extends [GroovyObjectSupport](../lang/groovyobjectsupport)
implements [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")
```
Represents an extent of objects. It's primarily used by methods of Groovy's [Sql](sql "Sql") class to return `ResultSet` data in map form; allowing access to the result of a SQL query by the name of the column, or by the column number.
Constructor Summary
-------------------
Constructors
| Constructor and description |
| `**[GroovyRowResult](#GroovyRowResult(Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> result)` |
Methods Summary
---------------
Methods
| Type Params | Return Type | Name and description |
| | `public void` | `**[clear](#clear())**()` |
| | `public boolean` | `**[containsKey](#containsKey(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") key)`Checks if the result contains (ignoring case) the given key. |
| | `public boolean` | `**[containsValue](#containsValue(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)` |
| | `public [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<Map.Entry<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")>>` | `**[entrySet](#entrySet())**()` |
| | `public boolean` | `**[equals](#equals(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[get](#get(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") property)`Find the property value for the given name (ignoring case). |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getAt](#getAt(int))**(int index)`Retrieve the value of the property by its index. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[getProperty](#getProperty(java.lang.String))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)`Retrieve the value of the property by its (case-insensitive) name. |
| | `public int` | `**[hashCode](#hashCode())**()` |
| | `public boolean` | `**[isEmpty](#isEmpty())**()` |
| | `public [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")>` | `**[keySet](#keySet())**()` |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[put](#put(java.lang.String,%20java.lang.Object))**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") key, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)`Associates the specified value with the specified property name in this result. |
| | `public void` | `**[putAll](#putAll(Map))**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<? extends [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), ?> t)`Copies all of the mappings from the specified map to this result. |
| | `public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")` | `**[remove](#remove(java.lang.Object))**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") rawKey)` |
| | `public int` | `**[size](#size())**()` |
| | `public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")` | `**[toString](#toString())**()` |
| | `public [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")>` | `**[values](#values())**()` |
Inherited Methods Summary
-------------------------
Inherited Methods
| Methods inherited from class | Name |
| `class [GroovyObjectSupport](../lang/groovyobjectsupport)` | `[getMetaClass](../lang/groovyobjectsupport#getMetaClass()), [setMetaClass](../lang/groovyobjectsupport#setMetaClass(groovy.lang.MetaClass))` |
Constructor Detail
------------------
### public **GroovyRowResult**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> result)
Method Detail
-------------
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **clear**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **containsKey**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") key)
Checks if the result contains (ignoring case) the given key.
**Parameters:**
`key` - the property name to look for
**Returns:**
true if the result contains this property name
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **containsValue**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<Map.Entry<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")>> **entrySet**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **equals**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") o)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **get**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") property)
Find the property value for the given name (ignoring case).
**Parameters:**
`property` - the name of the property to get
**Returns:**
the property value
### public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getAt**(int index)
Retrieve the value of the property by its index. A negative index will count backwards from the last column.
**Parameters:**
`index` - is the number of the column to look at
**Returns:**
the value of the property
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **getProperty**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") property)
Retrieve the value of the property by its (case-insensitive) name.
**Parameters:**
`property` - is the name of the property to look at
**Returns:**
the value of the property
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **hashCode**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public boolean **isEmpty**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Set](https://docs.oracle.com/javase/8/docs/api/java/util/Set.html "Set")<[String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String")> **keySet**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **put**([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") key, [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") value)
Associates the specified value with the specified property name in this result.
**Parameters:**
`key` - the property name for the result
`value` - the property value for the result
**Returns:**
the previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key.)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public void **putAll**([Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html "Map")<? extends [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String"), ?> t)
Copies all of the mappings from the specified map to this result. If the map contains different case versions of the same (case-insensitive) key only the last (according to the natural ordering of the supplied map) will remain after the `putAll` method has returned.
**Parameters:**
`t` - the mappings to store in this result
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") **remove**([Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object") rawKey)
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public int **size**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html "String") **toString**()
### @[Override](https://docs.oracle.com/javase/8/docs/api/java/lang/Override.html "Override") public [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html "Collection")<[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html "Object")> **values**()
matplotlib matplotlib.figure matplotlib.figure
=================
[`matplotlib.figure`](#module-matplotlib.figure "matplotlib.figure") implements the following classes:
[`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure")
Top level [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"), which holds all plot elements. Many methods are implemented in [`FigureBase`](#matplotlib.figure.FigureBase "matplotlib.figure.FigureBase").
[`SubFigure`](#matplotlib.figure.SubFigure "matplotlib.figure.SubFigure")
A logical figure inside a figure, usually added to a figure (or parent [`SubFigure`](#matplotlib.figure.SubFigure "matplotlib.figure.SubFigure")) with [`Figure.add_subfigure`](#matplotlib.figure.Figure.add_subfigure "matplotlib.figure.Figure.add_subfigure") or [`Figure.subfigures`](#matplotlib.figure.Figure.subfigures "matplotlib.figure.Figure.subfigures") methods (provisional API v3.4).
[`SubplotParams`](#matplotlib.figure.SubplotParams "matplotlib.figure.SubplotParams")
Control the default spacing between subplots.
*class*matplotlib.figure.Figure(*figsize=None*, *dpi=None*, *\**, *facecolor=None*, *edgecolor=None*, *linewidth=0.0*, *frameon=None*, *subplotpars=None*, *tight\_layout=None*, *constrained\_layout=None*, *layout=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2279-L3445)
The top level container for all the plot elements.
Attributes:
**patch**
The [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") instance representing the figure background patch.
**suppressComposite**
For multiple images, the figure will make composite images depending on the renderer option\_image\_nocomposite function. If *suppressComposite* is a boolean, this will override the renderer.
Parameters:
**figsize**2-tuple of floats, default: `[rcParams["figure.figsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.figsize#matplotlibrc-sample)` (default: `[6.4, 4.8]`)
Figure dimension `(width, height)` in inches.
**dpi**float, default: `[rcParams["figure.dpi"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.dpi#matplotlibrc-sample)` (default: `100.0`)
Dots per inch.
**facecolor**default: `[rcParams["figure.facecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.facecolor#matplotlibrc-sample)` (default: `'white'`)
The figure patch facecolor.
**edgecolor**default: `[rcParams["figure.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.edgecolor#matplotlibrc-sample)` (default: `'white'`)
The figure patch edge color.
**linewidth**float
The linewidth of the frame (i.e. the edge linewidth of the figure patch).
**frameon**bool, default: `[rcParams["figure.frameon"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.frameon#matplotlibrc-sample)` (default: `True`)
If `False`, suppress drawing the figure background patch.
**subplotpars**[`SubplotParams`](#matplotlib.figure.SubplotParams "matplotlib.figure.SubplotParams")
Subplot parameters. If not given, the default subplot parameters `[rcParams["figure.subplot.\*"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.subplot.*#matplotlibrc-sample)` are used.
**tight\_layout**bool or dict, default: `[rcParams["figure.autolayout"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.autolayout#matplotlibrc-sample)` (default: `False`)
Whether to use the tight layout mechanism. See [`set_tight_layout`](#matplotlib.figure.Figure.set_tight_layout "matplotlib.figure.Figure.set_tight_layout").
Discouraged
The use of this parameter is discouraged. Please use `layout='tight'` instead for the common case of `tight_layout=True` and use [`set_tight_layout`](#matplotlib.figure.Figure.set_tight_layout "matplotlib.figure.Figure.set_tight_layout") otherwise.
**constrained\_layout**bool, default: `[rcParams["figure.constrained\_layout.use"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.constrained_layout.use#matplotlibrc-sample)` (default: `False`)
This is equal to `layout='constrained'`.
Discouraged
The use of this parameter is discouraged. Please use `layout='constrained'` instead.
**layout**{'constrained', 'compressed', 'tight', [`LayoutEngine`](layout_engine_api#matplotlib.layout_engine.LayoutEngine "matplotlib.layout_engine.LayoutEngine"), None}
The layout mechanism for positioning of plot elements to avoid overlapping Axes decorations (labels, ticks, etc). Note that layout managers can have significant performance penalties. Defaults to *None*.
* 'constrained': The constrained layout solver adjusts axes sizes
to avoid overlapping axes decorations. Can handle complex plot layouts and colorbars, and is thus recommended.
See [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html) for examples.
* 'compressed': uses the same algorithm as 'constrained', but removes extra space between fixed-aspect-ratio Axes. Best for simple grids of axes.
* 'tight': Use the tight layout mechanism. This is a relatively simple algorithm that adjusts the subplot parameters so that decorations do not overlap. See [`Figure.set_tight_layout`](#matplotlib.figure.Figure.set_tight_layout "matplotlib.figure.Figure.set_tight_layout") for further details.
* A [`LayoutEngine`](layout_engine_api#matplotlib.layout_engine.LayoutEngine "matplotlib.layout_engine.LayoutEngine") instance. Builtin layout classes are [`ConstrainedLayoutEngine`](layout_engine_api#matplotlib.layout_engine.ConstrainedLayoutEngine "matplotlib.layout_engine.ConstrainedLayoutEngine") and [`TightLayoutEngine`](layout_engine_api#matplotlib.layout_engine.TightLayoutEngine "matplotlib.layout_engine.TightLayoutEngine"), more easily accessible by 'constrained' and 'tight'. Passing an instance allows third parties to provide their own layout engine.
If not given, fall back to using the parameters *tight\_layout* and *constrained\_layout*, including their config defaults `[rcParams["figure.autolayout"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.autolayout#matplotlibrc-sample)` (default: `False`) and `[rcParams["figure.constrained\_layout.use"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.constrained_layout.use#matplotlibrc-sample)` (default: `False`).
Other Parameters:
**\*\*kwargs**[`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") properties, optional
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`canvas`](#matplotlib.figure.Figure.set_canvas "matplotlib.figure.Figure.set_canvas") | FigureCanvas |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`constrained_layout`](#matplotlib.figure.Figure.set_constrained_layout "matplotlib.figure.Figure.set_constrained_layout") | unknown |
| [`constrained_layout_pads`](#matplotlib.figure.Figure.set_constrained_layout_pads "matplotlib.figure.Figure.set_constrained_layout_pads") | unknown |
| [`dpi`](#matplotlib.figure.Figure.set_dpi "matplotlib.figure.Figure.set_dpi") | float |
| [`edgecolor`](#matplotlib.figure.FigureBase.set_edgecolor "matplotlib.figure.FigureBase.set_edgecolor") | color |
| [`facecolor`](#matplotlib.figure.FigureBase.set_facecolor "matplotlib.figure.FigureBase.set_facecolor") | color |
| [`figheight`](#matplotlib.figure.Figure.set_figheight "matplotlib.figure.Figure.set_figheight") | float |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`figwidth`](#matplotlib.figure.Figure.set_figwidth "matplotlib.figure.Figure.set_figwidth") | float |
| [`frameon`](#matplotlib.figure.FigureBase.set_frameon "matplotlib.figure.FigureBase.set_frameon") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`layout_engine`](#matplotlib.figure.Figure.set_layout_engine "matplotlib.figure.Figure.set_layout_engine") | unknown |
| [`linewidth`](#matplotlib.figure.FigureBase.set_linewidth "matplotlib.figure.FigureBase.set_linewidth") | number |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`size_inches`](#matplotlib.figure.Figure.set_size_inches "matplotlib.figure.Figure.set_size_inches") | (float, float) or float |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`tight_layout`](#matplotlib.figure.Figure.set_tight_layout "matplotlib.figure.Figure.set_tight_layout") | unknown |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
add\_artist(*artist*, *clip=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L471-L504)
Add an [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") to the figure.
Usually artists are added to Axes objects using [`Axes.add_artist`](_as_gen/matplotlib.axes.axes.add_artist#matplotlib.axes.Axes.add_artist "matplotlib.axes.Axes.add_artist"); this method can be used in the rare cases where one needs to add artists directly to the figure instead.
Parameters:
**artist**[`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
The artist to add to the figure. If the added artist has no transform previously set, its transform will be set to `figure.transSubfigure`.
**clip**bool, default: False
Whether the added artist should be clipped by the figure patch.
Returns:
[`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
The added artist.
add\_axes(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L506-L617)
Add an Axes to the figure.
Call signatures:
```
add_axes(rect, projection=None, polar=False, **kwargs)
add_axes(ax)
```
Parameters:
**rect**tuple (left, bottom, width, height)
The dimensions (left, bottom, width, height) of the new Axes. All quantities are in fractions of figure width and height.
**projection**{None, 'aitoff', 'hammer', 'lambert', 'mollweide', 'polar', 'rectilinear', str}, optional
The projection type of the [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"). *str* is the name of a custom projection, see [`projections`](projections_api#module-matplotlib.projections "matplotlib.projections"). The default None results in a 'rectilinear' projection.
**polar**bool, default: False
If True, equivalent to projection='polar'.
**axes\_class**subclass type of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
The [`axes.Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") subclass that is instantiated. This parameter is incompatible with *projection* and *polar*. See [axisartist](https://matplotlib.org/stable/tutorials/toolkits/axisartist.html#axisartist-users-guide-index) for examples.
**sharex, sharey**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
Share the x or y [`axis`](axis_api#module-matplotlib.axis "matplotlib.axis") with sharex and/or sharey. The axis will have the same limits, ticks, and scale as the axis of the shared axes.
**label**str
A label for the returned Axes.
Returns:
[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), or a subclass of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The returned axes class depends on the projection used. It is [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") if rectilinear projection is used and [`projections.polar.PolarAxes`](projections_api#matplotlib.projections.polar.PolarAxes "matplotlib.projections.polar.PolarAxes") if polar projection is used.
Other Parameters:
**\*\*kwargs**
This method also takes the keyword arguments for the returned Axes class. The keyword arguments for the rectilinear Axes class [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") can be found in the following table but there might also be other keyword arguments if another projection is used, see the actual Axes class.
| Property | Description |
| --- | --- |
| [`adjustable`](_as_gen/matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](_as_gen/matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](_as_gen/matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](_as_gen/matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](_as_gen/matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](_as_gen/matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](_as_gen/matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](_as_gen/matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](_as_gen/matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](_as_gen/matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](_as_gen/matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](_as_gen/matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](_as_gen/matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](_as_gen/matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](_as_gen/matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](_as_gen/matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](_as_gen/matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](_as_gen/matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](_as_gen/matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xmargin`](_as_gen/matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](_as_gen/matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](_as_gen/matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](_as_gen/matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](_as_gen/matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](_as_gen/matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](_as_gen/matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ymargin`](_as_gen/matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](_as_gen/matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](_as_gen/matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](_as_gen/matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`Figure.add_subplot`](#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot")
[`pyplot.subplot`](_as_gen/matplotlib.pyplot.subplot#matplotlib.pyplot.subplot "matplotlib.pyplot.subplot")
[`pyplot.axes`](_as_gen/matplotlib.pyplot.axes#matplotlib.pyplot.axes "matplotlib.pyplot.axes")
[`Figure.subplots`](#matplotlib.figure.Figure.subplots "matplotlib.figure.Figure.subplots")
[`pyplot.subplots`](_as_gen/matplotlib.pyplot.subplots#matplotlib.pyplot.subplots "matplotlib.pyplot.subplots")
#### Notes
In rare circumstances, [`add_axes`](#matplotlib.figure.Figure.add_axes "matplotlib.figure.Figure.add_axes") may be called with a single argument, an Axes instance already created in the present figure but not in the figure's list of Axes.
#### Examples
Some simple examples:
```
rect = l, b, w, h
fig = plt.figure()
fig.add_axes(rect)
fig.add_axes(rect, frameon=False, facecolor='g')
fig.add_axes(rect, polar=True)
ax = fig.add_axes(rect, projection='polar')
fig.delaxes(ax)
fig.add_axes(ax)
```
add\_axobserver(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L3143-L3147)
Whenever the Axes state change, `func(self)` will be called.
add\_callback(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L348-L375)
Add a callback function that will be called whenever one of the [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")'s properties changes.
Parameters:
**func**callable
The callback function. It must have the signature:
```
def func(artist: Artist) -> Any
```
where *artist* is the calling [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"). Return values may exist but are ignored.
Returns:
int
The observer id associated with the callback. This id can be used for removing the callback with [`remove_callback`](#matplotlib.figure.Figure.remove_callback "matplotlib.figure.Figure.remove_callback") later.
See also
[`remove_callback`](#matplotlib.figure.Figure.remove_callback "matplotlib.figure.Figure.remove_callback")
add\_gridspec(*nrows=1*, *ncols=1*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1474-L1515)
Return a [`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec") that has this figure as a parent. This allows complex layout of Axes in the figure.
Parameters:
**nrows**int, default: 1
Number of rows in grid.
**ncols**int, default: 1
Number or columns in grid.
Returns:
[`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec")
Other Parameters:
**\*\*kwargs**
Keyword arguments are passed to [`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec").
See also
[`matplotlib.pyplot.subplots`](_as_gen/matplotlib.pyplot.subplots#matplotlib.pyplot.subplots "matplotlib.pyplot.subplots")
#### Examples
Adding a subplot that spans two rows:
```
fig = plt.figure()
gs = fig.add_gridspec(2, 2)
ax1 = fig.add_subplot(gs[0, 0])
ax2 = fig.add_subplot(gs[1, 0])
# spans two rows:
ax3 = fig.add_subplot(gs[:, 1])
```
add\_subfigure(*subplotspec*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1571-L1596)
Add a [`SubFigure`](#matplotlib.figure.SubFigure "matplotlib.figure.SubFigure") to the figure as part of a subplot arrangement.
Parameters:
**subplotspec**[`gridspec.SubplotSpec`](_as_gen/matplotlib.gridspec.subplotspec#matplotlib.gridspec.SubplotSpec "matplotlib.gridspec.SubplotSpec")
Defines the region in a parent gridspec where the subfigure will be placed.
Returns:
[`SubFigure`](#matplotlib.figure.SubFigure "matplotlib.figure.SubFigure")
Other Parameters:
**\*\*kwargs**
Are passed to the [`SubFigure`](#matplotlib.figure.SubFigure "matplotlib.figure.SubFigure") object.
See also
[`Figure.subfigures`](#matplotlib.figure.Figure.subfigures "matplotlib.figure.Figure.subfigures")
add\_subplot(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L619-L747)
Add an [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") to the figure as part of a subplot arrangement.
Call signatures:
```
add_subplot(nrows, ncols, index, **kwargs)
add_subplot(pos, **kwargs)
add_subplot(ax)
add_subplot()
```
Parameters:
**\*args**int, (int, int, *index*), or [`SubplotSpec`](_as_gen/matplotlib.gridspec.subplotspec#matplotlib.gridspec.SubplotSpec "matplotlib.gridspec.SubplotSpec"), default: (1, 1, 1)
The position of the subplot described by one of
* Three integers (*nrows*, *ncols*, *index*). The subplot will take the *index* position on a grid with *nrows* rows and *ncols* columns. *index* starts at 1 in the upper left corner and increases to the right. *index* can also be a two-tuple specifying the (*first*, *last*) indices (1-based, and including *last*) of the subplot, e.g., `fig.add_subplot(3, 1, (1, 2))` makes a subplot that spans the upper 2/3 of the figure.
* A 3-digit integer. The digits are interpreted as if given separately as three single-digit integers, i.e. `fig.add_subplot(235)` is the same as `fig.add_subplot(2, 3, 5)`. Note that this can only be used if there are no more than 9 subplots.
* A [`SubplotSpec`](_as_gen/matplotlib.gridspec.subplotspec#matplotlib.gridspec.SubplotSpec "matplotlib.gridspec.SubplotSpec").
In rare circumstances, [`add_subplot`](#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot") may be called with a single argument, a subplot Axes instance already created in the present figure but not in the figure's list of Axes.
**projection**{None, 'aitoff', 'hammer', 'lambert', 'mollweide', 'polar', 'rectilinear', str}, optional
The projection type of the subplot ([`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")). *str* is the name of a custom projection, see [`projections`](projections_api#module-matplotlib.projections "matplotlib.projections"). The default None results in a 'rectilinear' projection.
**polar**bool, default: False
If True, equivalent to projection='polar'.
**axes\_class**subclass type of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
The [`axes.Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") subclass that is instantiated. This parameter is incompatible with *projection* and *polar*. See [axisartist](https://matplotlib.org/stable/tutorials/toolkits/axisartist.html#axisartist-users-guide-index) for examples.
**sharex, sharey**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
Share the x or y [`axis`](axis_api#module-matplotlib.axis "matplotlib.axis") with sharex and/or sharey. The axis will have the same limits, ticks, and scale as the axis of the shared axes.
**label**str
A label for the returned Axes.
Returns:
[`axes.SubplotBase`](_as_gen/matplotlib.axes.subplotbase#matplotlib.axes.SubplotBase "matplotlib.axes.SubplotBase"), or another subclass of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The Axes of the subplot. The returned Axes base class depends on the projection used. It is [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") if rectilinear projection is used and [`projections.polar.PolarAxes`](projections_api#matplotlib.projections.polar.PolarAxes "matplotlib.projections.polar.PolarAxes") if polar projection is used. The returned Axes is then a subplot subclass of the base class.
Other Parameters:
**\*\*kwargs**
This method also takes the keyword arguments for the returned Axes base class; except for the *figure* argument. The keyword arguments for the rectilinear base class [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") can be found in the following table but there might also be other keyword arguments if another projection is used.
| Property | Description |
| --- | --- |
| [`adjustable`](_as_gen/matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](_as_gen/matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](_as_gen/matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](_as_gen/matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](_as_gen/matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](_as_gen/matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](_as_gen/matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](_as_gen/matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](_as_gen/matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](_as_gen/matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](_as_gen/matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](_as_gen/matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](_as_gen/matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](_as_gen/matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](_as_gen/matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](_as_gen/matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](_as_gen/matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](_as_gen/matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](_as_gen/matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xmargin`](_as_gen/matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](_as_gen/matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](_as_gen/matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](_as_gen/matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](_as_gen/matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](_as_gen/matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](_as_gen/matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ymargin`](_as_gen/matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](_as_gen/matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](_as_gen/matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](_as_gen/matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`Figure.add_axes`](#matplotlib.figure.Figure.add_axes "matplotlib.figure.Figure.add_axes")
[`pyplot.subplot`](_as_gen/matplotlib.pyplot.subplot#matplotlib.pyplot.subplot "matplotlib.pyplot.subplot")
[`pyplot.axes`](_as_gen/matplotlib.pyplot.axes#matplotlib.pyplot.axes "matplotlib.pyplot.axes")
[`Figure.subplots`](#matplotlib.figure.Figure.subplots "matplotlib.figure.Figure.subplots")
[`pyplot.subplots`](_as_gen/matplotlib.pyplot.subplots#matplotlib.pyplot.subplots "matplotlib.pyplot.subplots")
#### Examples
```
fig = plt.figure()
fig.add_subplot(231)
ax1 = fig.add_subplot(2, 3, 1) # equivalent but more general
fig.add_subplot(232, frameon=False) # subplot with no frame
fig.add_subplot(233, projection='polar') # polar subplot
fig.add_subplot(234, sharex=ax1) # subplot sharing x-axis with ax1
fig.add_subplot(235, facecolor="red") # red subplot
ax1.remove() # delete ax1 from the figure
fig.add_subplot(ax1) # add ax1 back to the figure
```
align\_labels(*axs=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1450-L1472)
Align the xlabels and ylabels of subplots with the same subplots row or column (respectively) if label alignment is being done automatically (i.e. the label position is not manually set).
Alignment persists for draw events after this is called.
Parameters:
**axs**list of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
Optional list (or ndarray) of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") to align the labels. Default is to align all Axes on the figure.
See also
[`matplotlib.figure.Figure.align_xlabels`](#matplotlib.figure.Figure.align_xlabels "matplotlib.figure.Figure.align_xlabels")
[`matplotlib.figure.Figure.align_ylabels`](#matplotlib.figure.Figure.align_ylabels "matplotlib.figure.Figure.align_ylabels")
align\_xlabels(*axs=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1325-L1386)
Align the xlabels of subplots in the same subplot column if label alignment is being done automatically (i.e. the label position is not manually set).
Alignment persists for draw events after this is called.
If a label is on the bottom, it is aligned with labels on Axes that also have their label on the bottom and that have the same bottom-most subplot row. If the label is on the top, it is aligned with labels on Axes with the same top-most row.
Parameters:
**axs**list of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
Optional list of (or ndarray) [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") to align the xlabels. Default is to align all Axes on the figure.
See also
[`matplotlib.figure.Figure.align_ylabels`](#matplotlib.figure.Figure.align_ylabels "matplotlib.figure.Figure.align_ylabels")
[`matplotlib.figure.Figure.align_labels`](#matplotlib.figure.Figure.align_labels "matplotlib.figure.Figure.align_labels")
#### Notes
This assumes that `axs` are from the same [`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec"), so that their [`SubplotSpec`](_as_gen/matplotlib.gridspec.subplotspec#matplotlib.gridspec.SubplotSpec "matplotlib.gridspec.SubplotSpec") positions correspond to figure positions.
#### Examples
Example with rotated xtick labels:
```
fig, axs = plt.subplots(1, 2)
for tick in axs[0].get_xticklabels():
tick.set_rotation(55)
axs[0].set_xlabel('XLabel 0')
axs[1].set_xlabel('XLabel 1')
fig.align_xlabels()
```
align\_ylabels(*axs=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1388-L1448)
Align the ylabels of subplots in the same subplot column if label alignment is being done automatically (i.e. the label position is not manually set).
Alignment persists for draw events after this is called.
If a label is on the left, it is aligned with labels on Axes that also have their label on the left and that have the same left-most subplot column. If the label is on the right, it is aligned with labels on Axes with the same right-most column.
Parameters:
**axs**list of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
Optional list (or ndarray) of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") to align the ylabels. Default is to align all Axes on the figure.
See also
[`matplotlib.figure.Figure.align_xlabels`](#matplotlib.figure.Figure.align_xlabels "matplotlib.figure.Figure.align_xlabels")
[`matplotlib.figure.Figure.align_labels`](#matplotlib.figure.Figure.align_labels "matplotlib.figure.Figure.align_labels")
#### Notes
This assumes that `axs` are from the same [`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec"), so that their [`SubplotSpec`](_as_gen/matplotlib.gridspec.subplotspec#matplotlib.gridspec.SubplotSpec "matplotlib.gridspec.SubplotSpec") positions correspond to figure positions.
#### Examples
Example with large yticks labels:
```
fig, axs = plt.subplots(2, 1)
axs[0].plot(np.arange(0, 1000, 50))
axs[0].set_ylabel('YLabel 0')
axs[1].set_ylabel('YLabel 1')
fig.align_ylabels()
```
autofmt\_xdate(*bottom=0.2*, *rotation=30*, *ha='right'*, *which='major'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L218-L259)
Date ticklabels often overlap, so it is useful to rotate them and right align them. Also, a common use case is a number of subplots with shared x-axis where the x-axis is date data. The ticklabels are often long, and it helps to rotate them on the bottom subplot and turn them off on other subplots, as well as turn off xlabels.
Parameters:
**bottom**float, default: 0.2
The bottom of the subplots for [`subplots_adjust`](#matplotlib.figure.Figure.subplots_adjust "matplotlib.figure.Figure.subplots_adjust").
**rotation**float, default: 30 degrees
The rotation angle of the xtick labels in degrees.
**ha**{'left', 'center', 'right'}, default: 'right'
The horizontal alignment of the xticklabels.
**which**{'major', 'minor', 'both'}, default: 'major'
Selects which ticklabels to rotate.
*property*axes
List of Axes in the Figure. You can access and modify the Axes in the Figure through this list.
Do not modify the list itself. Instead, use [`add_axes`](#matplotlib.figure.Figure.add_axes "matplotlib.figure.Figure.add_axes"), [`add_subplot`](#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot") or [`delaxes`](#matplotlib.figure.Figure.delaxes "matplotlib.figure.Figure.delaxes") to add or remove an Axes.
Note: The [`Figure.axes`](#matplotlib.figure.Figure.axes "matplotlib.figure.Figure.axes") property and [`get_axes`](#matplotlib.figure.Figure.get_axes "matplotlib.figure.Figure.get_axes") method are equivalent.
*property*callbacks[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
clear(*keep\_observers=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L3040-L3047)
Clear the figure.
Parameters:
**keep\_observers: bool, default: False**
Set *keep\_observers* to True if, for example, a gui widget is tracking the Axes in the figure.
clf(*keep\_observers=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L972-L986)
[*Discouraged*] Alias for the [`clear()`](#matplotlib.figure.Figure.clear "matplotlib.figure.Figure.clear") method.
Discouraged
The use of `clf()` is discouraged. Use `clear()` instead.
Parameters:
**keep\_observers: bool, default: False**
Set *keep\_observers* to True if, for example, a gui widget is tracking the Axes in the figure.
colorbar(*mappable*, *cax=None*, *ax=None*, *use\_gridspec=True*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1176-L1281)
Add a colorbar to a plot.
Parameters:
**mappable**
The [`matplotlib.cm.ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") (i.e., [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage"), [`ContourSet`](contour_api#matplotlib.contour.ContourSet "matplotlib.contour.ContourSet"), etc.) described by this colorbar. This argument is mandatory for the [`Figure.colorbar`](#matplotlib.figure.Figure.colorbar "matplotlib.figure.Figure.colorbar") method but optional for the [`pyplot.colorbar`](_as_gen/matplotlib.pyplot.colorbar#matplotlib.pyplot.colorbar "matplotlib.pyplot.colorbar") function, which sets the default to the current image.
Note that one can create a [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") "on-the-fly" to generate colorbars not attached to a previously drawn artist, e.g.
```
fig.colorbar(cm.ScalarMappable(norm=norm, cmap=cmap), ax=ax)
```
**cax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
Axes into which the colorbar will be drawn.
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), list of Axes, optional
One or more parent axes from which space for a new colorbar axes will be stolen, if *cax* is None. This has no effect if *cax* is set.
**use\_gridspec**bool, optional
If *cax* is `None`, a new *cax* is created as an instance of Axes. If *ax* is an instance of Subplot and *use\_gridspec* is `True`, *cax* is created as an instance of Subplot using the [`gridspec`](gridspec_api#module-matplotlib.gridspec "matplotlib.gridspec") module.
Returns:
**colorbar**[`Colorbar`](colorbar_api#matplotlib.colorbar.Colorbar "matplotlib.colorbar.Colorbar")
Other Parameters:
**location**None or {'left', 'right', 'top', 'bottom'}
The location, relative to the parent axes, where the colorbar axes is created. It also determines the *orientation* of the colorbar (colorbars on the left and right are vertical, colorbars at the top and bottom are horizontal). If None, the location will come from the *orientation* if it is set (vertical colorbars on the right, horizontal ones at the bottom), or default to 'right' if *orientation* is unset.
**orientation**None or {'vertical', 'horizontal'}
The orientation of the colorbar. It is preferable to set the *location* of the colorbar, as that also determines the *orientation*; passing incompatible values for *location* and *orientation* raises an exception.
**fraction**float, default: 0.15
Fraction of original axes to use for colorbar.
**shrink**float, default: 1.0
Fraction by which to multiply the size of the colorbar.
**aspect**float, default: 20
Ratio of long to short dimensions.
**pad**float, default: 0.05 if vertical, 0.15 if horizontal
Fraction of original axes between colorbar and new image axes.
**anchor**(float, float), optional
The anchor point of the colorbar axes. Defaults to (0.0, 0.5) if vertical; (0.5, 1.0) if horizontal.
**panchor**(float, float), or *False*, optional
The anchor point of the colorbar parent axes. If *False*, the parent axes' anchor will be unchanged. Defaults to (1.0, 0.5) if vertical; (0.5, 0.0) if horizontal.
**extend**{'neither', 'both', 'min', 'max'}
Make pointed end(s) for out-of-range values (unless 'neither'). These are set for a given colormap using the colormap set\_under and set\_over methods.
**extendfrac**{*None*, 'auto', length, lengths}
If set to *None*, both the minimum and maximum triangular colorbar extensions will have a length of 5% of the interior colorbar length (this is the default setting).
If set to 'auto', makes the triangular colorbar extensions the same lengths as the interior boxes (when *spacing* is set to 'uniform') or the same lengths as the respective adjacent interior boxes (when *spacing* is set to 'proportional').
If a scalar, indicates the length of both the minimum and maximum triangular colorbar extensions as a fraction of the interior colorbar length. A two-element sequence of fractions may also be given, indicating the lengths of the minimum and maximum colorbar extensions respectively as a fraction of the interior colorbar length.
**extendrect**bool
If *False* the minimum and maximum colorbar extensions will be triangular (the default). If *True* the extensions will be rectangular.
**spacing**{'uniform', 'proportional'}
For discrete colorbars ([`BoundaryNorm`](_as_gen/matplotlib.colors.boundarynorm#matplotlib.colors.BoundaryNorm "matplotlib.colors.BoundaryNorm") or contours), 'uniform' gives each color the same space; 'proportional' makes the space proportional to the data interval.
**ticks**None or list of ticks or Locator
If None, ticks are determined automatically from the input.
**format**None or str or Formatter
If None, [`ScalarFormatter`](ticker_api#matplotlib.ticker.ScalarFormatter "matplotlib.ticker.ScalarFormatter") is used. Format strings, e.g., `"%4.2e"` or `"{x:.2e}"`, are supported. An alternative [`Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter") may be given instead.
**drawedges**bool
Whether to draw lines at color boundaries.
**label**str
The label on the colorbar's long axis.
**boundaries, values**None or a sequence
If unset, the colormap will be displayed on a 0-1 scale. If sequences, *values* must have a length 1 less than *boundaries*. For each region delimited by adjacent entries in *boundaries*, the color mapped to the corresponding value in values will be used. Normally only useful for indexed colors (i.e. `norm=NoNorm()`) or other unusual circumstances.
#### Notes
If *mappable* is a [`ContourSet`](contour_api#matplotlib.contour.ContourSet "matplotlib.contour.ContourSet"), its *extend* kwarg is included automatically.
The *shrink* kwarg provides a simple way to scale the colorbar with respect to the axes. Note that if *cax* is specified, it determines the size of the colorbar and *shrink* and *aspect* kwargs are ignored.
For more precise control, you can manually specify the positions of the axes objects in which the mappable and the colorbar are drawn. In this case, do not use any of the axes properties kwargs.
It is known that some vector graphics viewers (svg and pdf) renders white gaps between segments of the colorbar. This is due to bugs in the viewers, not Matplotlib. As a workaround, the colorbar can be rendered with overlapping segments:
```
cbar = colorbar()
cbar.solids.set_edgecolor("face")
draw()
```
However this has negative consequences in other circumstances, e.g. with semi-transparent images (alpha < 1) and colorbar extensions; therefore, this workaround is not used by default (see issue #1188).
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L273-L285)
Test whether the mouse event occurred on the figure.
Returns:
bool, {}
convert\_xunits(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L241-L251)
Convert *x* using the unit type of the xaxis.
If the artist is not contained in an Axes or if the xaxis does not have units, *x* itself is returned.
convert\_yunits(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L253-L263)
Convert *y* using the unit type of the yaxis.
If the artist is not contained in an Axes or if the yaxis does not have units, *y* itself is returned.
delaxes(*ax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L899-L934)
Remove the [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") *ax* from the figure; update the current Axes.
*property*dpi
The resolution in dots per inch.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L3049-L3079)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
draw\_artist(*a*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L3090-L3094)
Draw [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") *a* only.
draw\_without\_rendering()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L3081-L3088)
Draw the figure with no output. Useful to get the final size of artists that require a draw before their size is known (e.g. text).
execute\_constrained\_layout(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L3390-L3403)
[*Deprecated*] Use `layoutgrid` to determine pos positions within Axes.
See also [`set_constrained_layout_pads`](#matplotlib.figure.Figure.set_constrained_layout_pads "matplotlib.figure.Figure.set_constrained_layout_pads").
Returns:
**layoutgrid**private debugging object
#### Notes
Deprecated since version 3.6: Use figure.get\_layout\_engine().execute() instead.
figimage(*X*, *xo=0*, *yo=0*, *alpha=None*, *norm=None*, *cmap=None*, *vmin=None*, *vmax=None*, *origin=None*, *resize=False*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2829-L2918)
Add a non-resampled image to the figure.
The image is attached to the lower or upper left corner depending on *origin*.
Parameters:
**X**
The image data. This is an array of one of the following shapes:
* (M, N): an image with scalar data. Color-mapping is controlled by *cmap*, *norm*, *vmin*, and *vmax*.
* (M, N, 3): an image with RGB values (0-1 float or 0-255 int).
* (M, N, 4): an image with RGBA values (0-1 float or 0-255 int), i.e. including transparency.
**xo, yo**int
The *x*/*y* image offset in pixels.
**alpha**None or float
The alpha blending value.
**cmap**str or [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"), default: `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
The Colormap instance or registered colormap name used to map scalar data to colors.
This parameter is ignored if *X* is RGB(A).
**norm**str or [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize"), optional
The normalization method used to scale scalar data to the [0, 1] range before mapping to colors using *cmap*. By default, a linear scaling is used, mapping the lowest value to 0 and the highest to 1.
If given, this can be one of the following:
* An instance of [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or one of its subclasses (see [Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html)).
* A scale name, i.e. one of "linear", "log", "symlog", "logit", etc. For a list of available scales, call [`matplotlib.scale.get_scale_names()`](scale_api#matplotlib.scale.get_scale_names "matplotlib.scale.get_scale_names"). In that case, a suitable [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") subclass is dynamically generated and instantiated.
This parameter is ignored if *X* is RGB(A).
**vmin, vmax**float, optional
When using scalar data and no explicit *norm*, *vmin* and *vmax* define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data. It is an error to use *vmin*/*vmax* when a *norm* instance is given (but using a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") *norm* name together with *vmin*/*vmax* is acceptable).
This parameter is ignored if *X* is RGB(A).
**origin**{'upper', 'lower'}, default: `[rcParams["image.origin"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.origin#matplotlibrc-sample)` (default: `'upper'`)
Indicates where the [0, 0] index of the array is in the upper left or lower left corner of the axes.
**resize**bool
If *True*, resize the figure to match the given image size.
Returns:
[`matplotlib.image.FigureImage`](image_api#matplotlib.image.FigureImage "matplotlib.image.FigureImage")
Other Parameters:
**\*\*kwargs**
Additional kwargs are [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") kwargs passed on to [`FigureImage`](image_api#matplotlib.image.FigureImage "matplotlib.image.FigureImage").
#### Notes
figimage complements the Axes image ([`imshow`](_as_gen/matplotlib.axes.axes.imshow#matplotlib.axes.Axes.imshow "matplotlib.axes.Axes.imshow")) which will be resampled to fit the current Axes. If you want a resampled image to fill the entire figure, you can define an [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") with extent [0, 0, 1, 1].
#### Examples
```
f = plt.figure()
nx = int(f.get_figwidth() * f.dpi)
ny = int(f.get_figheight() * f.dpi)
data = np.random.random((ny, nx))
f.figimage(data)
plt.show()
```
findobj(*match=None*, *include\_self=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1208-L1249)
Find artist objects.
Recursively find all [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") instances contained in the artist.
Parameters:
**match**
A filter criterion for the matches. This can be
* *None*: Return all objects contained in artist.
* A function with signature `def match(artist: Artist) -> bool`. The result will only contain artists for which the function returns *True*.
* A class instance: e.g., [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"). The result will only contain artists of this class or its subclasses (`isinstance` check).
**include\_self**bool
Include *self* in the list to be checked for a match.
Returns:
list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
format\_cursor\_data(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1282-L1336)
Return a string representation of *data*.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
The default implementation converts ints and floats and arrays of ints and floats into a comma-separated string enclosed in square brackets, unless the artist has an associated colorbar, in which case scalar values are formatted using the colorbar's formatter.
See also
[`get_cursor_data`](#matplotlib.figure.Figure.get_cursor_data "matplotlib.figure.Figure.get_cursor_data")
*property*frameon
Return the figure's background patch visibility, i.e. whether the figure background will be drawn. Equivalent to `Figure.patch.get_visible()`.
gca()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1604-L1615)
Get the current Axes.
If there is currently no Axes on this Figure, a new one is created using [`Figure.add_subplot`](#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot"). (To test whether there is currently an Axes on a Figure, check whether `figure.axes` is empty. To test whether there is currently a Figure on the pyplot figure stack, check whether [`pyplot.get_fignums()`](_as_gen/matplotlib.pyplot.get_fignums#matplotlib.pyplot.get_fignums "matplotlib.pyplot.get_fignums") is empty.)
get\_agg\_filter()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L929-L931)
Return filter function to be used for agg filter.
get\_alpha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L805-L810)
Return the alpha value used for blending - not supported on all backends.
get\_animated()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L816-L818)
Return whether the artist is animated.
get\_axes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2639-L2651)
List of Axes in the Figure. You can access and modify the Axes in the Figure through this list.
Do not modify the list itself. Instead, use [`add_axes`](#matplotlib.figure.Figure.add_axes "matplotlib.figure.Figure.add_axes"), [`add_subplot`](#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot") or [`delaxes`](#matplotlib.figure.Figure.delaxes "matplotlib.figure.Figure.delaxes") to add or remove an Axes.
Note: The [`Figure.axes`](#matplotlib.figure.Figure.axes "matplotlib.figure.Figure.axes") property and [`get_axes`](#matplotlib.figure.Figure.get_axes "matplotlib.figure.Figure.get_axes") method are equivalent.
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L261-L271)
Get a list of artists contained in the figure.
get\_clip\_box()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L859-L861)
Return the clipbox.
get\_clip\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L855-L857)
Return whether the artist uses clipping.
get\_clip\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L863-L865)
Return the clip path.
get\_constrained\_layout()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2714-L2720)
Return whether constrained layout is being used.
See [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html).
get\_constrained\_layout\_pads(*relative=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2786-L2817)
[*Deprecated*] Get padding for `constrained_layout`.
Returns a list of `w_pad, h_pad` in inches and `wspace` and `hspace` as fractions of the subplot. All values are None if `constrained_layout` is not used.
See [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html).
Parameters:
**relative**bool
If [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)"), then convert from inches to figure relative.
#### Notes
Deprecated since version 3.6: Use fig.get\_layout\_engine().get() instead.
get\_cursor\_data(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1251-L1280)
Return the cursor data for a given event.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
Cursor data can be used by Artists to provide additional context information for a given event. The default implementation just returns *None*.
Subclasses can override the method and return arbitrary data. However, when doing so, they must ensure that [`format_cursor_data`](#matplotlib.figure.Figure.format_cursor_data "matplotlib.figure.Figure.format_cursor_data") can convert the data to a string representation.
The only current use case is displaying the z-value of an [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") in the status bar of a plot window, while moving the mouse.
Parameters:
**event**[`matplotlib.backend_bases.MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
See also
[`format_cursor_data`](#matplotlib.figure.Figure.format_cursor_data "matplotlib.figure.Figure.format_cursor_data")
get\_default\_bbox\_extra\_artists()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1688-L1694)
get\_dpi()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2991-L2993)
Return the resolution in dots per inch as a float.
get\_edgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L404-L406)
Get the edge color of the Figure rectangle.
get\_facecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L408-L410)
Get the face color of the Figure rectangle.
get\_figheight()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2987-L2989)
Return the figure height in inches.
get\_figure()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L703-L705)
Return the [`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
get\_figwidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2983-L2985)
Return the figure width in inches.
get\_frameon()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L412-L418)
Return the figure's background patch visibility, i.e. whether the figure background will be drawn. Equivalent to `Figure.patch.get_visible()`.
get\_gid()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L588-L590)
Return the group id.
get\_in\_layout()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L820-L829)
Return boolean flag, `True` if artist is included in layout calculations.
E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
get\_label()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1056-L1058)
Return the label used for this artist in the legend.
get\_layout\_engine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2588-L2589)
get\_linewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L430-L434)
Get the line width of the Figure rectangle.
get\_mouseover()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1338-L1343)
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
get\_path\_effects()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L700-L701)
get\_picker()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L562-L572)
Return the picking behavior of the artist.
The possible values are described in [`set_picker`](#matplotlib.figure.Figure.set_picker "matplotlib.figure.Figure.set_picker").
See also
[`set_picker`](#matplotlib.figure.Figure.set_picker "matplotlib.figure.Figure.set_picker"), [`pickable`](#matplotlib.figure.Figure.pickable "matplotlib.figure.Figure.pickable"), [`pick`](#matplotlib.figure.Figure.pick "matplotlib.figure.Figure.pick")
get\_rasterized()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L904-L906)
Return whether the artist is to be rasterized.
get\_size\_inches()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2962-L2981)
Return the current size of the figure in inches.
Returns:
ndarray
The size (width, height) of the figure in inches.
See also
[`matplotlib.figure.Figure.set_size_inches`](#matplotlib.figure.Figure.set_size_inches "matplotlib.figure.Figure.set_size_inches")
[`matplotlib.figure.Figure.get_figwidth`](#matplotlib.figure.Figure.get_figwidth "matplotlib.figure.Figure.get_figwidth")
[`matplotlib.figure.Figure.get_figheight`](#matplotlib.figure.Figure.get_figheight "matplotlib.figure.Figure.get_figheight")
#### Notes
The size in pixels can be obtained by multiplying with [`Figure.dpi`](#matplotlib.figure.Figure.dpi "matplotlib.figure.Figure.dpi").
get\_sketch\_params()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L641-L659)
Return the sketch parameters for the artist.
Returns:
tuple or None
A 3-tuple with the following elements:
* *scale*: The amplitude of the wiggle perpendicular to the source line.
* *length*: The length of the wiggle along the line.
* *randomness*: The scale factor by which the length is shrunken or expanded.
Returns *None* if no sketch parameters were set.
get\_snap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L602-L611)
Return the snap setting.
See [`set_snap`](#matplotlib.figure.Figure.set_snap "matplotlib.figure.Figure.set_snap") for details.
get\_tight\_layout()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2684-L2686)
Return whether [`tight_layout`](#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout") is called when drawing.
get\_tightbbox(*renderer=None*, *bbox\_extra\_artists=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1696-L1765)
Return a (tight) bounding box of the figure *in inches*.
Note that [`FigureBase`](#matplotlib.figure.FigureBase "matplotlib.figure.FigureBase") differs from all other artists, which return their [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") in pixels.
Artists that have `artist.set_in_layout(False)` are not included in the bbox.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
**bbox\_extra\_artists**list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") or `None`
List of artists to include in the tight bounding box. If `None` (default), then all artist children of each Axes are included in the tight bounding box.
Returns:
[`BboxBase`](transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase")
containing the bounding box (in figure inches).
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L421-L428)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist.
get\_transformed\_clip\_path\_and\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L867-L875)
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
get\_url()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L574-L576)
Return the url.
get\_visible()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L812-L814)
Return the visibility.
get\_window\_extent(*renderer=None*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L287-L291)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
get\_zorder()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1076-L1078)
Return the artist's zorder.
ginput(*n=1*, *timeout=30*, *show\_clicks=True*, *mouse\_add=MouseButton.LEFT*, *mouse\_pop=MouseButton.RIGHT*, *mouse\_stop=MouseButton.MIDDLE*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L3274-L3368)
Blocking call to interact with a figure.
Wait until the user clicks *n* times on the figure, and return the coordinates of each click in a list.
There are three possible interactions:
* Add a point.
* Remove the most recently added point.
* Stop the interaction and return the points added so far.
The actions are assigned to mouse buttons via the arguments *mouse\_add*, *mouse\_pop* and *mouse\_stop*.
Parameters:
**n**int, default: 1
Number of mouse clicks to accumulate. If negative, accumulate clicks until the input is terminated manually.
**timeout**float, default: 30 seconds
Number of seconds to wait before timing out. If zero or negative will never timeout.
**show\_clicks**bool, default: True
If True, show a red cross at the location of each click.
**mouse\_add**[`MouseButton`](backend_bases_api#matplotlib.backend_bases.MouseButton "matplotlib.backend_bases.MouseButton") or None, default: [`MouseButton.LEFT`](backend_bases_api#matplotlib.backend_bases.MouseButton.LEFT "matplotlib.backend_bases.MouseButton.LEFT")
Mouse button used to add points.
**mouse\_pop**[`MouseButton`](backend_bases_api#matplotlib.backend_bases.MouseButton "matplotlib.backend_bases.MouseButton") or None, default: [`MouseButton.RIGHT`](backend_bases_api#matplotlib.backend_bases.MouseButton.RIGHT "matplotlib.backend_bases.MouseButton.RIGHT")
Mouse button used to remove the most recently added point.
**mouse\_stop**[`MouseButton`](backend_bases_api#matplotlib.backend_bases.MouseButton "matplotlib.backend_bases.MouseButton") or None, default: [`MouseButton.MIDDLE`](backend_bases_api#matplotlib.backend_bases.MouseButton.MIDDLE "matplotlib.backend_bases.MouseButton.MIDDLE")
Mouse button used to stop input.
Returns:
list of tuples
A list of the clicked (x, y) coordinates.
#### Notes
The keyboard can also be used to select points in case your mouse does not have one or more of the buttons. The delete and backspace keys act like right clicking (i.e., remove last point), the enter key terminates input and any other key (not already used by the window manager) selects a point.
have\_units()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L236-L239)
Return whether units are set on any axis.
is\_transform\_set()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L400-L406)
Return whether the Artist has an explicitly set transform.
This is *True* after [`set_transform`](#matplotlib.figure.Figure.set_transform "matplotlib.figure.Figure.set_transform") has been called.
legend(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L991-L1124)
Place a legend on the figure.
Call signatures:
```
legend()
legend(handles, labels)
legend(handles=handles)
legend(labels)
```
The call signatures correspond to the following different ways to use this method:
**1. Automatic detection of elements to be shown in the legend**
The elements to be added to the legend are automatically determined, when you do not pass in any extra arguments.
In this case, the labels are taken from the artist. You can specify them either at artist creation or by calling the [`set_label()`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") method on the artist:
```
ax.plot([1, 2, 3], label='Inline label')
fig.legend()
```
or:
```
line, = ax.plot([1, 2, 3])
line.set_label('Label via method')
fig.legend()
```
Specific lines can be excluded from the automatic legend element selection by defining a label starting with an underscore. This is default for all artists, so calling [`Figure.legend`](#matplotlib.figure.Figure.legend "matplotlib.figure.Figure.legend") without any arguments and without setting the labels manually will result in no legend being drawn.
**2. Explicitly listing the artists and labels in the legend**
For full control of which artists have a legend entry, it is possible to pass an iterable of legend artists followed by an iterable of legend labels respectively:
```
fig.legend([line1, line2, line3], ['label1', 'label2', 'label3'])
```
**3. Explicitly listing the artists in the legend**
This is similar to 2, but the labels are taken from the artists' label properties. Example:
```
line1, = ax1.plot([1, 2, 3], label='label1')
line2, = ax2.plot([1, 2, 3], label='label2')
fig.legend(handles=[line1, line2])
```
**4. Labeling existing plot elements**
Discouraged
This call signature is discouraged, because the relation between plot elements and labels is only implicit by their order and can easily be mixed up.
To make a legend for all artists on all Axes, call this function with an iterable of strings, one for each legend item. For example:
```
fig, (ax1, ax2) = plt.subplots(1, 2)
ax1.plot([1, 3, 5], color='blue')
ax2.plot([2, 4, 6], color='red')
fig.legend(['the blues', 'the reds'])
```
Parameters:
**handles**list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"), optional
A list of Artists (lines, patches) to be added to the legend. Use this together with *labels*, if you need full control on what is shown in the legend and the automatic mechanism described above is not sufficient.
The length of handles and labels should be the same in this case. If they are not, they are truncated to the smaller length.
**labels**list of str, optional
A list of labels to show next to the artists. Use this together with *handles*, if you need full control on what is shown in the legend and the automatic mechanism described above is not sufficient.
Returns:
[`Legend`](legend_api#matplotlib.legend.Legend "matplotlib.legend.Legend")
Other Parameters:
**loc**str or pair of floats, default: `[rcParams["legend.loc"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.loc#matplotlibrc-sample)` (default: `'best'`) ('best' for axes, 'upper right' for figures)
The location of the legend.
The strings `'upper left', 'upper right', 'lower left', 'lower right'` place the legend at the corresponding corner of the axes/figure.
The strings `'upper center', 'lower center', 'center left', 'center right'` place the legend at the center of the corresponding edge of the axes/figure.
The string `'center'` places the legend at the center of the axes/figure.
The string `'best'` places the legend at the location, among the nine locations defined so far, with the minimum overlap with other drawn artists. This option can be quite slow for plots with large amounts of data; your plotting speed may benefit from providing a specific location.
The location can also be a 2-tuple giving the coordinates of the lower-left corner of the legend in axes coordinates (in which case *bbox\_to\_anchor* will be ignored).
For back-compatibility, `'center right'` (but no other location) can also be spelled `'right'`, and each "string" locations can also be given as a numeric value:
| Location String | Location Code |
| --- | --- |
| 'best' | 0 |
| 'upper right' | 1 |
| 'upper left' | 2 |
| 'lower left' | 3 |
| 'lower right' | 4 |
| 'right' | 5 |
| 'center left' | 6 |
| 'center right' | 7 |
| 'lower center' | 8 |
| 'upper center' | 9 |
| 'center' | 10 |
**bbox\_to\_anchor**[`BboxBase`](transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase"), 2-tuple, or 4-tuple of floats
Box that is used to position the legend in conjunction with *loc*. Defaults to `axes.bbox` (if called as a method to [`Axes.legend`](_as_gen/matplotlib.axes.axes.legend#matplotlib.axes.Axes.legend "matplotlib.axes.Axes.legend")) or `figure.bbox` (if [`Figure.legend`](#matplotlib.figure.Figure.legend "matplotlib.figure.Figure.legend")). This argument allows arbitrary placement of the legend.
Bbox coordinates are interpreted in the coordinate system given by *bbox\_transform*, with the default transform Axes or Figure coordinates, depending on which `legend` is called.
If a 4-tuple or [`BboxBase`](transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase") is given, then it specifies the bbox `(x, y, width, height)` that the legend is placed in. To put the legend in the best location in the bottom right quadrant of the axes (or figure):
```
loc='best', bbox_to_anchor=(0.5, 0., 0.5, 0.5)
```
A 2-tuple `(x, y)` places the corner of the legend specified by *loc* at x, y. For example, to put the legend's upper right-hand corner in the center of the axes (or figure) the following keywords can be used:
```
loc='upper right', bbox_to_anchor=(0.5, 0.5)
```
**ncols**int, default: 1
The number of columns that the legend has.
For backward compatibility, the spelling *ncol* is also supported but it is discouraged. If both are given, *ncols* takes precedence.
**prop**None or [`matplotlib.font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or dict
The font properties of the legend. If None (default), the current [`matplotlib.rcParams`](matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams") will be used.
**fontsize**int or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}
The font size of the legend. If the value is numeric the size will be the absolute font size in points. String values are relative to the current default font size. This argument is only used if *prop* is not specified.
**labelcolor**str or list, default: `[rcParams["legend.labelcolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.labelcolor#matplotlibrc-sample)` (default: `'None'`)
The color of the text in the legend. Either a valid color string (for example, 'red'), or a list of color strings. The labelcolor can also be made to match the color of the line or marker using 'linecolor', 'markerfacecolor' (or 'mfc'), or 'markeredgecolor' (or 'mec').
Labelcolor can be set globally using `[rcParams["legend.labelcolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.labelcolor#matplotlibrc-sample)` (default: `'None'`). If None, use `[rcParams["text.color"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=text.color#matplotlibrc-sample)` (default: `'black'`).
**numpoints**int, default: `[rcParams["legend.numpoints"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.numpoints#matplotlibrc-sample)` (default: `1`)
The number of marker points in the legend when creating a legend entry for a [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") (line).
**scatterpoints**int, default: `[rcParams["legend.scatterpoints"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.scatterpoints#matplotlibrc-sample)` (default: `1`)
The number of marker points in the legend when creating a legend entry for a [`PathCollection`](collections_api#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection") (scatter plot).
**scatteryoffsets**iterable of floats, default: `[0.375, 0.5, 0.3125]`
The vertical offset (relative to the font size) for the markers created for a scatter plot legend entry. 0.0 is at the base the legend text, and 1.0 is at the top. To draw all markers at the same height, set to `[0.5]`.
**markerscale**float, default: `[rcParams["legend.markerscale"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.markerscale#matplotlibrc-sample)` (default: `1.0`)
The relative size of legend markers compared with the originally drawn ones.
**markerfirst**bool, default: True
If *True*, legend marker is placed to the left of the legend label. If *False*, legend marker is placed to the right of the legend label.
**frameon**bool, default: `[rcParams["legend.frameon"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.frameon#matplotlibrc-sample)` (default: `True`)
Whether the legend should be drawn on a patch (frame).
**fancybox**bool, default: `[rcParams["legend.fancybox"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.fancybox#matplotlibrc-sample)` (default: `True`)
Whether round edges should be enabled around the [`FancyBboxPatch`](_as_gen/matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") which makes up the legend's background.
**shadow**bool, default: `[rcParams["legend.shadow"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.shadow#matplotlibrc-sample)` (default: `False`)
Whether to draw a shadow behind the legend.
**framealpha**float, default: `[rcParams["legend.framealpha"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.framealpha#matplotlibrc-sample)` (default: `0.8`)
The alpha transparency of the legend's background. If *shadow* is activated and *framealpha* is `None`, the default value is ignored.
**facecolor**"inherit" or color, default: `[rcParams["legend.facecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.facecolor#matplotlibrc-sample)` (default: `'inherit'`)
The legend's background color. If `"inherit"`, use `[rcParams["axes.facecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.facecolor#matplotlibrc-sample)` (default: `'white'`).
**edgecolor**"inherit" or color, default: `[rcParams["legend.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.edgecolor#matplotlibrc-sample)` (default: `'0.8'`)
The legend's background patch edge color. If `"inherit"`, use take `[rcParams["axes.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.edgecolor#matplotlibrc-sample)` (default: `'black'`).
**mode**{"expand", None}
If *mode* is set to `"expand"` the legend will be horizontally expanded to fill the axes area (or *bbox\_to\_anchor* if defines the legend's size).
**bbox\_transform**None or [`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
The transform for the bounding box (*bbox\_to\_anchor*). For a value of `None` (default) the Axes' `transAxes` transform will be used.
**title**str or None
The legend's title. Default is no title (`None`).
**title\_fontproperties**None or [`matplotlib.font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or dict
The font properties of the legend's title. If None (default), the *title\_fontsize* argument will be used if present; if *title\_fontsize* is also None, the current `[rcParams["legend.title\_fontsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.title_fontsize#matplotlibrc-sample)` (default: `None`) will be used.
**title\_fontsize**int or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}, default: `[rcParams["legend.title\_fontsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.title_fontsize#matplotlibrc-sample)` (default: `None`)
The font size of the legend's title. Note: This cannot be combined with *title\_fontproperties*. If you want to set the fontsize alongside other font properties, use the *size* parameter in *title\_fontproperties*.
**alignment**{'center', 'left', 'right'}, default: 'center'
The alignment of the legend title and the box of entries. The entries are aligned as a single block, so that markers always lined up.
**borderpad**float, default: `[rcParams["legend.borderpad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.borderpad#matplotlibrc-sample)` (default: `0.4`)
The fractional whitespace inside the legend border, in font-size units.
**labelspacing**float, default: `[rcParams["legend.labelspacing"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.labelspacing#matplotlibrc-sample)` (default: `0.5`)
The vertical space between the legend entries, in font-size units.
**handlelength**float, default: `[rcParams["legend.handlelength"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.handlelength#matplotlibrc-sample)` (default: `2.0`)
The length of the legend handles, in font-size units.
**handleheight**float, default: `[rcParams["legend.handleheight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.handleheight#matplotlibrc-sample)` (default: `0.7`)
The height of the legend handles, in font-size units.
**handletextpad**float, default: `[rcParams["legend.handletextpad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.handletextpad#matplotlibrc-sample)` (default: `0.8`)
The pad between the legend handle and text, in font-size units.
**borderaxespad**float, default: `[rcParams["legend.borderaxespad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.borderaxespad#matplotlibrc-sample)` (default: `0.5`)
The pad between the axes and legend border, in font-size units.
**columnspacing**float, default: `[rcParams["legend.columnspacing"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.columnspacing#matplotlibrc-sample)` (default: `2.0`)
The spacing between columns, in font-size units.
**handler\_map**dict or None
The custom dictionary mapping instances or types to a legend handler. This *handler\_map* updates the default handler map found at [`matplotlib.legend.Legend.get_legend_handler_map`](legend_api#matplotlib.legend.Legend.get_legend_handler_map "matplotlib.legend.Legend.get_legend_handler_map").
See also
[`Axes.legend`](_as_gen/matplotlib.axes.axes.legend#matplotlib.axes.Axes.legend "matplotlib.axes.Axes.legend")
#### Notes
Some artists are not supported by this function. See [Legend guide](https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html) for details.
*property*mouseover
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
pchanged()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L387-L398)
Call all of the registered callbacks.
This function is triggered internally when a property is changed.
See also
[`add_callback`](#matplotlib.figure.Figure.add_callback "matplotlib.figure.Figure.add_callback")
[`remove_callback`](#matplotlib.figure.Figure.remove_callback "matplotlib.figure.Figure.remove_callback")
pick(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2499-L2501)
Process a pick event.
Each child artist will fire a pick event if *mouseevent* is over the artist and the artist has picker set.
See also
[`set_picker`](#matplotlib.figure.Figure.set_picker "matplotlib.figure.Figure.set_picker"), [`get_picker`](#matplotlib.figure.Figure.get_picker "matplotlib.figure.Figure.get_picker"), [`pickable`](#matplotlib.figure.Figure.pickable "matplotlib.figure.Figure.pickable")
pickable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L480-L488)
Return whether the artist is pickable.
See also
[`set_picker`](#matplotlib.figure.Figure.set_picker "matplotlib.figure.Figure.set_picker"), [`get_picker`](#matplotlib.figure.Figure.get_picker "matplotlib.figure.Figure.get_picker"), [`pick`](#matplotlib.figure.Figure.pick "matplotlib.figure.Figure.pick")
properties()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1139-L1141)
Return a dictionary of all the properties of the artist.
remove()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L193-L234)
Remove the artist from the figure if possible.
The effect will not be visible until the figure is redrawn, e.g., with [`FigureCanvasBase.draw_idle`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase.draw_idle "matplotlib.backend_bases.FigureCanvasBase.draw_idle"). Call [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") to update the axes limits if desired.
Note: [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") will not see collections even if the collection was added to the axes with *autolim* = True.
Note: there is no support for removing the artist's legend entry.
remove\_callback(*oid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L377-L385)
Remove a callback based on its observer id.
See also
[`add_callback`](#matplotlib.figure.Figure.add_callback "matplotlib.figure.Figure.add_callback")
savefig(*fname*, *\**, *transparent=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L3149-L3272)
Save the current figure.
Call signature:
```
savefig(fname, *, dpi='figure', format=None, metadata=None,
bbox_inches=None, pad_inches=0.1,
facecolor='auto', edgecolor='auto',
backend=None, **kwargs
)
```
The available output formats depend on the backend being used.
Parameters:
**fname**str or path-like or binary file-like
A path, or a Python file-like object, or possibly some backend-dependent object such as [`matplotlib.backends.backend_pdf.PdfPages`](backend_pdf_api#matplotlib.backends.backend_pdf.PdfPages "matplotlib.backends.backend_pdf.PdfPages").
If *format* is set, it determines the output format, and the file is saved as *fname*. Note that *fname* is used verbatim, and there is no attempt to make the extension, if any, of *fname* match *format*, and no extension is appended.
If *format* is not set, then the format is inferred from the extension of *fname*, if there is one. If *format* is not set and *fname* has no extension, then the file is saved with `[rcParams["savefig.format"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=savefig.format#matplotlibrc-sample)` (default: `'png'`) and the appropriate extension is appended to *fname*.
Other Parameters:
**dpi**float or 'figure', default: `[rcParams["savefig.dpi"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=savefig.dpi#matplotlibrc-sample)` (default: `'figure'`)
The resolution in dots per inch. If 'figure', use the figure's dpi value.
**format**str
The file format, e.g. 'png', 'pdf', 'svg', ... The behavior when this is unset is documented under *fname*.
**metadata**dict, optional
Key/value pairs to store in the image metadata. The supported keys and defaults depend on the image format and backend:
* 'png' with Agg backend: See the parameter `metadata` of [`print_png`](backend_agg_api#matplotlib.backends.backend_agg.FigureCanvasAgg.print_png "matplotlib.backends.backend_agg.FigureCanvasAgg.print_png").
* 'pdf' with pdf backend: See the parameter `metadata` of [`PdfPages`](backend_pdf_api#matplotlib.backends.backend_pdf.PdfPages "matplotlib.backends.backend_pdf.PdfPages").
* 'svg' with svg backend: See the parameter `metadata` of [`print_svg`](backend_svg_api#matplotlib.backends.backend_svg.FigureCanvasSVG.print_svg "matplotlib.backends.backend_svg.FigureCanvasSVG.print_svg").
* 'eps' and 'ps' with PS backend: Only 'Creator' is supported.
**bbox\_inches**str or [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox"), default: `[rcParams["savefig.bbox"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=savefig.bbox#matplotlibrc-sample)` (default: `None`)
Bounding box in inches: only the given portion of the figure is saved. If 'tight', try to figure out the tight bbox of the figure.
**pad\_inches**float, default: `[rcParams["savefig.pad\_inches"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=savefig.pad_inches#matplotlibrc-sample)` (default: `0.1`)
Amount of padding around the figure when bbox\_inches is 'tight'.
**facecolor**color or 'auto', default: `[rcParams["savefig.facecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=savefig.facecolor#matplotlibrc-sample)` (default: `'auto'`)
The facecolor of the figure. If 'auto', use the current figure facecolor.
**edgecolor**color or 'auto', default: `[rcParams["savefig.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=savefig.edgecolor#matplotlibrc-sample)` (default: `'auto'`)
The edgecolor of the figure. If 'auto', use the current figure edgecolor.
**backend**str, optional
Use a non-default backend to render the file, e.g. to render a png file with the "cairo" backend rather than the default "agg", or a pdf file with the "pgf" backend rather than the default "pdf". Note that the default backend is normally sufficient. See [The builtin backends](https://matplotlib.org/stable/users/explain/backends.html#the-builtin-backends) for a list of valid backends for each file format. Custom backends can be referenced as "module://...".
**orientation**{'landscape', 'portrait'}
Currently only supported by the postscript backend.
**papertype**str
One of 'letter', 'legal', 'executive', 'ledger', 'a0' through 'a10', 'b0' through 'b10'. Only supported for postscript output.
**transparent**bool
If *True*, the Axes patches will all be transparent; the Figure patch will also be transparent unless *facecolor* and/or *edgecolor* are specified via kwargs.
If *False* has no effect and the color of the Axes and Figure patches are unchanged (unless the Figure patch is specified via the *facecolor* and/or *edgecolor* keyword arguments in which case those colors are used).
The transparency of these patches will be restored to their original values upon exit of this function.
This is useful, for example, for displaying a plot on top of a colored background on a web page.
**bbox\_extra\_artists**list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"), optional
A list of extra artists that will be considered when the tight bbox is calculated.
**pil\_kwargs**dict, optional
Additional keyword arguments that are passed to [`PIL.Image.Image.save`](https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.save "(in Pillow (PIL Fork) v9.2.0)") when saving the figure.
sca(*a*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1598-L1602)
Set the current Axes to be *a* and return *a*.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *canvas=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *constrained\_layout=<UNSET>*, *constrained\_layout\_pads=<UNSET>*, *dpi=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *figheight=<UNSET>*, *figwidth=<UNSET>*, *frameon=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *layout\_engine=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *size\_inches=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *tight\_layout=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`canvas`](#matplotlib.figure.Figure.set_canvas "matplotlib.figure.Figure.set_canvas") | FigureCanvas |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`constrained_layout`](#matplotlib.figure.Figure.set_constrained_layout "matplotlib.figure.Figure.set_constrained_layout") | unknown |
| [`constrained_layout_pads`](#matplotlib.figure.Figure.set_constrained_layout_pads "matplotlib.figure.Figure.set_constrained_layout_pads") | unknown |
| [`dpi`](#matplotlib.figure.Figure.set_dpi "matplotlib.figure.Figure.set_dpi") | float |
| [`edgecolor`](#matplotlib.figure.FigureBase.set_edgecolor "matplotlib.figure.FigureBase.set_edgecolor") | color |
| [`facecolor`](#matplotlib.figure.FigureBase.set_facecolor "matplotlib.figure.FigureBase.set_facecolor") | color |
| [`figheight`](#matplotlib.figure.Figure.set_figheight "matplotlib.figure.Figure.set_figheight") | float |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`figwidth`](#matplotlib.figure.Figure.set_figwidth "matplotlib.figure.Figure.set_figwidth") | float |
| [`frameon`](#matplotlib.figure.FigureBase.set_frameon "matplotlib.figure.FigureBase.set_frameon") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`layout_engine`](#matplotlib.figure.Figure.set_layout_engine "matplotlib.figure.Figure.set_layout_engine") | unknown |
| [`linewidth`](#matplotlib.figure.FigureBase.set_linewidth "matplotlib.figure.FigureBase.set_linewidth") | number |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`size_inches`](#matplotlib.figure.Figure.set_size_inches "matplotlib.figure.Figure.set_size_inches") | (float, float) or float |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`tight_layout`](#matplotlib.figure.Figure.set_tight_layout "matplotlib.figure.Figure.set_tight_layout") | unknown |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_agg\_filter(*filter\_func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L933-L949)
Set the agg filter.
Parameters:
**filter\_func**callable
A filter function, which takes a (m, n, depth) float array and a dpi value, and returns a (m, n, depth) array and two offsets from the bottom left corner of the image
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L970-L986)
Set the alpha value used for blending - not supported on all backends.
Parameters:
**alpha**scalar or None
*alpha* must be within the 0-1 range, inclusive.
set\_animated(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1023-L1041)
Set whether the artist is intended to be used in an animation.
If True, the artist is excluded from regular drawing of the figure. You have to call [`Figure.draw_artist`](#matplotlib.figure.Figure.draw_artist "matplotlib.figure.Figure.draw_artist") / [`Axes.draw_artist`](_as_gen/matplotlib.axes.axes.draw_artist#matplotlib.axes.Axes.draw_artist "matplotlib.axes.Axes.draw_artist") explicitly on the artist. This approach is used to speed up animations using blitting.
See also [`matplotlib.animation`](animation_api#module-matplotlib.animation "matplotlib.animation") and [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html).
Parameters:
**b**bool
set\_canvas(*canvas*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2819-L2827)
Set the canvas that contains the figure
Parameters:
**canvas**FigureCanvas
set\_clip\_box(*clipbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L731-L741)
Set the artist's clip [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
Parameters:
**clipbox**[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
set\_clip\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L877-L892)
Set whether the artist uses clipping.
When False artists will be visible outside of the Axes which can lead to unexpected results.
Parameters:
**b**bool
set\_clip\_path(*path*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L743-L803)
Set the artist's clip path.
Parameters:
**path**[`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") or [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") or [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") or None
The clip path. If given a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), *transform* must be provided as well. If *None*, a previously set clip path is removed.
**transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
Only used if *path* is a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), in which case the given [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") is converted to a [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") using *transform*.
#### Notes
For efficiency, if *path* is a [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") this method will set the clipping box to the corresponding rectangle and set the clipping path to `None`.
For technical reasons (support of [`set`](_as_gen/matplotlib.artist.artist.set#matplotlib.artist.Artist.set "matplotlib.artist.Artist.set")), a tuple (*path*, *transform*) is also accepted as a single positional parameter.
set\_constrained\_layout(*constrained*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2722-L2750)
[*Deprecated*] [*Discouraged*] Set whether `constrained_layout` is used upon drawing.
If None, `[rcParams["figure.constrained\_layout.use"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.constrained_layout.use#matplotlibrc-sample)` (default: `False`) value will be used.
When providing a dict containing the keys `w_pad`, `h_pad` the default `constrained_layout` paddings will be overridden. These pads are in inches and default to 3.0/72.0. `w_pad` is the width padding and `h_pad` is the height padding.
Discouraged
This method is discouraged in favor of [`set_layout_engine`](#matplotlib.figure.Figure.set_layout_engine "matplotlib.figure.Figure.set_layout_engine").
Parameters:
**constrained**bool or dict or None
#### Notes
Deprecated since version 3.6: Use set\_layout\_engine('constrained') instead.
set\_constrained\_layout\_pads(*\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2752-L2784)
[*Deprecated*] Set padding for `constrained_layout`.
Tip: The parameters can be passed from a dictionary by using `fig.set_constrained_layout(**pad_dict)`.
See [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html).
Parameters:
**w\_pad**float, default: `[rcParams["figure.constrained\_layout.w\_pad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.constrained_layout.w_pad#matplotlibrc-sample)` (default: `0.04167`)
Width padding in inches. This is the pad around Axes and is meant to make sure there is enough room for fonts to look good. Defaults to 3 pts = 0.04167 inches
**h\_pad**float, default: `[rcParams["figure.constrained\_layout.h\_pad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.constrained_layout.h_pad#matplotlibrc-sample)` (default: `0.04167`)
Height padding in inches. Defaults to 3 pts.
**wspace**float, default: `[rcParams["figure.constrained\_layout.wspace"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.constrained_layout.wspace#matplotlibrc-sample)` (default: `0.02`)
Width padding between subplots, expressed as a fraction of the subplot width. The total padding ends up being w\_pad + wspace.
**hspace**float, default: `[rcParams["figure.constrained\_layout.hspace"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.constrained_layout.hspace#matplotlibrc-sample)` (default: `0.02`)
Height padding between subplots, expressed as a fraction of the subplot width. The total padding ends up being h\_pad + hspace.
#### Notes
Deprecated since version 3.6: Use figure.get\_layout\_engine().set() instead.
set\_dpi(*val*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2995-L3004)
Set the resolution of the figure in dots-per-inch.
Parameters:
**val**float
set\_edgecolor(*color*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L436-L444)
Set the edge color of the Figure rectangle.
Parameters:
**color**color
set\_facecolor(*color*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L446-L454)
Set the face color of the Figure rectangle.
Parameters:
**color**color
set\_figheight(*val*, *forward=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L3023-L3038)
Set the height of the figure in inches.
Parameters:
**val**float
**forward**bool
See [`set_size_inches`](#matplotlib.figure.Figure.set_size_inches "matplotlib.figure.Figure.set_size_inches").
See also
[`matplotlib.figure.Figure.set_figwidth`](#matplotlib.figure.Figure.set_figwidth "matplotlib.figure.Figure.set_figwidth")
[`matplotlib.figure.Figure.set_size_inches`](#matplotlib.figure.Figure.set_size_inches "matplotlib.figure.Figure.set_size_inches")
set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L707-L729)
Set the [`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
Parameters:
**fig**[`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure")
set\_figwidth(*val*, *forward=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L3006-L3021)
Set the width of the figure in inches.
Parameters:
**val**float
**forward**bool
See [`set_size_inches`](#matplotlib.figure.Figure.set_size_inches "matplotlib.figure.Figure.set_size_inches").
See also
[`matplotlib.figure.Figure.set_figheight`](#matplotlib.figure.Figure.set_figheight "matplotlib.figure.Figure.set_figheight")
[`matplotlib.figure.Figure.set_size_inches`](#matplotlib.figure.Figure.set_size_inches "matplotlib.figure.Figure.set_size_inches")
set\_frameon(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L456-L467)
Set the figure's background patch visibility, i.e. whether the figure background will be drawn. Equivalent to `Figure.patch.set_visible()`.
Parameters:
**b**bool
set\_gid(*gid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L592-L600)
Set the (group) id for the artist.
Parameters:
**gid**str
set\_in\_layout(*in\_layout*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1043-L1054)
Set if artist is to be included in layout calculations, E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
Parameters:
**in\_layout**bool
set\_label(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1060-L1074)
Set a label that will be displayed in the legend.
Parameters:
**s**object
*s* will be converted to a string by calling [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)").
set\_layout\_engine(*layout=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2522-L2586)
Set the layout engine for this figure.
Parameters:
**layout: {'constrained', 'compressed', 'tight', 'none'} or `LayoutEngine` or None**
* 'constrained' will use [`ConstrainedLayoutEngine`](layout_engine_api#matplotlib.layout_engine.ConstrainedLayoutEngine "matplotlib.layout_engine.ConstrainedLayoutEngine")
* 'compressed' will also use [`ConstrainedLayoutEngine`](layout_engine_api#matplotlib.layout_engine.ConstrainedLayoutEngine "matplotlib.layout_engine.ConstrainedLayoutEngine"), but with a correction that attempts to make a good layout for fixed-aspect ratio Axes.
* 'tight' uses [`TightLayoutEngine`](layout_engine_api#matplotlib.layout_engine.TightLayoutEngine "matplotlib.layout_engine.TightLayoutEngine")
* 'none' removes layout engine.
If [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), the behavior is controlled by `[rcParams["figure.autolayout"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.autolayout#matplotlibrc-sample)` (default: `False`) (which if [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)") behaves as if 'tight' were passed) and `[rcParams["figure.constrained\_layout.use"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.constrained_layout.use#matplotlibrc-sample)` (default: `False`) (which if [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)") behaves as if 'constrained' were passed). If both are [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)"), `[rcParams["figure.autolayout"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.autolayout#matplotlibrc-sample)` (default: `False`) takes priority.
Users and libraries can define their own layout engines and pass the instance directly as well.
**kwargs: dict**
The keyword arguments are passed to the layout engine to set things like padding and margin sizes. Only used if *layout* is a string.
set\_linewidth(*linewidth*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L420-L428)
Set the line width of the Figure rectangle.
Parameters:
**linewidth**number
set\_mouseover(*mouseover*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1345-L1366)
Set whether this artist is queried for custom context information when the mouse cursor moves over it.
Parameters:
**mouseover**bool
See also
[`get_cursor_data`](#matplotlib.figure.Figure.get_cursor_data "matplotlib.figure.Figure.get_cursor_data")
[`ToolCursorPosition`](backend_tools_api#matplotlib.backend_tools.ToolCursorPosition "matplotlib.backend_tools.ToolCursorPosition")
[`NavigationToolbar2`](backend_bases_api#matplotlib.backend_bases.NavigationToolbar2 "matplotlib.backend_bases.NavigationToolbar2")
set\_path\_effects(*path\_effects*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L689-L698)
Set the path effects.
Parameters:
**path\_effects**[`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
set\_picker(*picker*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L527-L560)
Define the picking behavior of the artist.
Parameters:
**picker**None or bool or float or callable
This can be one of the following:
* *None*: Picking is disabled for this artist (default).
* A boolean: If *True* then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist.
* A float: If picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if its data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event
* A function: If picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event:
```
hit, props = picker(artist, mouseevent)
```
to determine the hit test. if the mouse event is over the artist, return *hit=True* and props is a dictionary of properties you want added to the PickEvent attributes.
set\_rasterized(*rasterized*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L908-L927)
Force rasterized (bitmap) drawing for vector graphics output.
Rasterized drawing is not supported by all artists. If you try to enable this on an artist that does not support it, the command has no effect and a warning will be issued.
This setting is ignored for pixel-based output.
See also [Rasterization for vector graphics](https://matplotlib.org/stable/gallery/misc/rasterization_demo.html).
Parameters:
**rasterized**bool
set\_size\_inches(*w*, *h=None*, *forward=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2920-L2960)
Set the figure size in inches.
Call signatures:
```
fig.set_size_inches(w, h) # OR
fig.set_size_inches((w, h))
```
Parameters:
**w**(float, float) or float
Width and height in inches (if height not specified as a separate argument) or width.
**h**float
Height in inches.
**forward**bool, default: True
If `True`, the canvas size is automatically updated, e.g., you can resize the figure window from the shell.
See also
[`matplotlib.figure.Figure.get_size_inches`](#matplotlib.figure.Figure.get_size_inches "matplotlib.figure.Figure.get_size_inches")
[`matplotlib.figure.Figure.set_figwidth`](#matplotlib.figure.Figure.set_figwidth "matplotlib.figure.Figure.set_figwidth")
[`matplotlib.figure.Figure.set_figheight`](#matplotlib.figure.Figure.set_figheight "matplotlib.figure.Figure.set_figheight")
#### Notes
To transform from pixels to inches divide by [`Figure.dpi`](#matplotlib.figure.Figure.dpi "matplotlib.figure.Figure.dpi").
set\_sketch\_params(*scale=None*, *length=None*, *randomness=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L661-L687)
Set the sketch parameters.
Parameters:
**scale**float, optional
The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), or not provided, no sketch filter will be provided.
**length**float, optional
The length of the wiggle along the line, in pixels (default 128.0)
**randomness**float, optional
The scale factor by which the length is shrunken or expanded (default 16.0)
The PGF backend uses this argument as an RNG seed and not as described above. Using the same seed yields the same random shape.
set\_snap(*snap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L613-L639)
Set the snapping behavior.
Snapping aligns positions with the pixel grid, which results in clearer images. For example, if a black line of 1px width was defined at a position in between two pixels, the resulting image would contain the interpolated value of that line in the pixel grid, which would be a grey value on both adjacent pixel positions. In contrast, snapping will move the line to the nearest integer pixel value, so that the resulting image will really contain a 1px wide black line.
Snapping is currently only supported by the Agg and MacOSX backends.
Parameters:
**snap**bool or None
Possible values:
* *True*: Snap vertices to the nearest pixel center.
* *False*: Do not modify vertex positions.
* *None*: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center.
set\_tight\_layout(*tight*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2688-L2712)
[*Deprecated*] [*Discouraged*] Set whether and how [`tight_layout`](#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout") is called when drawing.
Discouraged
This method is discouraged in favor of [`set_layout_engine`](#matplotlib.figure.Figure.set_layout_engine "matplotlib.figure.Figure.set_layout_engine").
Parameters:
**tight**bool or dict with keys "pad", "w\_pad", "h\_pad", "rect" or None
If a bool, sets whether to call [`tight_layout`](#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout") upon drawing. If `None`, use `[rcParams["figure.autolayout"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.autolayout#matplotlibrc-sample)` (default: `False`) instead. If a dict, pass it as kwargs to [`tight_layout`](#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), overriding the default paddings.
#### Notes
Deprecated since version 3.6: Use set\_layout\_engine instead.
set\_transform(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L408-L419)
Set the artist transform.
Parameters:
**t**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_url(*url*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L578-L586)
Set the url for the artist.
Parameters:
**url**str
set\_visible(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1011-L1021)
Set the artist's visibility.
Parameters:
**b**bool
set\_zorder(*level*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1080-L1093)
Set the zorder for the artist. Artists with lower zorder values are drawn first.
Parameters:
**level**float
show(*warn=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2602-L2637)
If using a GUI backend with pyplot, display the figure window.
If the figure was not created using [`figure`](_as_gen/matplotlib.pyplot.figure#matplotlib.pyplot.figure "matplotlib.pyplot.figure"), it will lack a [`FigureManagerBase`](backend_bases_api#matplotlib.backend_bases.FigureManagerBase "matplotlib.backend_bases.FigureManagerBase"), and this method will raise an AttributeError.
Warning
This does not manage an GUI event loop. Consequently, the figure may only be shown briefly or not shown at all if you or your environment are not managing an event loop.
Proper use cases for [`Figure.show`](#matplotlib.figure.Figure.show "matplotlib.figure.Figure.show") include running this from a GUI application or an IPython shell.
If you're running a pure python shell or executing a non-GUI python script, you should use [`matplotlib.pyplot.show`](_as_gen/matplotlib.pyplot.show#matplotlib.pyplot.show "matplotlib.pyplot.show") instead, which takes care of managing the event loop for you.
Parameters:
**warn**bool, default: True
If `True` and we are not running headless (i.e. on Linux with an unset DISPLAY), issue warning when called on a non-GUI backend.
*property*stale
Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist.
*property*sticky\_edges
`x` and `y` sticky edge lists for autoscaling.
When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added--the view limit "sticks" to the edge. A typical use case is histograms, where one usually expects no margin on the bottom edge (0) of the histogram.
Moreover, margin expansion "bumps" against sticky edges and cannot cross them. For example, if the upper data limit is 1.0, the upper view limit computed by simple margin application is 1.2, but there is a sticky edge at 1.1, then the actual upper view limit will be 1.1.
This attribute cannot be assigned to; however, the `x` and `y` lists can be modified in place as needed.
#### Examples
```
>>> artist.sticky_edges.x[:] = (xmin, xmax)
>>> artist.sticky_edges.y[:] = (ymin, ymax)
```
subfigures(*nrows=1*, *ncols=1*, *squeeze=True*, *wspace=None*, *hspace=None*, *width\_ratios=None*, *height\_ratios=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1517-L1569)
Add a subfigure to this figure or subfigure.
A subfigure has the same artist methods as a figure, and is logically the same as a figure, but cannot print itself. See [Figure subfigures](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subfigures.html).
Parameters:
**nrows, ncols**int, default: 1
Number of rows/columns of the subfigure grid.
**squeeze**bool, default: True
If True, extra dimensions are squeezed out from the returned array of subfigures.
**wspace, hspace**float, default: None
The amount of width/height reserved for space between subfigures, expressed as a fraction of the average subfigure width/height. If not given, the values will be inferred from a figure or rcParams when necessary.
**width\_ratios**array-like of length *ncols*, optional
Defines the relative widths of the columns. Each column gets a relative width of `width_ratios[i] / sum(width_ratios)`. If not given, all columns will have the same width.
**height\_ratios**array-like of length *nrows*, optional
Defines the relative heights of the rows. Each row gets a relative height of `height_ratios[i] / sum(height_ratios)`. If not given, all rows will have the same height.
subplot\_mosaic(*mosaic*, *\**, *sharex=False*, *sharey=False*, *width\_ratios=None*, *height\_ratios=None*, *empty\_sentinel='.'*, *subplot\_kw=None*, *gridspec\_kw=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1777-L2054)
Build a layout of Axes based on ASCII art or nested lists.
This is a helper function to build complex GridSpec layouts visually.
Note
This API is provisional and may be revised in the future based on early user feedback.
See [Complex and semantic figure composition](https://matplotlib.org/stable/tutorials/provisional/mosaic.html) for an example and full API documentation
Parameters:
**mosaic**list of list of {hashable or nested} or str
A visual layout of how you want your Axes to be arranged labeled as strings. For example
```
x = [['A panel', 'A panel', 'edge'],
['C panel', '.', 'edge']]
```
produces 4 Axes:
* 'A panel' which is 1 row high and spans the first two columns
* 'edge' which is 2 rows high and is on the right edge
* 'C panel' which in 1 row and 1 column wide in the bottom left
* a blank space 1 row and 1 column wide in the bottom center
Any of the entries in the layout can be a list of lists of the same form to create nested layouts.
If input is a str, then it can either be a multi-line string of the form
```
'''
AAE
C.E
'''
```
where each character is a column and each line is a row. Or it can be a single-line string where rows are separated by `;`:
```
'AB;CC'
```
The string notation allows only single character Axes labels and does not support nesting but is very terse.
**sharex, sharey**bool, default: False
If True, the x-axis (*sharex*) or y-axis (*sharey*) will be shared among all subplots. In that case, tick label visibility and axis units behave as for [`subplots`](#matplotlib.figure.Figure.subplots "matplotlib.figure.Figure.subplots"). If False, each subplot's x- or y-axis will be independent.
**width\_ratios**array-like of length *ncols*, optional
Defines the relative widths of the columns. Each column gets a relative width of `width_ratios[i] / sum(width_ratios)`. If not given, all columns will have the same width. Equivalent to `gridspec_kw={'width_ratios': [...]}`.
**height\_ratios**array-like of length *nrows*, optional
Defines the relative heights of the rows. Each row gets a relative height of `height_ratios[i] / sum(height_ratios)`. If not given, all rows will have the same height. Equivalent to `gridspec_kw={'height_ratios': [...]}`.
**subplot\_kw**dict, optional
Dictionary with keywords passed to the [`Figure.add_subplot`](#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot") call used to create each subplot.
**gridspec\_kw**dict, optional
Dictionary with keywords passed to the [`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec") constructor used to create the grid the subplots are placed on.
**empty\_sentinel**object, optional
Entry in the layout to mean "leave this space empty". Defaults to `'.'`. Note, if *layout* is a string, it is processed via [`inspect.cleandoc`](https://docs.python.org/3/library/inspect.html#inspect.cleandoc "(in Python v3.10)") to remove leading white space, which may interfere with using white-space as the empty sentinel.
Returns:
dict[label, Axes]
A dictionary mapping the labels to the Axes objects. The order of the axes is left-to-right and top-to-bottom of their position in the total layout.
subplots(*nrows=1*, *ncols=1*, *\**, *sharex=False*, *sharey=False*, *squeeze=True*, *width\_ratios=None*, *height\_ratios=None*, *subplot\_kw=None*, *gridspec\_kw=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L762-L897)
Add a set of subplots to this figure.
This utility wrapper makes it convenient to create common layouts of subplots in a single call.
Parameters:
**nrows, ncols**int, default: 1
Number of rows/columns of the subplot grid.
**sharex, sharey**bool or {'none', 'all', 'row', 'col'}, default: False
Controls sharing of x-axis (*sharex*) or y-axis (*sharey*):
* True or 'all': x- or y-axis will be shared among all subplots.
* False or 'none': each subplot x- or y-axis will be independent.
* 'row': each subplot row will share an x- or y-axis.
* 'col': each subplot column will share an x- or y-axis.
When subplots have a shared x-axis along a column, only the x tick labels of the bottom subplot are created. Similarly, when subplots have a shared y-axis along a row, only the y tick labels of the first column subplot are created. To later turn other subplots' ticklabels on, use [`tick_params`](_as_gen/matplotlib.axes.axes.tick_params#matplotlib.axes.Axes.tick_params "matplotlib.axes.Axes.tick_params").
When subplots have a shared axis that has units, calling [`Axis.set_units`](_as_gen/matplotlib.axis.axis.set_units#matplotlib.axis.Axis.set_units "matplotlib.axis.Axis.set_units") will update each axis with the new units.
**squeeze**bool, default: True
* If True, extra dimensions are squeezed out from the returned array of Axes:
+ if only one subplot is constructed (nrows=ncols=1), the resulting single Axes object is returned as a scalar.
+ for Nx1 or 1xM subplots, the returned object is a 1D numpy object array of Axes objects.
+ for NxM, subplots with N>1 and M>1 are returned as a 2D array.
* If False, no squeezing at all is done: the returned Axes object is always a 2D array containing Axes instances, even if it ends up being 1x1.
**width\_ratios**array-like of length *ncols*, optional
Defines the relative widths of the columns. Each column gets a relative width of `width_ratios[i] / sum(width_ratios)`. If not given, all columns will have the same width. Equivalent to `gridspec_kw={'width_ratios': [...]}`.
**height\_ratios**array-like of length *nrows*, optional
Defines the relative heights of the rows. Each row gets a relative height of `height_ratios[i] / sum(height_ratios)`. If not given, all rows will have the same height. Equivalent to `gridspec_kw={'height_ratios': [...]}`.
**subplot\_kw**dict, optional
Dict with keywords passed to the [`Figure.add_subplot`](#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot") call used to create each subplot.
**gridspec\_kw**dict, optional
Dict with keywords passed to the [`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec") constructor used to create the grid the subplots are placed on.
Returns:
[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") or array of Axes
Either a single [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") object or an array of Axes objects if more than one subplot was created. The dimensions of the resulting array can be controlled with the *squeeze* keyword, see above.
See also
[`pyplot.subplots`](_as_gen/matplotlib.pyplot.subplots#matplotlib.pyplot.subplots "matplotlib.pyplot.subplots")
[`Figure.add_subplot`](#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot")
[`pyplot.subplot`](_as_gen/matplotlib.pyplot.subplot#matplotlib.pyplot.subplot "matplotlib.pyplot.subplot")
#### Examples
```
# First create some toy data:
x = np.linspace(0, 2*np.pi, 400)
y = np.sin(x**2)
# Create a figure
plt.figure()
# Create a subplot
ax = fig.subplots()
ax.plot(x, y)
ax.set_title('Simple plot')
# Create two subplots and unpack the output array immediately
ax1, ax2 = fig.subplots(1, 2, sharey=True)
ax1.plot(x, y)
ax1.set_title('Sharing Y axis')
ax2.scatter(x, y)
# Create four polar Axes and access them through the returned array
axes = fig.subplots(2, 2, subplot_kw=dict(projection='polar'))
axes[0, 0].plot(x, y)
axes[1, 1].scatter(x, y)
# Share a X axis with each column of subplots
fig.subplots(2, 2, sharex='col')
# Share a Y axis with each row of subplots
fig.subplots(2, 2, sharey='row')
# Share both X and Y axes with all subplots
fig.subplots(2, 2, sharex='all', sharey='all')
# Note that this is the same as
fig.subplots(2, 2, sharex=True, sharey=True)
```
subplots\_adjust(*left=None*, *bottom=None*, *right=None*, *top=None*, *wspace=None*, *hspace=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1283-L1323)
Adjust the subplot layout parameters.
Unset parameters are left unmodified; initial values are given by `[rcParams["figure.subplot.[name]"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.subplot.%5Bname%5D#matplotlibrc-sample)`.
Parameters:
**left**float, optional
The position of the left edge of the subplots, as a fraction of the figure width.
**right**float, optional
The position of the right edge of the subplots, as a fraction of the figure width.
**bottom**float, optional
The position of the bottom edge of the subplots, as a fraction of the figure height.
**top**float, optional
The position of the top edge of the subplots, as a fraction of the figure height.
**wspace**float, optional
The width of the padding between subplots, as a fraction of the average Axes width.
**hspace**float, optional
The height of the padding between subplots, as a fraction of the average Axes height.
suptitle(*t*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L373-L381)
Add a centered suptitle to the figure.
Parameters:
**t**str
The suptitle text.
**x**float, default: 0.5
The x location of the text in figure coordinates.
**y**float, default: 0.98
The y location of the text in figure coordinates.
**horizontalalignment, ha**{'center', 'left', 'right'}, default: center
The horizontal alignment of the text relative to (*x*, *y*).
**verticalalignment, va**{'top', 'center', 'bottom', 'baseline'}, default: top
The vertical alignment of the text relative to (*x*, *y*).
**fontsize, size**default: `[rcParams["figure.titlesize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.titlesize#matplotlibrc-sample)` (default: `'large'`)
The font size of the text. See [`Text.set_size`](text_api#matplotlib.text.Text.set_size "matplotlib.text.Text.set_size") for possible values.
**fontweight, weight**default: `[rcParams["figure.titleweight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.titleweight#matplotlibrc-sample)` (default: `'normal'`)
The font weight of the text. See [`Text.set_weight`](text_api#matplotlib.text.Text.set_weight "matplotlib.text.Text.set_weight") for possible values.
Returns:
text
The [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") instance of the suptitle.
Other Parameters:
**fontproperties**None or dict, optional
A dict of font properties. If *fontproperties* is given the default values for font size and weight are taken from the [`FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") defaults. `[rcParams["figure.titlesize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.titlesize#matplotlibrc-sample)` (default: `'large'`) and `[rcParams["figure.titleweight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.titleweight#matplotlibrc-sample)` (default: `'normal'`) are ignored in this case.
**\*\*kwargs**
Additional kwargs are [`matplotlib.text.Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") properties.
supxlabel(*t*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L383-L391)
Add a centered supxlabel to the figure.
Parameters:
**t**str
The supxlabel text.
**x**float, default: 0.5
The x location of the text in figure coordinates.
**y**float, default: 0.01
The y location of the text in figure coordinates.
**horizontalalignment, ha**{'center', 'left', 'right'}, default: center
The horizontal alignment of the text relative to (*x*, *y*).
**verticalalignment, va**{'top', 'center', 'bottom', 'baseline'}, default: bottom
The vertical alignment of the text relative to (*x*, *y*).
**fontsize, size**default: `[rcParams["figure.labelsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelsize#matplotlibrc-sample)` (default: `'large'`)
The font size of the text. See [`Text.set_size`](text_api#matplotlib.text.Text.set_size "matplotlib.text.Text.set_size") for possible values.
**fontweight, weight**default: `[rcParams["figure.labelweight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelweight#matplotlibrc-sample)` (default: `'normal'`)
The font weight of the text. See [`Text.set_weight`](text_api#matplotlib.text.Text.set_weight "matplotlib.text.Text.set_weight") for possible values.
Returns:
text
The [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") instance of the supxlabel.
Other Parameters:
**fontproperties**None or dict, optional
A dict of font properties. If *fontproperties* is given the default values for font size and weight are taken from the [`FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") defaults. `[rcParams["figure.labelsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelsize#matplotlibrc-sample)` (default: `'large'`) and `[rcParams["figure.labelweight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelweight#matplotlibrc-sample)` (default: `'normal'`) are ignored in this case.
**\*\*kwargs**
Additional kwargs are [`matplotlib.text.Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") properties.
supylabel(*t*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L393-L402)
Add a centered supylabel to the figure.
Parameters:
**t**str
The supylabel text.
**x**float, default: 0.02
The x location of the text in figure coordinates.
**y**float, default: 0.5
The y location of the text in figure coordinates.
**horizontalalignment, ha**{'center', 'left', 'right'}, default: left
The horizontal alignment of the text relative to (*x*, *y*).
**verticalalignment, va**{'top', 'center', 'bottom', 'baseline'}, default: center
The vertical alignment of the text relative to (*x*, *y*).
**fontsize, size**default: `[rcParams["figure.labelsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelsize#matplotlibrc-sample)` (default: `'large'`)
The font size of the text. See [`Text.set_size`](text_api#matplotlib.text.Text.set_size "matplotlib.text.Text.set_size") for possible values.
**fontweight, weight**default: `[rcParams["figure.labelweight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelweight#matplotlibrc-sample)` (default: `'normal'`)
The font weight of the text. See [`Text.set_weight`](text_api#matplotlib.text.Text.set_weight "matplotlib.text.Text.set_weight") for possible values.
Returns:
text
The [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") instance of the supylabel.
Other Parameters:
**fontproperties**None or dict, optional
A dict of font properties. If *fontproperties* is given the default values for font size and weight are taken from the [`FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") defaults. `[rcParams["figure.labelsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelsize#matplotlibrc-sample)` (default: `'large'`) and `[rcParams["figure.labelweight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelweight#matplotlibrc-sample)` (default: `'normal'`) are ignored in this case.
**\*\*kwargs**
Additional kwargs are [`matplotlib.text.Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") properties.
text(*x*, *y*, *s*, *fontdict=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1126-L1174)
Add text to figure.
Parameters:
**x, y**float
The position to place the text. By default, this is in figure coordinates, floats in [0, 1]. The coordinate system can be changed using the *transform* keyword.
**s**str
The text string.
**fontdict**dict, optional
A dictionary to override the default text properties. If not given, the defaults are determined by `[rcParams["font.\*"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=font.*#matplotlibrc-sample)`. Properties passed as *kwargs* override the corresponding ones given in *fontdict*.
Returns:
[`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")
Other Parameters:
**\*\*kwargs**[`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") properties
Other miscellaneous text parameters.
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`backgroundcolor`](text_api#matplotlib.text.Text.set_backgroundcolor "matplotlib.text.Text.set_backgroundcolor") | color |
| [`bbox`](text_api#matplotlib.text.Text.set_bbox "matplotlib.text.Text.set_bbox") | dict with properties for [`patches.FancyBboxPatch`](_as_gen/matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | unknown |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | unknown |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | unknown |
| [`color`](text_api#matplotlib.text.Text.set_color "matplotlib.text.Text.set_color") or c | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fontfamily`](text_api#matplotlib.text.Text.set_fontfamily "matplotlib.text.Text.set_fontfamily") or family | {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'} |
| [`fontproperties`](text_api#matplotlib.text.Text.set_fontproperties "matplotlib.text.Text.set_fontproperties") or font or font\_properties | [`font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") or [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.10)") |
| [`fontsize`](text_api#matplotlib.text.Text.set_fontsize "matplotlib.text.Text.set_fontsize") or size | float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'} |
| [`fontstretch`](text_api#matplotlib.text.Text.set_fontstretch "matplotlib.text.Text.set_fontstretch") or stretch | {a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'} |
| [`fontstyle`](text_api#matplotlib.text.Text.set_fontstyle "matplotlib.text.Text.set_fontstyle") or style | {'normal', 'italic', 'oblique'} |
| [`fontvariant`](text_api#matplotlib.text.Text.set_fontvariant "matplotlib.text.Text.set_fontvariant") or variant | {'normal', 'small-caps'} |
| [`fontweight`](text_api#matplotlib.text.Text.set_fontweight "matplotlib.text.Text.set_fontweight") or weight | {a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'} |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`horizontalalignment`](text_api#matplotlib.text.Text.set_horizontalalignment "matplotlib.text.Text.set_horizontalalignment") or ha | {'left', 'center', 'right'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linespacing`](text_api#matplotlib.text.Text.set_linespacing "matplotlib.text.Text.set_linespacing") | float (multiple of font size) |
| [`math_fontfamily`](text_api#matplotlib.text.Text.set_math_fontfamily "matplotlib.text.Text.set_math_fontfamily") | str |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`multialignment`](text_api#matplotlib.text.Text.set_multialignment "matplotlib.text.Text.set_multialignment") or ma | {'left', 'right', 'center'} |
| [`parse_math`](text_api#matplotlib.text.Text.set_parse_math "matplotlib.text.Text.set_parse_math") | bool |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](text_api#matplotlib.text.Text.set_position "matplotlib.text.Text.set_position") | (float, float) |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`rotation`](text_api#matplotlib.text.Text.set_rotation "matplotlib.text.Text.set_rotation") | float or {'vertical', 'horizontal'} |
| [`rotation_mode`](text_api#matplotlib.text.Text.set_rotation_mode "matplotlib.text.Text.set_rotation_mode") | {None, 'default', 'anchor'} |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`text`](text_api#matplotlib.text.Text.set_text "matplotlib.text.Text.set_text") | object |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`transform_rotates_text`](text_api#matplotlib.text.Text.set_transform_rotates_text "matplotlib.text.Text.set_transform_rotates_text") | bool |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`usetex`](text_api#matplotlib.text.Text.set_usetex "matplotlib.text.Text.set_usetex") | bool or None |
| [`verticalalignment`](text_api#matplotlib.text.Text.set_verticalalignment "matplotlib.text.Text.set_verticalalignment") or va | {'bottom', 'baseline', 'center', 'center\_baseline', 'top'} |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`wrap`](text_api#matplotlib.text.Text.set_wrap "matplotlib.text.Text.set_wrap") | bool |
| [`x`](text_api#matplotlib.text.Text.set_x "matplotlib.text.Text.set_x") | float |
| [`y`](text_api#matplotlib.text.Text.set_y "matplotlib.text.Text.set_y") | float |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`Axes.text`](_as_gen/matplotlib.axes.axes.text#matplotlib.axes.Axes.text "matplotlib.axes.Axes.text")
[`pyplot.text`](_as_gen/matplotlib.pyplot.text#matplotlib.pyplot.text "matplotlib.pyplot.text")
tight\_layout(*\**, *pad=1.08*, *h\_pad=None*, *w\_pad=None*, *rect=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L3405-L3445)
Adjust the padding between and around subplots.
To exclude an artist on the Axes from the bounding box calculation that determines the subplot parameters (i.e. legend, or annotation), set `a.set_in_layout(False)` for that artist.
Parameters:
**pad**float, default: 1.08
Padding between the figure edge and the edges of subplots, as a fraction of the font size.
**h\_pad, w\_pad**float, default: *pad*
Padding (height/width) between edges of adjacent subplots, as a fraction of the font size.
**rect**tuple (left, bottom, right, top), default: (0, 0, 1, 1)
A rectangle in normalized figure coordinates into which the whole subplots area (including labels) will fit.
See also
[`Figure.set_layout_engine`](#matplotlib.figure.Figure.set_layout_engine "matplotlib.figure.Figure.set_layout_engine")
[`pyplot.tight_layout`](_as_gen/matplotlib.pyplot.tight_layout#matplotlib.pyplot.tight_layout "matplotlib.pyplot.tight_layout")
update(*props*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1168-L1177)
Update this artist's properties from the dict *props*.
Parameters:
**props**dict
update\_from(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1122-L1137)
Copy properties from *other* to *self*.
waitforbuttonpress(*timeout=-1*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L3370-L3388)
Blocking call to interact with the figure.
Wait for user input and return True if a key was pressed, False if a mouse button was pressed and None if no input was given within *timeout* seconds. Negative values deactivate *timeout*.
zorder*=0*
*class*matplotlib.figure.FigureBase(*\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L158-L2060)
Base class for [`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") and [`SubFigure`](#matplotlib.figure.SubFigure "matplotlib.figure.SubFigure") containing the methods that add artists to the figure or subfigure, create Axes, etc.
add\_artist(*artist*, *clip=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L471-L504)
Add an [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") to the figure.
Usually artists are added to Axes objects using [`Axes.add_artist`](_as_gen/matplotlib.axes.axes.add_artist#matplotlib.axes.Axes.add_artist "matplotlib.axes.Axes.add_artist"); this method can be used in the rare cases where one needs to add artists directly to the figure instead.
Parameters:
**artist**[`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
The artist to add to the figure. If the added artist has no transform previously set, its transform will be set to `figure.transSubfigure`.
**clip**bool, default: False
Whether the added artist should be clipped by the figure patch.
Returns:
[`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
The added artist.
add\_axes(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L506-L617)
Add an Axes to the figure.
Call signatures:
```
add_axes(rect, projection=None, polar=False, **kwargs)
add_axes(ax)
```
Parameters:
**rect**tuple (left, bottom, width, height)
The dimensions (left, bottom, width, height) of the new Axes. All quantities are in fractions of figure width and height.
**projection**{None, 'aitoff', 'hammer', 'lambert', 'mollweide', 'polar', 'rectilinear', str}, optional
The projection type of the [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"). *str* is the name of a custom projection, see [`projections`](projections_api#module-matplotlib.projections "matplotlib.projections"). The default None results in a 'rectilinear' projection.
**polar**bool, default: False
If True, equivalent to projection='polar'.
**axes\_class**subclass type of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
The [`axes.Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") subclass that is instantiated. This parameter is incompatible with *projection* and *polar*. See [axisartist](https://matplotlib.org/stable/tutorials/toolkits/axisartist.html#axisartist-users-guide-index) for examples.
**sharex, sharey**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
Share the x or y [`axis`](axis_api#module-matplotlib.axis "matplotlib.axis") with sharex and/or sharey. The axis will have the same limits, ticks, and scale as the axis of the shared axes.
**label**str
A label for the returned Axes.
Returns:
[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), or a subclass of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The returned axes class depends on the projection used. It is [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") if rectilinear projection is used and [`projections.polar.PolarAxes`](projections_api#matplotlib.projections.polar.PolarAxes "matplotlib.projections.polar.PolarAxes") if polar projection is used.
Other Parameters:
**\*\*kwargs**
This method also takes the keyword arguments for the returned Axes class. The keyword arguments for the rectilinear Axes class [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") can be found in the following table but there might also be other keyword arguments if another projection is used, see the actual Axes class.
| Property | Description |
| --- | --- |
| [`adjustable`](_as_gen/matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](_as_gen/matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](_as_gen/matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](_as_gen/matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](_as_gen/matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](_as_gen/matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](_as_gen/matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](_as_gen/matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](_as_gen/matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](_as_gen/matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](_as_gen/matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](_as_gen/matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](_as_gen/matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](_as_gen/matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](_as_gen/matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](_as_gen/matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](_as_gen/matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](_as_gen/matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](_as_gen/matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xmargin`](_as_gen/matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](_as_gen/matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](_as_gen/matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](_as_gen/matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](_as_gen/matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](_as_gen/matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](_as_gen/matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ymargin`](_as_gen/matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](_as_gen/matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](_as_gen/matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](_as_gen/matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`Figure.add_subplot`](#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot")
[`pyplot.subplot`](_as_gen/matplotlib.pyplot.subplot#matplotlib.pyplot.subplot "matplotlib.pyplot.subplot")
[`pyplot.axes`](_as_gen/matplotlib.pyplot.axes#matplotlib.pyplot.axes "matplotlib.pyplot.axes")
[`Figure.subplots`](#matplotlib.figure.Figure.subplots "matplotlib.figure.Figure.subplots")
[`pyplot.subplots`](_as_gen/matplotlib.pyplot.subplots#matplotlib.pyplot.subplots "matplotlib.pyplot.subplots")
#### Notes
In rare circumstances, [`add_axes`](#matplotlib.figure.FigureBase.add_axes "matplotlib.figure.FigureBase.add_axes") may be called with a single argument, an Axes instance already created in the present figure but not in the figure's list of Axes.
#### Examples
Some simple examples:
```
rect = l, b, w, h
fig = plt.figure()
fig.add_axes(rect)
fig.add_axes(rect, frameon=False, facecolor='g')
fig.add_axes(rect, polar=True)
ax = fig.add_axes(rect, projection='polar')
fig.delaxes(ax)
fig.add_axes(ax)
```
add\_callback(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L348-L375)
Add a callback function that will be called whenever one of the [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")'s properties changes.
Parameters:
**func**callable
The callback function. It must have the signature:
```
def func(artist: Artist) -> Any
```
where *artist* is the calling [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"). Return values may exist but are ignored.
Returns:
int
The observer id associated with the callback. This id can be used for removing the callback with [`remove_callback`](#matplotlib.figure.FigureBase.remove_callback "matplotlib.figure.FigureBase.remove_callback") later.
See also
[`remove_callback`](#matplotlib.figure.FigureBase.remove_callback "matplotlib.figure.FigureBase.remove_callback")
add\_gridspec(*nrows=1*, *ncols=1*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1474-L1515)
Return a [`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec") that has this figure as a parent. This allows complex layout of Axes in the figure.
Parameters:
**nrows**int, default: 1
Number of rows in grid.
**ncols**int, default: 1
Number or columns in grid.
Returns:
[`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec")
Other Parameters:
**\*\*kwargs**
Keyword arguments are passed to [`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec").
See also
[`matplotlib.pyplot.subplots`](_as_gen/matplotlib.pyplot.subplots#matplotlib.pyplot.subplots "matplotlib.pyplot.subplots")
#### Examples
Adding a subplot that spans two rows:
```
fig = plt.figure()
gs = fig.add_gridspec(2, 2)
ax1 = fig.add_subplot(gs[0, 0])
ax2 = fig.add_subplot(gs[1, 0])
# spans two rows:
ax3 = fig.add_subplot(gs[:, 1])
```
add\_subfigure(*subplotspec*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1571-L1596)
Add a [`SubFigure`](#matplotlib.figure.SubFigure "matplotlib.figure.SubFigure") to the figure as part of a subplot arrangement.
Parameters:
**subplotspec**[`gridspec.SubplotSpec`](_as_gen/matplotlib.gridspec.subplotspec#matplotlib.gridspec.SubplotSpec "matplotlib.gridspec.SubplotSpec")
Defines the region in a parent gridspec where the subfigure will be placed.
Returns:
[`SubFigure`](#matplotlib.figure.SubFigure "matplotlib.figure.SubFigure")
Other Parameters:
**\*\*kwargs**
Are passed to the [`SubFigure`](#matplotlib.figure.SubFigure "matplotlib.figure.SubFigure") object.
See also
[`Figure.subfigures`](#matplotlib.figure.Figure.subfigures "matplotlib.figure.Figure.subfigures")
add\_subplot(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L619-L747)
Add an [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") to the figure as part of a subplot arrangement.
Call signatures:
```
add_subplot(nrows, ncols, index, **kwargs)
add_subplot(pos, **kwargs)
add_subplot(ax)
add_subplot()
```
Parameters:
**\*args**int, (int, int, *index*), or [`SubplotSpec`](_as_gen/matplotlib.gridspec.subplotspec#matplotlib.gridspec.SubplotSpec "matplotlib.gridspec.SubplotSpec"), default: (1, 1, 1)
The position of the subplot described by one of
* Three integers (*nrows*, *ncols*, *index*). The subplot will take the *index* position on a grid with *nrows* rows and *ncols* columns. *index* starts at 1 in the upper left corner and increases to the right. *index* can also be a two-tuple specifying the (*first*, *last*) indices (1-based, and including *last*) of the subplot, e.g., `fig.add_subplot(3, 1, (1, 2))` makes a subplot that spans the upper 2/3 of the figure.
* A 3-digit integer. The digits are interpreted as if given separately as three single-digit integers, i.e. `fig.add_subplot(235)` is the same as `fig.add_subplot(2, 3, 5)`. Note that this can only be used if there are no more than 9 subplots.
* A [`SubplotSpec`](_as_gen/matplotlib.gridspec.subplotspec#matplotlib.gridspec.SubplotSpec "matplotlib.gridspec.SubplotSpec").
In rare circumstances, [`add_subplot`](#matplotlib.figure.FigureBase.add_subplot "matplotlib.figure.FigureBase.add_subplot") may be called with a single argument, a subplot Axes instance already created in the present figure but not in the figure's list of Axes.
**projection**{None, 'aitoff', 'hammer', 'lambert', 'mollweide', 'polar', 'rectilinear', str}, optional
The projection type of the subplot ([`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")). *str* is the name of a custom projection, see [`projections`](projections_api#module-matplotlib.projections "matplotlib.projections"). The default None results in a 'rectilinear' projection.
**polar**bool, default: False
If True, equivalent to projection='polar'.
**axes\_class**subclass type of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
The [`axes.Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") subclass that is instantiated. This parameter is incompatible with *projection* and *polar*. See [axisartist](https://matplotlib.org/stable/tutorials/toolkits/axisartist.html#axisartist-users-guide-index) for examples.
**sharex, sharey**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
Share the x or y [`axis`](axis_api#module-matplotlib.axis "matplotlib.axis") with sharex and/or sharey. The axis will have the same limits, ticks, and scale as the axis of the shared axes.
**label**str
A label for the returned Axes.
Returns:
[`axes.SubplotBase`](_as_gen/matplotlib.axes.subplotbase#matplotlib.axes.SubplotBase "matplotlib.axes.SubplotBase"), or another subclass of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The Axes of the subplot. The returned Axes base class depends on the projection used. It is [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") if rectilinear projection is used and [`projections.polar.PolarAxes`](projections_api#matplotlib.projections.polar.PolarAxes "matplotlib.projections.polar.PolarAxes") if polar projection is used. The returned Axes is then a subplot subclass of the base class.
Other Parameters:
**\*\*kwargs**
This method also takes the keyword arguments for the returned Axes base class; except for the *figure* argument. The keyword arguments for the rectilinear base class [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") can be found in the following table but there might also be other keyword arguments if another projection is used.
| Property | Description |
| --- | --- |
| [`adjustable`](_as_gen/matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](_as_gen/matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](_as_gen/matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](_as_gen/matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](_as_gen/matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](_as_gen/matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](_as_gen/matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](_as_gen/matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](_as_gen/matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](_as_gen/matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](_as_gen/matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](_as_gen/matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](_as_gen/matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](_as_gen/matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](_as_gen/matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](_as_gen/matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](_as_gen/matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](_as_gen/matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](_as_gen/matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xmargin`](_as_gen/matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](_as_gen/matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](_as_gen/matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](_as_gen/matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](_as_gen/matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](_as_gen/matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](_as_gen/matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ymargin`](_as_gen/matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](_as_gen/matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](_as_gen/matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](_as_gen/matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`Figure.add_axes`](#matplotlib.figure.Figure.add_axes "matplotlib.figure.Figure.add_axes")
[`pyplot.subplot`](_as_gen/matplotlib.pyplot.subplot#matplotlib.pyplot.subplot "matplotlib.pyplot.subplot")
[`pyplot.axes`](_as_gen/matplotlib.pyplot.axes#matplotlib.pyplot.axes "matplotlib.pyplot.axes")
[`Figure.subplots`](#matplotlib.figure.Figure.subplots "matplotlib.figure.Figure.subplots")
[`pyplot.subplots`](_as_gen/matplotlib.pyplot.subplots#matplotlib.pyplot.subplots "matplotlib.pyplot.subplots")
#### Examples
```
fig = plt.figure()
fig.add_subplot(231)
ax1 = fig.add_subplot(2, 3, 1) # equivalent but more general
fig.add_subplot(232, frameon=False) # subplot with no frame
fig.add_subplot(233, projection='polar') # polar subplot
fig.add_subplot(234, sharex=ax1) # subplot sharing x-axis with ax1
fig.add_subplot(235, facecolor="red") # red subplot
ax1.remove() # delete ax1 from the figure
fig.add_subplot(ax1) # add ax1 back to the figure
```
align\_labels(*axs=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1450-L1472)
Align the xlabels and ylabels of subplots with the same subplots row or column (respectively) if label alignment is being done automatically (i.e. the label position is not manually set).
Alignment persists for draw events after this is called.
Parameters:
**axs**list of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
Optional list (or ndarray) of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") to align the labels. Default is to align all Axes on the figure.
See also
[`matplotlib.figure.Figure.align_xlabels`](#matplotlib.figure.Figure.align_xlabels "matplotlib.figure.Figure.align_xlabels")
[`matplotlib.figure.Figure.align_ylabels`](#matplotlib.figure.Figure.align_ylabels "matplotlib.figure.Figure.align_ylabels")
align\_xlabels(*axs=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1325-L1386)
Align the xlabels of subplots in the same subplot column if label alignment is being done automatically (i.e. the label position is not manually set).
Alignment persists for draw events after this is called.
If a label is on the bottom, it is aligned with labels on Axes that also have their label on the bottom and that have the same bottom-most subplot row. If the label is on the top, it is aligned with labels on Axes with the same top-most row.
Parameters:
**axs**list of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
Optional list of (or ndarray) [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") to align the xlabels. Default is to align all Axes on the figure.
See also
[`matplotlib.figure.Figure.align_ylabels`](#matplotlib.figure.Figure.align_ylabels "matplotlib.figure.Figure.align_ylabels")
[`matplotlib.figure.Figure.align_labels`](#matplotlib.figure.Figure.align_labels "matplotlib.figure.Figure.align_labels")
#### Notes
This assumes that `axs` are from the same [`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec"), so that their [`SubplotSpec`](_as_gen/matplotlib.gridspec.subplotspec#matplotlib.gridspec.SubplotSpec "matplotlib.gridspec.SubplotSpec") positions correspond to figure positions.
#### Examples
Example with rotated xtick labels:
```
fig, axs = plt.subplots(1, 2)
for tick in axs[0].get_xticklabels():
tick.set_rotation(55)
axs[0].set_xlabel('XLabel 0')
axs[1].set_xlabel('XLabel 1')
fig.align_xlabels()
```
align\_ylabels(*axs=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1388-L1448)
Align the ylabels of subplots in the same subplot column if label alignment is being done automatically (i.e. the label position is not manually set).
Alignment persists for draw events after this is called.
If a label is on the left, it is aligned with labels on Axes that also have their label on the left and that have the same left-most subplot column. If the label is on the right, it is aligned with labels on Axes with the same right-most column.
Parameters:
**axs**list of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
Optional list (or ndarray) of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") to align the ylabels. Default is to align all Axes on the figure.
See also
[`matplotlib.figure.Figure.align_xlabels`](#matplotlib.figure.Figure.align_xlabels "matplotlib.figure.Figure.align_xlabels")
[`matplotlib.figure.Figure.align_labels`](#matplotlib.figure.Figure.align_labels "matplotlib.figure.Figure.align_labels")
#### Notes
This assumes that `axs` are from the same [`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec"), so that their [`SubplotSpec`](_as_gen/matplotlib.gridspec.subplotspec#matplotlib.gridspec.SubplotSpec "matplotlib.gridspec.SubplotSpec") positions correspond to figure positions.
#### Examples
Example with large yticks labels:
```
fig, axs = plt.subplots(2, 1)
axs[0].plot(np.arange(0, 1000, 50))
axs[0].set_ylabel('YLabel 0')
axs[1].set_ylabel('YLabel 1')
fig.align_ylabels()
```
autofmt\_xdate(*bottom=0.2*, *rotation=30*, *ha='right'*, *which='major'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L218-L259)
Date ticklabels often overlap, so it is useful to rotate them and right align them. Also, a common use case is a number of subplots with shared x-axis where the x-axis is date data. The ticklabels are often long, and it helps to rotate them on the bottom subplot and turn them off on other subplots, as well as turn off xlabels.
Parameters:
**bottom**float, default: 0.2
The bottom of the subplots for [`subplots_adjust`](#matplotlib.figure.FigureBase.subplots_adjust "matplotlib.figure.FigureBase.subplots_adjust").
**rotation**float, default: 30 degrees
The rotation angle of the xtick labels in degrees.
**ha**{'left', 'center', 'right'}, default: 'right'
The horizontal alignment of the xticklabels.
**which**{'major', 'minor', 'both'}, default: 'major'
Selects which ticklabels to rotate.
*property*axes
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance the artist resides in, or *None*.
clear(*keep\_observers=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L936-L969)
Clear the figure.
Parameters:
**keep\_observers: bool, default: False**
Set *keep\_observers* to True if, for example, a gui widget is tracking the Axes in the figure.
clf(*keep\_observers=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L972-L986)
[*Discouraged*] Alias for the [`clear()`](#matplotlib.figure.FigureBase.clear "matplotlib.figure.FigureBase.clear") method.
Discouraged
The use of `clf()` is discouraged. Use `clear()` instead.
Parameters:
**keep\_observers: bool, default: False**
Set *keep\_observers* to True if, for example, a gui widget is tracking the Axes in the figure.
colorbar(*mappable*, *cax=None*, *ax=None*, *use\_gridspec=True*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1176-L1281)
Add a colorbar to a plot.
Parameters:
**mappable**
The [`matplotlib.cm.ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") (i.e., [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage"), [`ContourSet`](contour_api#matplotlib.contour.ContourSet "matplotlib.contour.ContourSet"), etc.) described by this colorbar. This argument is mandatory for the [`Figure.colorbar`](#matplotlib.figure.Figure.colorbar "matplotlib.figure.Figure.colorbar") method but optional for the [`pyplot.colorbar`](_as_gen/matplotlib.pyplot.colorbar#matplotlib.pyplot.colorbar "matplotlib.pyplot.colorbar") function, which sets the default to the current image.
Note that one can create a [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") "on-the-fly" to generate colorbars not attached to a previously drawn artist, e.g.
```
fig.colorbar(cm.ScalarMappable(norm=norm, cmap=cmap), ax=ax)
```
**cax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
Axes into which the colorbar will be drawn.
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), list of Axes, optional
One or more parent axes from which space for a new colorbar axes will be stolen, if *cax* is None. This has no effect if *cax* is set.
**use\_gridspec**bool, optional
If *cax* is `None`, a new *cax* is created as an instance of Axes. If *ax* is an instance of Subplot and *use\_gridspec* is `True`, *cax* is created as an instance of Subplot using the [`gridspec`](gridspec_api#module-matplotlib.gridspec "matplotlib.gridspec") module.
Returns:
**colorbar**[`Colorbar`](colorbar_api#matplotlib.colorbar.Colorbar "matplotlib.colorbar.Colorbar")
Other Parameters:
**location**None or {'left', 'right', 'top', 'bottom'}
The location, relative to the parent axes, where the colorbar axes is created. It also determines the *orientation* of the colorbar (colorbars on the left and right are vertical, colorbars at the top and bottom are horizontal). If None, the location will come from the *orientation* if it is set (vertical colorbars on the right, horizontal ones at the bottom), or default to 'right' if *orientation* is unset.
**orientation**None or {'vertical', 'horizontal'}
The orientation of the colorbar. It is preferable to set the *location* of the colorbar, as that also determines the *orientation*; passing incompatible values for *location* and *orientation* raises an exception.
**fraction**float, default: 0.15
Fraction of original axes to use for colorbar.
**shrink**float, default: 1.0
Fraction by which to multiply the size of the colorbar.
**aspect**float, default: 20
Ratio of long to short dimensions.
**pad**float, default: 0.05 if vertical, 0.15 if horizontal
Fraction of original axes between colorbar and new image axes.
**anchor**(float, float), optional
The anchor point of the colorbar axes. Defaults to (0.0, 0.5) if vertical; (0.5, 1.0) if horizontal.
**panchor**(float, float), or *False*, optional
The anchor point of the colorbar parent axes. If *False*, the parent axes' anchor will be unchanged. Defaults to (1.0, 0.5) if vertical; (0.5, 0.0) if horizontal.
**extend**{'neither', 'both', 'min', 'max'}
Make pointed end(s) for out-of-range values (unless 'neither'). These are set for a given colormap using the colormap set\_under and set\_over methods.
**extendfrac**{*None*, 'auto', length, lengths}
If set to *None*, both the minimum and maximum triangular colorbar extensions will have a length of 5% of the interior colorbar length (this is the default setting).
If set to 'auto', makes the triangular colorbar extensions the same lengths as the interior boxes (when *spacing* is set to 'uniform') or the same lengths as the respective adjacent interior boxes (when *spacing* is set to 'proportional').
If a scalar, indicates the length of both the minimum and maximum triangular colorbar extensions as a fraction of the interior colorbar length. A two-element sequence of fractions may also be given, indicating the lengths of the minimum and maximum colorbar extensions respectively as a fraction of the interior colorbar length.
**extendrect**bool
If *False* the minimum and maximum colorbar extensions will be triangular (the default). If *True* the extensions will be rectangular.
**spacing**{'uniform', 'proportional'}
For discrete colorbars ([`BoundaryNorm`](_as_gen/matplotlib.colors.boundarynorm#matplotlib.colors.BoundaryNorm "matplotlib.colors.BoundaryNorm") or contours), 'uniform' gives each color the same space; 'proportional' makes the space proportional to the data interval.
**ticks**None or list of ticks or Locator
If None, ticks are determined automatically from the input.
**format**None or str or Formatter
If None, [`ScalarFormatter`](ticker_api#matplotlib.ticker.ScalarFormatter "matplotlib.ticker.ScalarFormatter") is used. Format strings, e.g., `"%4.2e"` or `"{x:.2e}"`, are supported. An alternative [`Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter") may be given instead.
**drawedges**bool
Whether to draw lines at color boundaries.
**label**str
The label on the colorbar's long axis.
**boundaries, values**None or a sequence
If unset, the colormap will be displayed on a 0-1 scale. If sequences, *values* must have a length 1 less than *boundaries*. For each region delimited by adjacent entries in *boundaries*, the color mapped to the corresponding value in values will be used. Normally only useful for indexed colors (i.e. `norm=NoNorm()`) or other unusual circumstances.
#### Notes
If *mappable* is a [`ContourSet`](contour_api#matplotlib.contour.ContourSet "matplotlib.contour.ContourSet"), its *extend* kwarg is included automatically.
The *shrink* kwarg provides a simple way to scale the colorbar with respect to the axes. Note that if *cax* is specified, it determines the size of the colorbar and *shrink* and *aspect* kwargs are ignored.
For more precise control, you can manually specify the positions of the axes objects in which the mappable and the colorbar are drawn. In this case, do not use any of the axes properties kwargs.
It is known that some vector graphics viewers (svg and pdf) renders white gaps between segments of the colorbar. This is due to bugs in the viewers, not Matplotlib. As a workaround, the colorbar can be rendered with overlapping segments:
```
cbar = colorbar()
cbar.solids.set_edgecolor("face")
draw()
```
However this has negative consequences in other circumstances, e.g. with semi-transparent images (alpha < 1) and colorbar extensions; therefore, this workaround is not used by default (see issue #1188).
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L273-L285)
Test whether the mouse event occurred on the figure.
Returns:
bool, {}
convert\_xunits(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L241-L251)
Convert *x* using the unit type of the xaxis.
If the artist is not contained in an Axes or if the xaxis does not have units, *x* itself is returned.
convert\_yunits(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L253-L263)
Convert *y* using the unit type of the yaxis.
If the artist is not contained in an Axes or if the yaxis does not have units, *y* itself is returned.
delaxes(*ax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L899-L934)
Remove the [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") *ax* from the figure; update the current Axes.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L951-L968)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
findobj(*match=None*, *include\_self=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1208-L1249)
Find artist objects.
Recursively find all [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") instances contained in the artist.
Parameters:
**match**
A filter criterion for the matches. This can be
* *None*: Return all objects contained in artist.
* A function with signature `def match(artist: Artist) -> bool`. The result will only contain artists for which the function returns *True*.
* A class instance: e.g., [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"). The result will only contain artists of this class or its subclasses (`isinstance` check).
**include\_self**bool
Include *self* in the list to be checked for a match.
Returns:
list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
format\_cursor\_data(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1282-L1336)
Return a string representation of *data*.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
The default implementation converts ints and floats and arrays of ints and floats into a comma-separated string enclosed in square brackets, unless the artist has an associated colorbar, in which case scalar values are formatted using the colorbar's formatter.
See also
[`get_cursor_data`](#matplotlib.figure.FigureBase.get_cursor_data "matplotlib.figure.FigureBase.get_cursor_data")
*property*frameon
Return the figure's background patch visibility, i.e. whether the figure background will be drawn. Equivalent to `Figure.patch.get_visible()`.
gca()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1604-L1615)
Get the current Axes.
If there is currently no Axes on this Figure, a new one is created using [`Figure.add_subplot`](#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot"). (To test whether there is currently an Axes on a Figure, check whether `figure.axes` is empty. To test whether there is currently a Figure on the pyplot figure stack, check whether [`pyplot.get_fignums()`](_as_gen/matplotlib.pyplot.get_fignums#matplotlib.pyplot.get_fignums "matplotlib.pyplot.get_fignums") is empty.)
get\_agg\_filter()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L929-L931)
Return filter function to be used for agg filter.
get\_alpha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L805-L810)
Return the alpha value used for blending - not supported on all backends.
get\_animated()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L816-L818)
Return whether the artist is animated.
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L261-L271)
Get a list of artists contained in the figure.
get\_clip\_box()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L859-L861)
Return the clipbox.
get\_clip\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L855-L857)
Return whether the artist uses clipping.
get\_clip\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L863-L865)
Return the clip path.
get\_cursor\_data(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1251-L1280)
Return the cursor data for a given event.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
Cursor data can be used by Artists to provide additional context information for a given event. The default implementation just returns *None*.
Subclasses can override the method and return arbitrary data. However, when doing so, they must ensure that [`format_cursor_data`](#matplotlib.figure.FigureBase.format_cursor_data "matplotlib.figure.FigureBase.format_cursor_data") can convert the data to a string representation.
The only current use case is displaying the z-value of an [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") in the status bar of a plot window, while moving the mouse.
Parameters:
**event**[`matplotlib.backend_bases.MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
See also
[`format_cursor_data`](#matplotlib.figure.FigureBase.format_cursor_data "matplotlib.figure.FigureBase.format_cursor_data")
get\_default\_bbox\_extra\_artists()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1688-L1694)
get\_edgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L404-L406)
Get the edge color of the Figure rectangle.
get\_facecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L408-L410)
Get the face color of the Figure rectangle.
get\_figure()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L703-L705)
Return the [`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
get\_frameon()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L412-L418)
Return the figure's background patch visibility, i.e. whether the figure background will be drawn. Equivalent to `Figure.patch.get_visible()`.
get\_gid()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L588-L590)
Return the group id.
get\_in\_layout()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L820-L829)
Return boolean flag, `True` if artist is included in layout calculations.
E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
get\_label()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1056-L1058)
Return the label used for this artist in the legend.
get\_linewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L430-L434)
Get the line width of the Figure rectangle.
get\_mouseover()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1338-L1343)
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
get\_path\_effects()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L700-L701)
get\_picker()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L562-L572)
Return the picking behavior of the artist.
The possible values are described in [`set_picker`](#matplotlib.figure.FigureBase.set_picker "matplotlib.figure.FigureBase.set_picker").
See also
[`set_picker`](#matplotlib.figure.FigureBase.set_picker "matplotlib.figure.FigureBase.set_picker"), [`pickable`](#matplotlib.figure.FigureBase.pickable "matplotlib.figure.FigureBase.pickable"), [`pick`](#matplotlib.figure.FigureBase.pick "matplotlib.figure.FigureBase.pick")
get\_rasterized()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L904-L906)
Return whether the artist is to be rasterized.
get\_sketch\_params()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L641-L659)
Return the sketch parameters for the artist.
Returns:
tuple or None
A 3-tuple with the following elements:
* *scale*: The amplitude of the wiggle perpendicular to the source line.
* *length*: The length of the wiggle along the line.
* *randomness*: The scale factor by which the length is shrunken or expanded.
Returns *None* if no sketch parameters were set.
get\_snap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L602-L611)
Return the snap setting.
See [`set_snap`](#matplotlib.figure.FigureBase.set_snap "matplotlib.figure.FigureBase.set_snap") for details.
get\_tightbbox(*renderer=None*, *bbox\_extra\_artists=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1696-L1765)
Return a (tight) bounding box of the figure *in inches*.
Note that [`FigureBase`](#matplotlib.figure.FigureBase "matplotlib.figure.FigureBase") differs from all other artists, which return their [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") in pixels.
Artists that have `artist.set_in_layout(False)` are not included in the bbox.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
**bbox\_extra\_artists**list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") or `None`
List of artists to include in the tight bounding box. If `None` (default), then all artist children of each Axes are included in the tight bounding box.
Returns:
[`BboxBase`](transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase")
containing the bounding box (in figure inches).
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L421-L428)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist.
get\_transformed\_clip\_path\_and\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L867-L875)
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
get\_url()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L574-L576)
Return the url.
get\_visible()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L812-L814)
Return the visibility.
get\_window\_extent(*renderer=None*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L287-L291)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
get\_zorder()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1076-L1078)
Return the artist's zorder.
have\_units()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L236-L239)
Return whether units are set on any axis.
is\_transform\_set()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L400-L406)
Return whether the Artist has an explicitly set transform.
This is *True* after [`set_transform`](#matplotlib.figure.FigureBase.set_transform "matplotlib.figure.FigureBase.set_transform") has been called.
legend(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L991-L1124)
Place a legend on the figure.
Call signatures:
```
legend()
legend(handles, labels)
legend(handles=handles)
legend(labels)
```
The call signatures correspond to the following different ways to use this method:
**1. Automatic detection of elements to be shown in the legend**
The elements to be added to the legend are automatically determined, when you do not pass in any extra arguments.
In this case, the labels are taken from the artist. You can specify them either at artist creation or by calling the [`set_label()`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") method on the artist:
```
ax.plot([1, 2, 3], label='Inline label')
fig.legend()
```
or:
```
line, = ax.plot([1, 2, 3])
line.set_label('Label via method')
fig.legend()
```
Specific lines can be excluded from the automatic legend element selection by defining a label starting with an underscore. This is default for all artists, so calling [`Figure.legend`](#matplotlib.figure.Figure.legend "matplotlib.figure.Figure.legend") without any arguments and without setting the labels manually will result in no legend being drawn.
**2. Explicitly listing the artists and labels in the legend**
For full control of which artists have a legend entry, it is possible to pass an iterable of legend artists followed by an iterable of legend labels respectively:
```
fig.legend([line1, line2, line3], ['label1', 'label2', 'label3'])
```
**3. Explicitly listing the artists in the legend**
This is similar to 2, but the labels are taken from the artists' label properties. Example:
```
line1, = ax1.plot([1, 2, 3], label='label1')
line2, = ax2.plot([1, 2, 3], label='label2')
fig.legend(handles=[line1, line2])
```
**4. Labeling existing plot elements**
Discouraged
This call signature is discouraged, because the relation between plot elements and labels is only implicit by their order and can easily be mixed up.
To make a legend for all artists on all Axes, call this function with an iterable of strings, one for each legend item. For example:
```
fig, (ax1, ax2) = plt.subplots(1, 2)
ax1.plot([1, 3, 5], color='blue')
ax2.plot([2, 4, 6], color='red')
fig.legend(['the blues', 'the reds'])
```
Parameters:
**handles**list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"), optional
A list of Artists (lines, patches) to be added to the legend. Use this together with *labels*, if you need full control on what is shown in the legend and the automatic mechanism described above is not sufficient.
The length of handles and labels should be the same in this case. If they are not, they are truncated to the smaller length.
**labels**list of str, optional
A list of labels to show next to the artists. Use this together with *handles*, if you need full control on what is shown in the legend and the automatic mechanism described above is not sufficient.
Returns:
[`Legend`](legend_api#matplotlib.legend.Legend "matplotlib.legend.Legend")
Other Parameters:
**loc**str or pair of floats, default: `[rcParams["legend.loc"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.loc#matplotlibrc-sample)` (default: `'best'`) ('best' for axes, 'upper right' for figures)
The location of the legend.
The strings `'upper left', 'upper right', 'lower left', 'lower right'` place the legend at the corresponding corner of the axes/figure.
The strings `'upper center', 'lower center', 'center left', 'center right'` place the legend at the center of the corresponding edge of the axes/figure.
The string `'center'` places the legend at the center of the axes/figure.
The string `'best'` places the legend at the location, among the nine locations defined so far, with the minimum overlap with other drawn artists. This option can be quite slow for plots with large amounts of data; your plotting speed may benefit from providing a specific location.
The location can also be a 2-tuple giving the coordinates of the lower-left corner of the legend in axes coordinates (in which case *bbox\_to\_anchor* will be ignored).
For back-compatibility, `'center right'` (but no other location) can also be spelled `'right'`, and each "string" locations can also be given as a numeric value:
| Location String | Location Code |
| --- | --- |
| 'best' | 0 |
| 'upper right' | 1 |
| 'upper left' | 2 |
| 'lower left' | 3 |
| 'lower right' | 4 |
| 'right' | 5 |
| 'center left' | 6 |
| 'center right' | 7 |
| 'lower center' | 8 |
| 'upper center' | 9 |
| 'center' | 10 |
**bbox\_to\_anchor**[`BboxBase`](transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase"), 2-tuple, or 4-tuple of floats
Box that is used to position the legend in conjunction with *loc*. Defaults to `axes.bbox` (if called as a method to [`Axes.legend`](_as_gen/matplotlib.axes.axes.legend#matplotlib.axes.Axes.legend "matplotlib.axes.Axes.legend")) or `figure.bbox` (if [`Figure.legend`](#matplotlib.figure.Figure.legend "matplotlib.figure.Figure.legend")). This argument allows arbitrary placement of the legend.
Bbox coordinates are interpreted in the coordinate system given by *bbox\_transform*, with the default transform Axes or Figure coordinates, depending on which `legend` is called.
If a 4-tuple or [`BboxBase`](transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase") is given, then it specifies the bbox `(x, y, width, height)` that the legend is placed in. To put the legend in the best location in the bottom right quadrant of the axes (or figure):
```
loc='best', bbox_to_anchor=(0.5, 0., 0.5, 0.5)
```
A 2-tuple `(x, y)` places the corner of the legend specified by *loc* at x, y. For example, to put the legend's upper right-hand corner in the center of the axes (or figure) the following keywords can be used:
```
loc='upper right', bbox_to_anchor=(0.5, 0.5)
```
**ncols**int, default: 1
The number of columns that the legend has.
For backward compatibility, the spelling *ncol* is also supported but it is discouraged. If both are given, *ncols* takes precedence.
**prop**None or [`matplotlib.font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or dict
The font properties of the legend. If None (default), the current [`matplotlib.rcParams`](matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams") will be used.
**fontsize**int or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}
The font size of the legend. If the value is numeric the size will be the absolute font size in points. String values are relative to the current default font size. This argument is only used if *prop* is not specified.
**labelcolor**str or list, default: `[rcParams["legend.labelcolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.labelcolor#matplotlibrc-sample)` (default: `'None'`)
The color of the text in the legend. Either a valid color string (for example, 'red'), or a list of color strings. The labelcolor can also be made to match the color of the line or marker using 'linecolor', 'markerfacecolor' (or 'mfc'), or 'markeredgecolor' (or 'mec').
Labelcolor can be set globally using `[rcParams["legend.labelcolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.labelcolor#matplotlibrc-sample)` (default: `'None'`). If None, use `[rcParams["text.color"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=text.color#matplotlibrc-sample)` (default: `'black'`).
**numpoints**int, default: `[rcParams["legend.numpoints"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.numpoints#matplotlibrc-sample)` (default: `1`)
The number of marker points in the legend when creating a legend entry for a [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") (line).
**scatterpoints**int, default: `[rcParams["legend.scatterpoints"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.scatterpoints#matplotlibrc-sample)` (default: `1`)
The number of marker points in the legend when creating a legend entry for a [`PathCollection`](collections_api#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection") (scatter plot).
**scatteryoffsets**iterable of floats, default: `[0.375, 0.5, 0.3125]`
The vertical offset (relative to the font size) for the markers created for a scatter plot legend entry. 0.0 is at the base the legend text, and 1.0 is at the top. To draw all markers at the same height, set to `[0.5]`.
**markerscale**float, default: `[rcParams["legend.markerscale"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.markerscale#matplotlibrc-sample)` (default: `1.0`)
The relative size of legend markers compared with the originally drawn ones.
**markerfirst**bool, default: True
If *True*, legend marker is placed to the left of the legend label. If *False*, legend marker is placed to the right of the legend label.
**frameon**bool, default: `[rcParams["legend.frameon"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.frameon#matplotlibrc-sample)` (default: `True`)
Whether the legend should be drawn on a patch (frame).
**fancybox**bool, default: `[rcParams["legend.fancybox"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.fancybox#matplotlibrc-sample)` (default: `True`)
Whether round edges should be enabled around the [`FancyBboxPatch`](_as_gen/matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") which makes up the legend's background.
**shadow**bool, default: `[rcParams["legend.shadow"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.shadow#matplotlibrc-sample)` (default: `False`)
Whether to draw a shadow behind the legend.
**framealpha**float, default: `[rcParams["legend.framealpha"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.framealpha#matplotlibrc-sample)` (default: `0.8`)
The alpha transparency of the legend's background. If *shadow* is activated and *framealpha* is `None`, the default value is ignored.
**facecolor**"inherit" or color, default: `[rcParams["legend.facecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.facecolor#matplotlibrc-sample)` (default: `'inherit'`)
The legend's background color. If `"inherit"`, use `[rcParams["axes.facecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.facecolor#matplotlibrc-sample)` (default: `'white'`).
**edgecolor**"inherit" or color, default: `[rcParams["legend.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.edgecolor#matplotlibrc-sample)` (default: `'0.8'`)
The legend's background patch edge color. If `"inherit"`, use take `[rcParams["axes.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.edgecolor#matplotlibrc-sample)` (default: `'black'`).
**mode**{"expand", None}
If *mode* is set to `"expand"` the legend will be horizontally expanded to fill the axes area (or *bbox\_to\_anchor* if defines the legend's size).
**bbox\_transform**None or [`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
The transform for the bounding box (*bbox\_to\_anchor*). For a value of `None` (default) the Axes' `transAxes` transform will be used.
**title**str or None
The legend's title. Default is no title (`None`).
**title\_fontproperties**None or [`matplotlib.font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or dict
The font properties of the legend's title. If None (default), the *title\_fontsize* argument will be used if present; if *title\_fontsize* is also None, the current `[rcParams["legend.title\_fontsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.title_fontsize#matplotlibrc-sample)` (default: `None`) will be used.
**title\_fontsize**int or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}, default: `[rcParams["legend.title\_fontsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.title_fontsize#matplotlibrc-sample)` (default: `None`)
The font size of the legend's title. Note: This cannot be combined with *title\_fontproperties*. If you want to set the fontsize alongside other font properties, use the *size* parameter in *title\_fontproperties*.
**alignment**{'center', 'left', 'right'}, default: 'center'
The alignment of the legend title and the box of entries. The entries are aligned as a single block, so that markers always lined up.
**borderpad**float, default: `[rcParams["legend.borderpad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.borderpad#matplotlibrc-sample)` (default: `0.4`)
The fractional whitespace inside the legend border, in font-size units.
**labelspacing**float, default: `[rcParams["legend.labelspacing"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.labelspacing#matplotlibrc-sample)` (default: `0.5`)
The vertical space between the legend entries, in font-size units.
**handlelength**float, default: `[rcParams["legend.handlelength"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.handlelength#matplotlibrc-sample)` (default: `2.0`)
The length of the legend handles, in font-size units.
**handleheight**float, default: `[rcParams["legend.handleheight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.handleheight#matplotlibrc-sample)` (default: `0.7`)
The height of the legend handles, in font-size units.
**handletextpad**float, default: `[rcParams["legend.handletextpad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.handletextpad#matplotlibrc-sample)` (default: `0.8`)
The pad between the legend handle and text, in font-size units.
**borderaxespad**float, default: `[rcParams["legend.borderaxespad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.borderaxespad#matplotlibrc-sample)` (default: `0.5`)
The pad between the axes and legend border, in font-size units.
**columnspacing**float, default: `[rcParams["legend.columnspacing"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.columnspacing#matplotlibrc-sample)` (default: `2.0`)
The spacing between columns, in font-size units.
**handler\_map**dict or None
The custom dictionary mapping instances or types to a legend handler. This *handler\_map* updates the default handler map found at [`matplotlib.legend.Legend.get_legend_handler_map`](legend_api#matplotlib.legend.Legend.get_legend_handler_map "matplotlib.legend.Legend.get_legend_handler_map").
See also
[`Axes.legend`](_as_gen/matplotlib.axes.axes.legend#matplotlib.axes.Axes.legend "matplotlib.axes.Axes.legend")
#### Notes
Some artists are not supported by this function. See [Legend guide](https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html) for details.
*property*mouseover
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
pchanged()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L387-L398)
Call all of the registered callbacks.
This function is triggered internally when a property is changed.
See also
[`add_callback`](#matplotlib.figure.FigureBase.add_callback "matplotlib.figure.FigureBase.add_callback")
[`remove_callback`](#matplotlib.figure.FigureBase.remove_callback "matplotlib.figure.FigureBase.remove_callback")
pick(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L490-L525)
Process a pick event.
Each child artist will fire a pick event if *mouseevent* is over the artist and the artist has picker set.
See also
[`set_picker`](#matplotlib.figure.FigureBase.set_picker "matplotlib.figure.FigureBase.set_picker"), [`get_picker`](#matplotlib.figure.FigureBase.get_picker "matplotlib.figure.FigureBase.get_picker"), [`pickable`](#matplotlib.figure.FigureBase.pickable "matplotlib.figure.FigureBase.pickable")
pickable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L480-L488)
Return whether the artist is pickable.
See also
[`set_picker`](#matplotlib.figure.FigureBase.set_picker "matplotlib.figure.FigureBase.set_picker"), [`get_picker`](#matplotlib.figure.FigureBase.get_picker "matplotlib.figure.FigureBase.get_picker"), [`pick`](#matplotlib.figure.FigureBase.pick "matplotlib.figure.FigureBase.pick")
properties()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1139-L1141)
Return a dictionary of all the properties of the artist.
remove()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L193-L234)
Remove the artist from the figure if possible.
The effect will not be visible until the figure is redrawn, e.g., with [`FigureCanvasBase.draw_idle`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase.draw_idle "matplotlib.backend_bases.FigureCanvasBase.draw_idle"). Call [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") to update the axes limits if desired.
Note: [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") will not see collections even if the collection was added to the axes with *autolim* = True.
Note: there is no support for removing the artist's legend entry.
remove\_callback(*oid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L377-L385)
Remove a callback based on its observer id.
See also
[`add_callback`](#matplotlib.figure.FigureBase.add_callback "matplotlib.figure.FigureBase.add_callback")
sca(*a*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1598-L1602)
Set the current Axes to be *a* and return *a*.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *frameon=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`edgecolor`](#matplotlib.figure.FigureBase.set_edgecolor "matplotlib.figure.FigureBase.set_edgecolor") | color |
| [`facecolor`](#matplotlib.figure.FigureBase.set_facecolor "matplotlib.figure.FigureBase.set_facecolor") | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frameon`](#matplotlib.figure.FigureBase.set_frameon "matplotlib.figure.FigureBase.set_frameon") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linewidth`](#matplotlib.figure.FigureBase.set_linewidth "matplotlib.figure.FigureBase.set_linewidth") | number |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_agg\_filter(*filter\_func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L933-L949)
Set the agg filter.
Parameters:
**filter\_func**callable
A filter function, which takes a (m, n, depth) float array and a dpi value, and returns a (m, n, depth) array and two offsets from the bottom left corner of the image
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L970-L986)
Set the alpha value used for blending - not supported on all backends.
Parameters:
**alpha**scalar or None
*alpha* must be within the 0-1 range, inclusive.
set\_animated(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1023-L1041)
Set whether the artist is intended to be used in an animation.
If True, the artist is excluded from regular drawing of the figure. You have to call [`Figure.draw_artist`](#matplotlib.figure.Figure.draw_artist "matplotlib.figure.Figure.draw_artist") / [`Axes.draw_artist`](_as_gen/matplotlib.axes.axes.draw_artist#matplotlib.axes.Axes.draw_artist "matplotlib.axes.Axes.draw_artist") explicitly on the artist. This approach is used to speed up animations using blitting.
See also [`matplotlib.animation`](animation_api#module-matplotlib.animation "matplotlib.animation") and [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html).
Parameters:
**b**bool
set\_clip\_box(*clipbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L731-L741)
Set the artist's clip [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
Parameters:
**clipbox**[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
set\_clip\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L877-L892)
Set whether the artist uses clipping.
When False artists will be visible outside of the Axes which can lead to unexpected results.
Parameters:
**b**bool
set\_clip\_path(*path*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L743-L803)
Set the artist's clip path.
Parameters:
**path**[`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") or [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") or [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") or None
The clip path. If given a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), *transform* must be provided as well. If *None*, a previously set clip path is removed.
**transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
Only used if *path* is a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), in which case the given [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") is converted to a [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") using *transform*.
#### Notes
For efficiency, if *path* is a [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") this method will set the clipping box to the corresponding rectangle and set the clipping path to `None`.
For technical reasons (support of [`set`](_as_gen/matplotlib.artist.artist.set#matplotlib.artist.Artist.set "matplotlib.artist.Artist.set")), a tuple (*path*, *transform*) is also accepted as a single positional parameter.
set\_edgecolor(*color*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L436-L444)
Set the edge color of the Figure rectangle.
Parameters:
**color**color
set\_facecolor(*color*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L446-L454)
Set the face color of the Figure rectangle.
Parameters:
**color**color
set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L707-L729)
Set the [`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
Parameters:
**fig**[`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure")
set\_frameon(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L456-L467)
Set the figure's background patch visibility, i.e. whether the figure background will be drawn. Equivalent to `Figure.patch.set_visible()`.
Parameters:
**b**bool
set\_gid(*gid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L592-L600)
Set the (group) id for the artist.
Parameters:
**gid**str
set\_in\_layout(*in\_layout*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1043-L1054)
Set if artist is to be included in layout calculations, E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
Parameters:
**in\_layout**bool
set\_label(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1060-L1074)
Set a label that will be displayed in the legend.
Parameters:
**s**object
*s* will be converted to a string by calling [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)").
set\_linewidth(*linewidth*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L420-L428)
Set the line width of the Figure rectangle.
Parameters:
**linewidth**number
set\_mouseover(*mouseover*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1345-L1366)
Set whether this artist is queried for custom context information when the mouse cursor moves over it.
Parameters:
**mouseover**bool
See also
[`get_cursor_data`](#matplotlib.figure.FigureBase.get_cursor_data "matplotlib.figure.FigureBase.get_cursor_data")
[`ToolCursorPosition`](backend_tools_api#matplotlib.backend_tools.ToolCursorPosition "matplotlib.backend_tools.ToolCursorPosition")
[`NavigationToolbar2`](backend_bases_api#matplotlib.backend_bases.NavigationToolbar2 "matplotlib.backend_bases.NavigationToolbar2")
set\_path\_effects(*path\_effects*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L689-L698)
Set the path effects.
Parameters:
**path\_effects**[`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
set\_picker(*picker*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L527-L560)
Define the picking behavior of the artist.
Parameters:
**picker**None or bool or float or callable
This can be one of the following:
* *None*: Picking is disabled for this artist (default).
* A boolean: If *True* then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist.
* A float: If picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if its data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event
* A function: If picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event:
```
hit, props = picker(artist, mouseevent)
```
to determine the hit test. if the mouse event is over the artist, return *hit=True* and props is a dictionary of properties you want added to the PickEvent attributes.
set\_rasterized(*rasterized*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L908-L927)
Force rasterized (bitmap) drawing for vector graphics output.
Rasterized drawing is not supported by all artists. If you try to enable this on an artist that does not support it, the command has no effect and a warning will be issued.
This setting is ignored for pixel-based output.
See also [Rasterization for vector graphics](https://matplotlib.org/stable/gallery/misc/rasterization_demo.html).
Parameters:
**rasterized**bool
set\_sketch\_params(*scale=None*, *length=None*, *randomness=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L661-L687)
Set the sketch parameters.
Parameters:
**scale**float, optional
The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), or not provided, no sketch filter will be provided.
**length**float, optional
The length of the wiggle along the line, in pixels (default 128.0)
**randomness**float, optional
The scale factor by which the length is shrunken or expanded (default 16.0)
The PGF backend uses this argument as an RNG seed and not as described above. Using the same seed yields the same random shape.
set\_snap(*snap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L613-L639)
Set the snapping behavior.
Snapping aligns positions with the pixel grid, which results in clearer images. For example, if a black line of 1px width was defined at a position in between two pixels, the resulting image would contain the interpolated value of that line in the pixel grid, which would be a grey value on both adjacent pixel positions. In contrast, snapping will move the line to the nearest integer pixel value, so that the resulting image will really contain a 1px wide black line.
Snapping is currently only supported by the Agg and MacOSX backends.
Parameters:
**snap**bool or None
Possible values:
* *True*: Snap vertices to the nearest pixel center.
* *False*: Do not modify vertex positions.
* *None*: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center.
set\_transform(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L408-L419)
Set the artist transform.
Parameters:
**t**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_url(*url*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L578-L586)
Set the url for the artist.
Parameters:
**url**str
set\_visible(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1011-L1021)
Set the artist's visibility.
Parameters:
**b**bool
set\_zorder(*level*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1080-L1093)
Set the zorder for the artist. Artists with lower zorder values are drawn first.
Parameters:
**level**float
*property*stale
Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist.
*property*sticky\_edges
`x` and `y` sticky edge lists for autoscaling.
When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added--the view limit "sticks" to the edge. A typical use case is histograms, where one usually expects no margin on the bottom edge (0) of the histogram.
Moreover, margin expansion "bumps" against sticky edges and cannot cross them. For example, if the upper data limit is 1.0, the upper view limit computed by simple margin application is 1.2, but there is a sticky edge at 1.1, then the actual upper view limit will be 1.1.
This attribute cannot be assigned to; however, the `x` and `y` lists can be modified in place as needed.
#### Examples
```
>>> artist.sticky_edges.x[:] = (xmin, xmax)
>>> artist.sticky_edges.y[:] = (ymin, ymax)
```
subfigures(*nrows=1*, *ncols=1*, *squeeze=True*, *wspace=None*, *hspace=None*, *width\_ratios=None*, *height\_ratios=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1517-L1569)
Add a subfigure to this figure or subfigure.
A subfigure has the same artist methods as a figure, and is logically the same as a figure, but cannot print itself. See [Figure subfigures](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subfigures.html).
Parameters:
**nrows, ncols**int, default: 1
Number of rows/columns of the subfigure grid.
**squeeze**bool, default: True
If True, extra dimensions are squeezed out from the returned array of subfigures.
**wspace, hspace**float, default: None
The amount of width/height reserved for space between subfigures, expressed as a fraction of the average subfigure width/height. If not given, the values will be inferred from a figure or rcParams when necessary.
**width\_ratios**array-like of length *ncols*, optional
Defines the relative widths of the columns. Each column gets a relative width of `width_ratios[i] / sum(width_ratios)`. If not given, all columns will have the same width.
**height\_ratios**array-like of length *nrows*, optional
Defines the relative heights of the rows. Each row gets a relative height of `height_ratios[i] / sum(height_ratios)`. If not given, all rows will have the same height.
subplot\_mosaic(*mosaic*, *\**, *sharex=False*, *sharey=False*, *width\_ratios=None*, *height\_ratios=None*, *empty\_sentinel='.'*, *subplot\_kw=None*, *gridspec\_kw=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1777-L2054)
Build a layout of Axes based on ASCII art or nested lists.
This is a helper function to build complex GridSpec layouts visually.
Note
This API is provisional and may be revised in the future based on early user feedback.
See [Complex and semantic figure composition](https://matplotlib.org/stable/tutorials/provisional/mosaic.html) for an example and full API documentation
Parameters:
**mosaic**list of list of {hashable or nested} or str
A visual layout of how you want your Axes to be arranged labeled as strings. For example
```
x = [['A panel', 'A panel', 'edge'],
['C panel', '.', 'edge']]
```
produces 4 Axes:
* 'A panel' which is 1 row high and spans the first two columns
* 'edge' which is 2 rows high and is on the right edge
* 'C panel' which in 1 row and 1 column wide in the bottom left
* a blank space 1 row and 1 column wide in the bottom center
Any of the entries in the layout can be a list of lists of the same form to create nested layouts.
If input is a str, then it can either be a multi-line string of the form
```
'''
AAE
C.E
'''
```
where each character is a column and each line is a row. Or it can be a single-line string where rows are separated by `;`:
```
'AB;CC'
```
The string notation allows only single character Axes labels and does not support nesting but is very terse.
**sharex, sharey**bool, default: False
If True, the x-axis (*sharex*) or y-axis (*sharey*) will be shared among all subplots. In that case, tick label visibility and axis units behave as for [`subplots`](#matplotlib.figure.FigureBase.subplots "matplotlib.figure.FigureBase.subplots"). If False, each subplot's x- or y-axis will be independent.
**width\_ratios**array-like of length *ncols*, optional
Defines the relative widths of the columns. Each column gets a relative width of `width_ratios[i] / sum(width_ratios)`. If not given, all columns will have the same width. Equivalent to `gridspec_kw={'width_ratios': [...]}`.
**height\_ratios**array-like of length *nrows*, optional
Defines the relative heights of the rows. Each row gets a relative height of `height_ratios[i] / sum(height_ratios)`. If not given, all rows will have the same height. Equivalent to `gridspec_kw={'height_ratios': [...]}`.
**subplot\_kw**dict, optional
Dictionary with keywords passed to the [`Figure.add_subplot`](#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot") call used to create each subplot.
**gridspec\_kw**dict, optional
Dictionary with keywords passed to the [`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec") constructor used to create the grid the subplots are placed on.
**empty\_sentinel**object, optional
Entry in the layout to mean "leave this space empty". Defaults to `'.'`. Note, if *layout* is a string, it is processed via [`inspect.cleandoc`](https://docs.python.org/3/library/inspect.html#inspect.cleandoc "(in Python v3.10)") to remove leading white space, which may interfere with using white-space as the empty sentinel.
Returns:
dict[label, Axes]
A dictionary mapping the labels to the Axes objects. The order of the axes is left-to-right and top-to-bottom of their position in the total layout.
subplots(*nrows=1*, *ncols=1*, *\**, *sharex=False*, *sharey=False*, *squeeze=True*, *width\_ratios=None*, *height\_ratios=None*, *subplot\_kw=None*, *gridspec\_kw=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L762-L897)
Add a set of subplots to this figure.
This utility wrapper makes it convenient to create common layouts of subplots in a single call.
Parameters:
**nrows, ncols**int, default: 1
Number of rows/columns of the subplot grid.
**sharex, sharey**bool or {'none', 'all', 'row', 'col'}, default: False
Controls sharing of x-axis (*sharex*) or y-axis (*sharey*):
* True or 'all': x- or y-axis will be shared among all subplots.
* False or 'none': each subplot x- or y-axis will be independent.
* 'row': each subplot row will share an x- or y-axis.
* 'col': each subplot column will share an x- or y-axis.
When subplots have a shared x-axis along a column, only the x tick labels of the bottom subplot are created. Similarly, when subplots have a shared y-axis along a row, only the y tick labels of the first column subplot are created. To later turn other subplots' ticklabels on, use [`tick_params`](_as_gen/matplotlib.axes.axes.tick_params#matplotlib.axes.Axes.tick_params "matplotlib.axes.Axes.tick_params").
When subplots have a shared axis that has units, calling [`Axis.set_units`](_as_gen/matplotlib.axis.axis.set_units#matplotlib.axis.Axis.set_units "matplotlib.axis.Axis.set_units") will update each axis with the new units.
**squeeze**bool, default: True
* If True, extra dimensions are squeezed out from the returned array of Axes:
+ if only one subplot is constructed (nrows=ncols=1), the resulting single Axes object is returned as a scalar.
+ for Nx1 or 1xM subplots, the returned object is a 1D numpy object array of Axes objects.
+ for NxM, subplots with N>1 and M>1 are returned as a 2D array.
* If False, no squeezing at all is done: the returned Axes object is always a 2D array containing Axes instances, even if it ends up being 1x1.
**width\_ratios**array-like of length *ncols*, optional
Defines the relative widths of the columns. Each column gets a relative width of `width_ratios[i] / sum(width_ratios)`. If not given, all columns will have the same width. Equivalent to `gridspec_kw={'width_ratios': [...]}`.
**height\_ratios**array-like of length *nrows*, optional
Defines the relative heights of the rows. Each row gets a relative height of `height_ratios[i] / sum(height_ratios)`. If not given, all rows will have the same height. Equivalent to `gridspec_kw={'height_ratios': [...]}`.
**subplot\_kw**dict, optional
Dict with keywords passed to the [`Figure.add_subplot`](#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot") call used to create each subplot.
**gridspec\_kw**dict, optional
Dict with keywords passed to the [`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec") constructor used to create the grid the subplots are placed on.
Returns:
[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") or array of Axes
Either a single [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") object or an array of Axes objects if more than one subplot was created. The dimensions of the resulting array can be controlled with the *squeeze* keyword, see above.
See also
[`pyplot.subplots`](_as_gen/matplotlib.pyplot.subplots#matplotlib.pyplot.subplots "matplotlib.pyplot.subplots")
[`Figure.add_subplot`](#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot")
[`pyplot.subplot`](_as_gen/matplotlib.pyplot.subplot#matplotlib.pyplot.subplot "matplotlib.pyplot.subplot")
#### Examples
```
# First create some toy data:
x = np.linspace(0, 2*np.pi, 400)
y = np.sin(x**2)
# Create a figure
plt.figure()
# Create a subplot
ax = fig.subplots()
ax.plot(x, y)
ax.set_title('Simple plot')
# Create two subplots and unpack the output array immediately
ax1, ax2 = fig.subplots(1, 2, sharey=True)
ax1.plot(x, y)
ax1.set_title('Sharing Y axis')
ax2.scatter(x, y)
# Create four polar Axes and access them through the returned array
axes = fig.subplots(2, 2, subplot_kw=dict(projection='polar'))
axes[0, 0].plot(x, y)
axes[1, 1].scatter(x, y)
# Share a X axis with each column of subplots
fig.subplots(2, 2, sharex='col')
# Share a Y axis with each row of subplots
fig.subplots(2, 2, sharey='row')
# Share both X and Y axes with all subplots
fig.subplots(2, 2, sharex='all', sharey='all')
# Note that this is the same as
fig.subplots(2, 2, sharex=True, sharey=True)
```
subplots\_adjust(*left=None*, *bottom=None*, *right=None*, *top=None*, *wspace=None*, *hspace=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1283-L1323)
Adjust the subplot layout parameters.
Unset parameters are left unmodified; initial values are given by `[rcParams["figure.subplot.[name]"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.subplot.%5Bname%5D#matplotlibrc-sample)`.
Parameters:
**left**float, optional
The position of the left edge of the subplots, as a fraction of the figure width.
**right**float, optional
The position of the right edge of the subplots, as a fraction of the figure width.
**bottom**float, optional
The position of the bottom edge of the subplots, as a fraction of the figure height.
**top**float, optional
The position of the top edge of the subplots, as a fraction of the figure height.
**wspace**float, optional
The width of the padding between subplots, as a fraction of the average Axes width.
**hspace**float, optional
The height of the padding between subplots, as a fraction of the average Axes height.
suptitle(*t*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L373-L381)
Add a centered suptitle to the figure.
Parameters:
**t**str
The suptitle text.
**x**float, default: 0.5
The x location of the text in figure coordinates.
**y**float, default: 0.98
The y location of the text in figure coordinates.
**horizontalalignment, ha**{'center', 'left', 'right'}, default: center
The horizontal alignment of the text relative to (*x*, *y*).
**verticalalignment, va**{'top', 'center', 'bottom', 'baseline'}, default: top
The vertical alignment of the text relative to (*x*, *y*).
**fontsize, size**default: `[rcParams["figure.titlesize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.titlesize#matplotlibrc-sample)` (default: `'large'`)
The font size of the text. See [`Text.set_size`](text_api#matplotlib.text.Text.set_size "matplotlib.text.Text.set_size") for possible values.
**fontweight, weight**default: `[rcParams["figure.titleweight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.titleweight#matplotlibrc-sample)` (default: `'normal'`)
The font weight of the text. See [`Text.set_weight`](text_api#matplotlib.text.Text.set_weight "matplotlib.text.Text.set_weight") for possible values.
Returns:
text
The [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") instance of the suptitle.
Other Parameters:
**fontproperties**None or dict, optional
A dict of font properties. If *fontproperties* is given the default values for font size and weight are taken from the [`FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") defaults. `[rcParams["figure.titlesize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.titlesize#matplotlibrc-sample)` (default: `'large'`) and `[rcParams["figure.titleweight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.titleweight#matplotlibrc-sample)` (default: `'normal'`) are ignored in this case.
**\*\*kwargs**
Additional kwargs are [`matplotlib.text.Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") properties.
supxlabel(*t*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L383-L391)
Add a centered supxlabel to the figure.
Parameters:
**t**str
The supxlabel text.
**x**float, default: 0.5
The x location of the text in figure coordinates.
**y**float, default: 0.01
The y location of the text in figure coordinates.
**horizontalalignment, ha**{'center', 'left', 'right'}, default: center
The horizontal alignment of the text relative to (*x*, *y*).
**verticalalignment, va**{'top', 'center', 'bottom', 'baseline'}, default: bottom
The vertical alignment of the text relative to (*x*, *y*).
**fontsize, size**default: `[rcParams["figure.labelsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelsize#matplotlibrc-sample)` (default: `'large'`)
The font size of the text. See [`Text.set_size`](text_api#matplotlib.text.Text.set_size "matplotlib.text.Text.set_size") for possible values.
**fontweight, weight**default: `[rcParams["figure.labelweight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelweight#matplotlibrc-sample)` (default: `'normal'`)
The font weight of the text. See [`Text.set_weight`](text_api#matplotlib.text.Text.set_weight "matplotlib.text.Text.set_weight") for possible values.
Returns:
text
The [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") instance of the supxlabel.
Other Parameters:
**fontproperties**None or dict, optional
A dict of font properties. If *fontproperties* is given the default values for font size and weight are taken from the [`FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") defaults. `[rcParams["figure.labelsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelsize#matplotlibrc-sample)` (default: `'large'`) and `[rcParams["figure.labelweight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelweight#matplotlibrc-sample)` (default: `'normal'`) are ignored in this case.
**\*\*kwargs**
Additional kwargs are [`matplotlib.text.Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") properties.
supylabel(*t*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L393-L402)
Add a centered supylabel to the figure.
Parameters:
**t**str
The supylabel text.
**x**float, default: 0.02
The x location of the text in figure coordinates.
**y**float, default: 0.5
The y location of the text in figure coordinates.
**horizontalalignment, ha**{'center', 'left', 'right'}, default: left
The horizontal alignment of the text relative to (*x*, *y*).
**verticalalignment, va**{'top', 'center', 'bottom', 'baseline'}, default: center
The vertical alignment of the text relative to (*x*, *y*).
**fontsize, size**default: `[rcParams["figure.labelsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelsize#matplotlibrc-sample)` (default: `'large'`)
The font size of the text. See [`Text.set_size`](text_api#matplotlib.text.Text.set_size "matplotlib.text.Text.set_size") for possible values.
**fontweight, weight**default: `[rcParams["figure.labelweight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelweight#matplotlibrc-sample)` (default: `'normal'`)
The font weight of the text. See [`Text.set_weight`](text_api#matplotlib.text.Text.set_weight "matplotlib.text.Text.set_weight") for possible values.
Returns:
text
The [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") instance of the supylabel.
Other Parameters:
**fontproperties**None or dict, optional
A dict of font properties. If *fontproperties* is given the default values for font size and weight are taken from the [`FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") defaults. `[rcParams["figure.labelsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelsize#matplotlibrc-sample)` (default: `'large'`) and `[rcParams["figure.labelweight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelweight#matplotlibrc-sample)` (default: `'normal'`) are ignored in this case.
**\*\*kwargs**
Additional kwargs are [`matplotlib.text.Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") properties.
text(*x*, *y*, *s*, *fontdict=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1126-L1174)
Add text to figure.
Parameters:
**x, y**float
The position to place the text. By default, this is in figure coordinates, floats in [0, 1]. The coordinate system can be changed using the *transform* keyword.
**s**str
The text string.
**fontdict**dict, optional
A dictionary to override the default text properties. If not given, the defaults are determined by `[rcParams["font.\*"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=font.*#matplotlibrc-sample)`. Properties passed as *kwargs* override the corresponding ones given in *fontdict*.
Returns:
[`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")
Other Parameters:
**\*\*kwargs**[`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") properties
Other miscellaneous text parameters.
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`backgroundcolor`](text_api#matplotlib.text.Text.set_backgroundcolor "matplotlib.text.Text.set_backgroundcolor") | color |
| [`bbox`](text_api#matplotlib.text.Text.set_bbox "matplotlib.text.Text.set_bbox") | dict with properties for [`patches.FancyBboxPatch`](_as_gen/matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | unknown |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | unknown |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | unknown |
| [`color`](text_api#matplotlib.text.Text.set_color "matplotlib.text.Text.set_color") or c | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fontfamily`](text_api#matplotlib.text.Text.set_fontfamily "matplotlib.text.Text.set_fontfamily") or family | {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'} |
| [`fontproperties`](text_api#matplotlib.text.Text.set_fontproperties "matplotlib.text.Text.set_fontproperties") or font or font\_properties | [`font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") or [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.10)") |
| [`fontsize`](text_api#matplotlib.text.Text.set_fontsize "matplotlib.text.Text.set_fontsize") or size | float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'} |
| [`fontstretch`](text_api#matplotlib.text.Text.set_fontstretch "matplotlib.text.Text.set_fontstretch") or stretch | {a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'} |
| [`fontstyle`](text_api#matplotlib.text.Text.set_fontstyle "matplotlib.text.Text.set_fontstyle") or style | {'normal', 'italic', 'oblique'} |
| [`fontvariant`](text_api#matplotlib.text.Text.set_fontvariant "matplotlib.text.Text.set_fontvariant") or variant | {'normal', 'small-caps'} |
| [`fontweight`](text_api#matplotlib.text.Text.set_fontweight "matplotlib.text.Text.set_fontweight") or weight | {a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'} |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`horizontalalignment`](text_api#matplotlib.text.Text.set_horizontalalignment "matplotlib.text.Text.set_horizontalalignment") or ha | {'left', 'center', 'right'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linespacing`](text_api#matplotlib.text.Text.set_linespacing "matplotlib.text.Text.set_linespacing") | float (multiple of font size) |
| [`math_fontfamily`](text_api#matplotlib.text.Text.set_math_fontfamily "matplotlib.text.Text.set_math_fontfamily") | str |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`multialignment`](text_api#matplotlib.text.Text.set_multialignment "matplotlib.text.Text.set_multialignment") or ma | {'left', 'right', 'center'} |
| [`parse_math`](text_api#matplotlib.text.Text.set_parse_math "matplotlib.text.Text.set_parse_math") | bool |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](text_api#matplotlib.text.Text.set_position "matplotlib.text.Text.set_position") | (float, float) |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`rotation`](text_api#matplotlib.text.Text.set_rotation "matplotlib.text.Text.set_rotation") | float or {'vertical', 'horizontal'} |
| [`rotation_mode`](text_api#matplotlib.text.Text.set_rotation_mode "matplotlib.text.Text.set_rotation_mode") | {None, 'default', 'anchor'} |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`text`](text_api#matplotlib.text.Text.set_text "matplotlib.text.Text.set_text") | object |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`transform_rotates_text`](text_api#matplotlib.text.Text.set_transform_rotates_text "matplotlib.text.Text.set_transform_rotates_text") | bool |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`usetex`](text_api#matplotlib.text.Text.set_usetex "matplotlib.text.Text.set_usetex") | bool or None |
| [`verticalalignment`](text_api#matplotlib.text.Text.set_verticalalignment "matplotlib.text.Text.set_verticalalignment") or va | {'bottom', 'baseline', 'center', 'center\_baseline', 'top'} |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`wrap`](text_api#matplotlib.text.Text.set_wrap "matplotlib.text.Text.set_wrap") | bool |
| [`x`](text_api#matplotlib.text.Text.set_x "matplotlib.text.Text.set_x") | float |
| [`y`](text_api#matplotlib.text.Text.set_y "matplotlib.text.Text.set_y") | float |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`Axes.text`](_as_gen/matplotlib.axes.axes.text#matplotlib.axes.Axes.text "matplotlib.axes.Axes.text")
[`pyplot.text`](_as_gen/matplotlib.pyplot.text#matplotlib.pyplot.text "matplotlib.pyplot.text")
update(*props*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1168-L1177)
Update this artist's properties from the dict *props*.
Parameters:
**props**dict
update\_from(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1122-L1137)
Copy properties from *other* to *self*.
zorder*=0*
*class*matplotlib.figure.SubFigure(*parent*, *subplotspec*, *\**, *facecolor=None*, *edgecolor=None*, *linewidth=0.0*, *frameon=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2063-L2276)
Logical figure that can be placed inside a figure.
Typically instantiated using [`Figure.add_subfigure`](#matplotlib.figure.Figure.add_subfigure "matplotlib.figure.Figure.add_subfigure") or [`SubFigure.add_subfigure`](#matplotlib.figure.SubFigure.add_subfigure "matplotlib.figure.SubFigure.add_subfigure"), or [`SubFigure.subfigures`](#matplotlib.figure.SubFigure.subfigures "matplotlib.figure.SubFigure.subfigures"). A subfigure has the same methods as a figure except for those particularly tied to the size or dpi of the figure, and is confined to a prescribed region of the figure. For example the following puts two subfigures side-by-side:
```
fig = plt.figure()
sfigs = fig.subfigures(1, 2)
axsL = sfigs[0].subplots(1, 2)
axsR = sfigs[1].subplots(2, 1)
```
See [Figure subfigures](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subfigures.html)
Parameters:
**parent**[`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") or [`SubFigure`](#matplotlib.figure.SubFigure "matplotlib.figure.SubFigure")
Figure or subfigure that contains the SubFigure. SubFigures can be nested.
**subplotspec**[`gridspec.SubplotSpec`](_as_gen/matplotlib.gridspec.subplotspec#matplotlib.gridspec.SubplotSpec "matplotlib.gridspec.SubplotSpec")
Defines the region in a parent gridspec where the subfigure will be placed.
**facecolor**default: `[rcParams["figure.facecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.facecolor#matplotlibrc-sample)` (default: `'white'`)
The figure patch face color.
**edgecolor**default: `[rcParams["figure.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.edgecolor#matplotlibrc-sample)` (default: `'white'`)
The figure patch edge color.
**linewidth**float
The linewidth of the frame (i.e. the edge linewidth of the figure patch).
**frameon**bool, default: `[rcParams["figure.frameon"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.frameon#matplotlibrc-sample)` (default: `True`)
If `False`, suppress drawing the figure background patch.
Other Parameters:
**\*\*kwargs**[`SubFigure`](#matplotlib.figure.SubFigure "matplotlib.figure.SubFigure") properties, optional
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`dpi`](#matplotlib.figure.SubFigure.set_dpi "matplotlib.figure.SubFigure.set_dpi") | float |
| [`edgecolor`](#matplotlib.figure.FigureBase.set_edgecolor "matplotlib.figure.FigureBase.set_edgecolor") | color |
| [`facecolor`](#matplotlib.figure.FigureBase.set_facecolor "matplotlib.figure.FigureBase.set_facecolor") | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frameon`](#matplotlib.figure.FigureBase.set_frameon "matplotlib.figure.FigureBase.set_frameon") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linewidth`](#matplotlib.figure.FigureBase.set_linewidth "matplotlib.figure.FigureBase.set_linewidth") | number |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
add\_artist(*artist*, *clip=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L471-L504)
Add an [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") to the figure.
Usually artists are added to Axes objects using [`Axes.add_artist`](_as_gen/matplotlib.axes.axes.add_artist#matplotlib.axes.Axes.add_artist "matplotlib.axes.Axes.add_artist"); this method can be used in the rare cases where one needs to add artists directly to the figure instead.
Parameters:
**artist**[`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
The artist to add to the figure. If the added artist has no transform previously set, its transform will be set to `figure.transSubfigure`.
**clip**bool, default: False
Whether the added artist should be clipped by the figure patch.
Returns:
[`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
The added artist.
add\_axes(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L506-L617)
Add an Axes to the figure.
Call signatures:
```
add_axes(rect, projection=None, polar=False, **kwargs)
add_axes(ax)
```
Parameters:
**rect**tuple (left, bottom, width, height)
The dimensions (left, bottom, width, height) of the new Axes. All quantities are in fractions of figure width and height.
**projection**{None, 'aitoff', 'hammer', 'lambert', 'mollweide', 'polar', 'rectilinear', str}, optional
The projection type of the [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"). *str* is the name of a custom projection, see [`projections`](projections_api#module-matplotlib.projections "matplotlib.projections"). The default None results in a 'rectilinear' projection.
**polar**bool, default: False
If True, equivalent to projection='polar'.
**axes\_class**subclass type of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
The [`axes.Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") subclass that is instantiated. This parameter is incompatible with *projection* and *polar*. See [axisartist](https://matplotlib.org/stable/tutorials/toolkits/axisartist.html#axisartist-users-guide-index) for examples.
**sharex, sharey**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
Share the x or y [`axis`](axis_api#module-matplotlib.axis "matplotlib.axis") with sharex and/or sharey. The axis will have the same limits, ticks, and scale as the axis of the shared axes.
**label**str
A label for the returned Axes.
Returns:
[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), or a subclass of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The returned axes class depends on the projection used. It is [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") if rectilinear projection is used and [`projections.polar.PolarAxes`](projections_api#matplotlib.projections.polar.PolarAxes "matplotlib.projections.polar.PolarAxes") if polar projection is used.
Other Parameters:
**\*\*kwargs**
This method also takes the keyword arguments for the returned Axes class. The keyword arguments for the rectilinear Axes class [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") can be found in the following table but there might also be other keyword arguments if another projection is used, see the actual Axes class.
| Property | Description |
| --- | --- |
| [`adjustable`](_as_gen/matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](_as_gen/matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](_as_gen/matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](_as_gen/matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](_as_gen/matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](_as_gen/matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](_as_gen/matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](_as_gen/matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](_as_gen/matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](_as_gen/matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](_as_gen/matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](_as_gen/matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](_as_gen/matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](_as_gen/matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](_as_gen/matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](_as_gen/matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](_as_gen/matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](_as_gen/matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](_as_gen/matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xmargin`](_as_gen/matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](_as_gen/matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](_as_gen/matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](_as_gen/matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](_as_gen/matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](_as_gen/matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](_as_gen/matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ymargin`](_as_gen/matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](_as_gen/matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](_as_gen/matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](_as_gen/matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`Figure.add_subplot`](#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot")
[`pyplot.subplot`](_as_gen/matplotlib.pyplot.subplot#matplotlib.pyplot.subplot "matplotlib.pyplot.subplot")
[`pyplot.axes`](_as_gen/matplotlib.pyplot.axes#matplotlib.pyplot.axes "matplotlib.pyplot.axes")
[`Figure.subplots`](#matplotlib.figure.Figure.subplots "matplotlib.figure.Figure.subplots")
[`pyplot.subplots`](_as_gen/matplotlib.pyplot.subplots#matplotlib.pyplot.subplots "matplotlib.pyplot.subplots")
#### Notes
In rare circumstances, [`add_axes`](#matplotlib.figure.SubFigure.add_axes "matplotlib.figure.SubFigure.add_axes") may be called with a single argument, an Axes instance already created in the present figure but not in the figure's list of Axes.
#### Examples
Some simple examples:
```
rect = l, b, w, h
fig = plt.figure()
fig.add_axes(rect)
fig.add_axes(rect, frameon=False, facecolor='g')
fig.add_axes(rect, polar=True)
ax = fig.add_axes(rect, projection='polar')
fig.delaxes(ax)
fig.add_axes(ax)
```
add\_callback(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L348-L375)
Add a callback function that will be called whenever one of the [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")'s properties changes.
Parameters:
**func**callable
The callback function. It must have the signature:
```
def func(artist: Artist) -> Any
```
where *artist* is the calling [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"). Return values may exist but are ignored.
Returns:
int
The observer id associated with the callback. This id can be used for removing the callback with [`remove_callback`](#matplotlib.figure.SubFigure.remove_callback "matplotlib.figure.SubFigure.remove_callback") later.
See also
[`remove_callback`](#matplotlib.figure.SubFigure.remove_callback "matplotlib.figure.SubFigure.remove_callback")
add\_gridspec(*nrows=1*, *ncols=1*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1474-L1515)
Return a [`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec") that has this figure as a parent. This allows complex layout of Axes in the figure.
Parameters:
**nrows**int, default: 1
Number of rows in grid.
**ncols**int, default: 1
Number or columns in grid.
Returns:
[`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec")
Other Parameters:
**\*\*kwargs**
Keyword arguments are passed to [`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec").
See also
[`matplotlib.pyplot.subplots`](_as_gen/matplotlib.pyplot.subplots#matplotlib.pyplot.subplots "matplotlib.pyplot.subplots")
#### Examples
Adding a subplot that spans two rows:
```
fig = plt.figure()
gs = fig.add_gridspec(2, 2)
ax1 = fig.add_subplot(gs[0, 0])
ax2 = fig.add_subplot(gs[1, 0])
# spans two rows:
ax3 = fig.add_subplot(gs[:, 1])
```
add\_subfigure(*subplotspec*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1571-L1596)
Add a [`SubFigure`](#matplotlib.figure.SubFigure "matplotlib.figure.SubFigure") to the figure as part of a subplot arrangement.
Parameters:
**subplotspec**[`gridspec.SubplotSpec`](_as_gen/matplotlib.gridspec.subplotspec#matplotlib.gridspec.SubplotSpec "matplotlib.gridspec.SubplotSpec")
Defines the region in a parent gridspec where the subfigure will be placed.
Returns:
[`SubFigure`](#matplotlib.figure.SubFigure "matplotlib.figure.SubFigure")
Other Parameters:
**\*\*kwargs**
Are passed to the [`SubFigure`](#matplotlib.figure.SubFigure "matplotlib.figure.SubFigure") object.
See also
[`Figure.subfigures`](#matplotlib.figure.Figure.subfigures "matplotlib.figure.Figure.subfigures")
add\_subplot(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L619-L747)
Add an [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") to the figure as part of a subplot arrangement.
Call signatures:
```
add_subplot(nrows, ncols, index, **kwargs)
add_subplot(pos, **kwargs)
add_subplot(ax)
add_subplot()
```
Parameters:
**\*args**int, (int, int, *index*), or [`SubplotSpec`](_as_gen/matplotlib.gridspec.subplotspec#matplotlib.gridspec.SubplotSpec "matplotlib.gridspec.SubplotSpec"), default: (1, 1, 1)
The position of the subplot described by one of
* Three integers (*nrows*, *ncols*, *index*). The subplot will take the *index* position on a grid with *nrows* rows and *ncols* columns. *index* starts at 1 in the upper left corner and increases to the right. *index* can also be a two-tuple specifying the (*first*, *last*) indices (1-based, and including *last*) of the subplot, e.g., `fig.add_subplot(3, 1, (1, 2))` makes a subplot that spans the upper 2/3 of the figure.
* A 3-digit integer. The digits are interpreted as if given separately as three single-digit integers, i.e. `fig.add_subplot(235)` is the same as `fig.add_subplot(2, 3, 5)`. Note that this can only be used if there are no more than 9 subplots.
* A [`SubplotSpec`](_as_gen/matplotlib.gridspec.subplotspec#matplotlib.gridspec.SubplotSpec "matplotlib.gridspec.SubplotSpec").
In rare circumstances, [`add_subplot`](#matplotlib.figure.SubFigure.add_subplot "matplotlib.figure.SubFigure.add_subplot") may be called with a single argument, a subplot Axes instance already created in the present figure but not in the figure's list of Axes.
**projection**{None, 'aitoff', 'hammer', 'lambert', 'mollweide', 'polar', 'rectilinear', str}, optional
The projection type of the subplot ([`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")). *str* is the name of a custom projection, see [`projections`](projections_api#module-matplotlib.projections "matplotlib.projections"). The default None results in a 'rectilinear' projection.
**polar**bool, default: False
If True, equivalent to projection='polar'.
**axes\_class**subclass type of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
The [`axes.Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") subclass that is instantiated. This parameter is incompatible with *projection* and *polar*. See [axisartist](https://matplotlib.org/stable/tutorials/toolkits/axisartist.html#axisartist-users-guide-index) for examples.
**sharex, sharey**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
Share the x or y [`axis`](axis_api#module-matplotlib.axis "matplotlib.axis") with sharex and/or sharey. The axis will have the same limits, ticks, and scale as the axis of the shared axes.
**label**str
A label for the returned Axes.
Returns:
[`axes.SubplotBase`](_as_gen/matplotlib.axes.subplotbase#matplotlib.axes.SubplotBase "matplotlib.axes.SubplotBase"), or another subclass of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The Axes of the subplot. The returned Axes base class depends on the projection used. It is [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") if rectilinear projection is used and [`projections.polar.PolarAxes`](projections_api#matplotlib.projections.polar.PolarAxes "matplotlib.projections.polar.PolarAxes") if polar projection is used. The returned Axes is then a subplot subclass of the base class.
Other Parameters:
**\*\*kwargs**
This method also takes the keyword arguments for the returned Axes base class; except for the *figure* argument. The keyword arguments for the rectilinear base class [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") can be found in the following table but there might also be other keyword arguments if another projection is used.
| Property | Description |
| --- | --- |
| [`adjustable`](_as_gen/matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](_as_gen/matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](_as_gen/matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](_as_gen/matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](_as_gen/matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](_as_gen/matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](_as_gen/matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](_as_gen/matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](_as_gen/matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](_as_gen/matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](_as_gen/matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](_as_gen/matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](_as_gen/matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](_as_gen/matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](_as_gen/matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](_as_gen/matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](_as_gen/matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](_as_gen/matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](_as_gen/matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xmargin`](_as_gen/matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](_as_gen/matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](_as_gen/matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](_as_gen/matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](_as_gen/matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](_as_gen/matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](_as_gen/matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ymargin`](_as_gen/matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](_as_gen/matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](_as_gen/matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](_as_gen/matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`Figure.add_axes`](#matplotlib.figure.Figure.add_axes "matplotlib.figure.Figure.add_axes")
[`pyplot.subplot`](_as_gen/matplotlib.pyplot.subplot#matplotlib.pyplot.subplot "matplotlib.pyplot.subplot")
[`pyplot.axes`](_as_gen/matplotlib.pyplot.axes#matplotlib.pyplot.axes "matplotlib.pyplot.axes")
[`Figure.subplots`](#matplotlib.figure.Figure.subplots "matplotlib.figure.Figure.subplots")
[`pyplot.subplots`](_as_gen/matplotlib.pyplot.subplots#matplotlib.pyplot.subplots "matplotlib.pyplot.subplots")
#### Examples
```
fig = plt.figure()
fig.add_subplot(231)
ax1 = fig.add_subplot(2, 3, 1) # equivalent but more general
fig.add_subplot(232, frameon=False) # subplot with no frame
fig.add_subplot(233, projection='polar') # polar subplot
fig.add_subplot(234, sharex=ax1) # subplot sharing x-axis with ax1
fig.add_subplot(235, facecolor="red") # red subplot
ax1.remove() # delete ax1 from the figure
fig.add_subplot(ax1) # add ax1 back to the figure
```
align\_labels(*axs=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1450-L1472)
Align the xlabels and ylabels of subplots with the same subplots row or column (respectively) if label alignment is being done automatically (i.e. the label position is not manually set).
Alignment persists for draw events after this is called.
Parameters:
**axs**list of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
Optional list (or ndarray) of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") to align the labels. Default is to align all Axes on the figure.
See also
[`matplotlib.figure.Figure.align_xlabels`](#matplotlib.figure.Figure.align_xlabels "matplotlib.figure.Figure.align_xlabels")
[`matplotlib.figure.Figure.align_ylabels`](#matplotlib.figure.Figure.align_ylabels "matplotlib.figure.Figure.align_ylabels")
align\_xlabels(*axs=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1325-L1386)
Align the xlabels of subplots in the same subplot column if label alignment is being done automatically (i.e. the label position is not manually set).
Alignment persists for draw events after this is called.
If a label is on the bottom, it is aligned with labels on Axes that also have their label on the bottom and that have the same bottom-most subplot row. If the label is on the top, it is aligned with labels on Axes with the same top-most row.
Parameters:
**axs**list of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
Optional list of (or ndarray) [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") to align the xlabels. Default is to align all Axes on the figure.
See also
[`matplotlib.figure.Figure.align_ylabels`](#matplotlib.figure.Figure.align_ylabels "matplotlib.figure.Figure.align_ylabels")
[`matplotlib.figure.Figure.align_labels`](#matplotlib.figure.Figure.align_labels "matplotlib.figure.Figure.align_labels")
#### Notes
This assumes that `axs` are from the same [`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec"), so that their [`SubplotSpec`](_as_gen/matplotlib.gridspec.subplotspec#matplotlib.gridspec.SubplotSpec "matplotlib.gridspec.SubplotSpec") positions correspond to figure positions.
#### Examples
Example with rotated xtick labels:
```
fig, axs = plt.subplots(1, 2)
for tick in axs[0].get_xticklabels():
tick.set_rotation(55)
axs[0].set_xlabel('XLabel 0')
axs[1].set_xlabel('XLabel 1')
fig.align_xlabels()
```
align\_ylabels(*axs=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1388-L1448)
Align the ylabels of subplots in the same subplot column if label alignment is being done automatically (i.e. the label position is not manually set).
Alignment persists for draw events after this is called.
If a label is on the left, it is aligned with labels on Axes that also have their label on the left and that have the same left-most subplot column. If the label is on the right, it is aligned with labels on Axes with the same right-most column.
Parameters:
**axs**list of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
Optional list (or ndarray) of [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") to align the ylabels. Default is to align all Axes on the figure.
See also
[`matplotlib.figure.Figure.align_xlabels`](#matplotlib.figure.Figure.align_xlabels "matplotlib.figure.Figure.align_xlabels")
[`matplotlib.figure.Figure.align_labels`](#matplotlib.figure.Figure.align_labels "matplotlib.figure.Figure.align_labels")
#### Notes
This assumes that `axs` are from the same [`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec"), so that their [`SubplotSpec`](_as_gen/matplotlib.gridspec.subplotspec#matplotlib.gridspec.SubplotSpec "matplotlib.gridspec.SubplotSpec") positions correspond to figure positions.
#### Examples
Example with large yticks labels:
```
fig, axs = plt.subplots(2, 1)
axs[0].plot(np.arange(0, 1000, 50))
axs[0].set_ylabel('YLabel 0')
axs[1].set_ylabel('YLabel 1')
fig.align_ylabels()
```
autofmt\_xdate(*bottom=0.2*, *rotation=30*, *ha='right'*, *which='major'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L218-L259)
Date ticklabels often overlap, so it is useful to rotate them and right align them. Also, a common use case is a number of subplots with shared x-axis where the x-axis is date data. The ticklabels are often long, and it helps to rotate them on the bottom subplot and turn them off on other subplots, as well as turn off xlabels.
Parameters:
**bottom**float, default: 0.2
The bottom of the subplots for [`subplots_adjust`](#matplotlib.figure.SubFigure.subplots_adjust "matplotlib.figure.SubFigure.subplots_adjust").
**rotation**float, default: 30 degrees
The rotation angle of the xtick labels in degrees.
**ha**{'left', 'center', 'right'}, default: 'right'
The horizontal alignment of the xticklabels.
**which**{'major', 'minor', 'both'}, default: 'major'
Selects which ticklabels to rotate.
*property*axes
List of Axes in the SubFigure. You can access and modify the Axes in the SubFigure through this list.
Modifying this list has no effect. Instead, use [`add_axes`](#matplotlib.figure.SubFigure.add_axes "matplotlib.figure.SubFigure.add_axes"), [`add_subplot`](#matplotlib.figure.SubFigure.add_subplot "matplotlib.figure.SubFigure.add_subplot") or [`delaxes`](#matplotlib.figure.SubFigure.delaxes "matplotlib.figure.SubFigure.delaxes") to add or remove an Axes.
Note: The [`SubFigure.axes`](#matplotlib.figure.SubFigure.axes "matplotlib.figure.SubFigure.axes") property and [`get_axes`](#matplotlib.figure.SubFigure.get_axes "matplotlib.figure.SubFigure.get_axes") method are equivalent.
*property*callbacks[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
clear(*keep\_observers=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L936-L969)
Clear the figure.
Parameters:
**keep\_observers: bool, default: False**
Set *keep\_observers* to True if, for example, a gui widget is tracking the Axes in the figure.
clf(*keep\_observers=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L972-L986)
[*Discouraged*] Alias for the [`clear()`](#matplotlib.figure.SubFigure.clear "matplotlib.figure.SubFigure.clear") method.
Discouraged
The use of `clf()` is discouraged. Use `clear()` instead.
Parameters:
**keep\_observers: bool, default: False**
Set *keep\_observers* to True if, for example, a gui widget is tracking the Axes in the figure.
colorbar(*mappable*, *cax=None*, *ax=None*, *use\_gridspec=True*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1176-L1281)
Add a colorbar to a plot.
Parameters:
**mappable**
The [`matplotlib.cm.ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") (i.e., [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage"), [`ContourSet`](contour_api#matplotlib.contour.ContourSet "matplotlib.contour.ContourSet"), etc.) described by this colorbar. This argument is mandatory for the [`Figure.colorbar`](#matplotlib.figure.Figure.colorbar "matplotlib.figure.Figure.colorbar") method but optional for the [`pyplot.colorbar`](_as_gen/matplotlib.pyplot.colorbar#matplotlib.pyplot.colorbar "matplotlib.pyplot.colorbar") function, which sets the default to the current image.
Note that one can create a [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") "on-the-fly" to generate colorbars not attached to a previously drawn artist, e.g.
```
fig.colorbar(cm.ScalarMappable(norm=norm, cmap=cmap), ax=ax)
```
**cax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
Axes into which the colorbar will be drawn.
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), list of Axes, optional
One or more parent axes from which space for a new colorbar axes will be stolen, if *cax* is None. This has no effect if *cax* is set.
**use\_gridspec**bool, optional
If *cax* is `None`, a new *cax* is created as an instance of Axes. If *ax* is an instance of Subplot and *use\_gridspec* is `True`, *cax* is created as an instance of Subplot using the [`gridspec`](gridspec_api#module-matplotlib.gridspec "matplotlib.gridspec") module.
Returns:
**colorbar**[`Colorbar`](colorbar_api#matplotlib.colorbar.Colorbar "matplotlib.colorbar.Colorbar")
Other Parameters:
**location**None or {'left', 'right', 'top', 'bottom'}
The location, relative to the parent axes, where the colorbar axes is created. It also determines the *orientation* of the colorbar (colorbars on the left and right are vertical, colorbars at the top and bottom are horizontal). If None, the location will come from the *orientation* if it is set (vertical colorbars on the right, horizontal ones at the bottom), or default to 'right' if *orientation* is unset.
**orientation**None or {'vertical', 'horizontal'}
The orientation of the colorbar. It is preferable to set the *location* of the colorbar, as that also determines the *orientation*; passing incompatible values for *location* and *orientation* raises an exception.
**fraction**float, default: 0.15
Fraction of original axes to use for colorbar.
**shrink**float, default: 1.0
Fraction by which to multiply the size of the colorbar.
**aspect**float, default: 20
Ratio of long to short dimensions.
**pad**float, default: 0.05 if vertical, 0.15 if horizontal
Fraction of original axes between colorbar and new image axes.
**anchor**(float, float), optional
The anchor point of the colorbar axes. Defaults to (0.0, 0.5) if vertical; (0.5, 1.0) if horizontal.
**panchor**(float, float), or *False*, optional
The anchor point of the colorbar parent axes. If *False*, the parent axes' anchor will be unchanged. Defaults to (1.0, 0.5) if vertical; (0.5, 0.0) if horizontal.
**extend**{'neither', 'both', 'min', 'max'}
Make pointed end(s) for out-of-range values (unless 'neither'). These are set for a given colormap using the colormap set\_under and set\_over methods.
**extendfrac**{*None*, 'auto', length, lengths}
If set to *None*, both the minimum and maximum triangular colorbar extensions will have a length of 5% of the interior colorbar length (this is the default setting).
If set to 'auto', makes the triangular colorbar extensions the same lengths as the interior boxes (when *spacing* is set to 'uniform') or the same lengths as the respective adjacent interior boxes (when *spacing* is set to 'proportional').
If a scalar, indicates the length of both the minimum and maximum triangular colorbar extensions as a fraction of the interior colorbar length. A two-element sequence of fractions may also be given, indicating the lengths of the minimum and maximum colorbar extensions respectively as a fraction of the interior colorbar length.
**extendrect**bool
If *False* the minimum and maximum colorbar extensions will be triangular (the default). If *True* the extensions will be rectangular.
**spacing**{'uniform', 'proportional'}
For discrete colorbars ([`BoundaryNorm`](_as_gen/matplotlib.colors.boundarynorm#matplotlib.colors.BoundaryNorm "matplotlib.colors.BoundaryNorm") or contours), 'uniform' gives each color the same space; 'proportional' makes the space proportional to the data interval.
**ticks**None or list of ticks or Locator
If None, ticks are determined automatically from the input.
**format**None or str or Formatter
If None, [`ScalarFormatter`](ticker_api#matplotlib.ticker.ScalarFormatter "matplotlib.ticker.ScalarFormatter") is used. Format strings, e.g., `"%4.2e"` or `"{x:.2e}"`, are supported. An alternative [`Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter") may be given instead.
**drawedges**bool
Whether to draw lines at color boundaries.
**label**str
The label on the colorbar's long axis.
**boundaries, values**None or a sequence
If unset, the colormap will be displayed on a 0-1 scale. If sequences, *values* must have a length 1 less than *boundaries*. For each region delimited by adjacent entries in *boundaries*, the color mapped to the corresponding value in values will be used. Normally only useful for indexed colors (i.e. `norm=NoNorm()`) or other unusual circumstances.
#### Notes
If *mappable* is a [`ContourSet`](contour_api#matplotlib.contour.ContourSet "matplotlib.contour.ContourSet"), its *extend* kwarg is included automatically.
The *shrink* kwarg provides a simple way to scale the colorbar with respect to the axes. Note that if *cax* is specified, it determines the size of the colorbar and *shrink* and *aspect* kwargs are ignored.
For more precise control, you can manually specify the positions of the axes objects in which the mappable and the colorbar are drawn. In this case, do not use any of the axes properties kwargs.
It is known that some vector graphics viewers (svg and pdf) renders white gaps between segments of the colorbar. This is due to bugs in the viewers, not Matplotlib. As a workaround, the colorbar can be rendered with overlapping segments:
```
cbar = colorbar()
cbar.solids.set_edgecolor("face")
draw()
```
However this has negative consequences in other circumstances, e.g. with semi-transparent images (alpha < 1) and colorbar extensions; therefore, this workaround is not used by default (see issue #1188).
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L273-L285)
Test whether the mouse event occurred on the figure.
Returns:
bool, {}
convert\_xunits(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L241-L251)
Convert *x* using the unit type of the xaxis.
If the artist is not contained in an Axes or if the xaxis does not have units, *x* itself is returned.
convert\_yunits(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L253-L263)
Convert *y* using the unit type of the yaxis.
If the artist is not contained in an Axes or if the yaxis does not have units, *y* itself is returned.
delaxes(*ax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L899-L934)
Remove the [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") *ax* from the figure; update the current Axes.
*property*dpi
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2257-L2276)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
findobj(*match=None*, *include\_self=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1208-L1249)
Find artist objects.
Recursively find all [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") instances contained in the artist.
Parameters:
**match**
A filter criterion for the matches. This can be
* *None*: Return all objects contained in artist.
* A function with signature `def match(artist: Artist) -> bool`. The result will only contain artists for which the function returns *True*.
* A class instance: e.g., [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"). The result will only contain artists of this class or its subclasses (`isinstance` check).
**include\_self**bool
Include *self* in the list to be checked for a match.
Returns:
list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
format\_cursor\_data(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1282-L1336)
Return a string representation of *data*.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
The default implementation converts ints and floats and arrays of ints and floats into a comma-separated string enclosed in square brackets, unless the artist has an associated colorbar, in which case scalar values are formatted using the colorbar's formatter.
See also
[`get_cursor_data`](#matplotlib.figure.SubFigure.get_cursor_data "matplotlib.figure.SubFigure.get_cursor_data")
*property*frameon
Return the figure's background patch visibility, i.e. whether the figure background will be drawn. Equivalent to `Figure.patch.get_visible()`.
gca()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1604-L1615)
Get the current Axes.
If there is currently no Axes on this Figure, a new one is created using [`Figure.add_subplot`](#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot"). (To test whether there is currently an Axes on a Figure, check whether `figure.axes` is empty. To test whether there is currently a Figure on the pyplot figure stack, check whether [`pyplot.get_fignums()`](_as_gen/matplotlib.pyplot.get_fignums#matplotlib.pyplot.get_fignums "matplotlib.pyplot.get_fignums") is empty.)
get\_agg\_filter()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L929-L931)
Return filter function to be used for agg filter.
get\_alpha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L805-L810)
Return the alpha value used for blending - not supported on all backends.
get\_animated()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L816-L818)
Return whether the artist is animated.
get\_axes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2240-L2253)
List of Axes in the SubFigure. You can access and modify the Axes in the SubFigure through this list.
Modifying this list has no effect. Instead, use [`add_axes`](#matplotlib.figure.SubFigure.add_axes "matplotlib.figure.SubFigure.add_axes"), [`add_subplot`](#matplotlib.figure.SubFigure.add_subplot "matplotlib.figure.SubFigure.add_subplot") or [`delaxes`](#matplotlib.figure.SubFigure.delaxes "matplotlib.figure.SubFigure.delaxes") to add or remove an Axes.
Note: The [`SubFigure.axes`](#matplotlib.figure.SubFigure.axes "matplotlib.figure.SubFigure.axes") property and [`get_axes`](#matplotlib.figure.SubFigure.get_axes "matplotlib.figure.SubFigure.get_axes") method are equivalent.
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L261-L271)
Get a list of artists contained in the figure.
get\_clip\_box()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L859-L861)
Return the clipbox.
get\_clip\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L855-L857)
Return whether the artist uses clipping.
get\_clip\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L863-L865)
Return the clip path.
get\_constrained\_layout()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2213-L2219)
Return whether constrained layout is being used.
See [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html).
get\_constrained\_layout\_pads(*relative=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2221-L2235)
Get padding for `constrained_layout`.
Returns a list of `w_pad, h_pad` in inches and `wspace` and `hspace` as fractions of the subplot.
See [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html).
Parameters:
**relative**bool
If [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)"), then convert from inches to figure relative.
get\_cursor\_data(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1251-L1280)
Return the cursor data for a given event.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
Cursor data can be used by Artists to provide additional context information for a given event. The default implementation just returns *None*.
Subclasses can override the method and return arbitrary data. However, when doing so, they must ensure that [`format_cursor_data`](#matplotlib.figure.SubFigure.format_cursor_data "matplotlib.figure.SubFigure.format_cursor_data") can convert the data to a string representation.
The only current use case is displaying the z-value of an [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") in the status bar of a plot window, while moving the mouse.
Parameters:
**event**[`matplotlib.backend_bases.MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
See also
[`format_cursor_data`](#matplotlib.figure.SubFigure.format_cursor_data "matplotlib.figure.SubFigure.format_cursor_data")
get\_default\_bbox\_extra\_artists()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1688-L1694)
get\_dpi()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2165-L2169)
Return the resolution of the parent figure in dots-per-inch as a float.
get\_edgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L404-L406)
Get the edge color of the Figure rectangle.
get\_facecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L408-L410)
Get the face color of the Figure rectangle.
get\_figure()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L703-L705)
Return the [`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
get\_frameon()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L412-L418)
Return the figure's background patch visibility, i.e. whether the figure background will be drawn. Equivalent to `Figure.patch.get_visible()`.
get\_gid()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L588-L590)
Return the group id.
get\_in\_layout()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L820-L829)
Return boolean flag, `True` if artist is included in layout calculations.
E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
get\_label()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1056-L1058)
Return the label used for this artist in the legend.
get\_layout\_engine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2237-L2238)
get\_linewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L430-L434)
Get the line width of the Figure rectangle.
get\_mouseover()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1338-L1343)
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
get\_path\_effects()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L700-L701)
get\_picker()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L562-L572)
Return the picking behavior of the artist.
The possible values are described in [`set_picker`](#matplotlib.figure.SubFigure.set_picker "matplotlib.figure.SubFigure.set_picker").
See also
[`set_picker`](#matplotlib.figure.SubFigure.set_picker "matplotlib.figure.SubFigure.set_picker"), [`pickable`](#matplotlib.figure.SubFigure.pickable "matplotlib.figure.SubFigure.pickable"), [`pick`](#matplotlib.figure.SubFigure.pick "matplotlib.figure.SubFigure.pick")
get\_rasterized()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L904-L906)
Return whether the artist is to be rasterized.
get\_sketch\_params()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L641-L659)
Return the sketch parameters for the artist.
Returns:
tuple or None
A 3-tuple with the following elements:
* *scale*: The amplitude of the wiggle perpendicular to the source line.
* *length*: The length of the wiggle along the line.
* *randomness*: The scale factor by which the length is shrunken or expanded.
Returns *None* if no sketch parameters were set.
get\_snap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L602-L611)
Return the snap setting.
See [`set_snap`](#matplotlib.figure.SubFigure.set_snap "matplotlib.figure.SubFigure.set_snap") for details.
get\_tightbbox(*renderer=None*, *bbox\_extra\_artists=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1696-L1765)
Return a (tight) bounding box of the figure *in inches*.
Note that [`FigureBase`](#matplotlib.figure.FigureBase "matplotlib.figure.FigureBase") differs from all other artists, which return their [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") in pixels.
Artists that have `artist.set_in_layout(False)` are not included in the bbox.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
**bbox\_extra\_artists**list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") or `None`
List of artists to include in the tight bounding box. If `None` (default), then all artist children of each Axes are included in the tight bounding box.
Returns:
[`BboxBase`](transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase")
containing the bounding box (in figure inches).
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L421-L428)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist.
get\_transformed\_clip\_path\_and\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L867-L875)
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
get\_url()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L574-L576)
Return the url.
get\_visible()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L812-L814)
Return the visibility.
get\_window\_extent(*renderer=None*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L287-L291)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
get\_zorder()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1076-L1078)
Return the artist's zorder.
have\_units()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L236-L239)
Return whether units are set on any axis.
is\_transform\_set()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L400-L406)
Return whether the Artist has an explicitly set transform.
This is *True* after [`set_transform`](#matplotlib.figure.SubFigure.set_transform "matplotlib.figure.SubFigure.set_transform") has been called.
legend(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L991-L1124)
Place a legend on the figure.
Call signatures:
```
legend()
legend(handles, labels)
legend(handles=handles)
legend(labels)
```
The call signatures correspond to the following different ways to use this method:
**1. Automatic detection of elements to be shown in the legend**
The elements to be added to the legend are automatically determined, when you do not pass in any extra arguments.
In this case, the labels are taken from the artist. You can specify them either at artist creation or by calling the [`set_label()`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") method on the artist:
```
ax.plot([1, 2, 3], label='Inline label')
fig.legend()
```
or:
```
line, = ax.plot([1, 2, 3])
line.set_label('Label via method')
fig.legend()
```
Specific lines can be excluded from the automatic legend element selection by defining a label starting with an underscore. This is default for all artists, so calling [`Figure.legend`](#matplotlib.figure.Figure.legend "matplotlib.figure.Figure.legend") without any arguments and without setting the labels manually will result in no legend being drawn.
**2. Explicitly listing the artists and labels in the legend**
For full control of which artists have a legend entry, it is possible to pass an iterable of legend artists followed by an iterable of legend labels respectively:
```
fig.legend([line1, line2, line3], ['label1', 'label2', 'label3'])
```
**3. Explicitly listing the artists in the legend**
This is similar to 2, but the labels are taken from the artists' label properties. Example:
```
line1, = ax1.plot([1, 2, 3], label='label1')
line2, = ax2.plot([1, 2, 3], label='label2')
fig.legend(handles=[line1, line2])
```
**4. Labeling existing plot elements**
Discouraged
This call signature is discouraged, because the relation between plot elements and labels is only implicit by their order and can easily be mixed up.
To make a legend for all artists on all Axes, call this function with an iterable of strings, one for each legend item. For example:
```
fig, (ax1, ax2) = plt.subplots(1, 2)
ax1.plot([1, 3, 5], color='blue')
ax2.plot([2, 4, 6], color='red')
fig.legend(['the blues', 'the reds'])
```
Parameters:
**handles**list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"), optional
A list of Artists (lines, patches) to be added to the legend. Use this together with *labels*, if you need full control on what is shown in the legend and the automatic mechanism described above is not sufficient.
The length of handles and labels should be the same in this case. If they are not, they are truncated to the smaller length.
**labels**list of str, optional
A list of labels to show next to the artists. Use this together with *handles*, if you need full control on what is shown in the legend and the automatic mechanism described above is not sufficient.
Returns:
[`Legend`](legend_api#matplotlib.legend.Legend "matplotlib.legend.Legend")
Other Parameters:
**loc**str or pair of floats, default: `[rcParams["legend.loc"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.loc#matplotlibrc-sample)` (default: `'best'`) ('best' for axes, 'upper right' for figures)
The location of the legend.
The strings `'upper left', 'upper right', 'lower left', 'lower right'` place the legend at the corresponding corner of the axes/figure.
The strings `'upper center', 'lower center', 'center left', 'center right'` place the legend at the center of the corresponding edge of the axes/figure.
The string `'center'` places the legend at the center of the axes/figure.
The string `'best'` places the legend at the location, among the nine locations defined so far, with the minimum overlap with other drawn artists. This option can be quite slow for plots with large amounts of data; your plotting speed may benefit from providing a specific location.
The location can also be a 2-tuple giving the coordinates of the lower-left corner of the legend in axes coordinates (in which case *bbox\_to\_anchor* will be ignored).
For back-compatibility, `'center right'` (but no other location) can also be spelled `'right'`, and each "string" locations can also be given as a numeric value:
| Location String | Location Code |
| --- | --- |
| 'best' | 0 |
| 'upper right' | 1 |
| 'upper left' | 2 |
| 'lower left' | 3 |
| 'lower right' | 4 |
| 'right' | 5 |
| 'center left' | 6 |
| 'center right' | 7 |
| 'lower center' | 8 |
| 'upper center' | 9 |
| 'center' | 10 |
**bbox\_to\_anchor**[`BboxBase`](transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase"), 2-tuple, or 4-tuple of floats
Box that is used to position the legend in conjunction with *loc*. Defaults to `axes.bbox` (if called as a method to [`Axes.legend`](_as_gen/matplotlib.axes.axes.legend#matplotlib.axes.Axes.legend "matplotlib.axes.Axes.legend")) or `figure.bbox` (if [`Figure.legend`](#matplotlib.figure.Figure.legend "matplotlib.figure.Figure.legend")). This argument allows arbitrary placement of the legend.
Bbox coordinates are interpreted in the coordinate system given by *bbox\_transform*, with the default transform Axes or Figure coordinates, depending on which `legend` is called.
If a 4-tuple or [`BboxBase`](transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase") is given, then it specifies the bbox `(x, y, width, height)` that the legend is placed in. To put the legend in the best location in the bottom right quadrant of the axes (or figure):
```
loc='best', bbox_to_anchor=(0.5, 0., 0.5, 0.5)
```
A 2-tuple `(x, y)` places the corner of the legend specified by *loc* at x, y. For example, to put the legend's upper right-hand corner in the center of the axes (or figure) the following keywords can be used:
```
loc='upper right', bbox_to_anchor=(0.5, 0.5)
```
**ncols**int, default: 1
The number of columns that the legend has.
For backward compatibility, the spelling *ncol* is also supported but it is discouraged. If both are given, *ncols* takes precedence.
**prop**None or [`matplotlib.font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or dict
The font properties of the legend. If None (default), the current [`matplotlib.rcParams`](matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams") will be used.
**fontsize**int or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}
The font size of the legend. If the value is numeric the size will be the absolute font size in points. String values are relative to the current default font size. This argument is only used if *prop* is not specified.
**labelcolor**str or list, default: `[rcParams["legend.labelcolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.labelcolor#matplotlibrc-sample)` (default: `'None'`)
The color of the text in the legend. Either a valid color string (for example, 'red'), or a list of color strings. The labelcolor can also be made to match the color of the line or marker using 'linecolor', 'markerfacecolor' (or 'mfc'), or 'markeredgecolor' (or 'mec').
Labelcolor can be set globally using `[rcParams["legend.labelcolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.labelcolor#matplotlibrc-sample)` (default: `'None'`). If None, use `[rcParams["text.color"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=text.color#matplotlibrc-sample)` (default: `'black'`).
**numpoints**int, default: `[rcParams["legend.numpoints"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.numpoints#matplotlibrc-sample)` (default: `1`)
The number of marker points in the legend when creating a legend entry for a [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") (line).
**scatterpoints**int, default: `[rcParams["legend.scatterpoints"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.scatterpoints#matplotlibrc-sample)` (default: `1`)
The number of marker points in the legend when creating a legend entry for a [`PathCollection`](collections_api#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection") (scatter plot).
**scatteryoffsets**iterable of floats, default: `[0.375, 0.5, 0.3125]`
The vertical offset (relative to the font size) for the markers created for a scatter plot legend entry. 0.0 is at the base the legend text, and 1.0 is at the top. To draw all markers at the same height, set to `[0.5]`.
**markerscale**float, default: `[rcParams["legend.markerscale"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.markerscale#matplotlibrc-sample)` (default: `1.0`)
The relative size of legend markers compared with the originally drawn ones.
**markerfirst**bool, default: True
If *True*, legend marker is placed to the left of the legend label. If *False*, legend marker is placed to the right of the legend label.
**frameon**bool, default: `[rcParams["legend.frameon"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.frameon#matplotlibrc-sample)` (default: `True`)
Whether the legend should be drawn on a patch (frame).
**fancybox**bool, default: `[rcParams["legend.fancybox"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.fancybox#matplotlibrc-sample)` (default: `True`)
Whether round edges should be enabled around the [`FancyBboxPatch`](_as_gen/matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") which makes up the legend's background.
**shadow**bool, default: `[rcParams["legend.shadow"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.shadow#matplotlibrc-sample)` (default: `False`)
Whether to draw a shadow behind the legend.
**framealpha**float, default: `[rcParams["legend.framealpha"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.framealpha#matplotlibrc-sample)` (default: `0.8`)
The alpha transparency of the legend's background. If *shadow* is activated and *framealpha* is `None`, the default value is ignored.
**facecolor**"inherit" or color, default: `[rcParams["legend.facecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.facecolor#matplotlibrc-sample)` (default: `'inherit'`)
The legend's background color. If `"inherit"`, use `[rcParams["axes.facecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.facecolor#matplotlibrc-sample)` (default: `'white'`).
**edgecolor**"inherit" or color, default: `[rcParams["legend.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.edgecolor#matplotlibrc-sample)` (default: `'0.8'`)
The legend's background patch edge color. If `"inherit"`, use take `[rcParams["axes.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.edgecolor#matplotlibrc-sample)` (default: `'black'`).
**mode**{"expand", None}
If *mode* is set to `"expand"` the legend will be horizontally expanded to fill the axes area (or *bbox\_to\_anchor* if defines the legend's size).
**bbox\_transform**None or [`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
The transform for the bounding box (*bbox\_to\_anchor*). For a value of `None` (default) the Axes' `transAxes` transform will be used.
**title**str or None
The legend's title. Default is no title (`None`).
**title\_fontproperties**None or [`matplotlib.font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or dict
The font properties of the legend's title. If None (default), the *title\_fontsize* argument will be used if present; if *title\_fontsize* is also None, the current `[rcParams["legend.title\_fontsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.title_fontsize#matplotlibrc-sample)` (default: `None`) will be used.
**title\_fontsize**int or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}, default: `[rcParams["legend.title\_fontsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.title_fontsize#matplotlibrc-sample)` (default: `None`)
The font size of the legend's title. Note: This cannot be combined with *title\_fontproperties*. If you want to set the fontsize alongside other font properties, use the *size* parameter in *title\_fontproperties*.
**alignment**{'center', 'left', 'right'}, default: 'center'
The alignment of the legend title and the box of entries. The entries are aligned as a single block, so that markers always lined up.
**borderpad**float, default: `[rcParams["legend.borderpad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.borderpad#matplotlibrc-sample)` (default: `0.4`)
The fractional whitespace inside the legend border, in font-size units.
**labelspacing**float, default: `[rcParams["legend.labelspacing"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.labelspacing#matplotlibrc-sample)` (default: `0.5`)
The vertical space between the legend entries, in font-size units.
**handlelength**float, default: `[rcParams["legend.handlelength"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.handlelength#matplotlibrc-sample)` (default: `2.0`)
The length of the legend handles, in font-size units.
**handleheight**float, default: `[rcParams["legend.handleheight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.handleheight#matplotlibrc-sample)` (default: `0.7`)
The height of the legend handles, in font-size units.
**handletextpad**float, default: `[rcParams["legend.handletextpad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.handletextpad#matplotlibrc-sample)` (default: `0.8`)
The pad between the legend handle and text, in font-size units.
**borderaxespad**float, default: `[rcParams["legend.borderaxespad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.borderaxespad#matplotlibrc-sample)` (default: `0.5`)
The pad between the axes and legend border, in font-size units.
**columnspacing**float, default: `[rcParams["legend.columnspacing"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.columnspacing#matplotlibrc-sample)` (default: `2.0`)
The spacing between columns, in font-size units.
**handler\_map**dict or None
The custom dictionary mapping instances or types to a legend handler. This *handler\_map* updates the default handler map found at [`matplotlib.legend.Legend.get_legend_handler_map`](legend_api#matplotlib.legend.Legend.get_legend_handler_map "matplotlib.legend.Legend.get_legend_handler_map").
See also
[`Axes.legend`](_as_gen/matplotlib.axes.axes.legend#matplotlib.axes.Axes.legend "matplotlib.axes.Axes.legend")
#### Notes
Some artists are not supported by this function. See [Legend guide](https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html) for details.
*property*mouseover
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
pchanged()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L387-L398)
Call all of the registered callbacks.
This function is triggered internally when a property is changed.
See also
[`add_callback`](#matplotlib.figure.SubFigure.add_callback "matplotlib.figure.SubFigure.add_callback")
[`remove_callback`](#matplotlib.figure.SubFigure.remove_callback "matplotlib.figure.SubFigure.remove_callback")
pick(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L490-L525)
Process a pick event.
Each child artist will fire a pick event if *mouseevent* is over the artist and the artist has picker set.
See also
[`set_picker`](#matplotlib.figure.SubFigure.set_picker "matplotlib.figure.SubFigure.set_picker"), [`get_picker`](#matplotlib.figure.SubFigure.get_picker "matplotlib.figure.SubFigure.get_picker"), [`pickable`](#matplotlib.figure.SubFigure.pickable "matplotlib.figure.SubFigure.pickable")
pickable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L480-L488)
Return whether the artist is pickable.
See also
[`set_picker`](#matplotlib.figure.SubFigure.set_picker "matplotlib.figure.SubFigure.set_picker"), [`get_picker`](#matplotlib.figure.SubFigure.get_picker "matplotlib.figure.SubFigure.get_picker"), [`pick`](#matplotlib.figure.SubFigure.pick "matplotlib.figure.SubFigure.pick")
properties()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1139-L1141)
Return a dictionary of all the properties of the artist.
remove()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L193-L234)
Remove the artist from the figure if possible.
The effect will not be visible until the figure is redrawn, e.g., with [`FigureCanvasBase.draw_idle`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase.draw_idle "matplotlib.backend_bases.FigureCanvasBase.draw_idle"). Call [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") to update the axes limits if desired.
Note: [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") will not see collections even if the collection was added to the axes with *autolim* = True.
Note: there is no support for removing the artist's legend entry.
remove\_callback(*oid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L377-L385)
Remove a callback based on its observer id.
See also
[`add_callback`](#matplotlib.figure.SubFigure.add_callback "matplotlib.figure.SubFigure.add_callback")
sca(*a*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1598-L1602)
Set the current Axes to be *a* and return *a*.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *dpi=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *frameon=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`dpi`](#matplotlib.figure.SubFigure.set_dpi "matplotlib.figure.SubFigure.set_dpi") | float |
| [`edgecolor`](#matplotlib.figure.FigureBase.set_edgecolor "matplotlib.figure.FigureBase.set_edgecolor") | color |
| [`facecolor`](#matplotlib.figure.FigureBase.set_facecolor "matplotlib.figure.FigureBase.set_facecolor") | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frameon`](#matplotlib.figure.FigureBase.set_frameon "matplotlib.figure.FigureBase.set_frameon") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linewidth`](#matplotlib.figure.FigureBase.set_linewidth "matplotlib.figure.FigureBase.set_linewidth") | number |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_agg\_filter(*filter\_func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L933-L949)
Set the agg filter.
Parameters:
**filter\_func**callable
A filter function, which takes a (m, n, depth) float array and a dpi value, and returns a (m, n, depth) array and two offsets from the bottom left corner of the image
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L970-L986)
Set the alpha value used for blending - not supported on all backends.
Parameters:
**alpha**scalar or None
*alpha* must be within the 0-1 range, inclusive.
set\_animated(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1023-L1041)
Set whether the artist is intended to be used in an animation.
If True, the artist is excluded from regular drawing of the figure. You have to call [`Figure.draw_artist`](#matplotlib.figure.Figure.draw_artist "matplotlib.figure.Figure.draw_artist") / [`Axes.draw_artist`](_as_gen/matplotlib.axes.axes.draw_artist#matplotlib.axes.Axes.draw_artist "matplotlib.axes.Axes.draw_artist") explicitly on the artist. This approach is used to speed up animations using blitting.
See also [`matplotlib.animation`](animation_api#module-matplotlib.animation "matplotlib.animation") and [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html).
Parameters:
**b**bool
set\_clip\_box(*clipbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L731-L741)
Set the artist's clip [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
Parameters:
**clipbox**[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
set\_clip\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L877-L892)
Set whether the artist uses clipping.
When False artists will be visible outside of the Axes which can lead to unexpected results.
Parameters:
**b**bool
set\_clip\_path(*path*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L743-L803)
Set the artist's clip path.
Parameters:
**path**[`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") or [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") or [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") or None
The clip path. If given a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), *transform* must be provided as well. If *None*, a previously set clip path is removed.
**transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
Only used if *path* is a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), in which case the given [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") is converted to a [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") using *transform*.
#### Notes
For efficiency, if *path* is a [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") this method will set the clipping box to the corresponding rectangle and set the clipping path to `None`.
For technical reasons (support of [`set`](_as_gen/matplotlib.artist.artist.set#matplotlib.artist.Artist.set "matplotlib.artist.Artist.set")), a tuple (*path*, *transform*) is also accepted as a single positional parameter.
set\_dpi(*val*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L2171-L2180)
Set the resolution of parent figure in dots-per-inch.
Parameters:
**val**float
set\_edgecolor(*color*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L436-L444)
Set the edge color of the Figure rectangle.
Parameters:
**color**color
set\_facecolor(*color*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L446-L454)
Set the face color of the Figure rectangle.
Parameters:
**color**color
set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L707-L729)
Set the [`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
Parameters:
**fig**[`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure")
set\_frameon(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L456-L467)
Set the figure's background patch visibility, i.e. whether the figure background will be drawn. Equivalent to `Figure.patch.set_visible()`.
Parameters:
**b**bool
set\_gid(*gid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L592-L600)
Set the (group) id for the artist.
Parameters:
**gid**str
set\_in\_layout(*in\_layout*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1043-L1054)
Set if artist is to be included in layout calculations, E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
Parameters:
**in\_layout**bool
set\_label(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1060-L1074)
Set a label that will be displayed in the legend.
Parameters:
**s**object
*s* will be converted to a string by calling [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)").
set\_linewidth(*linewidth*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L420-L428)
Set the line width of the Figure rectangle.
Parameters:
**linewidth**number
set\_mouseover(*mouseover*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1345-L1366)
Set whether this artist is queried for custom context information when the mouse cursor moves over it.
Parameters:
**mouseover**bool
See also
[`get_cursor_data`](#matplotlib.figure.SubFigure.get_cursor_data "matplotlib.figure.SubFigure.get_cursor_data")
[`ToolCursorPosition`](backend_tools_api#matplotlib.backend_tools.ToolCursorPosition "matplotlib.backend_tools.ToolCursorPosition")
[`NavigationToolbar2`](backend_bases_api#matplotlib.backend_bases.NavigationToolbar2 "matplotlib.backend_bases.NavigationToolbar2")
set\_path\_effects(*path\_effects*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L689-L698)
Set the path effects.
Parameters:
**path\_effects**[`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
set\_picker(*picker*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L527-L560)
Define the picking behavior of the artist.
Parameters:
**picker**None or bool or float or callable
This can be one of the following:
* *None*: Picking is disabled for this artist (default).
* A boolean: If *True* then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist.
* A float: If picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if its data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event
* A function: If picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event:
```
hit, props = picker(artist, mouseevent)
```
to determine the hit test. if the mouse event is over the artist, return *hit=True* and props is a dictionary of properties you want added to the PickEvent attributes.
set\_rasterized(*rasterized*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L908-L927)
Force rasterized (bitmap) drawing for vector graphics output.
Rasterized drawing is not supported by all artists. If you try to enable this on an artist that does not support it, the command has no effect and a warning will be issued.
This setting is ignored for pixel-based output.
See also [Rasterization for vector graphics](https://matplotlib.org/stable/gallery/misc/rasterization_demo.html).
Parameters:
**rasterized**bool
set\_sketch\_params(*scale=None*, *length=None*, *randomness=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L661-L687)
Set the sketch parameters.
Parameters:
**scale**float, optional
The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), or not provided, no sketch filter will be provided.
**length**float, optional
The length of the wiggle along the line, in pixels (default 128.0)
**randomness**float, optional
The scale factor by which the length is shrunken or expanded (default 16.0)
The PGF backend uses this argument as an RNG seed and not as described above. Using the same seed yields the same random shape.
set\_snap(*snap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L613-L639)
Set the snapping behavior.
Snapping aligns positions with the pixel grid, which results in clearer images. For example, if a black line of 1px width was defined at a position in between two pixels, the resulting image would contain the interpolated value of that line in the pixel grid, which would be a grey value on both adjacent pixel positions. In contrast, snapping will move the line to the nearest integer pixel value, so that the resulting image will really contain a 1px wide black line.
Snapping is currently only supported by the Agg and MacOSX backends.
Parameters:
**snap**bool or None
Possible values:
* *True*: Snap vertices to the nearest pixel center.
* *False*: Do not modify vertex positions.
* *None*: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center.
set\_transform(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L408-L419)
Set the artist transform.
Parameters:
**t**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_url(*url*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L578-L586)
Set the url for the artist.
Parameters:
**url**str
set\_visible(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1011-L1021)
Set the artist's visibility.
Parameters:
**b**bool
set\_zorder(*level*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1080-L1093)
Set the zorder for the artist. Artists with lower zorder values are drawn first.
Parameters:
**level**float
*property*stale
Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist.
*property*sticky\_edges
`x` and `y` sticky edge lists for autoscaling.
When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added--the view limit "sticks" to the edge. A typical use case is histograms, where one usually expects no margin on the bottom edge (0) of the histogram.
Moreover, margin expansion "bumps" against sticky edges and cannot cross them. For example, if the upper data limit is 1.0, the upper view limit computed by simple margin application is 1.2, but there is a sticky edge at 1.1, then the actual upper view limit will be 1.1.
This attribute cannot be assigned to; however, the `x` and `y` lists can be modified in place as needed.
#### Examples
```
>>> artist.sticky_edges.x[:] = (xmin, xmax)
>>> artist.sticky_edges.y[:] = (ymin, ymax)
```
subfigures(*nrows=1*, *ncols=1*, *squeeze=True*, *wspace=None*, *hspace=None*, *width\_ratios=None*, *height\_ratios=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1517-L1569)
Add a subfigure to this figure or subfigure.
A subfigure has the same artist methods as a figure, and is logically the same as a figure, but cannot print itself. See [Figure subfigures](https://matplotlib.org/stable/gallery/subplots_axes_and_figures/subfigures.html).
Parameters:
**nrows, ncols**int, default: 1
Number of rows/columns of the subfigure grid.
**squeeze**bool, default: True
If True, extra dimensions are squeezed out from the returned array of subfigures.
**wspace, hspace**float, default: None
The amount of width/height reserved for space between subfigures, expressed as a fraction of the average subfigure width/height. If not given, the values will be inferred from a figure or rcParams when necessary.
**width\_ratios**array-like of length *ncols*, optional
Defines the relative widths of the columns. Each column gets a relative width of `width_ratios[i] / sum(width_ratios)`. If not given, all columns will have the same width.
**height\_ratios**array-like of length *nrows*, optional
Defines the relative heights of the rows. Each row gets a relative height of `height_ratios[i] / sum(height_ratios)`. If not given, all rows will have the same height.
subplot\_mosaic(*mosaic*, *\**, *sharex=False*, *sharey=False*, *width\_ratios=None*, *height\_ratios=None*, *empty\_sentinel='.'*, *subplot\_kw=None*, *gridspec\_kw=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1777-L2054)
Build a layout of Axes based on ASCII art or nested lists.
This is a helper function to build complex GridSpec layouts visually.
Note
This API is provisional and may be revised in the future based on early user feedback.
See [Complex and semantic figure composition](https://matplotlib.org/stable/tutorials/provisional/mosaic.html) for an example and full API documentation
Parameters:
**mosaic**list of list of {hashable or nested} or str
A visual layout of how you want your Axes to be arranged labeled as strings. For example
```
x = [['A panel', 'A panel', 'edge'],
['C panel', '.', 'edge']]
```
produces 4 Axes:
* 'A panel' which is 1 row high and spans the first two columns
* 'edge' which is 2 rows high and is on the right edge
* 'C panel' which in 1 row and 1 column wide in the bottom left
* a blank space 1 row and 1 column wide in the bottom center
Any of the entries in the layout can be a list of lists of the same form to create nested layouts.
If input is a str, then it can either be a multi-line string of the form
```
'''
AAE
C.E
'''
```
where each character is a column and each line is a row. Or it can be a single-line string where rows are separated by `;`:
```
'AB;CC'
```
The string notation allows only single character Axes labels and does not support nesting but is very terse.
**sharex, sharey**bool, default: False
If True, the x-axis (*sharex*) or y-axis (*sharey*) will be shared among all subplots. In that case, tick label visibility and axis units behave as for [`subplots`](#matplotlib.figure.SubFigure.subplots "matplotlib.figure.SubFigure.subplots"). If False, each subplot's x- or y-axis will be independent.
**width\_ratios**array-like of length *ncols*, optional
Defines the relative widths of the columns. Each column gets a relative width of `width_ratios[i] / sum(width_ratios)`. If not given, all columns will have the same width. Equivalent to `gridspec_kw={'width_ratios': [...]}`.
**height\_ratios**array-like of length *nrows*, optional
Defines the relative heights of the rows. Each row gets a relative height of `height_ratios[i] / sum(height_ratios)`. If not given, all rows will have the same height. Equivalent to `gridspec_kw={'height_ratios': [...]}`.
**subplot\_kw**dict, optional
Dictionary with keywords passed to the [`Figure.add_subplot`](#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot") call used to create each subplot.
**gridspec\_kw**dict, optional
Dictionary with keywords passed to the [`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec") constructor used to create the grid the subplots are placed on.
**empty\_sentinel**object, optional
Entry in the layout to mean "leave this space empty". Defaults to `'.'`. Note, if *layout* is a string, it is processed via [`inspect.cleandoc`](https://docs.python.org/3/library/inspect.html#inspect.cleandoc "(in Python v3.10)") to remove leading white space, which may interfere with using white-space as the empty sentinel.
Returns:
dict[label, Axes]
A dictionary mapping the labels to the Axes objects. The order of the axes is left-to-right and top-to-bottom of their position in the total layout.
subplots(*nrows=1*, *ncols=1*, *\**, *sharex=False*, *sharey=False*, *squeeze=True*, *width\_ratios=None*, *height\_ratios=None*, *subplot\_kw=None*, *gridspec\_kw=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L762-L897)
Add a set of subplots to this figure.
This utility wrapper makes it convenient to create common layouts of subplots in a single call.
Parameters:
**nrows, ncols**int, default: 1
Number of rows/columns of the subplot grid.
**sharex, sharey**bool or {'none', 'all', 'row', 'col'}, default: False
Controls sharing of x-axis (*sharex*) or y-axis (*sharey*):
* True or 'all': x- or y-axis will be shared among all subplots.
* False or 'none': each subplot x- or y-axis will be independent.
* 'row': each subplot row will share an x- or y-axis.
* 'col': each subplot column will share an x- or y-axis.
When subplots have a shared x-axis along a column, only the x tick labels of the bottom subplot are created. Similarly, when subplots have a shared y-axis along a row, only the y tick labels of the first column subplot are created. To later turn other subplots' ticklabels on, use [`tick_params`](_as_gen/matplotlib.axes.axes.tick_params#matplotlib.axes.Axes.tick_params "matplotlib.axes.Axes.tick_params").
When subplots have a shared axis that has units, calling [`Axis.set_units`](_as_gen/matplotlib.axis.axis.set_units#matplotlib.axis.Axis.set_units "matplotlib.axis.Axis.set_units") will update each axis with the new units.
**squeeze**bool, default: True
* If True, extra dimensions are squeezed out from the returned array of Axes:
+ if only one subplot is constructed (nrows=ncols=1), the resulting single Axes object is returned as a scalar.
+ for Nx1 or 1xM subplots, the returned object is a 1D numpy object array of Axes objects.
+ for NxM, subplots with N>1 and M>1 are returned as a 2D array.
* If False, no squeezing at all is done: the returned Axes object is always a 2D array containing Axes instances, even if it ends up being 1x1.
**width\_ratios**array-like of length *ncols*, optional
Defines the relative widths of the columns. Each column gets a relative width of `width_ratios[i] / sum(width_ratios)`. If not given, all columns will have the same width. Equivalent to `gridspec_kw={'width_ratios': [...]}`.
**height\_ratios**array-like of length *nrows*, optional
Defines the relative heights of the rows. Each row gets a relative height of `height_ratios[i] / sum(height_ratios)`. If not given, all rows will have the same height. Equivalent to `gridspec_kw={'height_ratios': [...]}`.
**subplot\_kw**dict, optional
Dict with keywords passed to the [`Figure.add_subplot`](#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot") call used to create each subplot.
**gridspec\_kw**dict, optional
Dict with keywords passed to the [`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec") constructor used to create the grid the subplots are placed on.
Returns:
[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") or array of Axes
Either a single [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") object or an array of Axes objects if more than one subplot was created. The dimensions of the resulting array can be controlled with the *squeeze* keyword, see above.
See also
[`pyplot.subplots`](_as_gen/matplotlib.pyplot.subplots#matplotlib.pyplot.subplots "matplotlib.pyplot.subplots")
[`Figure.add_subplot`](#matplotlib.figure.Figure.add_subplot "matplotlib.figure.Figure.add_subplot")
[`pyplot.subplot`](_as_gen/matplotlib.pyplot.subplot#matplotlib.pyplot.subplot "matplotlib.pyplot.subplot")
#### Examples
```
# First create some toy data:
x = np.linspace(0, 2*np.pi, 400)
y = np.sin(x**2)
# Create a figure
plt.figure()
# Create a subplot
ax = fig.subplots()
ax.plot(x, y)
ax.set_title('Simple plot')
# Create two subplots and unpack the output array immediately
ax1, ax2 = fig.subplots(1, 2, sharey=True)
ax1.plot(x, y)
ax1.set_title('Sharing Y axis')
ax2.scatter(x, y)
# Create four polar Axes and access them through the returned array
axes = fig.subplots(2, 2, subplot_kw=dict(projection='polar'))
axes[0, 0].plot(x, y)
axes[1, 1].scatter(x, y)
# Share a X axis with each column of subplots
fig.subplots(2, 2, sharex='col')
# Share a Y axis with each row of subplots
fig.subplots(2, 2, sharey='row')
# Share both X and Y axes with all subplots
fig.subplots(2, 2, sharex='all', sharey='all')
# Note that this is the same as
fig.subplots(2, 2, sharex=True, sharey=True)
```
subplots\_adjust(*left=None*, *bottom=None*, *right=None*, *top=None*, *wspace=None*, *hspace=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1283-L1323)
Adjust the subplot layout parameters.
Unset parameters are left unmodified; initial values are given by `[rcParams["figure.subplot.[name]"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.subplot.%5Bname%5D#matplotlibrc-sample)`.
Parameters:
**left**float, optional
The position of the left edge of the subplots, as a fraction of the figure width.
**right**float, optional
The position of the right edge of the subplots, as a fraction of the figure width.
**bottom**float, optional
The position of the bottom edge of the subplots, as a fraction of the figure height.
**top**float, optional
The position of the top edge of the subplots, as a fraction of the figure height.
**wspace**float, optional
The width of the padding between subplots, as a fraction of the average Axes width.
**hspace**float, optional
The height of the padding between subplots, as a fraction of the average Axes height.
suptitle(*t*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L373-L381)
Add a centered suptitle to the figure.
Parameters:
**t**str
The suptitle text.
**x**float, default: 0.5
The x location of the text in figure coordinates.
**y**float, default: 0.98
The y location of the text in figure coordinates.
**horizontalalignment, ha**{'center', 'left', 'right'}, default: center
The horizontal alignment of the text relative to (*x*, *y*).
**verticalalignment, va**{'top', 'center', 'bottom', 'baseline'}, default: top
The vertical alignment of the text relative to (*x*, *y*).
**fontsize, size**default: `[rcParams["figure.titlesize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.titlesize#matplotlibrc-sample)` (default: `'large'`)
The font size of the text. See [`Text.set_size`](text_api#matplotlib.text.Text.set_size "matplotlib.text.Text.set_size") for possible values.
**fontweight, weight**default: `[rcParams["figure.titleweight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.titleweight#matplotlibrc-sample)` (default: `'normal'`)
The font weight of the text. See [`Text.set_weight`](text_api#matplotlib.text.Text.set_weight "matplotlib.text.Text.set_weight") for possible values.
Returns:
text
The [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") instance of the suptitle.
Other Parameters:
**fontproperties**None or dict, optional
A dict of font properties. If *fontproperties* is given the default values for font size and weight are taken from the [`FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") defaults. `[rcParams["figure.titlesize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.titlesize#matplotlibrc-sample)` (default: `'large'`) and `[rcParams["figure.titleweight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.titleweight#matplotlibrc-sample)` (default: `'normal'`) are ignored in this case.
**\*\*kwargs**
Additional kwargs are [`matplotlib.text.Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") properties.
supxlabel(*t*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L383-L391)
Add a centered supxlabel to the figure.
Parameters:
**t**str
The supxlabel text.
**x**float, default: 0.5
The x location of the text in figure coordinates.
**y**float, default: 0.01
The y location of the text in figure coordinates.
**horizontalalignment, ha**{'center', 'left', 'right'}, default: center
The horizontal alignment of the text relative to (*x*, *y*).
**verticalalignment, va**{'top', 'center', 'bottom', 'baseline'}, default: bottom
The vertical alignment of the text relative to (*x*, *y*).
**fontsize, size**default: `[rcParams["figure.labelsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelsize#matplotlibrc-sample)` (default: `'large'`)
The font size of the text. See [`Text.set_size`](text_api#matplotlib.text.Text.set_size "matplotlib.text.Text.set_size") for possible values.
**fontweight, weight**default: `[rcParams["figure.labelweight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelweight#matplotlibrc-sample)` (default: `'normal'`)
The font weight of the text. See [`Text.set_weight`](text_api#matplotlib.text.Text.set_weight "matplotlib.text.Text.set_weight") for possible values.
Returns:
text
The [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") instance of the supxlabel.
Other Parameters:
**fontproperties**None or dict, optional
A dict of font properties. If *fontproperties* is given the default values for font size and weight are taken from the [`FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") defaults. `[rcParams["figure.labelsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelsize#matplotlibrc-sample)` (default: `'large'`) and `[rcParams["figure.labelweight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelweight#matplotlibrc-sample)` (default: `'normal'`) are ignored in this case.
**\*\*kwargs**
Additional kwargs are [`matplotlib.text.Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") properties.
supylabel(*t*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L393-L402)
Add a centered supylabel to the figure.
Parameters:
**t**str
The supylabel text.
**x**float, default: 0.02
The x location of the text in figure coordinates.
**y**float, default: 0.5
The y location of the text in figure coordinates.
**horizontalalignment, ha**{'center', 'left', 'right'}, default: left
The horizontal alignment of the text relative to (*x*, *y*).
**verticalalignment, va**{'top', 'center', 'bottom', 'baseline'}, default: center
The vertical alignment of the text relative to (*x*, *y*).
**fontsize, size**default: `[rcParams["figure.labelsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelsize#matplotlibrc-sample)` (default: `'large'`)
The font size of the text. See [`Text.set_size`](text_api#matplotlib.text.Text.set_size "matplotlib.text.Text.set_size") for possible values.
**fontweight, weight**default: `[rcParams["figure.labelweight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelweight#matplotlibrc-sample)` (default: `'normal'`)
The font weight of the text. See [`Text.set_weight`](text_api#matplotlib.text.Text.set_weight "matplotlib.text.Text.set_weight") for possible values.
Returns:
text
The [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") instance of the supylabel.
Other Parameters:
**fontproperties**None or dict, optional
A dict of font properties. If *fontproperties* is given the default values for font size and weight are taken from the [`FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") defaults. `[rcParams["figure.labelsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelsize#matplotlibrc-sample)` (default: `'large'`) and `[rcParams["figure.labelweight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.labelweight#matplotlibrc-sample)` (default: `'normal'`) are ignored in this case.
**\*\*kwargs**
Additional kwargs are [`matplotlib.text.Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") properties.
text(*x*, *y*, *s*, *fontdict=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L1126-L1174)
Add text to figure.
Parameters:
**x, y**float
The position to place the text. By default, this is in figure coordinates, floats in [0, 1]. The coordinate system can be changed using the *transform* keyword.
**s**str
The text string.
**fontdict**dict, optional
A dictionary to override the default text properties. If not given, the defaults are determined by `[rcParams["font.\*"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=font.*#matplotlibrc-sample)`. Properties passed as *kwargs* override the corresponding ones given in *fontdict*.
Returns:
[`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")
Other Parameters:
**\*\*kwargs**[`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") properties
Other miscellaneous text parameters.
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`backgroundcolor`](text_api#matplotlib.text.Text.set_backgroundcolor "matplotlib.text.Text.set_backgroundcolor") | color |
| [`bbox`](text_api#matplotlib.text.Text.set_bbox "matplotlib.text.Text.set_bbox") | dict with properties for [`patches.FancyBboxPatch`](_as_gen/matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | unknown |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | unknown |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | unknown |
| [`color`](text_api#matplotlib.text.Text.set_color "matplotlib.text.Text.set_color") or c | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fontfamily`](text_api#matplotlib.text.Text.set_fontfamily "matplotlib.text.Text.set_fontfamily") or family | {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'} |
| [`fontproperties`](text_api#matplotlib.text.Text.set_fontproperties "matplotlib.text.Text.set_fontproperties") or font or font\_properties | [`font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") or [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.10)") |
| [`fontsize`](text_api#matplotlib.text.Text.set_fontsize "matplotlib.text.Text.set_fontsize") or size | float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'} |
| [`fontstretch`](text_api#matplotlib.text.Text.set_fontstretch "matplotlib.text.Text.set_fontstretch") or stretch | {a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'} |
| [`fontstyle`](text_api#matplotlib.text.Text.set_fontstyle "matplotlib.text.Text.set_fontstyle") or style | {'normal', 'italic', 'oblique'} |
| [`fontvariant`](text_api#matplotlib.text.Text.set_fontvariant "matplotlib.text.Text.set_fontvariant") or variant | {'normal', 'small-caps'} |
| [`fontweight`](text_api#matplotlib.text.Text.set_fontweight "matplotlib.text.Text.set_fontweight") or weight | {a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'} |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`horizontalalignment`](text_api#matplotlib.text.Text.set_horizontalalignment "matplotlib.text.Text.set_horizontalalignment") or ha | {'left', 'center', 'right'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linespacing`](text_api#matplotlib.text.Text.set_linespacing "matplotlib.text.Text.set_linespacing") | float (multiple of font size) |
| [`math_fontfamily`](text_api#matplotlib.text.Text.set_math_fontfamily "matplotlib.text.Text.set_math_fontfamily") | str |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`multialignment`](text_api#matplotlib.text.Text.set_multialignment "matplotlib.text.Text.set_multialignment") or ma | {'left', 'right', 'center'} |
| [`parse_math`](text_api#matplotlib.text.Text.set_parse_math "matplotlib.text.Text.set_parse_math") | bool |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](text_api#matplotlib.text.Text.set_position "matplotlib.text.Text.set_position") | (float, float) |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`rotation`](text_api#matplotlib.text.Text.set_rotation "matplotlib.text.Text.set_rotation") | float or {'vertical', 'horizontal'} |
| [`rotation_mode`](text_api#matplotlib.text.Text.set_rotation_mode "matplotlib.text.Text.set_rotation_mode") | {None, 'default', 'anchor'} |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`text`](text_api#matplotlib.text.Text.set_text "matplotlib.text.Text.set_text") | object |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`transform_rotates_text`](text_api#matplotlib.text.Text.set_transform_rotates_text "matplotlib.text.Text.set_transform_rotates_text") | bool |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`usetex`](text_api#matplotlib.text.Text.set_usetex "matplotlib.text.Text.set_usetex") | bool or None |
| [`verticalalignment`](text_api#matplotlib.text.Text.set_verticalalignment "matplotlib.text.Text.set_verticalalignment") or va | {'bottom', 'baseline', 'center', 'center\_baseline', 'top'} |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`wrap`](text_api#matplotlib.text.Text.set_wrap "matplotlib.text.Text.set_wrap") | bool |
| [`x`](text_api#matplotlib.text.Text.set_x "matplotlib.text.Text.set_x") | float |
| [`y`](text_api#matplotlib.text.Text.set_y "matplotlib.text.Text.set_y") | float |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
See also
[`Axes.text`](_as_gen/matplotlib.axes.axes.text#matplotlib.axes.Axes.text "matplotlib.axes.Axes.text")
[`pyplot.text`](_as_gen/matplotlib.pyplot.text#matplotlib.pyplot.text "matplotlib.pyplot.text")
update(*props*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1168-L1177)
Update this artist's properties from the dict *props*.
Parameters:
**props**dict
update\_from(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1122-L1137)
Copy properties from *other* to *self*.
zorder*=0*
*class*matplotlib.figure.SubplotParams(*left=None*, *bottom=None*, *right=None*, *top=None*, *wspace=None*, *hspace=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L93-L155)
A class to hold the parameters for a subplot.
Defaults are given by `[rcParams["figure.subplot.[name]"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.subplot.%5Bname%5D#matplotlibrc-sample)`.
Parameters:
**left**float
The position of the left edge of the subplots, as a fraction of the figure width.
**right**float
The position of the right edge of the subplots, as a fraction of the figure width.
**bottom**float
The position of the bottom edge of the subplots, as a fraction of the figure height.
**top**float
The position of the top edge of the subplots, as a fraction of the figure height.
**wspace**float
The width of the padding between subplots, as a fraction of the average Axes width.
**hspace**float
The height of the padding between subplots, as a fraction of the average Axes height.
update(*left=None*, *bottom=None*, *right=None*, *top=None*, *wspace=None*, *hspace=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L132-L155)
Update the dimensions of the passed parameters. *None* means unchanged.
*property*validate[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
matplotlib.figure.figaspect(*arg*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/figure.py#L3448-L3525)
Calculate the width and height for a figure with a specified aspect ratio.
While the height is taken from `[rcParams["figure.figsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.figsize#matplotlibrc-sample)` (default: `[6.4, 4.8]`), the width is adjusted to match the desired aspect ratio. Additionally, it is ensured that the width is in the range [4., 16.] and the height is in the range [2., 16.]. If necessary, the default height is adjusted to ensure this.
Parameters:
**arg**float or 2D array
If a float, this defines the aspect ratio (i.e. the ratio height / width). In case of an array the aspect ratio is number of rows / number of columns, so that the array could be fitted in the figure undistorted.
Returns:
**width, height**float
The figure size in inches.
#### Notes
If you want to create an Axes within the figure, that still preserves the aspect ratio, be sure to create it with equal width and height. See examples below.
Thanks to Fernando Perez for this function.
#### Examples
Make a figure twice as tall as it is wide:
```
w, h = figaspect(2.)
fig = Figure(figsize=(w, h))
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8])
ax.imshow(A, **kwargs)
```
Make a figure with the proper aspect for an array:
```
A = rand(5, 3)
w, h = figaspect(A)
fig = Figure(figsize=(w, h))
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8])
ax.imshow(A, **kwargs)
```
| programming_docs |
matplotlib matplotlib.style matplotlib.style
================
Styles are predefined sets of [`rcParams`](matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams") that define the visual appearance of a plot.
[Customizing Matplotlib with style sheets and rcParams](https://matplotlib.org/stable/tutorials/introductory/customizing.html) describes the mechanism and usage of styles.
The [Style sheets reference](https://matplotlib.org/stable/gallery/style_sheets/style_sheets_reference.html) gives an overview of the builtin styles.
matplotlib.style.context(*style*, *after\_reset=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/style/core.py#L164-L195)
Context manager for using style settings temporarily.
Parameters:
**style**str, dict, Path or list
A style specification. Valid options are:
| | |
| --- | --- |
| str | The name of a style or a path/URL to a style file. For a list of available style names, see [`style.available`](#matplotlib.style.matplotlib.style.available "matplotlib.style.matplotlib.style.available"). |
| dict | Dictionary with valid key/value pairs for [`matplotlib.rcParams`](matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams"). |
| Path | A path-like object which is a path to a style file. |
| list | A list of style specifiers (str, Path or dict) applied from first to last in the list. |
**after\_reset**bool
If True, apply style after resetting settings to their defaults; otherwise, apply style on top of the current settings.
matplotlib.style.reload\_library()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/style/core.py#L254-L258)
Reload the style library.
matplotlib.style.use(*style*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/style/core.py#L65-L161)
Use Matplotlib style settings from a style specification.
The style name of 'default' is reserved for reverting back to the default style settings.
Note
This updates the [`rcParams`](matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams") with the settings from the style. [`rcParams`](matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams") not defined in the style are kept.
Parameters:
**style**str, dict, Path or list
A style specification. Valid options are:
| | |
| --- | --- |
| str | The name of a style or a path/URL to a style file. For a list of available style names, see [`style.available`](#matplotlib.style.matplotlib.style.available "matplotlib.style.matplotlib.style.available"). |
| dict | Dictionary with valid key/value pairs for [`matplotlib.rcParams`](matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams"). |
| Path | A path-like object which is a path to a style file. |
| list | A list of style specifiers (str, Path or dict) applied from first to last in the list. |
#### Notes
The following [`rcParams`](matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams") are not related to style and will be ignored if found in a style specification:
* backend
* backend\_fallback
* date.epoch
* docstring.hardcopy
* figure.max\_open\_warning
* figure.raise\_window
* interactive
* savefig.directory
* timezone
* tk.window\_focus
* toolbar
* webagg.address
* webagg.open\_in\_browser
* webagg.port
* webagg.port\_retries
matplotlib.style.library
A dict mapping from style name to [`RcParams`](matplotlib_configuration_api#matplotlib.RcParams "matplotlib.RcParams") defining that style.
This is meant to be read-only. Use [`reload_library`](#matplotlib.style.reload_library "matplotlib.style.reload_library") to update.
matplotlib.style.available
List of the names of the available styles.
This is meant to be read-only. Use [`reload_library`](#matplotlib.style.reload_library "matplotlib.style.reload_library") to update.
matplotlib matplotlib.projections matplotlib.projections
======================
Non-separable transforms that map from data space to screen space.
Projections are defined as [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") subclasses. They include the following elements:
* A transformation from data coordinates into display coordinates.
* An inverse of that transformation. This is used, for example, to convert mouse positions from screen space back into data space.
* Transformations for the gridlines, ticks and ticklabels. Custom projections will often need to place these elements in special locations, and Matplotlib has a facility to help with doing so.
* Setting up default values (overriding [`cla`](_as_gen/matplotlib.axes.axes.cla#matplotlib.axes.Axes.cla "matplotlib.axes.Axes.cla")), since the defaults for a rectilinear axes may not be appropriate.
* Defining the shape of the axes, for example, an elliptical axes, that will be used to draw the background of the plot and for clipping any data elements.
* Defining custom locators and formatters for the projection. For example, in a geographic projection, it may be more convenient to display the grid in degrees, even if the data is in radians.
* Set up interactive panning and zooming. This is left as an "advanced" feature left to the reader, but there is an example of this for polar plots in [`matplotlib.projections.polar`](#module-matplotlib.projections.polar "matplotlib.projections.polar").
* Any additional methods for additional convenience or features.
Once the projection axes is defined, it can be used in one of two ways:
* By defining the class attribute `name`, the projection axes can be registered with [`matplotlib.projections.register_projection`](#matplotlib.projections.register_projection "matplotlib.projections.register_projection") and subsequently simply invoked by name:
```
fig.add_subplot(projection="my_proj_name")
```
* For more complex, parameterisable projections, a generic "projection" object may be defined which includes the method `_as_mpl_axes`. `_as_mpl_axes` should take no arguments and return the projection's axes subclass and a dictionary of additional arguments to pass to the subclass' `__init__` method. Subsequently a parameterised projection can be initialised with:
```
fig.add_subplot(projection=MyProjection(param1=param1_value))
```
where MyProjection is an object which implements a `_as_mpl_axes` method.
A full-fledged and heavily annotated example is in [Custom projection](https://matplotlib.org/stable/gallery/misc/custom_projection.html). The polar plot functionality in [`matplotlib.projections.polar`](#module-matplotlib.projections.polar "matplotlib.projections.polar") may also be of interest.
*class*matplotlib.projections.ProjectionRegistry[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/__init__.py#L61-L79)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A mapping of registered projection names to projection classes.
get\_projection\_class(*name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/__init__.py#L73-L75)
Get a projection class from its *name*.
get\_projection\_names()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/__init__.py#L77-L79)
Return the names of all projections currently registered.
register(*\*projections*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/__init__.py#L67-L71)
Register a new set of projections.
matplotlib.projections.get\_projection\_class(*projection=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/__init__.py#L98-L110)
Get a projection class from its name.
If *projection* is None, a standard rectilinear projection is returned.
matplotlib.projections.get\_projection\_names()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/__init__.py#L77-L79)
Return the names of all projections currently registered.
matplotlib.projections.register\_projection(*cls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/__init__.py#L94-L95)
`matplotlib.projections.polar`
------------------------------
*class*matplotlib.projections.polar.InvertedPolarTransform(*axis=None*, *use\_rmin=True*, *\_apply\_theta\_transforms=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L150-L188)
Bases: [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
The inverse of the polar transform, mapping Cartesian coordinate space *x* and *y* back to *theta* and *r*.
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
has\_inverse*=True*
True if this transform has a corresponding inverse transform.
input\_dims*=2*
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L185-L188)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
output\_dims*=2*
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
transform\_non\_affine(*xy*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L169-L183)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length [`input_dims`](#matplotlib.projections.polar.InvertedPolarTransform.input_dims "matplotlib.projections.polar.InvertedPolarTransform.input_dims") or shape (N x [`input_dims`](#matplotlib.projections.polar.InvertedPolarTransform.input_dims "matplotlib.projections.polar.InvertedPolarTransform.input_dims")).
Returns:
array
The output values as NumPy array of length [`output_dims`](#matplotlib.projections.polar.InvertedPolarTransform.output_dims "matplotlib.projections.polar.InvertedPolarTransform.output_dims") or shape (N x [`output_dims`](#matplotlib.projections.polar.InvertedPolarTransform.output_dims "matplotlib.projections.polar.InvertedPolarTransform.output_dims")), depending on the input.
*class*matplotlib.projections.polar.PolarAffine(*scale\_transform*, *limits*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L117-L147)
Bases: [`Affine2DBase`](transformations#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")
The affine part of the polar projection. Scales the output so that maximum radius rests on the edge of the axes circle.
*limits* is the view limit of the data. The only part of its bounds that is used is the y limits (for the radius limits). The theta range is handled by the non-affine transform.
get\_matrix()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L136-L147)
Get the matrix for the affine part of this transform.
*class*matplotlib.projections.polar.PolarAxes(*\*args*, *theta\_offset=0*, *theta\_direction=1*, *rlabel\_position=22.5*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L748-L1430)
Bases: [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes._axes.Axes")
A polar graph projection, where the input dimensions are *theta*, *r*.
Theta starts pointing east and goes anti-clockwise.
Build an Axes in a figure.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The Axes is built in the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") *fig*.
**rect**tuple (left, bottom, width, height).
The Axes is built in the rectangle *rect*. *rect* is in [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") coordinates.
**sharex, sharey**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
The x or y [`axis`](axis_api#module-matplotlib.axis "matplotlib.axis") is shared with the x or y axis in the input [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes").
**frameon**bool, default: True
Whether the Axes frame is visible.
**box\_aspect**float, optional
Set a fixed aspect for the Axes box, i.e. the ratio of height to width. See [`set_box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") for details.
**\*\*kwargs**
Other optional keyword arguments:
| Property | Description |
| --- | --- |
| [`adjustable`](_as_gen/matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](_as_gen/matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](_as_gen/matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](_as_gen/matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](_as_gen/matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](_as_gen/matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](_as_gen/matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](_as_gen/matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](_as_gen/matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](_as_gen/matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](_as_gen/matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](_as_gen/matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](_as_gen/matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](_as_gen/matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](_as_gen/matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](_as_gen/matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](_as_gen/matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](_as_gen/matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](_as_gen/matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xmargin`](_as_gen/matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](_as_gen/matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](_as_gen/matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](_as_gen/matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](_as_gen/matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](_as_gen/matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](_as_gen/matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ymargin`](_as_gen/matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](_as_gen/matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](_as_gen/matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](_as_gen/matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Returns:
[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The new [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") object.
*class*InvertedPolarTransform(*axis=None*, *use\_rmin=True*, *\_apply\_theta\_transforms=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L150-L188)
Bases: [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
The inverse of the polar transform, mapping Cartesian coordinate space *x* and *y* back to *theta* and *r*.
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
has\_inverse*=True*
True if this transform has a corresponding inverse transform.
input\_dims*=2*
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L185-L188)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
output\_dims*=2*
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
transform\_non\_affine(*xy*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L169-L183)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length [`input_dims`](#matplotlib.projections.polar.PolarAxes.InvertedPolarTransform.input_dims "matplotlib.projections.polar.PolarAxes.InvertedPolarTransform.input_dims") or shape (N x [`input_dims`](#matplotlib.projections.polar.PolarAxes.InvertedPolarTransform.input_dims "matplotlib.projections.polar.PolarAxes.InvertedPolarTransform.input_dims")).
Returns:
array
The output values as NumPy array of length [`output_dims`](#matplotlib.projections.polar.PolarAxes.InvertedPolarTransform.output_dims "matplotlib.projections.polar.PolarAxes.InvertedPolarTransform.output_dims") or shape (N x [`output_dims`](#matplotlib.projections.polar.PolarAxes.InvertedPolarTransform.output_dims "matplotlib.projections.polar.PolarAxes.InvertedPolarTransform.output_dims")), depending on the input.
*class*PolarAffine(*scale\_transform*, *limits*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L117-L147)
Bases: [`Affine2DBase`](transformations#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")
The affine part of the polar projection. Scales the output so that maximum radius rests on the edge of the axes circle.
*limits* is the view limit of the data. The only part of its bounds that is used is the y limits (for the radius limits). The theta range is handled by the non-affine transform.
get\_matrix()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L136-L147)
Get the matrix for the affine part of this transform.
*class*PolarTransform(*axis=None*, *use\_rmin=True*, *\_apply\_theta\_transforms=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L18-L114)
Bases: [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
The base polar transform.
This transform maps polar coordinates `(theta, r)` into Cartesian coordinates `(x, y) = (r * cos(theta), r * sin(theta))` (but does not handle positioning in screen space).
Path segments at a fixed radius are automatically transformed to circular arcs as long as `path._interpolation_steps > 1`.
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
has\_inverse*=True*
True if this transform has a corresponding inverse transform.
input\_dims*=2*
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L111-L114)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
output\_dims*=2*
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
transform\_non\_affine(*tr*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L44-L55)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length [`input_dims`](#matplotlib.projections.polar.PolarAxes.PolarTransform.input_dims "matplotlib.projections.polar.PolarAxes.PolarTransform.input_dims") or shape (N x [`input_dims`](#matplotlib.projections.polar.PolarAxes.PolarTransform.input_dims "matplotlib.projections.polar.PolarAxes.PolarTransform.input_dims")).
Returns:
array
The output values as NumPy array of length [`output_dims`](#matplotlib.projections.polar.PolarAxes.PolarTransform.output_dims "matplotlib.projections.polar.PolarAxes.PolarTransform.output_dims") or shape (N x [`output_dims`](#matplotlib.projections.polar.PolarAxes.PolarTransform.output_dims "matplotlib.projections.polar.PolarAxes.PolarTransform.output_dims")), depending on the input.
transform\_path\_non\_affine(*path*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L57-L109)
Apply the non-affine part of this transform to [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") *path*, returning a new [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path").
`transform_path(path)` is equivalent to `transform_path_affine(transform_path_non_affine(values))`.
*class*RadialLocator(*base*, *axes=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L404-L439)
Bases: [`Locator`](ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator")
Used to locate radius ticks.
Ensures that all ticks are strictly positive. For all other tasks, it delegates to the base [`Locator`](ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator") (which may be different depending on the scale of the *r*-axis).
nonsingular(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L429-L432)
Adjust a range as needed to avoid singularities.
This method gets called during autoscaling, with `(v0, v1)` set to the data limits on the axes if the axes contains any data, or `(-inf, +inf)` if not.
* If `v0 == v1` (possibly up to some floating point slop), this method returns an expanded interval around this value.
* If `(v0, v1) == (-inf, +inf)`, this method returns appropriate default view limits.
* Otherwise, `(v0, v1)` is returned without modification.
set\_axis(*axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L417-L418)
view\_limits(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L434-L439)
Select a scale for the range from vmin to vmax.
Subclasses should override this method to change locator behaviour.
*class*ThetaFormatter[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L191-L206)
Bases: [`Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter")
Used to format the *theta* tick labels. Converts the native unit of radians into degrees and adds a degree symbol.
*class*ThetaLocator(*base*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L232-L262)
Bases: [`Locator`](ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator")
Used to locate theta ticks.
This will work the same as the base locator except in the case that the view spans the entire circle. In such cases, the previously used default locations of every 45 degrees are returned.
refresh()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L256-L258)
set\_axis(*axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L245-L247)
view\_limits(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L260-L262)
Select a scale for the range from vmin to vmax.
Subclasses should override this method to change locator behaviour.
can\_pan()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1372-L1380)
Return whether this axes supports the pan/zoom button functionality.
For polar axes, this is slightly misleading. Both panning and zooming are performed by the same button. Panning is performed in azimuth while zooming is done along the radial.
can\_zoom()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1364-L1370)
Return whether this axes supports the zoom box button functionality.
Polar axes do not support zoom boxes.
clear()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L768-L789)
Clear the Axes.
drag\_pan(*button*, *key*, *x*, *y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1405-L1430)
Called when the mouse moves during a pan operation.
Parameters:
**button**[`MouseButton`](backend_bases_api#matplotlib.backend_bases.MouseButton "matplotlib.backend_bases.MouseButton")
The pressed mouse button.
**key**str or None
The pressed key, if any.
**x, y**float
The mouse coordinates in display coords.
#### Notes
This is intended to be overridden by new projection types.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L922-L966)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
end\_pan()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1402-L1403)
Called when a pan operation completes (when the mouse button is up.)
#### Notes
This is intended to be overridden by new projection types.
format\_coord(*theta*, *r*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1324-L1353)
Return a format string formatting the *x*, *y* coordinates.
get\_data\_ratio()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1355-L1360)
Return the aspect ratio of the data itself. For a polar plot, this should always be 1.0
get\_rlabel\_position()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1188-L1195)
Returns:
float
The theta position of the radius labels in degrees.
get\_rmax()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1112-L1119)
Returns:
float
Outer radial limit.
get\_rmin()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1131-L1138)
Returns:
float
The inner radial limit.
get\_rorigin()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1150-L1156)
Returns:
float
get\_rsign()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1158-L1159)
get\_theta\_direction()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1090-L1100)
Get the direction in which theta increases.
-1:
Theta increases in the clockwise direction
1:
Theta increases in the counterclockwise direction
get\_theta\_offset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1037-L1041)
Get the offset for the location of 0 in radians.
get\_thetamax()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L988-L990)
Return the maximum theta limit in degrees.
get\_thetamin()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L996-L998)
Get the minimum theta limit in degrees.
get\_xaxis\_text1\_transform(*pad*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L887-L888)
Returns:
**transform**Transform
The transform used for drawing x-axis labels, which will add *pad\_points* of padding (in points) between the axis and the label. The x-direction is in data coordinates and the y-direction is in axis coordinates
**valign**{'center', 'top', 'bottom', 'baseline', 'center\_baseline'}
The text vertical alignment.
**halign**{'center', 'left', 'right'}
The text horizontal alignment.
#### Notes
This transformation is primarily used by the [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis") class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.
get\_xaxis\_text2\_transform(*pad*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L890-L891)
Returns:
**transform**Transform
The transform used for drawing secondary x-axis labels, which will add *pad\_points* of padding (in points) between the axis and the label. The x-direction is in data coordinates and the y-direction is in axis coordinates
**valign**{'center', 'top', 'bottom', 'baseline', 'center\_baseline'}
The text vertical alignment.
**halign**{'center', 'left', 'right'}
The text horizontal alignment.
#### Notes
This transformation is primarily used by the [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis") class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.
get\_xaxis\_transform(*which='grid'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L883-L885)
Get the transformation used for drawing x-axis labels, ticks and gridlines. The x-direction is in data coordinates and the y-direction is in axis coordinates.
Note
This transformation is primarily used by the [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis") class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.
get\_yaxis\_text1\_transform(*pad*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L901-L911)
Returns:
**transform**Transform
The transform used for drawing y-axis labels, which will add *pad\_points* of padding (in points) between the axis and the label. The x-direction is in axis coordinates and the y-direction is in data coordinates
**valign**{'center', 'top', 'bottom', 'baseline', 'center\_baseline'}
The text vertical alignment.
**halign**{'center', 'left', 'right'}
The text horizontal alignment.
#### Notes
This transformation is primarily used by the [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis") class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.
get\_yaxis\_text2\_transform(*pad*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L913-L920)
Returns:
**transform**Transform
The transform used for drawing secondart y-axis labels, which will add *pad\_points* of padding (in points) between the axis and the label. The x-direction is in axis coordinates and the y-direction is in data coordinates
**valign**{'center', 'top', 'bottom', 'baseline', 'center\_baseline'}
The text vertical alignment.
**halign**{'center', 'left', 'right'}
The text horizontal alignment.
#### Notes
This transformation is primarily used by the [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis") class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.
get\_yaxis\_transform(*which='grid'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L893-L899)
Get the transformation used for drawing y-axis labels, ticks and gridlines. The x-direction is in axis coordinates and the y-direction is in data coordinates.
Note
This transformation is primarily used by the [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis") class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.
name*='polar'*
set(*\**, *adjustable=<UNSET>*, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *anchor=<UNSET>*, *animated=<UNSET>*, *aspect=<UNSET>*, *autoscale\_on=<UNSET>*, *autoscalex\_on=<UNSET>*, *autoscaley\_on=<UNSET>*, *axes\_locator=<UNSET>*, *axisbelow=<UNSET>*, *box\_aspect=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *facecolor=<UNSET>*, *frame\_on=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *navigate=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *position=<UNSET>*, *prop\_cycle=<UNSET>*, *rasterization\_zorder=<UNSET>*, *rasterized=<UNSET>*, *rgrids=<UNSET>*, *rlabel\_position=<UNSET>*, *rlim=<UNSET>*, *rmax=<UNSET>*, *rmin=<UNSET>*, *rorigin=<UNSET>*, *rscale=<UNSET>*, *rticks=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *theta\_direction=<UNSET>*, *theta\_offset=<UNSET>*, *theta\_zero\_location=<UNSET>*, *thetagrids=<UNSET>*, *thetalim=<UNSET>*, *thetamax=<UNSET>*, *thetamin=<UNSET>*, *title=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *xbound=<UNSET>*, *xlabel=<UNSET>*, *xlim=<UNSET>*, *xmargin=<UNSET>*, *xscale=<UNSET>*, *xticklabels=<UNSET>*, *xticks=<UNSET>*, *ybound=<UNSET>*, *ylabel=<UNSET>*, *ylim=<UNSET>*, *ymargin=<UNSET>*, *yscale=<UNSET>*, *yticklabels=<UNSET>*, *yticks=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`adjustable`](_as_gen/matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](_as_gen/matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](_as_gen/matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](_as_gen/matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](_as_gen/matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](_as_gen/matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](_as_gen/matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](_as_gen/matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](_as_gen/matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](_as_gen/matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](_as_gen/matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](_as_gen/matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](_as_gen/matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](_as_gen/matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](_as_gen/matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`rgrids`](#matplotlib.projections.polar.PolarAxes.set_rgrids "matplotlib.projections.polar.PolarAxes.set_rgrids") | tuple with floats |
| [`rlabel_position`](#matplotlib.projections.polar.PolarAxes.set_rlabel_position "matplotlib.projections.polar.PolarAxes.set_rlabel_position") | number |
| [`rlim`](#matplotlib.projections.polar.PolarAxes.set_rlim "matplotlib.projections.polar.PolarAxes.set_rlim") | unknown |
| [`rmax`](#matplotlib.projections.polar.PolarAxes.set_rmax "matplotlib.projections.polar.PolarAxes.set_rmax") | float |
| [`rmin`](#matplotlib.projections.polar.PolarAxes.set_rmin "matplotlib.projections.polar.PolarAxes.set_rmin") | float |
| [`rorigin`](#matplotlib.projections.polar.PolarAxes.set_rorigin "matplotlib.projections.polar.PolarAxes.set_rorigin") | float |
| [`rscale`](#matplotlib.projections.polar.PolarAxes.set_rscale "matplotlib.projections.polar.PolarAxes.set_rscale") | unknown |
| [`rticks`](#matplotlib.projections.polar.PolarAxes.set_rticks "matplotlib.projections.polar.PolarAxes.set_rticks") | unknown |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`theta_direction`](#matplotlib.projections.polar.PolarAxes.set_theta_direction "matplotlib.projections.polar.PolarAxes.set_theta_direction") | unknown |
| [`theta_offset`](#matplotlib.projections.polar.PolarAxes.set_theta_offset "matplotlib.projections.polar.PolarAxes.set_theta_offset") | unknown |
| [`theta_zero_location`](#matplotlib.projections.polar.PolarAxes.set_theta_zero_location "matplotlib.projections.polar.PolarAxes.set_theta_zero_location") | str |
| [`thetagrids`](#matplotlib.projections.polar.PolarAxes.set_thetagrids "matplotlib.projections.polar.PolarAxes.set_thetagrids") | tuple with floats, degrees |
| [`thetalim`](#matplotlib.projections.polar.PolarAxes.set_thetalim "matplotlib.projections.polar.PolarAxes.set_thetalim") | unknown |
| [`thetamax`](#matplotlib.projections.polar.PolarAxes.set_thetamax "matplotlib.projections.polar.PolarAxes.set_thetamax") | unknown |
| [`thetamin`](#matplotlib.projections.polar.PolarAxes.set_thetamin "matplotlib.projections.polar.PolarAxes.set_thetamin") | unknown |
| [`title`](_as_gen/matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](_as_gen/matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](_as_gen/matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](_as_gen/matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xmargin`](_as_gen/matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](_as_gen/matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](_as_gen/matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](_as_gen/matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](_as_gen/matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](_as_gen/matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](_as_gen/matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ymargin`](_as_gen/matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](_as_gen/matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](_as_gen/matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](_as_gen/matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_rgrids(*radii*, *labels=None*, *angle=None*, *fmt=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1269-L1322)
Set the radial gridlines on a polar plot.
Parameters:
**radii**tuple with floats
The radii for the radial gridlines
**labels**tuple with strings or None
The labels to use at each radial gridline. The [`matplotlib.ticker.ScalarFormatter`](ticker_api#matplotlib.ticker.ScalarFormatter "matplotlib.ticker.ScalarFormatter") will be used if None.
**angle**float
The angular position of the radius labels in degrees.
**fmt**str or None
Format string used in [`matplotlib.ticker.FormatStrFormatter`](ticker_api#matplotlib.ticker.FormatStrFormatter "matplotlib.ticker.FormatStrFormatter"). For example '%f'.
Returns:
**lines**list of [`lines.Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
The radial gridlines.
**labels**list of [`text.Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")
The tick labels.
Other Parameters:
**\*\*kwargs**
*kwargs* are optional [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") properties for the labels.
See also
[`PolarAxes.set_thetagrids`](#matplotlib.projections.polar.PolarAxes.set_thetagrids "matplotlib.projections.polar.PolarAxes.set_thetagrids")
[`Axis.get_gridlines`](_as_gen/matplotlib.axis.axis.get_gridlines#matplotlib.axis.Axis.get_gridlines "matplotlib.axis.Axis.get_gridlines")
[`Axis.get_ticklabels`](_as_gen/matplotlib.axis.axis.get_ticklabels#matplotlib.axis.Axis.get_ticklabels "matplotlib.axis.Axis.get_ticklabels")
set\_rlabel\_position(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1197-L1206)
Update the theta position of the radius labels.
Parameters:
**value**number
The angular position of the radius labels in degrees.
set\_rlim(*bottom=None*, *top=None*, *\**, *emit=True*, *auto=False*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1161-L1186)
Set the radial axis view limits.
This function behaves like [`Axes.set_ylim`](_as_gen/matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim"), but additionally supports *rmin* and *rmax* as aliases for *bottom* and *top*.
See also
[`Axes.set_ylim`](_as_gen/matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim")
set\_rmax(*rmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1102-L1110)
Set the outer radial limit.
Parameters:
**rmax**float
set\_rmin(*rmin*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1121-L1129)
Set the inner radial limit.
Parameters:
**rmin**float
set\_rorigin(*rorigin*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1140-L1148)
Update the radial origin.
Parameters:
**rorigin**float
set\_rscale(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1213-L1214)
set\_rticks(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1216-L1217)
set\_theta\_direction(*direction*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1069-L1088)
Set the direction in which theta increases.
clockwise, -1:
Theta increases in the clockwise direction
counterclockwise, anticlockwise, 1:
Theta increases in the counterclockwise direction
set\_theta\_offset(*offset*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1029-L1035)
Set the offset for the location of 0 in radians.
set\_theta\_zero\_location(*loc*, *offset=0.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1043-L1067)
Set the location of theta's zero.
This simply calls [`set_theta_offset`](#matplotlib.projections.polar.PolarAxes.set_theta_offset "matplotlib.projections.polar.PolarAxes.set_theta_offset") with the correct value in radians.
Parameters:
**loc**str
May be one of "N", "NW", "W", "SW", "S", "SE", "E", or "NE".
**offset**float, default: 0
An offset in degrees to apply from the specified *loc*. **Note:** this offset is *always* applied counter-clockwise regardless of the direction setting.
set\_thetagrids(*angles*, *labels=None*, *fmt=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1219-L1267)
Set the theta gridlines in a polar plot.
Parameters:
**angles**tuple with floats, degrees
The angles of the theta gridlines.
**labels**tuple with strings or None
The labels to use at each theta gridline. The [`projections.polar.ThetaFormatter`](#matplotlib.projections.polar.ThetaFormatter "matplotlib.projections.polar.ThetaFormatter") will be used if None.
**fmt**str or None
Format string used in [`matplotlib.ticker.FormatStrFormatter`](ticker_api#matplotlib.ticker.FormatStrFormatter "matplotlib.ticker.FormatStrFormatter"). For example '%f'. Note that the angle that is used is in radians.
Returns:
**lines**list of [`lines.Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
The theta gridlines.
**labels**list of [`text.Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")
The tick labels.
Other Parameters:
**\*\*kwargs**
*kwargs* are optional [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") properties for the labels.
See also
[`PolarAxes.set_rgrids`](#matplotlib.projections.polar.PolarAxes.set_rgrids "matplotlib.projections.polar.PolarAxes.set_rgrids")
[`Axis.get_gridlines`](_as_gen/matplotlib.axis.axis.get_gridlines#matplotlib.axis.Axis.get_gridlines "matplotlib.axis.Axis.get_gridlines")
[`Axis.get_ticklabels`](_as_gen/matplotlib.axis.axis.get_ticklabels#matplotlib.axis.Axis.get_ticklabels "matplotlib.axis.Axis.get_ticklabels")
set\_thetalim(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1000-L1027)
Set the minimum and maximum theta values.
Can take the following signatures:
* `set_thetalim(minval, maxval)`: Set the limits in radians.
* `set_thetalim(thetamin=minval, thetamax=maxval)`: Set the limits in degrees.
where minval and maxval are the minimum and maximum limits. Values are wrapped in to the range \([0, 2\pi]\) (in radians), so for example it is possible to do `set_thetalim(-np.pi / 2, np.pi / 2)` to have an axis symmetric around 0. A ValueError is raised if the absolute angle difference is larger than a full circle.
set\_thetamax(*thetamax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L984-L986)
Set the maximum theta limit in degrees.
set\_thetamin(*thetamin*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L992-L994)
Set the minimum theta limit in degrees.
set\_yscale(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1208-L1211)
Set the yaxis' scale.
Parameters:
**value**{"linear", "log", "symlog", "logit", ...} or [`ScaleBase`](scale_api#matplotlib.scale.ScaleBase "matplotlib.scale.ScaleBase")
The axis scale type to apply.
**\*\*kwargs**
Different keyword arguments are accepted, depending on the scale. See the respective class keyword arguments:
* [`matplotlib.scale.LinearScale`](scale_api#matplotlib.scale.LinearScale "matplotlib.scale.LinearScale")
* [`matplotlib.scale.LogScale`](scale_api#matplotlib.scale.LogScale "matplotlib.scale.LogScale")
* [`matplotlib.scale.SymmetricalLogScale`](scale_api#matplotlib.scale.SymmetricalLogScale "matplotlib.scale.SymmetricalLogScale")
* [`matplotlib.scale.LogitScale`](scale_api#matplotlib.scale.LogitScale "matplotlib.scale.LogitScale")
* [`matplotlib.scale.FuncScale`](scale_api#matplotlib.scale.FuncScale "matplotlib.scale.FuncScale")
#### Notes
By default, Matplotlib supports the above mentioned scales. Additionally, custom scales may be registered using [`matplotlib.scale.register_scale`](scale_api#matplotlib.scale.register_scale "matplotlib.scale.register_scale"). These scales can then also be used here.
start\_pan(*x*, *y*, *button*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L1382-L1400)
Called when a pan operation has started.
Parameters:
**x, y**float
The mouse coordinates in display coords.
**button**[`MouseButton`](backend_bases_api#matplotlib.backend_bases.MouseButton "matplotlib.backend_bases.MouseButton")
The pressed mouse button.
#### Notes
This is intended to be overridden by new projection types.
*class*matplotlib.projections.polar.PolarTransform(*axis=None*, *use\_rmin=True*, *\_apply\_theta\_transforms=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L18-L114)
Bases: [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
The base polar transform.
This transform maps polar coordinates `(theta, r)` into Cartesian coordinates `(x, y) = (r * cos(theta), r * sin(theta))` (but does not handle positioning in screen space).
Path segments at a fixed radius are automatically transformed to circular arcs as long as `path._interpolation_steps > 1`.
Parameters:
**shorthand\_name**str
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of `str(transform)` when DEBUG=True.
has\_inverse*=True*
True if this transform has a corresponding inverse transform.
input\_dims*=2*
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L111-L114)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
output\_dims*=2*
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
transform\_non\_affine(*tr*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L44-L55)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length [`input_dims`](#matplotlib.projections.polar.PolarTransform.input_dims "matplotlib.projections.polar.PolarTransform.input_dims") or shape (N x [`input_dims`](#matplotlib.projections.polar.PolarTransform.input_dims "matplotlib.projections.polar.PolarTransform.input_dims")).
Returns:
array
The output values as NumPy array of length [`output_dims`](#matplotlib.projections.polar.PolarTransform.output_dims "matplotlib.projections.polar.PolarTransform.output_dims") or shape (N x [`output_dims`](#matplotlib.projections.polar.PolarTransform.output_dims "matplotlib.projections.polar.PolarTransform.output_dims")), depending on the input.
transform\_path\_non\_affine(*path*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L57-L109)
Apply the non-affine part of this transform to [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") *path*, returning a new [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path").
`transform_path(path)` is equivalent to `transform_path_affine(transform_path_non_affine(values))`.
*class*matplotlib.projections.polar.RadialAxis(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L643-L671)
Bases: [`YAxis`](axis_api#matplotlib.axis.YAxis "matplotlib.axis.YAxis")
A radial Axis.
This overrides certain properties of a [`YAxis`](axis_api#matplotlib.axis.YAxis "matplotlib.axis.YAxis") to provide special-casing for a radial axis.
Parameters:
**axes**[`matplotlib.axes.Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") to which the created Axis belongs.
**pickradius**float
The acceptance radius for containment tests. See also [`Axis.contains`](_as_gen/matplotlib.axis.axis.contains#matplotlib.axis.Axis.contains "matplotlib.axis.Axis.contains").
axis\_name*='radius'*
Read-only name identifying the axis.
clear()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L663-L667)
Clear the axis.
This resets axis properties to their default values:
* the label
* the scale
* locators, formatters and ticks
* major and minor grid
* units
* registered callbacks
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *data\_interval=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *inverted=<UNSET>*, *label=<UNSET>*, *label\_coords=<UNSET>*, *label\_position=<UNSET>*, *label\_text=<UNSET>*, *major\_formatter=<UNSET>*, *major\_locator=<UNSET>*, *minor\_formatter=<UNSET>*, *minor\_locator=<UNSET>*, *mouseover=<UNSET>*, *offset\_position=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *remove\_overlapping\_locs=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *tick\_params=<UNSET>*, *ticklabels=<UNSET>*, *ticks=<UNSET>*, *ticks\_position=<UNSET>*, *transform=<UNSET>*, *units=<UNSET>*, *url=<UNSET>*, *view\_interval=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`data_interval`](_as_gen/matplotlib.axis.axis.set_data_interval#matplotlib.axis.Axis.set_data_interval "matplotlib.axis.Axis.set_data_interval") | unknown |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`inverted`](_as_gen/matplotlib.axis.axis.set_inverted#matplotlib.axis.Axis.set_inverted "matplotlib.axis.Axis.set_inverted") | unknown |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`label_coords`](_as_gen/matplotlib.axis.axis.set_label_coords#matplotlib.axis.Axis.set_label_coords "matplotlib.axis.Axis.set_label_coords") | unknown |
| [`label_position`](_as_gen/matplotlib.axis.yaxis.set_label_position#matplotlib.axis.YAxis.set_label_position "matplotlib.axis.YAxis.set_label_position") | {'left', 'right'} |
| [`label_text`](_as_gen/matplotlib.axis.axis.set_label_text#matplotlib.axis.Axis.set_label_text "matplotlib.axis.Axis.set_label_text") | str |
| [`major_formatter`](_as_gen/matplotlib.axis.axis.set_major_formatter#matplotlib.axis.Axis.set_major_formatter "matplotlib.axis.Axis.set_major_formatter") | [`Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter"), `str`, or function |
| [`major_locator`](_as_gen/matplotlib.axis.axis.set_major_locator#matplotlib.axis.Axis.set_major_locator "matplotlib.axis.Axis.set_major_locator") | [`Locator`](ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator") |
| [`minor_formatter`](_as_gen/matplotlib.axis.axis.set_minor_formatter#matplotlib.axis.Axis.set_minor_formatter "matplotlib.axis.Axis.set_minor_formatter") | [`Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter"), `str`, or function |
| [`minor_locator`](_as_gen/matplotlib.axis.axis.set_minor_locator#matplotlib.axis.Axis.set_minor_locator "matplotlib.axis.Axis.set_minor_locator") | [`Locator`](ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator") |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`offset_position`](_as_gen/matplotlib.axis.yaxis.set_offset_position#matplotlib.axis.YAxis.set_offset_position "matplotlib.axis.YAxis.set_offset_position") | {'left', 'right'} |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](_as_gen/matplotlib.axis.axis.set_pickradius#matplotlib.axis.Axis.set_pickradius "matplotlib.axis.Axis.set_pickradius") | float |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`remove_overlapping_locs`](_as_gen/matplotlib.axis.axis.set_remove_overlapping_locs#matplotlib.axis.Axis.set_remove_overlapping_locs "matplotlib.axis.Axis.set_remove_overlapping_locs") | unknown |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`tick_params`](_as_gen/matplotlib.axis.axis.set_tick_params#matplotlib.axis.Axis.set_tick_params "matplotlib.axis.Axis.set_tick_params") | unknown |
| [`ticklabels`](_as_gen/matplotlib.axis.axis.set_ticklabels#matplotlib.axis.Axis.set_ticklabels "matplotlib.axis.Axis.set_ticklabels") | sequence of str or of [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")s |
| [`ticks`](_as_gen/matplotlib.axis.axis.set_ticks#matplotlib.axis.Axis.set_ticks "matplotlib.axis.Axis.set_ticks") | list of floats |
| [`ticks_position`](_as_gen/matplotlib.axis.yaxis.set_ticks_position#matplotlib.axis.YAxis.set_ticks_position "matplotlib.axis.YAxis.set_ticks_position") | {'left', 'right', 'both', 'default', 'none'} |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`units`](_as_gen/matplotlib.axis.axis.set_units#matplotlib.axis.Axis.set_units "matplotlib.axis.Axis.set_units") | units tag |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`view_interval`](_as_gen/matplotlib.axis.axis.set_view_interval#matplotlib.axis.Axis.set_view_interval "matplotlib.axis.Axis.set_view_interval") | unknown |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
*class*matplotlib.projections.polar.RadialLocator(*base*, *axes=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L404-L439)
Bases: [`Locator`](ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator")
Used to locate radius ticks.
Ensures that all ticks are strictly positive. For all other tasks, it delegates to the base [`Locator`](ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator") (which may be different depending on the scale of the *r*-axis).
nonsingular(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L429-L432)
Adjust a range as needed to avoid singularities.
This method gets called during autoscaling, with `(v0, v1)` set to the data limits on the axes if the axes contains any data, or `(-inf, +inf)` if not.
* If `v0 == v1` (possibly up to some floating point slop), this method returns an expanded interval around this value.
* If `(v0, v1) == (-inf, +inf)`, this method returns appropriate default view limits.
* Otherwise, `(v0, v1)` is returned without modification.
set\_axis(*axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L417-L418)
view\_limits(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L434-L439)
Select a scale for the range from vmin to vmax.
Subclasses should override this method to change locator behaviour.
*class*matplotlib.projections.polar.RadialTick(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L492-L640)
Bases: [`YTick`](axis_api#matplotlib.axis.YTick "matplotlib.axis.YTick")
A radial-axis tick.
This subclass of [`YTick`](axis_api#matplotlib.axis.YTick "matplotlib.axis.YTick") provides radial ticks with some small modification to their re-positioning such that ticks are rotated based on axes limits. This results in ticks that are correctly perpendicular to the spine. Labels are also rotated to be perpendicular to the spine, when 'auto' rotation is enabled.
bbox is the Bound2D bounding box in display coords of the Axes loc is the tick location in data coords size is the tick size in points
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *label1=<UNSET>*, *label2=<UNSET>*, *mouseover=<UNSET>*, *pad=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.axis.tick.set_label1#matplotlib.axis.Tick.set_label1 "matplotlib.axis.Tick.set_label1") | str |
| [`label1`](_as_gen/matplotlib.axis.tick.set_label1#matplotlib.axis.Tick.set_label1 "matplotlib.axis.Tick.set_label1") | str |
| [`label2`](_as_gen/matplotlib.axis.tick.set_label2#matplotlib.axis.Tick.set_label2 "matplotlib.axis.Tick.set_label2") | str |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`pad`](_as_gen/matplotlib.axis.tick.set_pad#matplotlib.axis.Tick.set_pad "matplotlib.axis.Tick.set_pad") | float |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.axis.tick.set_url#matplotlib.axis.Tick.set_url "matplotlib.axis.Tick.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
update\_position(*loc*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L562-L640)
Set the location of tick in data coords with scalar *loc*.
*class*matplotlib.projections.polar.ThetaAxis(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L357-L401)
Bases: [`XAxis`](axis_api#matplotlib.axis.XAxis "matplotlib.axis.XAxis")
A theta Axis.
This overrides certain properties of an [`XAxis`](axis_api#matplotlib.axis.XAxis "matplotlib.axis.XAxis") to provide special-casing for an angular axis.
Parameters:
**axes**[`matplotlib.axes.Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") to which the created Axis belongs.
**pickradius**float
The acceptance radius for containment tests. See also [`Axis.contains`](_as_gen/matplotlib.axis.axis.contains#matplotlib.axis.Axis.contains "matplotlib.axis.Axis.contains").
axis\_name*='theta'*
Read-only name identifying the axis.
clear()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L374-L378)
Clear the axis.
This resets axis properties to their default values:
* the label
* the scale
* locators, formatters and ticks
* major and minor grid
* units
* registered callbacks
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *data\_interval=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *inverted=<UNSET>*, *label=<UNSET>*, *label\_coords=<UNSET>*, *label\_position=<UNSET>*, *label\_text=<UNSET>*, *major\_formatter=<UNSET>*, *major\_locator=<UNSET>*, *minor\_formatter=<UNSET>*, *minor\_locator=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *remove\_overlapping\_locs=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *tick\_params=<UNSET>*, *ticklabels=<UNSET>*, *ticks=<UNSET>*, *ticks\_position=<UNSET>*, *transform=<UNSET>*, *units=<UNSET>*, *url=<UNSET>*, *view\_interval=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`data_interval`](_as_gen/matplotlib.axis.axis.set_data_interval#matplotlib.axis.Axis.set_data_interval "matplotlib.axis.Axis.set_data_interval") | unknown |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`inverted`](_as_gen/matplotlib.axis.axis.set_inverted#matplotlib.axis.Axis.set_inverted "matplotlib.axis.Axis.set_inverted") | unknown |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`label_coords`](_as_gen/matplotlib.axis.axis.set_label_coords#matplotlib.axis.Axis.set_label_coords "matplotlib.axis.Axis.set_label_coords") | unknown |
| [`label_position`](_as_gen/matplotlib.axis.xaxis.set_label_position#matplotlib.axis.XAxis.set_label_position "matplotlib.axis.XAxis.set_label_position") | {'top', 'bottom'} |
| [`label_text`](_as_gen/matplotlib.axis.axis.set_label_text#matplotlib.axis.Axis.set_label_text "matplotlib.axis.Axis.set_label_text") | str |
| [`major_formatter`](_as_gen/matplotlib.axis.axis.set_major_formatter#matplotlib.axis.Axis.set_major_formatter "matplotlib.axis.Axis.set_major_formatter") | [`Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter"), `str`, or function |
| [`major_locator`](_as_gen/matplotlib.axis.axis.set_major_locator#matplotlib.axis.Axis.set_major_locator "matplotlib.axis.Axis.set_major_locator") | [`Locator`](ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator") |
| [`minor_formatter`](_as_gen/matplotlib.axis.axis.set_minor_formatter#matplotlib.axis.Axis.set_minor_formatter "matplotlib.axis.Axis.set_minor_formatter") | [`Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter"), `str`, or function |
| [`minor_locator`](_as_gen/matplotlib.axis.axis.set_minor_locator#matplotlib.axis.Axis.set_minor_locator "matplotlib.axis.Axis.set_minor_locator") | [`Locator`](ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator") |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](_as_gen/matplotlib.axis.axis.set_pickradius#matplotlib.axis.Axis.set_pickradius "matplotlib.axis.Axis.set_pickradius") | float |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`remove_overlapping_locs`](_as_gen/matplotlib.axis.axis.set_remove_overlapping_locs#matplotlib.axis.Axis.set_remove_overlapping_locs "matplotlib.axis.Axis.set_remove_overlapping_locs") | unknown |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`tick_params`](_as_gen/matplotlib.axis.axis.set_tick_params#matplotlib.axis.Axis.set_tick_params "matplotlib.axis.Axis.set_tick_params") | unknown |
| [`ticklabels`](_as_gen/matplotlib.axis.axis.set_ticklabels#matplotlib.axis.Axis.set_ticklabels "matplotlib.axis.Axis.set_ticklabels") | sequence of str or of [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")s |
| [`ticks`](_as_gen/matplotlib.axis.axis.set_ticks#matplotlib.axis.Axis.set_ticks "matplotlib.axis.Axis.set_ticks") | list of floats |
| [`ticks_position`](_as_gen/matplotlib.axis.xaxis.set_ticks_position#matplotlib.axis.XAxis.set_ticks_position "matplotlib.axis.XAxis.set_ticks_position") | {'top', 'bottom', 'both', 'default', 'none'} |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`units`](_as_gen/matplotlib.axis.axis.set_units#matplotlib.axis.Axis.set_units "matplotlib.axis.Axis.set_units") | units tag |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`view_interval`](_as_gen/matplotlib.axis.axis.set_view_interval#matplotlib.axis.Axis.set_view_interval "matplotlib.axis.Axis.set_view_interval") | unknown |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
*class*matplotlib.projections.polar.ThetaFormatter[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L191-L206)
Bases: [`Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter")
Used to format the *theta* tick labels. Converts the native unit of radians into degrees and adds a degree symbol.
*class*matplotlib.projections.polar.ThetaLocator(*base*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L232-L262)
Bases: [`Locator`](ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator")
Used to locate theta ticks.
This will work the same as the base locator except in the case that the view spans the entire circle. In such cases, the previously used default locations of every 45 degrees are returned.
refresh()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L256-L258)
set\_axis(*axis*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L245-L247)
view\_limits(*vmin*, *vmax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L260-L262)
Select a scale for the range from vmin to vmax.
Subclasses should override this method to change locator behaviour.
*class*matplotlib.projections.polar.ThetaTick(*axes*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L265-L354)
Bases: [`XTick`](axis_api#matplotlib.axis.XTick "matplotlib.axis.XTick")
A theta-axis tick.
This subclass of [`XTick`](axis_api#matplotlib.axis.XTick "matplotlib.axis.XTick") provides angular ticks with some small modification to their re-positioning such that ticks are rotated based on tick location. This results in ticks that are correctly perpendicular to the arc spine.
When 'auto' rotation is enabled, labels are also rotated to be parallel to the spine. The label padding is also applied here since it's not possible to use a generic axes transform to produce tick-specific padding.
bbox is the Bound2D bounding box in display coords of the Axes loc is the tick location in data coords size is the tick size in points
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *label1=<UNSET>*, *label2=<UNSET>*, *mouseover=<UNSET>*, *pad=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.axis.tick.set_label1#matplotlib.axis.Tick.set_label1 "matplotlib.axis.Tick.set_label1") | str |
| [`label1`](_as_gen/matplotlib.axis.tick.set_label1#matplotlib.axis.Tick.set_label1 "matplotlib.axis.Tick.set_label1") | str |
| [`label2`](_as_gen/matplotlib.axis.tick.set_label2#matplotlib.axis.Tick.set_label2 "matplotlib.axis.Tick.set_label2") | str |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`pad`](_as_gen/matplotlib.axis.tick.set_pad#matplotlib.axis.Tick.set_pad "matplotlib.axis.Tick.set_pad") | float |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.axis.tick.set_url#matplotlib.axis.Tick.set_url "matplotlib.axis.Tick.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
update\_position(*loc*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/polar.py#L310-L354)
Set the location of tick in data coords with scalar *loc*.
`matplotlib.projections.geo`
----------------------------
*class*matplotlib.projections.geo.AitoffAxes(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L249-L292)
Bases: [`GeoAxes`](#matplotlib.projections.geo.GeoAxes "matplotlib.projections.geo.GeoAxes")
Build an Axes in a figure.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The Axes is built in the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") *fig*.
**rect**tuple (left, bottom, width, height).
The Axes is built in the rectangle *rect*. *rect* is in [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") coordinates.
**sharex, sharey**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
The x or y [`axis`](axis_api#module-matplotlib.axis "matplotlib.axis") is shared with the x or y axis in the input [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes").
**frameon**bool, default: True
Whether the Axes frame is visible.
**box\_aspect**float, optional
Set a fixed aspect for the Axes box, i.e. the ratio of height to width. See [`set_box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") for details.
**\*\*kwargs**
Other optional keyword arguments:
| Property | Description |
| --- | --- |
| [`adjustable`](_as_gen/matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](_as_gen/matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](_as_gen/matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](_as_gen/matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](_as_gen/matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](_as_gen/matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](_as_gen/matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](_as_gen/matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](_as_gen/matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](_as_gen/matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](_as_gen/matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](_as_gen/matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](_as_gen/matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](_as_gen/matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](_as_gen/matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](_as_gen/matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](_as_gen/matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](_as_gen/matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](_as_gen/matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xmargin`](_as_gen/matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](_as_gen/matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](_as_gen/matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](_as_gen/matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](_as_gen/matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](_as_gen/matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](_as_gen/matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ymargin`](_as_gen/matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](_as_gen/matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](_as_gen/matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](_as_gen/matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Returns:
[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The new [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") object.
*class*AitoffTransform(*resolution*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L252-L272)
Bases: `_GeoTransform`
The base Aitoff transform.
Create a new geographical transform.
Resolution is the number of steps to interpolate between each input line segment to approximate its path in curved space.
has\_inverse*=True*
True if this transform has a corresponding inverse transform.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L270-L272)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
transform\_non\_affine(*ll*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L255-L268)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length `input_dims` or shape (N x `input_dims`).
Returns:
array
The output values as NumPy array of length `output_dims` or shape (N x `output_dims`), depending on the input.
*class*InvertedAitoffTransform(*resolution*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L274-L283)
Bases: `_GeoTransform`
Create a new geographical transform.
Resolution is the number of steps to interpolate between each input line segment to approximate its path in curved space.
has\_inverse*=True*
True if this transform has a corresponding inverse transform.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L281-L283)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
transform\_non\_affine(*xy*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L276-L279)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length `input_dims` or shape (N x `input_dims`).
Returns:
array
The output values as NumPy array of length `output_dims` or shape (N x `output_dims`), depending on the input.
name*='aitoff'*
set(*\**, *adjustable=<UNSET>*, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *anchor=<UNSET>*, *animated=<UNSET>*, *aspect=<UNSET>*, *autoscale\_on=<UNSET>*, *autoscalex\_on=<UNSET>*, *autoscaley\_on=<UNSET>*, *axes\_locator=<UNSET>*, *axisbelow=<UNSET>*, *box\_aspect=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *facecolor=<UNSET>*, *frame\_on=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *latitude\_grid=<UNSET>*, *longitude\_grid=<UNSET>*, *longitude\_grid\_ends=<UNSET>*, *mouseover=<UNSET>*, *navigate=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *position=<UNSET>*, *prop\_cycle=<UNSET>*, *rasterization\_zorder=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *title=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *xbound=<UNSET>*, *xlabel=<UNSET>*, *xlim=<UNSET>*, *xmargin=<UNSET>*, *xscale=<UNSET>*, *xticklabels=<UNSET>*, *xticks=<UNSET>*, *ybound=<UNSET>*, *ylabel=<UNSET>*, *ylim=<UNSET>*, *ymargin=<UNSET>*, *yscale=<UNSET>*, *yticklabels=<UNSET>*, *yticks=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`adjustable`](_as_gen/matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](_as_gen/matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](_as_gen/matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](_as_gen/matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](_as_gen/matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](_as_gen/matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](_as_gen/matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](_as_gen/matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](_as_gen/matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](_as_gen/matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`latitude_grid`](#matplotlib.projections.geo.GeoAxes.set_latitude_grid "matplotlib.projections.geo.GeoAxes.set_latitude_grid") | unknown |
| [`longitude_grid`](#matplotlib.projections.geo.GeoAxes.set_longitude_grid "matplotlib.projections.geo.GeoAxes.set_longitude_grid") | unknown |
| [`longitude_grid_ends`](#matplotlib.projections.geo.GeoAxes.set_longitude_grid_ends "matplotlib.projections.geo.GeoAxes.set_longitude_grid_ends") | unknown |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](_as_gen/matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](_as_gen/matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](_as_gen/matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](_as_gen/matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](_as_gen/matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](_as_gen/matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](_as_gen/matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](_as_gen/matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](#matplotlib.projections.geo.GeoAxes.set_xlim "matplotlib.projections.geo.GeoAxes.set_xlim") | unknown |
| [`xmargin`](_as_gen/matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](_as_gen/matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](_as_gen/matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](_as_gen/matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](_as_gen/matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](_as_gen/matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](#matplotlib.projections.geo.GeoAxes.set_xlim "matplotlib.projections.geo.GeoAxes.set_xlim") | unknown |
| [`ymargin`](_as_gen/matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](_as_gen/matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](_as_gen/matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](_as_gen/matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
*class*matplotlib.projections.geo.GeoAxes(*fig*, *rect*, *\**, *facecolor=None*, *frameon=True*, *sharex=None*, *sharey=None*, *label=''*, *xscale=None*, *yscale=None*, *box\_aspect=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L15-L223)
Bases: [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes._axes.Axes")
An abstract base class for geographic projections.
Build an Axes in a figure.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The Axes is built in the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") *fig*.
**rect**tuple (left, bottom, width, height).
The Axes is built in the rectangle *rect*. *rect* is in [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") coordinates.
**sharex, sharey**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
The x or y [`axis`](axis_api#module-matplotlib.axis "matplotlib.axis") is shared with the x or y axis in the input [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes").
**frameon**bool, default: True
Whether the Axes frame is visible.
**box\_aspect**float, optional
Set a fixed aspect for the Axes box, i.e. the ratio of height to width. See [`set_box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") for details.
**\*\*kwargs**
Other optional keyword arguments:
| Property | Description |
| --- | --- |
| [`adjustable`](_as_gen/matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](_as_gen/matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](_as_gen/matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](_as_gen/matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](_as_gen/matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](_as_gen/matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](_as_gen/matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](_as_gen/matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](_as_gen/matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](_as_gen/matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](_as_gen/matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](_as_gen/matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](_as_gen/matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](_as_gen/matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](_as_gen/matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](_as_gen/matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](_as_gen/matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](_as_gen/matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](_as_gen/matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xmargin`](_as_gen/matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](_as_gen/matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](_as_gen/matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](_as_gen/matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](_as_gen/matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](_as_gen/matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](_as_gen/matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ymargin`](_as_gen/matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](_as_gen/matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](_as_gen/matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](_as_gen/matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Returns:
[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The new [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") object.
RESOLUTION*=75*
*class*ThetaFormatter(*round\_to=1.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L18-L28)
Bases: [`Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter")
Used to format the theta tick labels. Converts the native unit of radians into degrees and adds a degree symbol.
can\_pan()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L208-L214)
Return whether this axes supports the pan/zoom button functionality.
This axes object does not support interactive pan/zoom.
can\_zoom()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L200-L206)
Return whether this axes supports the zoom box button functionality.
This axes object does not support interactive zoom box.
clear()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L40-L58)
Clear the Axes.
drag\_pan(*button*, *key*, *x*, *y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L222-L223)
Called when the mouse moves during a pan operation.
Parameters:
**button**[`MouseButton`](backend_bases_api#matplotlib.backend_bases.MouseButton "matplotlib.backend_bases.MouseButton")
The pressed mouse button.
**key**str or None
The pressed key, if any.
**x, y**float
The mouse coordinates in display coords.
#### Notes
This is intended to be overridden by new projection types.
end\_pan()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L219-L220)
Called when a pan operation completes (when the mouse button is up.)
#### Notes
This is intended to be overridden by new projection types.
format\_coord(*lon*, *lat*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L158-L164)
Return a format string formatting the coordinate.
get\_data\_ratio()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L194-L196)
Return the aspect ratio of the data itself.
get\_xaxis\_text1\_transform(*pad*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L123-L124)
Returns:
**transform**Transform
The transform used for drawing x-axis labels, which will add *pad\_points* of padding (in points) between the axis and the label. The x-direction is in data coordinates and the y-direction is in axis coordinates
**valign**{'center', 'top', 'bottom', 'baseline', 'center\_baseline'}
The text vertical alignment.
**halign**{'center', 'left', 'right'}
The text horizontal alignment.
#### Notes
This transformation is primarily used by the [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis") class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.
get\_xaxis\_text2\_transform(*pad*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L126-L127)
Returns:
**transform**Transform
The transform used for drawing secondary x-axis labels, which will add *pad\_points* of padding (in points) between the axis and the label. The x-direction is in data coordinates and the y-direction is in axis coordinates
**valign**{'center', 'top', 'bottom', 'baseline', 'center\_baseline'}
The text vertical alignment.
**halign**{'center', 'left', 'right'}
The text horizontal alignment.
#### Notes
This transformation is primarily used by the [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis") class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.
get\_xaxis\_transform(*which='grid'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L119-L121)
Get the transformation used for drawing x-axis labels, ticks and gridlines. The x-direction is in data coordinates and the y-direction is in axis coordinates.
Note
This transformation is primarily used by the [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis") class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.
get\_yaxis\_text1\_transform(*pad*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L133-L134)
Returns:
**transform**Transform
The transform used for drawing y-axis labels, which will add *pad\_points* of padding (in points) between the axis and the label. The x-direction is in axis coordinates and the y-direction is in data coordinates
**valign**{'center', 'top', 'bottom', 'baseline', 'center\_baseline'}
The text vertical alignment.
**halign**{'center', 'left', 'right'}
The text horizontal alignment.
#### Notes
This transformation is primarily used by the [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis") class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.
get\_yaxis\_text2\_transform(*pad*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L136-L137)
Returns:
**transform**Transform
The transform used for drawing secondart y-axis labels, which will add *pad\_points* of padding (in points) between the axis and the label. The x-direction is in axis coordinates and the y-direction is in data coordinates
**valign**{'center', 'top', 'bottom', 'baseline', 'center\_baseline'}
The text vertical alignment.
**halign**{'center', 'left', 'right'}
The text horizontal alignment.
#### Notes
This transformation is primarily used by the [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis") class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.
get\_yaxis\_transform(*which='grid'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L129-L131)
Get the transformation used for drawing y-axis labels, ticks and gridlines. The x-direction is in axis coordinates and the y-direction is in data coordinates.
Note
This transformation is primarily used by the [`Axis`](axis_api#matplotlib.axis.Axis "matplotlib.axis.Axis") class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.
set(*\**, *adjustable=<UNSET>*, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *anchor=<UNSET>*, *animated=<UNSET>*, *aspect=<UNSET>*, *autoscale\_on=<UNSET>*, *autoscalex\_on=<UNSET>*, *autoscaley\_on=<UNSET>*, *axes\_locator=<UNSET>*, *axisbelow=<UNSET>*, *box\_aspect=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *facecolor=<UNSET>*, *frame\_on=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *latitude\_grid=<UNSET>*, *longitude\_grid=<UNSET>*, *longitude\_grid\_ends=<UNSET>*, *mouseover=<UNSET>*, *navigate=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *position=<UNSET>*, *prop\_cycle=<UNSET>*, *rasterization\_zorder=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *title=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *xbound=<UNSET>*, *xlabel=<UNSET>*, *xlim=<UNSET>*, *xmargin=<UNSET>*, *xscale=<UNSET>*, *xticklabels=<UNSET>*, *xticks=<UNSET>*, *ybound=<UNSET>*, *ylabel=<UNSET>*, *ylim=<UNSET>*, *ymargin=<UNSET>*, *yscale=<UNSET>*, *yticklabels=<UNSET>*, *yticks=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`adjustable`](_as_gen/matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](_as_gen/matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](_as_gen/matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](_as_gen/matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](_as_gen/matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](_as_gen/matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](_as_gen/matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](_as_gen/matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](_as_gen/matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](_as_gen/matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`latitude_grid`](#matplotlib.projections.geo.GeoAxes.set_latitude_grid "matplotlib.projections.geo.GeoAxes.set_latitude_grid") | unknown |
| [`longitude_grid`](#matplotlib.projections.geo.GeoAxes.set_longitude_grid "matplotlib.projections.geo.GeoAxes.set_longitude_grid") | unknown |
| [`longitude_grid_ends`](#matplotlib.projections.geo.GeoAxes.set_longitude_grid_ends "matplotlib.projections.geo.GeoAxes.set_longitude_grid_ends") | unknown |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](_as_gen/matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](_as_gen/matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](_as_gen/matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](_as_gen/matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](_as_gen/matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](_as_gen/matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](_as_gen/matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](_as_gen/matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](#matplotlib.projections.geo.GeoAxes.set_xlim "matplotlib.projections.geo.GeoAxes.set_xlim") | unknown |
| [`xmargin`](_as_gen/matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](_as_gen/matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](_as_gen/matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](_as_gen/matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](_as_gen/matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](_as_gen/matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](#matplotlib.projections.geo.GeoAxes.set_xlim "matplotlib.projections.geo.GeoAxes.set_xlim") | unknown |
| [`ymargin`](_as_gen/matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](_as_gen/matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](_as_gen/matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](_as_gen/matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_latitude\_grid(*degrees*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L175-L182)
Set the number of degrees between each latitude grid.
set\_longitude\_grid(*degrees*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L166-L173)
Set the number of degrees between each longitude grid.
set\_longitude\_grid\_ends(*degrees*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L184-L192)
Set the latitude(s) at which to stop drawing the longitude grids.
set\_xlim(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L151-L154)
Not supported. Please consider using Cartopy.
set\_xscale(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L145-L147)
Set the xaxis' scale.
Parameters:
**value**{"linear", "log", "symlog", "logit", ...} or [`ScaleBase`](scale_api#matplotlib.scale.ScaleBase "matplotlib.scale.ScaleBase")
The axis scale type to apply.
**\*\*kwargs**
Different keyword arguments are accepted, depending on the scale. See the respective class keyword arguments:
* [`matplotlib.scale.LinearScale`](scale_api#matplotlib.scale.LinearScale "matplotlib.scale.LinearScale")
* [`matplotlib.scale.LogScale`](scale_api#matplotlib.scale.LogScale "matplotlib.scale.LogScale")
* [`matplotlib.scale.SymmetricalLogScale`](scale_api#matplotlib.scale.SymmetricalLogScale "matplotlib.scale.SymmetricalLogScale")
* [`matplotlib.scale.LogitScale`](scale_api#matplotlib.scale.LogitScale "matplotlib.scale.LogitScale")
* [`matplotlib.scale.FuncScale`](scale_api#matplotlib.scale.FuncScale "matplotlib.scale.FuncScale")
#### Notes
By default, Matplotlib supports the above mentioned scales. Additionally, custom scales may be registered using [`matplotlib.scale.register_scale`](scale_api#matplotlib.scale.register_scale "matplotlib.scale.register_scale"). These scales can then also be used here.
set\_ylim(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L151-L154)
Not supported. Please consider using Cartopy.
set\_yscale(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L145-L147)
Set the yaxis' scale.
Parameters:
**value**{"linear", "log", "symlog", "logit", ...} or [`ScaleBase`](scale_api#matplotlib.scale.ScaleBase "matplotlib.scale.ScaleBase")
The axis scale type to apply.
**\*\*kwargs**
Different keyword arguments are accepted, depending on the scale. See the respective class keyword arguments:
* [`matplotlib.scale.LinearScale`](scale_api#matplotlib.scale.LinearScale "matplotlib.scale.LinearScale")
* [`matplotlib.scale.LogScale`](scale_api#matplotlib.scale.LogScale "matplotlib.scale.LogScale")
* [`matplotlib.scale.SymmetricalLogScale`](scale_api#matplotlib.scale.SymmetricalLogScale "matplotlib.scale.SymmetricalLogScale")
* [`matplotlib.scale.LogitScale`](scale_api#matplotlib.scale.LogitScale "matplotlib.scale.LogitScale")
* [`matplotlib.scale.FuncScale`](scale_api#matplotlib.scale.FuncScale "matplotlib.scale.FuncScale")
#### Notes
By default, Matplotlib supports the above mentioned scales. Additionally, custom scales may be registered using [`matplotlib.scale.register_scale`](scale_api#matplotlib.scale.register_scale "matplotlib.scale.register_scale"). These scales can then also be used here.
start\_pan(*x*, *y*, *button*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L216-L217)
Called when a pan operation has started.
Parameters:
**x, y**float
The mouse coordinates in display coords.
**button**[`MouseButton`](backend_bases_api#matplotlib.backend_bases.MouseButton "matplotlib.backend_bases.MouseButton")
The pressed mouse button.
#### Notes
This is intended to be overridden by new projection types.
*class*matplotlib.projections.geo.HammerAxes(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L295-L337)
Bases: [`GeoAxes`](#matplotlib.projections.geo.GeoAxes "matplotlib.projections.geo.GeoAxes")
Build an Axes in a figure.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The Axes is built in the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") *fig*.
**rect**tuple (left, bottom, width, height).
The Axes is built in the rectangle *rect*. *rect* is in [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") coordinates.
**sharex, sharey**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
The x or y [`axis`](axis_api#module-matplotlib.axis "matplotlib.axis") is shared with the x or y axis in the input [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes").
**frameon**bool, default: True
Whether the Axes frame is visible.
**box\_aspect**float, optional
Set a fixed aspect for the Axes box, i.e. the ratio of height to width. See [`set_box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") for details.
**\*\*kwargs**
Other optional keyword arguments:
| Property | Description |
| --- | --- |
| [`adjustable`](_as_gen/matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](_as_gen/matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](_as_gen/matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](_as_gen/matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](_as_gen/matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](_as_gen/matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](_as_gen/matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](_as_gen/matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](_as_gen/matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](_as_gen/matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](_as_gen/matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](_as_gen/matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](_as_gen/matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](_as_gen/matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](_as_gen/matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](_as_gen/matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](_as_gen/matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](_as_gen/matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](_as_gen/matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xmargin`](_as_gen/matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](_as_gen/matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](_as_gen/matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](_as_gen/matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](_as_gen/matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](_as_gen/matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](_as_gen/matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ymargin`](_as_gen/matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](_as_gen/matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](_as_gen/matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](_as_gen/matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Returns:
[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The new [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") object.
*class*HammerTransform(*resolution*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L298-L314)
Bases: `_GeoTransform`
The base Hammer transform.
Create a new geographical transform.
Resolution is the number of steps to interpolate between each input line segment to approximate its path in curved space.
has\_inverse*=True*
True if this transform has a corresponding inverse transform.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L312-L314)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
transform\_non\_affine(*ll*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L301-L310)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length `input_dims` or shape (N x `input_dims`).
Returns:
array
The output values as NumPy array of length `output_dims` or shape (N x `output_dims`), depending on the input.
*class*InvertedHammerTransform(*resolution*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L316-L328)
Bases: `_GeoTransform`
Create a new geographical transform.
Resolution is the number of steps to interpolate between each input line segment to approximate its path in curved space.
has\_inverse*=True*
True if this transform has a corresponding inverse transform.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L326-L328)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
transform\_non\_affine(*xy*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L318-L324)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length `input_dims` or shape (N x `input_dims`).
Returns:
array
The output values as NumPy array of length `output_dims` or shape (N x `output_dims`), depending on the input.
name*='hammer'*
set(*\**, *adjustable=<UNSET>*, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *anchor=<UNSET>*, *animated=<UNSET>*, *aspect=<UNSET>*, *autoscale\_on=<UNSET>*, *autoscalex\_on=<UNSET>*, *autoscaley\_on=<UNSET>*, *axes\_locator=<UNSET>*, *axisbelow=<UNSET>*, *box\_aspect=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *facecolor=<UNSET>*, *frame\_on=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *latitude\_grid=<UNSET>*, *longitude\_grid=<UNSET>*, *longitude\_grid\_ends=<UNSET>*, *mouseover=<UNSET>*, *navigate=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *position=<UNSET>*, *prop\_cycle=<UNSET>*, *rasterization\_zorder=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *title=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *xbound=<UNSET>*, *xlabel=<UNSET>*, *xlim=<UNSET>*, *xmargin=<UNSET>*, *xscale=<UNSET>*, *xticklabels=<UNSET>*, *xticks=<UNSET>*, *ybound=<UNSET>*, *ylabel=<UNSET>*, *ylim=<UNSET>*, *ymargin=<UNSET>*, *yscale=<UNSET>*, *yticklabels=<UNSET>*, *yticks=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`adjustable`](_as_gen/matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](_as_gen/matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](_as_gen/matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](_as_gen/matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](_as_gen/matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](_as_gen/matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](_as_gen/matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](_as_gen/matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](_as_gen/matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](_as_gen/matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`latitude_grid`](#matplotlib.projections.geo.GeoAxes.set_latitude_grid "matplotlib.projections.geo.GeoAxes.set_latitude_grid") | unknown |
| [`longitude_grid`](#matplotlib.projections.geo.GeoAxes.set_longitude_grid "matplotlib.projections.geo.GeoAxes.set_longitude_grid") | unknown |
| [`longitude_grid_ends`](#matplotlib.projections.geo.GeoAxes.set_longitude_grid_ends "matplotlib.projections.geo.GeoAxes.set_longitude_grid_ends") | unknown |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](_as_gen/matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](_as_gen/matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](_as_gen/matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](_as_gen/matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](_as_gen/matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](_as_gen/matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](_as_gen/matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](_as_gen/matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](#matplotlib.projections.geo.GeoAxes.set_xlim "matplotlib.projections.geo.GeoAxes.set_xlim") | unknown |
| [`xmargin`](_as_gen/matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](_as_gen/matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](_as_gen/matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](_as_gen/matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](_as_gen/matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](_as_gen/matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](#matplotlib.projections.geo.GeoAxes.set_xlim "matplotlib.projections.geo.GeoAxes.set_xlim") | unknown |
| [`ymargin`](_as_gen/matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](_as_gen/matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](_as_gen/matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](_as_gen/matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
*class*matplotlib.projections.geo.LambertAxes(*\*args*, *center\_longitude=0*, *center\_latitude=0*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L410-L505)
Bases: [`GeoAxes`](#matplotlib.projections.geo.GeoAxes "matplotlib.projections.geo.GeoAxes")
Build an Axes in a figure.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The Axes is built in the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") *fig*.
**rect**tuple (left, bottom, width, height).
The Axes is built in the rectangle *rect*. *rect* is in [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") coordinates.
**sharex, sharey**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
The x or y [`axis`](axis_api#module-matplotlib.axis "matplotlib.axis") is shared with the x or y axis in the input [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes").
**frameon**bool, default: True
Whether the Axes frame is visible.
**box\_aspect**float, optional
Set a fixed aspect for the Axes box, i.e. the ratio of height to width. See [`set_box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") for details.
**\*\*kwargs**
Other optional keyword arguments:
| Property | Description |
| --- | --- |
| [`adjustable`](_as_gen/matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](_as_gen/matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](_as_gen/matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](_as_gen/matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](_as_gen/matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](_as_gen/matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](_as_gen/matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](_as_gen/matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](_as_gen/matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](_as_gen/matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](_as_gen/matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](_as_gen/matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](_as_gen/matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](_as_gen/matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](_as_gen/matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](_as_gen/matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](_as_gen/matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](_as_gen/matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](_as_gen/matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xmargin`](_as_gen/matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](_as_gen/matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](_as_gen/matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](_as_gen/matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](_as_gen/matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](_as_gen/matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](_as_gen/matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ymargin`](_as_gen/matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](_as_gen/matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](_as_gen/matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](_as_gen/matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Returns:
[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The new [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") object.
*class*InvertedLambertTransform(*center\_longitude*, *center\_latitude*, *resolution*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L452-L481)
Bases: `_GeoTransform`
Create a new geographical transform.
Resolution is the number of steps to interpolate between each input line segment to approximate its path in curved space.
has\_inverse*=True*
True if this transform has a corresponding inverse transform.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L476-L481)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
transform\_non\_affine(*xy*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L459-L474)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length `input_dims` or shape (N x `input_dims`).
Returns:
array
The output values as NumPy array of length `output_dims` or shape (N x `output_dims`), depending on the input.
*class*LambertTransform(*center\_longitude*, *center\_latitude*, *resolution*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L413-L450)
Bases: `_GeoTransform`
The base Lambert transform.
Create a new Lambert transform. Resolution is the number of steps to interpolate between each input line segment to approximate its path in curved Lambert space.
has\_inverse*=True*
True if this transform has a corresponding inverse transform.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L445-L450)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
transform\_non\_affine(*ll*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L426-L443)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length `input_dims` or shape (N x `input_dims`).
Returns:
array
The output values as NumPy array of length `output_dims` or shape (N x `output_dims`), depending on the input.
clear()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L491-L494)
Clear the Axes.
name*='lambert'*
set(*\**, *adjustable=<UNSET>*, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *anchor=<UNSET>*, *animated=<UNSET>*, *aspect=<UNSET>*, *autoscale\_on=<UNSET>*, *autoscalex\_on=<UNSET>*, *autoscaley\_on=<UNSET>*, *axes\_locator=<UNSET>*, *axisbelow=<UNSET>*, *box\_aspect=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *facecolor=<UNSET>*, *frame\_on=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *latitude\_grid=<UNSET>*, *longitude\_grid=<UNSET>*, *longitude\_grid\_ends=<UNSET>*, *mouseover=<UNSET>*, *navigate=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *position=<UNSET>*, *prop\_cycle=<UNSET>*, *rasterization\_zorder=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *title=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *xbound=<UNSET>*, *xlabel=<UNSET>*, *xlim=<UNSET>*, *xmargin=<UNSET>*, *xscale=<UNSET>*, *xticklabels=<UNSET>*, *xticks=<UNSET>*, *ybound=<UNSET>*, *ylabel=<UNSET>*, *ylim=<UNSET>*, *ymargin=<UNSET>*, *yscale=<UNSET>*, *yticklabels=<UNSET>*, *yticks=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`adjustable`](_as_gen/matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](_as_gen/matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](_as_gen/matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](_as_gen/matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](_as_gen/matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](_as_gen/matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](_as_gen/matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](_as_gen/matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](_as_gen/matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](_as_gen/matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`latitude_grid`](#matplotlib.projections.geo.GeoAxes.set_latitude_grid "matplotlib.projections.geo.GeoAxes.set_latitude_grid") | unknown |
| [`longitude_grid`](#matplotlib.projections.geo.GeoAxes.set_longitude_grid "matplotlib.projections.geo.GeoAxes.set_longitude_grid") | unknown |
| [`longitude_grid_ends`](#matplotlib.projections.geo.GeoAxes.set_longitude_grid_ends "matplotlib.projections.geo.GeoAxes.set_longitude_grid_ends") | unknown |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](_as_gen/matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](_as_gen/matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](_as_gen/matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](_as_gen/matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](_as_gen/matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](_as_gen/matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](_as_gen/matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](_as_gen/matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](#matplotlib.projections.geo.GeoAxes.set_xlim "matplotlib.projections.geo.GeoAxes.set_xlim") | unknown |
| [`xmargin`](_as_gen/matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](_as_gen/matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](_as_gen/matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](_as_gen/matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](_as_gen/matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](_as_gen/matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](#matplotlib.projections.geo.GeoAxes.set_xlim "matplotlib.projections.geo.GeoAxes.set_xlim") | unknown |
| [`ymargin`](_as_gen/matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](_as_gen/matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](_as_gen/matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](_as_gen/matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
*class*matplotlib.projections.geo.MollweideAxes(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L340-L407)
Bases: [`GeoAxes`](#matplotlib.projections.geo.GeoAxes "matplotlib.projections.geo.GeoAxes")
Build an Axes in a figure.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The Axes is built in the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") *fig*.
**rect**tuple (left, bottom, width, height).
The Axes is built in the rectangle *rect*. *rect* is in [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") coordinates.
**sharex, sharey**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes"), optional
The x or y [`axis`](axis_api#module-matplotlib.axis "matplotlib.axis") is shared with the x or y axis in the input [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes").
**frameon**bool, default: True
Whether the Axes frame is visible.
**box\_aspect**float, optional
Set a fixed aspect for the Axes box, i.e. the ratio of height to width. See [`set_box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") for details.
**\*\*kwargs**
Other optional keyword arguments:
| Property | Description |
| --- | --- |
| [`adjustable`](_as_gen/matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](_as_gen/matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](_as_gen/matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](_as_gen/matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](_as_gen/matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](_as_gen/matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](_as_gen/matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](_as_gen/matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](_as_gen/matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](_as_gen/matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](_as_gen/matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](_as_gen/matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](_as_gen/matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](_as_gen/matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](_as_gen/matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](_as_gen/matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](_as_gen/matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](_as_gen/matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](_as_gen/matplotlib.axes.axes.set_xlim#matplotlib.axes.Axes.set_xlim "matplotlib.axes.Axes.set_xlim") | (bottom: float, top: float) |
| [`xmargin`](_as_gen/matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](_as_gen/matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](_as_gen/matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](_as_gen/matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](_as_gen/matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](_as_gen/matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](_as_gen/matplotlib.axes.axes.set_ylim#matplotlib.axes.Axes.set_ylim "matplotlib.axes.Axes.set_ylim") | (bottom: float, top: float) |
| [`ymargin`](_as_gen/matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](_as_gen/matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](_as_gen/matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](_as_gen/matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
Returns:
[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The new [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") object.
*class*InvertedMollweideTransform(*resolution*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L384-L398)
Bases: `_GeoTransform`
Create a new geographical transform.
Resolution is the number of steps to interpolate between each input line segment to approximate its path in curved space.
has\_inverse*=True*
True if this transform has a corresponding inverse transform.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L396-L398)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
transform\_non\_affine(*xy*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L386-L394)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length `input_dims` or shape (N x `input_dims`).
Returns:
array
The output values as NumPy array of length `output_dims` or shape (N x `output_dims`), depending on the input.
*class*MollweideTransform(*resolution*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L343-L382)
Bases: `_GeoTransform`
The base Mollweide transform.
Create a new geographical transform.
Resolution is the number of steps to interpolate between each input line segment to approximate its path in curved space.
has\_inverse*=True*
True if this transform has a corresponding inverse transform.
inverted()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L380-L382)
Return the corresponding inverse transformation.
It holds `x == self.inverted().transform(self.transform(x))`.
The return value of this method should be treated as temporary. An update to *self* does not cause a corresponding update to its inverted copy.
transform\_non\_affine(*ll*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/projections/geo.py#L346-L378)
Apply only the non-affine part of this transformation.
`transform(values)` is always equivalent to `transform_affine(transform_non_affine(values))`.
In non-affine transformations, this is generally equivalent to `transform(values)`. In affine transformations, this is always a no-op.
Parameters:
**values**array
The input values as NumPy array of length `input_dims` or shape (N x `input_dims`).
Returns:
array
The output values as NumPy array of length `output_dims` or shape (N x `output_dims`), depending on the input.
name*='mollweide'*
set(*\**, *adjustable=<UNSET>*, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *anchor=<UNSET>*, *animated=<UNSET>*, *aspect=<UNSET>*, *autoscale\_on=<UNSET>*, *autoscalex\_on=<UNSET>*, *autoscaley\_on=<UNSET>*, *axes\_locator=<UNSET>*, *axisbelow=<UNSET>*, *box\_aspect=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *facecolor=<UNSET>*, *frame\_on=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *latitude\_grid=<UNSET>*, *longitude\_grid=<UNSET>*, *longitude\_grid\_ends=<UNSET>*, *mouseover=<UNSET>*, *navigate=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *position=<UNSET>*, *prop\_cycle=<UNSET>*, *rasterization\_zorder=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *title=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *xbound=<UNSET>*, *xlabel=<UNSET>*, *xlim=<UNSET>*, *xmargin=<UNSET>*, *xscale=<UNSET>*, *xticklabels=<UNSET>*, *xticks=<UNSET>*, *ybound=<UNSET>*, *ylabel=<UNSET>*, *ylim=<UNSET>*, *ymargin=<UNSET>*, *yscale=<UNSET>*, *yticklabels=<UNSET>*, *yticks=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`adjustable`](_as_gen/matplotlib.axes.axes.set_adjustable#matplotlib.axes.Axes.set_adjustable "matplotlib.axes.Axes.set_adjustable") | {'box', 'datalim'} |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`anchor`](_as_gen/matplotlib.axes.axes.set_anchor#matplotlib.axes.Axes.set_anchor "matplotlib.axes.Axes.set_anchor") | (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`aspect`](_as_gen/matplotlib.axes.axes.set_aspect#matplotlib.axes.Axes.set_aspect "matplotlib.axes.Axes.set_aspect") | {'auto', 'equal'} or float |
| [`autoscale_on`](_as_gen/matplotlib.axes.axes.set_autoscale_on#matplotlib.axes.Axes.set_autoscale_on "matplotlib.axes.Axes.set_autoscale_on") | bool |
| [`autoscalex_on`](_as_gen/matplotlib.axes.axes.set_autoscalex_on#matplotlib.axes.Axes.set_autoscalex_on "matplotlib.axes.Axes.set_autoscalex_on") | unknown |
| [`autoscaley_on`](_as_gen/matplotlib.axes.axes.set_autoscaley_on#matplotlib.axes.Axes.set_autoscaley_on "matplotlib.axes.Axes.set_autoscaley_on") | unknown |
| [`axes_locator`](_as_gen/matplotlib.axes.axes.set_axes_locator#matplotlib.axes.Axes.set_axes_locator "matplotlib.axes.Axes.set_axes_locator") | Callable[[Axes, Renderer], Bbox] |
| [`axisbelow`](_as_gen/matplotlib.axes.axes.set_axisbelow#matplotlib.axes.Axes.set_axisbelow "matplotlib.axes.Axes.set_axisbelow") | bool or 'line' |
| [`box_aspect`](_as_gen/matplotlib.axes.axes.set_box_aspect#matplotlib.axes.Axes.set_box_aspect "matplotlib.axes.Axes.set_box_aspect") | float or None |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`facecolor`](_as_gen/matplotlib.axes.axes.set_facecolor#matplotlib.axes.Axes.set_facecolor "matplotlib.axes.Axes.set_facecolor") or fc | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`frame_on`](_as_gen/matplotlib.axes.axes.set_frame_on#matplotlib.axes.Axes.set_frame_on "matplotlib.axes.Axes.set_frame_on") | bool |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`latitude_grid`](#matplotlib.projections.geo.GeoAxes.set_latitude_grid "matplotlib.projections.geo.GeoAxes.set_latitude_grid") | unknown |
| [`longitude_grid`](#matplotlib.projections.geo.GeoAxes.set_longitude_grid "matplotlib.projections.geo.GeoAxes.set_longitude_grid") | unknown |
| [`longitude_grid_ends`](#matplotlib.projections.geo.GeoAxes.set_longitude_grid_ends "matplotlib.projections.geo.GeoAxes.set_longitude_grid_ends") | unknown |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`navigate`](_as_gen/matplotlib.axes.axes.set_navigate#matplotlib.axes.Axes.set_navigate "matplotlib.axes.Axes.set_navigate") | bool |
| [`navigate_mode`](_as_gen/matplotlib.axes.axes.set_navigate_mode#matplotlib.axes.Axes.set_navigate_mode "matplotlib.axes.Axes.set_navigate_mode") | unknown |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](_as_gen/matplotlib.axes.axes.set_position#matplotlib.axes.Axes.set_position "matplotlib.axes.Axes.set_position") | [left, bottom, width, height] or [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`prop_cycle`](_as_gen/matplotlib.axes.axes.set_prop_cycle#matplotlib.axes.Axes.set_prop_cycle "matplotlib.axes.Axes.set_prop_cycle") | unknown |
| [`rasterization_zorder`](_as_gen/matplotlib.axes.axes.set_rasterization_zorder#matplotlib.axes.Axes.set_rasterization_zorder "matplotlib.axes.Axes.set_rasterization_zorder") | float or None |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`title`](_as_gen/matplotlib.axes.axes.set_title#matplotlib.axes.Axes.set_title "matplotlib.axes.Axes.set_title") | str |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`xbound`](_as_gen/matplotlib.axes.axes.set_xbound#matplotlib.axes.Axes.set_xbound "matplotlib.axes.Axes.set_xbound") | unknown |
| [`xlabel`](_as_gen/matplotlib.axes.axes.set_xlabel#matplotlib.axes.Axes.set_xlabel "matplotlib.axes.Axes.set_xlabel") | str |
| [`xlim`](#matplotlib.projections.geo.GeoAxes.set_xlim "matplotlib.projections.geo.GeoAxes.set_xlim") | unknown |
| [`xmargin`](_as_gen/matplotlib.axes.axes.set_xmargin#matplotlib.axes.Axes.set_xmargin "matplotlib.axes.Axes.set_xmargin") | float greater than -0.5 |
| [`xscale`](_as_gen/matplotlib.axes.axes.set_xscale#matplotlib.axes.Axes.set_xscale "matplotlib.axes.Axes.set_xscale") | unknown |
| [`xticklabels`](_as_gen/matplotlib.axes.axes.set_xticklabels#matplotlib.axes.Axes.set_xticklabels "matplotlib.axes.Axes.set_xticklabels") | unknown |
| [`xticks`](_as_gen/matplotlib.axes.axes.set_xticks#matplotlib.axes.Axes.set_xticks "matplotlib.axes.Axes.set_xticks") | unknown |
| [`ybound`](_as_gen/matplotlib.axes.axes.set_ybound#matplotlib.axes.Axes.set_ybound "matplotlib.axes.Axes.set_ybound") | unknown |
| [`ylabel`](_as_gen/matplotlib.axes.axes.set_ylabel#matplotlib.axes.Axes.set_ylabel "matplotlib.axes.Axes.set_ylabel") | str |
| [`ylim`](#matplotlib.projections.geo.GeoAxes.set_xlim "matplotlib.projections.geo.GeoAxes.set_xlim") | unknown |
| [`ymargin`](_as_gen/matplotlib.axes.axes.set_ymargin#matplotlib.axes.Axes.set_ymargin "matplotlib.axes.Axes.set_ymargin") | float greater than -0.5 |
| [`yscale`](_as_gen/matplotlib.axes.axes.set_yscale#matplotlib.axes.Axes.set_yscale "matplotlib.axes.Axes.set_yscale") | unknown |
| [`yticklabels`](_as_gen/matplotlib.axes.axes.set_yticklabels#matplotlib.axes.Axes.set_yticklabels "matplotlib.axes.Axes.set_yticklabels") | unknown |
| [`yticks`](_as_gen/matplotlib.axes.axes.set_yticks#matplotlib.axes.Axes.set_yticks "matplotlib.axes.Axes.set_yticks") | unknown |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
| programming_docs |
matplotlib matplotlib.dviread matplotlib.dviread
==================
A module for reading dvi files output by TeX. Several limitations make this not (currently) useful as a general-purpose dvi preprocessor, but it is currently used by the pdf backend for processing usetex text.
Interface:
```
with Dvi(filename, 72) as dvi:
# iterate over pages:
for page in dvi:
w, h, d = page.width, page.height, page.descent
for x, y, font, glyph, width in page.text:
fontname = font.texname
pointsize = font.size
...
for x, y, height, width in page.boxes:
...
```
*class*matplotlib.dviread.Dvi(*filename*, *dpi*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dviread.py#L238-L544)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A reader for a dvi ("device-independent") file, as produced by TeX.
The current implementation can only iterate through pages in order, and does not even attempt to verify the postamble.
This class can be used as a context manager to close the underlying file upon exit. Pages can be read via iteration. Here is an overly simple way to extract text without trying to detect whitespace:
```
>>> with matplotlib.dviread.Dvi('input.dvi', 72) as dvi:
... for page in dvi:
... print(''.join(chr(t.glyph) for t in page.text))
```
Read the data from the file named *filename* and convert TeX's internal units to units of *dpi* per inch. *dpi* only sets the units and does not limit the resolution. Use None to return TeX's internal units.
*property*baseline[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
close()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dviread.py#L301-L304)
Close the underlying file if it is open.
*class*matplotlib.dviread.DviFont(*scale*, *tfm*, *texname*, *vf*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dviread.py#L547-L635)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Encapsulation of a font that a DVI file can refer to.
This class holds a font's texname and size, supports comparison, and knows the widths of glyphs in the same units as the AFM file. There are also internal attributes (for use by dviread.py) that are *not* used for comparison.
The size is in Adobe points (converted from TeX points).
Parameters:
**scale**float
Factor by which the font is scaled from its natural size.
**tfm**Tfm
TeX font metrics for this font
**texname**bytes
Name of the font as used internally by TeX and friends, as an ASCII bytestring. This is usually very different from any external font names; [`PsfontsMap`](#matplotlib.dviread.PsfontsMap "matplotlib.dviread.PsfontsMap") can be used to find the external name of the font.
**vf**Vf
A TeX "virtual font" file, or None if this font is not virtual.
Attributes:
**texname**bytes
**size**float
Size of the font in Adobe points, converted from the slightly smaller TeX points.
**widths**list
Widths of glyphs in glyph-space units, typically 1/1000ths of the point size.
size
texname
widths
*class*matplotlib.dviread.PsFont(*texname*, *psname*, *effects*, *encoding*, *filename*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dviread.py)
Bases: [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.10)")
Create new instance of PsFont(texname, psname, effects, encoding, filename)
effects
Alias for field number 2
encoding
Alias for field number 3
filename
Alias for field number 4
psname
Alias for field number 1
texname
Alias for field number 0
*class*matplotlib.dviread.PsfontsMap(*filename*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dviread.py#L805-L979)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A psfonts.map formatted file, mapping TeX fonts to PS fonts.
Parameters:
**filename**str or path-like
#### Notes
For historical reasons, TeX knows many Type-1 fonts by different names than the outside world. (For one thing, the names have to fit in eight characters.) Also, TeX's native fonts are not Type-1 but Metafont, which is nontrivial to convert to PostScript except as a bitmap. While high-quality conversions to Type-1 format exist and are shipped with modern TeX distributions, we need to know which Type-1 fonts are the counterparts of which native fonts. For these reasons a mapping is needed from internal font names to font file names.
A texmf tree typically includes mapping files called e.g. `psfonts.map`, `pdftex.map`, or `dvipdfm.map`. The file `psfonts.map` is used by **dvips**, `pdftex.map` by **pdfTeX**, and `dvipdfm.map` by **dvipdfm**. `psfonts.map` might avoid embedding the 35 PostScript fonts (i.e., have no filename for them, as in the Times-Bold example above), while the pdf-related files perhaps only avoid the "Base 14" pdf fonts. But the user may have configured these files differently.
#### Examples
```
>>> map = PsfontsMap(find_tex_file('pdftex.map'))
>>> entry = map[b'ptmbo8r']
>>> entry.texname
b'ptmbo8r'
>>> entry.psname
b'Times-Bold'
>>> entry.encoding
'/usr/local/texlive/2008/texmf-dist/fonts/enc/dvips/base/8r.enc'
>>> entry.effects
{'slant': 0.16700000000000001}
>>> entry.filename
```
*class*matplotlib.dviread.Tfm(*filename*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dviread.py#L756-L799)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A TeX Font Metric file.
This implementation covers only the bare minimum needed by the Dvi class.
Parameters:
**filename**str or path-like
Attributes:
**checksum**int
Used for verifying against the dvi file.
**design\_size**int
Design size of the font (unknown units)
**width, height, depth**dict
Dimensions of each character, need to be scaled by the factor specified in the dvi file. These are dicts because indexing may not start from 0.
checksum
depth
design\_size
height
width
*class*matplotlib.dviread.Vf(*filename*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dviread.py#L638-L747)
Bases: [`Dvi`](#matplotlib.dviread.Dvi "matplotlib.dviread.Dvi")
A virtual font (\*.vf file) containing subroutines for dvi files.
Parameters:
**filename**str or path-like
#### Notes
The virtual font format is a derivative of dvi: <http://mirrors.ctan.org/info/knuth/virtual-fonts> This class reuses some of the machinery of [`Dvi`](#matplotlib.dviread.Dvi "matplotlib.dviread.Dvi") but replaces the `_read` loop and dispatch mechanism.
#### Examples
```
vf = Vf(filename)
glyph = vf[code]
glyph.text, glyph.boxes, glyph.width
```
Read the data from the file named *filename* and convert TeX's internal units to units of *dpi* per inch. *dpi* only sets the units and does not limit the resolution. Use None to return TeX's internal units.
matplotlib.dviread.find\_tex\_file(*filename*, *format=<deprecated parameter>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/dviread.py#L1102-L1111)
Find a file in the texmf tree using [kpathsea](https://www.tug.org/kpathsea/).
The kpathsea library, provided by most existing TeX distributions, both on Unix-like systems and on Windows (MikTeX), is invoked via a long-lived luatex process if luatex is installed, or via kpsewhich otherwise.
Parameters:
**filename**str or path-like
**format**str or bytes
Used as the value of the `--format` option to **kpsewhich**. Could be e.g. 'tfm' or 'vf' to limit the search to that type of files. Deprecated.
Raises:
FileNotFoundError
If the file is not found.
matplotlib backend_agg backend\_agg
============
An [Anti-Grain Geometry](http://agg.sourceforge.net/antigrain.com) (AGG) backend.
Features that are implemented:
* capstyles and join styles
* dashes
* linewidth
* lines, rectangles, ellipses
* clipping to a rectangle
* output to RGBA and Pillow-supported image formats
* alpha blending
* DPI scaling properly - everything scales properly (dashes, linewidths, etc)
* draw polygon
* freetype2 w/ ft2font
Still TODO:
* integrate screen dpi w/ ppi and text
matplotlib.backends.backend\_agg.FigureCanvas[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L387-L561)
alias of [`FigureCanvasAgg`](#matplotlib.backends.backend_agg.FigureCanvasAgg "matplotlib.backends.backend_agg.FigureCanvasAgg")
*class*matplotlib.backends.backend\_agg.FigureCanvasAgg(*figure=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L387-L561)
Bases: [`FigureCanvasBase`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase "matplotlib.backend_bases.FigureCanvasBase")
buffer\_rgba()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L443-L450)
Get the image as a [`memoryview`](https://docs.python.org/3/library/stdtypes.html#memoryview "(in Python v3.10)") to the renderer's buffer.
[`draw`](#matplotlib.backends.backend_agg.FigureCanvasAgg.draw "matplotlib.backends.backend_agg.FigureCanvasAgg.draw") must be called at least once before this function will work and to update the renderer for any subsequent changes to the Figure.
copy\_from\_bbox(*bbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L392-L394)
draw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L400-L411)
Render the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure").
This method must walk the artist tree, even if no output is produced, because it triggers deferred work that users may want to access before saving output to disk. For example computing limits, auto-limits, and tick values.
get\_renderer(*cleared=<deprecated parameter>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L413-L423)
print\_jpeg(*filename\_or\_obj*, *\*args*, *pil\_kwargs=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L532-L538)
Write the figure to a JPEG file.
Parameters:
**filename\_or\_obj**str or path-like or file-like
The file to write to.
**pil\_kwargs**dict, optional
Additional keyword arguments that are passed to [`PIL.Image.Image.save`](https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.save "(in Pillow (PIL Fork) v9.2.0)") when saving the figure.
print\_jpg(*filename\_or\_obj*, *\*args*, *pil\_kwargs=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L532-L538)
Write the figure to a JPEG file.
Parameters:
**filename\_or\_obj**str or path-like or file-like
The file to write to.
**pil\_kwargs**dict, optional
Additional keyword arguments that are passed to [`PIL.Image.Image.save`](https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.save "(in Pillow (PIL Fork) v9.2.0)") when saving the figure.
print\_png(*filename\_or\_obj*, *\*args*, *metadata=None*, *pil\_kwargs=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L471-L520)
Write the figure to a PNG file.
Parameters:
**filename\_or\_obj**str or path-like or file-like
The file to write to.
**metadata**dict, optional
Metadata in the PNG file as key-value pairs of bytes or latin-1 encodable strings. According to the PNG specification, keys must be shorter than 79 chars.
The [PNG specification](https://www.w3.org/TR/2003/REC-PNG-20031110/#11keywords) defines some common keywords that may be used as appropriate:
* Title: Short (one line) title or caption for image.
* Author: Name of image's creator.
* Description: Description of image (possibly long).
* Copyright: Copyright notice.
* Creation Time: Time of original image creation (usually RFC 1123 format).
* Software: Software used to create the image.
* Disclaimer: Legal disclaimer.
* Warning: Warning of nature of content.
* Source: Device used to create the image.
* Comment: Miscellaneous comment; conversion from other image format.
Other keywords may be invented for other purposes.
If 'Software' is not given, an autogenerated value for Matplotlib will be used. This can be removed by setting it to *None*.
For more details see the [PNG specification](https://www.w3.org/TR/2003/REC-PNG-20031110/#11keywords).
**pil\_kwargs**dict, optional
Keyword arguments passed to [`PIL.Image.Image.save`](https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.save "(in Pillow (PIL Fork) v9.2.0)").
If the 'pnginfo' key is present, it completely overrides *metadata*, including the default 'Software' key.
print\_raw(*filename\_or\_obj*, *\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L452-L457)
print\_rgba(*filename\_or\_obj*, *\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L452-L457)
print\_tif(*filename\_or\_obj*, *\**, *pil\_kwargs=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L542-L543)
Write the figure to a TIFF file.
Parameters:
**filename\_or\_obj**str or path-like or file-like
The file to write to.
**pil\_kwargs**dict, optional
Additional keyword arguments that are passed to [`PIL.Image.Image.save`](https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.save "(in Pillow (PIL Fork) v9.2.0)") when saving the figure.
print\_tiff(*filename\_or\_obj*, *\**, *pil\_kwargs=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L542-L543)
Write the figure to a TIFF file.
Parameters:
**filename\_or\_obj**str or path-like or file-like
The file to write to.
**pil\_kwargs**dict, optional
Additional keyword arguments that are passed to [`PIL.Image.Image.save`](https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.save "(in Pillow (PIL Fork) v9.2.0)") when saving the figure.
print\_to\_buffer()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L522-L526)
print\_webp(*filename\_or\_obj*, *\**, *pil\_kwargs=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L547-L548)
Write the figure to a WebP file.
Parameters:
**filename\_or\_obj**str or path-like or file-like
The file to write to.
**pil\_kwargs**dict, optional
Additional keyword arguments that are passed to [`PIL.Image.Image.save`](https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.save "(in Pillow (PIL Fork) v9.2.0)") when saving the figure.
restore\_region(*region*, *bbox=None*, *xy=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L396-L398)
tostring\_argb()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L434-L441)
Get the image as ARGB [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.10)").
[`draw`](#matplotlib.backends.backend_agg.FigureCanvasAgg.draw "matplotlib.backends.backend_agg.FigureCanvasAgg.draw") must be called at least once before this function will work and to update the renderer for any subsequent changes to the Figure.
tostring\_rgb()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L425-L432)
Get the image as RGB [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.10)").
[`draw`](#matplotlib.backends.backend_agg.FigureCanvasAgg.draw "matplotlib.backends.backend_agg.FigureCanvasAgg.draw") must be called at least once before this function will work and to update the renderer for any subsequent changes to the Figure.
*class*matplotlib.backends.backend\_agg.RendererAgg(*width*, *height*, *dpi*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L62-L384)
Bases: [`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase")
The renderer handles all the drawing primitives using a graphics context instance that controls the colors/styles
buffer\_rgba()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L285-L286)
clear()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L294-L295)
draw\_mathtext(*gc*, *x*, *y*, *s*, *prop*, *angle*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L192-L201)
Draw mathtext using [`matplotlib.mathtext`](mathtext_api#module-matplotlib.mathtext "matplotlib.mathtext").
draw\_path(*gc*, *path*, *transform*, *rgbFace=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L112-L190)
Draw a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") instance using the given affine transform.
draw\_tex(*gc*, *x*, *y*, *s*, *prop*, *angle*, *\**, *mtext=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L250-L265)
draw\_text(*gc*, *x*, *y*, *s*, *prop*, *angle*, *ismath=False*, *mtext=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L203-L222)
Draw a text instance.
Parameters:
**gc**[`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
The graphics context.
**x**float
The x location of the text in display coords.
**y**float
The y location of the text baseline in display coords.
**s**str
The text string.
**prop**[`matplotlib.font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties")
The font properties.
**angle**float
The rotation angle in degrees anti-clockwise.
**mtext**[`matplotlib.text.Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")
The original text object to be rendered.
#### Notes
**Note for backend implementers:**
When you are trying to determine if you have gotten your bounding box right (which is what enables the text layout/alignment to work properly), it helps to change the line in text.py:
```
if 0: bbox_artist(self, renderer)
```
to if 1, and then the actual bounding box will be plotted along with your text.
get\_canvas\_width\_height()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L267-L269)
Return the canvas width and height in display coords.
get\_text\_width\_height\_descent(*s*, *prop*, *ismath*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L224-L248)
Get the width, height, and descent (offset from the bottom to the baseline), in display coords, of the string *s* with [`FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") *prop*.
lock*=<unlocked \_thread.RLock object owner=0 count=0>*
option\_image\_nocomposite()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L297-L303)
Return whether image composition by Matplotlib should be skipped.
Raster backends should usually return False (letting the C-level rasterizer take care of image composition); vector backends should usually return `not rcParams["image.composite_image"]`.
option\_scale\_image()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L305-L307)
Return whether arbitrary affine transformations in `draw_image` are supported (True for most vector backends).
points\_to\_pixels(*points*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L281-L283)
Convert points to display units.
You need to override this function (unless your backend doesn't have a dpi, e.g., postscript or svg). Some imaging systems assume some value for pixels per inch:
```
points to pixels = points * pixels_per_inch/72 * dpi/72
```
Parameters:
**points**float or array-like
a float or a numpy array of float
Returns:
Points converted to pixels
restore\_region(*region*, *bbox=None*, *xy=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L309-L342)
Restore the saved region. If bbox (instance of BboxBase, or its extents) is given, only the region specified by the bbox will be restored. *xy* (a pair of floats) optionally specifies the new position (the LLC of the original region, not the LLC of the bbox) where the region will be restored.
```
>>> region = renderer.copy_from_bbox()
>>> x1, y1, x2, y2 = region.get_extents()
>>> renderer.restore_region(region, bbox=(x1+dx, y1, x2, y2),
... xy=(x1-dx, y1))
```
start\_filter()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L344-L351)
Start filtering. It simply create a new canvas (the old one is saved).
stop\_filter(*post\_processing*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L353-L384)
Save the plot in the current canvas as a image and apply the *post\_processing* function.
def post\_processing(image, dpi):
# ny, nx, depth = image.shape # image (numpy array) has RGBA channels and has a depth of 4. ... # create a new\_image (numpy array of 4 channels, size can be # different). The resulting image may have offsets from # lower-left corner of the original image return new\_image, offset\_x, offset\_y
The saved renderer is restored and the returned image from post\_processing is plotted (using draw\_image) on it.
tostring\_argb()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L288-L289)
tostring\_rgb()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L291-L292)
matplotlib.backends.backend\_agg.get\_hinting\_flag()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_agg.py#L46-L59)
| programming_docs |
matplotlib matplotlib.quiver matplotlib.quiver
=================
Support for plotting vector fields.
Presently this contains Quiver and Barb. Quiver plots an arrow in the direction of the vector, with the size of the arrow related to the magnitude of the vector.
Barbs are like quiver in that they point along a vector, but the magnitude of the vector is given schematically by the presence of barbs or flags on the barb.
This will also become a home for things such as standard deviation ellipses, which can and will be derived very easily from the Quiver code.
Classes
-------
| | |
| --- | --- |
| [`Quiver`](_as_gen/matplotlib.quiver.quiver#matplotlib.quiver.Quiver "matplotlib.quiver.Quiver")(ax, \*args[, scale, headwidth, ...]) | Specialized PolyCollection for arrows. |
| [`QuiverKey`](_as_gen/matplotlib.quiver.quiverkey#matplotlib.quiver.QuiverKey "matplotlib.quiver.QuiverKey")(Q, X, Y, U, label, \*[, angle, ...]) | Labelled arrow for use as a quiver plot scale key. |
| [`Barbs`](_as_gen/matplotlib.quiver.barbs#matplotlib.quiver.Barbs "matplotlib.quiver.Barbs")(ax, \*args[, pivot, length, barbcolor, ...]) | Specialized PolyCollection for barbs. |
matplotlib matplotlib.sphinxext.plot_directive matplotlib.sphinxext.plot\_directive
====================================
A directive for including a Matplotlib plot in a Sphinx document
----------------------------------------------------------------
By default, in HTML output, `plot` will include a .png file with a link to a high-res .png and .pdf. In LaTeX output, it will include a .pdf.
The source code for the plot may be included in one of three ways:
1. **A path to a source file** as the argument to the directive:
```
.. plot:: path/to/plot.py
```
When a path to a source file is given, the content of the directive may optionally contain a caption for the plot:
```
.. plot:: path/to/plot.py
The plot caption.
```
Additionally, one may specify the name of a function to call (with no arguments) immediately after importing the module:
```
.. plot:: path/to/plot.py plot_function1
```
2. Included as **inline content** to the directive:
```
.. plot::
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
img = mpimg.imread('_static/stinkbug.png')
imgplot = plt.imshow(img)
```
3. Using **doctest** syntax:
```
.. plot::
A plotting example:
>>> import matplotlib.pyplot as plt
>>> plt.plot([1, 2, 3], [4, 5, 6])
```
### Options
The `plot` directive supports the following options:
format{'python', 'doctest'}
The format of the input. If unset, the format is auto-detected.
include-sourcebool
Whether to display the source code. The default can be changed using the `plot_include_source` variable in `conf.py` (which itself defaults to False).
encodingstr
If this source file is in a non-UTF8 or non-ASCII encoding, the encoding must be specified using the `:encoding:` option. The encoding will not be inferred using the `-*- coding -*-` metacomment.
contextbool or str
If provided, the code will be run in the context of all previous plot directives for which the `:context:` option was specified. This only applies to inline code plot directives, not those run from files. If the `:context: reset` option is specified, the context is reset for this and future plots, and previous figures are closed prior to running the code. `:context: close-figs` keeps the context but closes previous figures before running the code.
nofigsbool
If specified, the code block will be run, but no figures will be inserted. This is usually useful with the `:context:` option.
captionstr
If specified, the option's argument will be used as a caption for the figure. This overwrites the caption given in the content, when the plot is generated from a file.
Additionally, this directive supports all of the options of the `image` directive, except for *target* (since plot will add its own target). These include *alt*, *height*, *width*, *scale*, *align* and *class*.
### Configuration options
The plot directive has the following configuration options:
plot\_include\_source
Default value for the include-source option (default: False).
plot\_html\_show\_source\_link
Whether to show a link to the source in HTML (default: True).
plot\_pre\_code
Code that should be executed before each plot. If None (the default), it will default to a string containing:
```
import numpy as np
from matplotlib import pyplot as plt
```
plot\_basedir
Base directory, to which `plot::` file names are relative to. If None or empty (the default), file names are relative to the directory where the file containing the directive is.
plot\_formats
File formats to generate (default: ['png', 'hires.png', 'pdf']). List of tuples or strings:
```
[(suffix, dpi), suffix, ...]
```
that determine the file format and the DPI. For entries whose DPI was omitted, sensible defaults are chosen. When passing from the command line through sphinx\_build the list should be passed as suffix:dpi,suffix:dpi, ...
plot\_html\_show\_formats
Whether to show links to the files in HTML (default: True).
plot\_rcparams
A dictionary containing any non-standard rcParams that should be applied before each plot (default: {}).
plot\_apply\_rcparams
By default, rcParams are applied when `:context:` option is not used in a plot directive. If set, this configuration option overrides this behavior and applies rcParams before each plot.
plot\_working\_directory
By default, the working directory will be changed to the directory of the example, so the code can get at its data files, if any. Also its path will be added to [`sys.path`](https://docs.python.org/3/library/sys.html#sys.path "(in Python v3.10)") so it can import any helper modules sitting beside it. This configuration option can be used to specify a central directory (also added to [`sys.path`](https://docs.python.org/3/library/sys.html#sys.path "(in Python v3.10)")) where data files and helper modules for all code are located.
plot\_template
Provide a customized template for preparing restructured text.
*class*matplotlib.sphinxext.plot\_directive.PlotDirective(*name*, *arguments*, *options*, *content*, *lineno*, *content\_offset*, *block\_text*, *state*, *state\_machine*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/sphinxext/plot_directive.py#L231-L259)
The `.. plot::` directive, as documented in the module's docstring.
final\_argument\_whitespace*=False*
May the final argument contain whitespace?
has\_content*=True*
May the directive have content?
option\_spec*={'align': <function Image.align>, 'alt': <function unchanged>, 'caption': <function unchanged>, 'class': <function class\_option>, 'context': <function \_option\_context>, 'encoding': <function \_deprecated\_option\_encoding>, 'format': <function \_option\_format>, 'height': <function length\_or\_unitless>, 'include-source': <function \_option\_boolean>, 'nofigs': <function flag>, 'scale': <function nonnegative\_int>, 'width': <function length\_or\_percentage\_or\_unitless>}*
Mapping of option names to validator functions.
optional\_arguments*=2*
Number of optional arguments after the required arguments.
required\_arguments*=0*
Number of required directive arguments.
run()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/sphinxext/plot_directive.py#L253-L259)
Run the plot directive.
*exception*matplotlib.sphinxext.plot\_directive.PlotError[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/sphinxext/plot_directive.py#L460-L461)
matplotlib.sphinxext.plot\_directive.mark\_plot\_labels(*app*, *document*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/sphinxext/plot_directive.py#L201-L228)
To make plots referenceable, we need to move the reference from the "htmlonly" (or "latexonly") node to the actual figure node itself.
matplotlib.sphinxext.plot\_directive.out\_of\_date(*original*, *derived*, *includes=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/sphinxext/plot_directive.py#L438-L457)
Return whether *derived* is out-of-date relative to *original* or any of the RST files included in it using the RST include directive (*includes*). *derived* and *original* are full paths, and *includes* is optionally a list of full paths which may have been included in the *original*.
matplotlib.sphinxext.plot\_directive.render\_figures(*code*, *code\_path*, *output\_dir*, *output\_base*, *context*, *function\_name*, *config*, *context\_reset=False*, *close\_figs=False*, *code\_includes=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/sphinxext/plot_directive.py#L551-L655)
Run a pyplot script and save the images in *output\_dir*.
Save the images under *output\_dir* with file names derived from *output\_base*
matplotlib.sphinxext.plot\_directive.run\_code(*code*, *code\_path*, *ns=None*, *function\_name=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/sphinxext/plot_directive.py#L464-L470)
[*Deprecated*] Import a Python module from a path, and run the function given by name, if function\_name is not None.
#### Notes
Deprecated since version 3.5.
matplotlib.sphinxext.plot\_directive.split\_code\_at\_show(*text*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/sphinxext/plot_directive.py#L331-L334)
[*Deprecated*] Split code at plt.show().
#### Notes
Deprecated since version 3.5.
matplotlib.sphinxext.plot\_directive.unescape\_doctest(*text*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/sphinxext/plot_directive.py#L311-L328)
[*Deprecated*] Extract code from a piece of text, which contains either Python code or doctests.
#### Notes
Deprecated since version 3.5: Use doctest.script\_from\_examples instead.
matplotlib matplotlib.testing matplotlib.testing
==================
matplotlib.test()
-----------------
matplotlib.test(*verbosity=None*, *coverage=False*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/__init__.py#L1228-L1274)
[*Deprecated*] Run the matplotlib test suite.
#### Notes
Deprecated since version 3.5: Use pytest instead.
matplotlib.testing
------------------
Helper functions for testing.
matplotlib.testing.set\_font\_settings\_for\_testing()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/testing/__init__.py#L18-L21)
matplotlib.testing.set\_reproducibility\_for\_testing()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/testing/__init__.py#L24-L25)
matplotlib.testing.setup()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/testing/__init__.py#L28-L50)
matplotlib.testing.subprocess\_run\_helper(*func*, *\*args*, *timeout*, *extra\_env=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/testing/__init__.py#L53-L79)
Run a function in a sub-process.
Parameters:
**func**function
The function to be run. It must be in a module that is importable.
**\*args**str
Any additional command line arguments to be passed in the first argument to `subprocess.run`.
**extra\_env**dict[str, str]
Any additional environment variables to be set for the subprocess.
matplotlib.testing.compare
--------------------------
Utilities for comparing image results.
matplotlib.testing.compare.calculate\_rms(*expected\_image*, *actual\_image*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/testing/compare.py#L358-L367)
Calculate the per-pixel errors, then compute the root mean square error.
matplotlib.testing.compare.comparable\_formats()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/testing/compare.py#L256-L267)
Return the list of file formats that [`compare_images`](#matplotlib.testing.compare.compare_images "matplotlib.testing.compare.compare_images") can compare on this system.
Returns:
list of str
E.g. `['png', 'pdf', 'svg', 'eps']`.
matplotlib.testing.compare.compare\_images(*expected*, *actual*, *tol*, *in\_decorator=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/testing/compare.py#L384-L485)
Compare two "image" files checking differences within a tolerance.
The two given filenames may point to files which are convertible to PNG via the `converter` dictionary. The underlying RMS is calculated with the [`calculate_rms`](#matplotlib.testing.compare.calculate_rms "matplotlib.testing.compare.calculate_rms") function.
Parameters:
**expected**str
The filename of the expected image.
**actual**str
The filename of the actual image.
**tol**float
The tolerance (a color value difference, where 255 is the maximal difference). The test fails if the average pixel difference is greater than this value.
**in\_decorator**bool
Determines the output format. If called from image\_comparison decorator, this should be True. (default=False)
Returns:
None or dict or str
Return *None* if the images are equal within the given tolerance.
If the images differ, the return value depends on *in\_decorator*. If *in\_decorator* is true, a dict with the following entries is returned:
* *rms*: The RMS of the image difference.
* *expected*: The filename of the expected image.
* *actual*: The filename of the actual image.
* *diff\_image*: The filename of the difference image.
* *tol*: The comparison tolerance.
Otherwise, a human-readable multi-line string representation of this information is returned.
#### Examples
```
img1 = "./baseline/plot.png"
img2 = "./output/plot.png"
compare_images(img1, img2, 0.001)
```
matplotlib.testing.decorators
-----------------------------
*class*matplotlib.testing.decorators.CleanupTestCase(*methodName='runTest'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/testing/decorators.py#L35-L45)
Bases: `TestCase`
[*Deprecated*] A wrapper for unittest.TestCase that includes cleanup operations.
#### Notes
Deprecated since version 3.6: Use a vendored copy of the existing code, including the private function \_cleanup\_cm instead.
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
*classmethod*setUpClass()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/testing/decorators.py#L39-L41)
Hook method for setting up class fixture before running tests in the class.
*classmethod*tearDownClass()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/testing/decorators.py#L43-L45)
Hook method for deconstructing the class fixture after running all tests in the class.
matplotlib.testing.decorators.check\_figures\_equal(*\**, *extensions=('png', 'pdf', 'svg')*, *tol=0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/testing/decorators.py#L405-L504)
Decorator for test cases that generate and compare two figures.
The decorated function must take two keyword arguments, *fig\_test* and *fig\_ref*, and draw the test and reference images on them. After the function returns, the figures are saved and compared.
This decorator should be preferred over [`image_comparison`](#matplotlib.testing.decorators.image_comparison "matplotlib.testing.decorators.image_comparison") when possible in order to keep the size of the test suite from ballooning.
Parameters:
**extensions**list, default: ["png", "pdf", "svg"]
The extensions to test.
**tol**float
The RMS threshold above which the test is considered failed.
Raises:
RuntimeError
If any new figures are created (and not subsequently closed) inside the test function.
#### Examples
Check that calling [`Axes.plot`](_as_gen/matplotlib.axes.axes.plot#matplotlib.axes.Axes.plot "matplotlib.axes.Axes.plot") with a single argument plots it against `[0, 1, 2, ...]`:
```
@check_figures_equal()
def test_plot(fig_test, fig_ref):
fig_test.subplots().plot([1, 3, 5])
fig_ref.subplots().plot([0, 1, 2], [1, 3, 5])
```
matplotlib.testing.decorators.check\_freetype\_version(*ver*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/testing/decorators.py#L91-L94)
[*Deprecated*]
#### Notes
Deprecated since version 3.6: Use a vendored copy of the existing code of \_check\_freetype\_version instead.
matplotlib.testing.decorators.cleanup(*style=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/testing/decorators.py#L48-L88)
[*Deprecated*] A decorator to ensure that any global state is reset before running a test.
Parameters:
**style**str, dict, or list, optional
The style(s) to apply. Defaults to `["classic",
"_classic_test_patch"]`.
#### Notes
Deprecated since version 3.6: Use a vendored copy of the existing code, including the private function \_cleanup\_cm instead.
matplotlib.testing.decorators.image\_comparison(*baseline\_images*, *extensions=None*, *tol=0*, *freetype\_version=None*, *remove\_text=False*, *savefig\_kwarg=None*, *style=('classic', '\_classic\_test\_patch')*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/testing/decorators.py#L315-L402)
Compare images generated by the test with those specified in *baseline\_images*, which must correspond, else an `ImageComparisonFailure` exception will be raised.
Parameters:
**baseline\_images**list or None
A list of strings specifying the names of the images generated by calls to [`Figure.savefig`](figure_api#matplotlib.figure.Figure.savefig "matplotlib.figure.Figure.savefig").
If *None*, the test function must use the `baseline_images` fixture, either as a parameter or with [`pytest.mark.usefixtures`](https://pytest.org/en/stable/reference/reference.html#pytest.mark.usefixtures "(in pytest v7.1.3)"). This value is only allowed when using pytest.
**extensions**None or list of str
The list of extensions to test, e.g. `['png', 'pdf']`.
If *None*, defaults to all supported extensions: png, pdf, and svg.
When testing a single extension, it can be directly included in the names passed to *baseline\_images*. In that case, *extensions* must not be set.
In order to keep the size of the test suite from ballooning, we only include the `svg` or `pdf` outputs if the test is explicitly exercising a feature dependent on that backend (see also the [`check_figures_equal`](#matplotlib.testing.decorators.check_figures_equal "matplotlib.testing.decorators.check_figures_equal") decorator for that purpose).
**tol**float, default: 0
The RMS threshold above which the test is considered failed.
Due to expected small differences in floating-point calculations, on 32-bit systems an additional 0.06 is added to this threshold.
**freetype\_version**str or tuple
The expected freetype version or range of versions for this test to pass.
**remove\_text**bool
Remove the title and tick text from the figure before comparison. This is useful to make the baseline images independent of variations in text rendering between different versions of FreeType.
This does not remove other, more deliberate, text, such as legends and annotations.
**savefig\_kwarg**dict
Optional arguments that are passed to the savefig method.
**style**str, dict, or list
The optional style(s) to apply to the image test. The test itself can also apply additional styles if desired. Defaults to `["classic",
"_classic_test_patch"]`.
matplotlib.testing.decorators.remove\_ticks\_and\_titles(*figure*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/testing/decorators.py#L119-L137)
matplotlib.testing.exceptions
-----------------------------
*exception*matplotlib.testing.exceptions.ImageComparisonFailure[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/testing/exceptions.py#L1-L4)
Bases: [`AssertionError`](https://docs.python.org/3/library/exceptions.html#AssertionError "(in Python v3.10)")
Raise this exception to mark a test as a comparison between two images.
| programming_docs |
matplotlib matplotlib.offsetbox matplotlib.offsetbox
====================
Container classes for [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s.
[`OffsetBox`](#matplotlib.offsetbox.OffsetBox "matplotlib.offsetbox.OffsetBox")
The base of all container artists defined in this module.
[`AnchoredOffsetbox`](#matplotlib.offsetbox.AnchoredOffsetbox "matplotlib.offsetbox.AnchoredOffsetbox"), [`AnchoredText`](#matplotlib.offsetbox.AnchoredText "matplotlib.offsetbox.AnchoredText")
Anchor and align an arbitrary [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") or a text relative to the parent axes or a specific anchor point.
[`DrawingArea`](#matplotlib.offsetbox.DrawingArea "matplotlib.offsetbox.DrawingArea")
A container with fixed width and height. Children have a fixed position inside the container and may be clipped.
[`HPacker`](#matplotlib.offsetbox.HPacker "matplotlib.offsetbox.HPacker"), [`VPacker`](#matplotlib.offsetbox.VPacker "matplotlib.offsetbox.VPacker")
Containers for layouting their children vertically or horizontally.
[`PaddedBox`](#matplotlib.offsetbox.PaddedBox "matplotlib.offsetbox.PaddedBox")
A container to add a padding around an [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist").
[`TextArea`](#matplotlib.offsetbox.TextArea "matplotlib.offsetbox.TextArea")
Contains a single [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") instance.
*class*matplotlib.offsetbox.AnchoredOffsetbox(*loc*, *\**, *pad=0.4*, *borderpad=0.5*, *child=None*, *prop=None*, *frameon=True*, *bbox\_to\_anchor=None*, *bbox\_transform=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L910-L1117)
Bases: [`OffsetBox`](#matplotlib.offsetbox.OffsetBox "matplotlib.offsetbox.OffsetBox")
An offset box placed according to location *loc*.
AnchoredOffsetbox has a single child. When multiple children are needed, use an extra OffsetBox to enclose them. By default, the offset box is anchored against its parent axes. You may explicitly specify the *bbox\_to\_anchor*.
Parameters:
**loc**str
The box location. Valid locations are 'upper left', 'upper center', 'upper right', 'center left', 'center', 'center right', 'lower left', 'lower center, 'lower right'. For backward compatibility, numeric values are accepted as well. See the parameter *loc* of [`Legend`](legend_api#matplotlib.legend.Legend "matplotlib.legend.Legend") for details.
**pad**float, default: 0.4
Padding around the child as fraction of the fontsize.
**borderpad**float, default: 0.5
Padding between the offsetbox frame and the *bbox\_to\_anchor*.
**child**[`OffsetBox`](#matplotlib.offsetbox.OffsetBox "matplotlib.offsetbox.OffsetBox")
The box that will be anchored.
**prop**[`FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties")
This is only used as a reference for paddings. If not given, `[rcParams["legend.fontsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.fontsize#matplotlibrc-sample)` (default: `'medium'`) is used.
**frameon**bool
Whether to draw a frame around the box.
**bbox\_to\_anchor**[`BboxBase`](transformations#matplotlib.transforms.BboxBase "matplotlib.transforms.BboxBase"), 2-tuple, or 4-tuple of floats
Box that is used to position the legend in conjunction with *loc*.
**bbox\_transform**None or [`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
The transform for the bounding box (*bbox\_to\_anchor*).
**\*\*kwargs**
All other parameters are passed on to [`OffsetBox`](#matplotlib.offsetbox.OffsetBox "matplotlib.offsetbox.OffsetBox").
#### Notes
See [`Legend`](legend_api#matplotlib.legend.Legend "matplotlib.legend.Legend") for a detailed description of the anchoring mechanism.
codes*={'center': 10, 'center left': 6, 'center right': 7, 'lower center': 8, 'lower left': 3, 'lower right': 4, 'right': 5, 'upper center': 9, 'upper left': 2, 'upper right': 1}*
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1098-L1117)
Update the location of children if necessary and draw them to the given *renderer*.
get\_bbox\_to\_anchor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1028-L1037)
Return the bbox that the box is anchored to.
get\_child()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1008-L1010)
Return the child.
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1012-L1014)
Return the list of children.
get\_extent(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1016-L1026)
Return the extent of the box as (width, height, x, y).
This is the extent of the child plus the padding.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1064-L1072)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *bbox\_to\_anchor=<UNSET>*, *child=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *gid=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *offset=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`bbox_to_anchor`](#matplotlib.offsetbox.AnchoredOffsetbox.set_bbox_to_anchor "matplotlib.offsetbox.AnchoredOffsetbox.set_bbox_to_anchor") | unknown |
| [`child`](#matplotlib.offsetbox.AnchoredOffsetbox.set_child "matplotlib.offsetbox.AnchoredOffsetbox.set_child") | unknown |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](#matplotlib.offsetbox.OffsetBox.set_figure "matplotlib.offsetbox.OffsetBox.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`height`](#matplotlib.offsetbox.OffsetBox.set_height "matplotlib.offsetbox.OffsetBox.set_height") | float |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`offset`](#matplotlib.offsetbox.OffsetBox.set_offset "matplotlib.offsetbox.OffsetBox.set_offset") | (float, float) or callable |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](#matplotlib.offsetbox.OffsetBox.set_width "matplotlib.offsetbox.OffsetBox.set_width") | float |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_bbox\_to\_anchor(*bbox*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1039-L1062)
Set the bbox that the box is anchored to.
*bbox* can be a Bbox instance, a list of [left, bottom, width, height], or a list of [left, bottom] where the width and height will be assumed to be zero. The bbox will be transformed to display coordinate by the given transform.
set\_child(*child*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1001-L1006)
Set the child to be anchored.
update\_frame(*bbox*, *fontsize=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1093-L1096)
zorder*=5*
*class*matplotlib.offsetbox.AnchoredText(*s*, *loc*, *\**, *pad=0.4*, *borderpad=0.5*, *prop=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1132-L1173)
Bases: [`AnchoredOffsetbox`](#matplotlib.offsetbox.AnchoredOffsetbox "matplotlib.offsetbox.AnchoredOffsetbox")
AnchoredOffsetbox with Text.
Parameters:
**s**str
Text.
**loc**str
Location code. See [`AnchoredOffsetbox`](#matplotlib.offsetbox.AnchoredOffsetbox "matplotlib.offsetbox.AnchoredOffsetbox").
**pad**float, default: 0.4
Padding around the text as fraction of the fontsize.
**borderpad**float, default: 0.5
Spacing between the offsetbox frame and the *bbox\_to\_anchor*.
**prop**dict, optional
Dictionary of keyword parameters to be passed to the [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") instance contained inside AnchoredText.
**\*\*kwargs**
All other parameters are passed to [`AnchoredOffsetbox`](#matplotlib.offsetbox.AnchoredOffsetbox "matplotlib.offsetbox.AnchoredOffsetbox").
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *bbox\_to\_anchor=<UNSET>*, *child=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *gid=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *offset=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`bbox_to_anchor`](#matplotlib.offsetbox.AnchoredOffsetbox.set_bbox_to_anchor "matplotlib.offsetbox.AnchoredOffsetbox.set_bbox_to_anchor") | unknown |
| [`child`](#matplotlib.offsetbox.AnchoredOffsetbox.set_child "matplotlib.offsetbox.AnchoredOffsetbox.set_child") | unknown |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](#matplotlib.offsetbox.OffsetBox.set_figure "matplotlib.offsetbox.OffsetBox.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`height`](#matplotlib.offsetbox.OffsetBox.set_height "matplotlib.offsetbox.OffsetBox.set_height") | float |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`offset`](#matplotlib.offsetbox.OffsetBox.set_offset "matplotlib.offsetbox.OffsetBox.set_offset") | (float, float) or callable |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](#matplotlib.offsetbox.OffsetBox.set_width "matplotlib.offsetbox.OffsetBox.set_width") | float |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
*class*matplotlib.offsetbox.AnnotationBbox(*offsetbox*, *xy*, *xybox=None*, *\**, *xycoords='data'*, *boxcoords=None*, *frameon=True*, *pad=0.4*, *annotation\_clip=None*, *box\_alignment=(0.5, 0.5)*, *bboxprops=None*, *arrowprops=None*, *fontsize=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1261-L1485)
Bases: [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"), `_AnnotationBase`
Container for an [`OffsetBox`](#matplotlib.offsetbox.OffsetBox "matplotlib.offsetbox.OffsetBox") referring to a specific position *xy*.
Optionally an arrow pointing from the offsetbox to *xy* can be drawn.
This is like [`Annotation`](text_api#matplotlib.text.Annotation "matplotlib.text.Annotation"), but with [`OffsetBox`](#matplotlib.offsetbox.OffsetBox "matplotlib.offsetbox.OffsetBox") instead of [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text").
Parameters:
**offsetbox**[`OffsetBox`](#matplotlib.offsetbox.OffsetBox "matplotlib.offsetbox.OffsetBox")
**xy**(float, float)
The point *(x, y)* to annotate. The coordinate system is determined by *xycoords*.
**xybox**(float, float), default: *xy*
The position *(x, y)* to place the text at. The coordinate system is determined by *boxcoords*.
**xycoords**str or [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") or [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") or callable or (float, float), default: 'data'
The coordinate system that *xy* is given in. See the parameter *xycoords* in [`Annotation`](text_api#matplotlib.text.Annotation "matplotlib.text.Annotation") for a detailed description.
**boxcoords**str or [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") or [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") or callable or (float, float), default: value of *xycoords*
The coordinate system that *xybox* is given in. See the parameter *textcoords* in [`Annotation`](text_api#matplotlib.text.Annotation "matplotlib.text.Annotation") for a detailed description.
**frameon**bool, default: True
By default, the text is surrounded by a white [`FancyBboxPatch`](_as_gen/matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") (accessible as the `patch` attribute of the [`AnnotationBbox`](#matplotlib.offsetbox.AnnotationBbox "matplotlib.offsetbox.AnnotationBbox")). If *frameon* is set to False, this patch is made invisible.
**pad**float, default: 0.4
Padding around the offsetbox.
**box\_alignment**(float, float)
A tuple of two floats for a vertical and horizontal alignment of the offset box w.r.t. the *boxcoords*. The lower-left corner is (0, 0) and upper-right corner is (1, 1).
**\*\*kwargs**
Other parameters are identical to [`Annotation`](text_api#matplotlib.text.Annotation "matplotlib.text.Annotation").
*property*anncoords
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1378-L1385)
Test whether the artist contains the mouse event.
Parameters:
**mouseevent**[`matplotlib.backend_bases.MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
Returns:
**contains**bool
Whether any values are within the radius.
**details**dict
An artist-specific dictionary of details of the event context, such as which points are contained in the pick radius. See the individual Artist subclasses for details.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1472-L1485)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1387-L1391)
Return a list of the child [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s of this [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist").
get\_fontsize()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1411-L1413)
Return the fontsize in points.
get\_tightbbox(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1422-L1425)
Like [`Artist.get_window_extent`](_as_gen/matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent"), but includes any clipping.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
Returns:
[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The enclosing bounding box (in figure pixel coordinates).
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1415-L1420)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *annotation\_clip=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *fontsize=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| `annotation_clip` | bool or None |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | unknown |
| [`fontsize`](#matplotlib.offsetbox.AnnotationBbox.set_fontsize "matplotlib.offsetbox.AnnotationBbox.set_fontsize") | unknown |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1393-L1397)
Set the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
set\_fontsize(*s=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1399-L1409)
Set the fontsize in points.
If *s* is not given, reset to `[rcParams["legend.fontsize"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=legend.fontsize#matplotlibrc-sample)` (default: `'medium'`).
update\_positions(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1427-L1470)
Update pixel positions for the annotated point, the text and the arrow.
*property*xyann
zorder*=3*
*class*matplotlib.offsetbox.AuxTransformBox(*aux\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L819-L907)
Bases: [`OffsetBox`](#matplotlib.offsetbox.OffsetBox "matplotlib.offsetbox.OffsetBox")
Offset Box with the aux\_transform. Its children will be transformed with the aux\_transform first then will be offsetted. The absolute coordinate of the aux\_transform is meaning as it will be automatically adjust so that the left-lower corner of the bounding box of children will be set to (0, 0) before the offset transform.
It is similar to drawing area, except that the extent of the box is not predetermined but calculated from the window extent of its children. Furthermore, the extent of the children will be calculated in the transformed coordinate.
add\_artist(*a*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L841-L845)
Add an [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") to the container box.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L902-L907)
Update the location of children if necessary and draw them to the given *renderer*.
get\_extent(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L887-L900)
Return a tuple `width, height, xdescent, ydescent` of the box.
get\_offset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L875-L877)
Return offset of the container.
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L847-L854)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") applied to the children
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L879-L885)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *gid=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *offset=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](#matplotlib.offsetbox.OffsetBox.set_figure "matplotlib.offsetbox.OffsetBox.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`height`](#matplotlib.offsetbox.OffsetBox.set_height "matplotlib.offsetbox.OffsetBox.set_height") | float |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`offset`](#matplotlib.offsetbox.AuxTransformBox.set_offset "matplotlib.offsetbox.AuxTransformBox.set_offset") | (float, float) |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](#matplotlib.offsetbox.AuxTransformBox.set_transform "matplotlib.offsetbox.AuxTransformBox.set_transform") | unknown |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](#matplotlib.offsetbox.OffsetBox.set_width "matplotlib.offsetbox.OffsetBox.set_width") | float |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_offset(*xy*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L861-L873)
Set the offset of the container.
Parameters:
**xy**(float, float)
The (x, y) coordinates of the offset in display units.
set\_transform(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L856-L859)
set\_transform is ignored.
*class*matplotlib.offsetbox.DraggableAnnotation(*annotation*, *use\_blit=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1624-L1636)
Bases: [`DraggableBase`](#matplotlib.offsetbox.DraggableBase "matplotlib.offsetbox.DraggableBase")
save\_offset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1629-L1631)
update\_offset(*dx*, *dy*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1633-L1636)
*class*matplotlib.offsetbox.DraggableBase(*ref\_artist*, *use\_blit=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1488-L1595)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Helper base class for a draggable artist (legend, offsetbox).
Derived classes must override the following methods:
```
def save_offset(self):
'''
Called when the object is picked for dragging; should save the
reference position of the artist.
'''
def update_offset(self, dx, dy):
'''
Called during the dragging; (*dx*, *dy*) is the pixel offset from
the point where the mouse drag started.
'''
```
Optionally, you may override the following method:
```
def finalize_offset(self):
'''Called when the mouse is released.'''
```
In the current implementation of [`DraggableLegend`](legend_api#matplotlib.legend.DraggableLegend "matplotlib.legend.DraggableLegend") and [`DraggableAnnotation`](#matplotlib.offsetbox.DraggableAnnotation "matplotlib.offsetbox.DraggableAnnotation"), [`update_offset`](#matplotlib.offsetbox.DraggableBase.update_offset "matplotlib.offsetbox.DraggableBase.update_offset") places the artists in display coordinates, and [`finalize_offset`](#matplotlib.offsetbox.DraggableBase.finalize_offset "matplotlib.offsetbox.DraggableBase.finalize_offset") recalculates their position in axes coordinate and set a relevant attribute.
disconnect()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1577-L1586)
Disconnect the callbacks.
finalize\_offset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1594-L1595)
on\_motion(*evt*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1531-L1542)
on\_pick(*evt*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1544-L1559)
on\_release(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1561-L1568)
save\_offset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1588-L1589)
update\_offset(*dx*, *dy*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1591-L1592)
*class*matplotlib.offsetbox.DraggableOffsetBox(*ref\_artist*, *offsetbox*, *use\_blit=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1598-L1621)
Bases: [`DraggableBase`](#matplotlib.offsetbox.DraggableBase "matplotlib.offsetbox.DraggableBase")
get\_loc\_in\_canvas()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1615-L1621)
save\_offset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1603-L1609)
update\_offset(*dx*, *dy*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1611-L1613)
*class*matplotlib.offsetbox.DrawingArea(*width*, *height*, *xdescent=0.0*, *ydescent=0.0*, *clip=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L569-L686)
Bases: [`OffsetBox`](#matplotlib.offsetbox.OffsetBox "matplotlib.offsetbox.OffsetBox")
The DrawingArea can contain any Artist as a child. The DrawingArea has a fixed width and height. The position of children relative to the parent is fixed. The children can be clipped at the boundaries of the parent.
Parameters:
**width, height**float
Width and height of the container box.
**xdescent, ydescent**float
Descent of the box in x- and y-direction.
**clip**bool
Whether to clip the children to the box.
add\_artist(*a*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L654-L663)
Add an [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") to the container box.
*property*clip\_children
If the children of this DrawingArea should be clipped by DrawingArea bounding box.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L665-L686)
Update the location of children if necessary and draw them to the given *renderer*.
get\_extent(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L648-L652)
Return width, height, xdescent, ydescent of box.
get\_offset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L635-L637)
Return offset of the container.
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L610-L614)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") applied to the children.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L639-L646)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *gid=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *offset=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](#matplotlib.offsetbox.OffsetBox.set_figure "matplotlib.offsetbox.OffsetBox.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`height`](#matplotlib.offsetbox.OffsetBox.set_height "matplotlib.offsetbox.OffsetBox.set_height") | float |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`offset`](#matplotlib.offsetbox.DrawingArea.set_offset "matplotlib.offsetbox.DrawingArea.set_offset") | (float, float) |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](#matplotlib.offsetbox.DrawingArea.set_transform "matplotlib.offsetbox.DrawingArea.set_transform") | unknown |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](#matplotlib.offsetbox.OffsetBox.set_width "matplotlib.offsetbox.OffsetBox.set_width") | float |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_offset(*xy*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L621-L633)
Set the offset of the container.
Parameters:
**xy**(float, float)
The (x, y) coordinates of the offset in display units.
set\_transform(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L616-L619)
set\_transform is ignored.
*class*matplotlib.offsetbox.HPacker(*pad=None*, *sep=None*, *width=None*, *height=None*, *align='baseline'*, *mode='fixed'*, *children=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L459-L494)
Bases: [`PackerBase`](#matplotlib.offsetbox.PackerBase "matplotlib.offsetbox.PackerBase")
HPacker packs its children horizontally, automatically adjusting their relative positions at draw time.
Parameters:
**pad**float, optional
The boundary padding in points.
**sep**float, optional
The spacing between items in points.
**width, height**float, optional
Width and height of the container box in pixels, calculated if *None*.
**align**{'top', 'bottom', 'left', 'right', 'center', 'baseline'}, default: 'baseline'
Alignment of boxes.
**mode**{'fixed', 'expand', 'equal'}, default: 'fixed'
The packing mode.
* 'fixed' packs the given [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s tight with *sep* spacing.
* 'expand' uses the maximal available space to distribute the artists with equal spacing in between.
* 'equal': Each artist an equal fraction of the available space and is left-aligned (or top-aligned) therein.
**children**list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
The artists to pack.
#### Notes
*pad* and *sep* are in points and will be scaled with the renderer dpi, while *width* and *height* are in pixels.
get\_extent\_offsets(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L465-L494)
Update offset of the children and return the extent of the box.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
Returns:
width
height
xdescent
ydescent
list of (xoffset, yoffset) pairs
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *gid=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *offset=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](#matplotlib.offsetbox.OffsetBox.set_figure "matplotlib.offsetbox.OffsetBox.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`height`](#matplotlib.offsetbox.OffsetBox.set_height "matplotlib.offsetbox.OffsetBox.set_height") | float |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`offset`](#matplotlib.offsetbox.OffsetBox.set_offset "matplotlib.offsetbox.OffsetBox.set_offset") | (float, float) or callable |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](#matplotlib.offsetbox.OffsetBox.set_width "matplotlib.offsetbox.OffsetBox.set_width") | float |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
*class*matplotlib.offsetbox.OffsetBox(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L186-L368)
Bases: [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
The OffsetBox is a simple container artist.
The child artists are meant to be drawn at a relative position to its parent.
Being an artist itself, all parameters are passed on to [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist").
*property*axes
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance the artist resides in, or *None*.
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L225-L256)
Delegate the mouse event contains-check to the children.
As a container, the [`OffsetBox`](#matplotlib.offsetbox.OffsetBox "matplotlib.offsetbox.OffsetBox") does not respond itself to mouseevents.
Parameters:
**mouseevent**[`matplotlib.backend_bases.MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
Returns:
**contains**bool
Whether any values are within the radius.
**details**dict
An artist-specific dictionary of details of the event context, such as which points are contained in the pick radius. See the individual Artist subclasses for details.
See also
[`Artist.contains`](_as_gen/matplotlib.artist.artist.contains#matplotlib.artist.Artist.contains "matplotlib.artist.Artist.contains")
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L357-L368)
Update the location of children if necessary and draw them to the given *renderer*.
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L321-L323)
Return a list of the child [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s.
get\_extent(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L344-L347)
Return a tuple `width, height, xdescent, ydescent` of the box.
get\_extent\_offsets(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L325-L342)
Update offset of the children and return the extent of the box.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
Returns:
width
height
xdescent
ydescent
list of (xoffset, yoffset) pairs
get\_offset(*width*, *height*, *xdescent*, *ydescent*, *renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L276-L293)
Return the offset as a tuple (x, y).
The extent parameters have to be provided to handle the case where the offset is dynamically determined by a callable (see [`set_offset`](#matplotlib.offsetbox.OffsetBox.set_offset "matplotlib.offsetbox.OffsetBox.set_offset")).
Parameters:
**width, height, xdescent, ydescent**
Extent parameters.
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
get\_visible\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L317-L319)
Return a list of the visible child [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L349-L355)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *gid=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *offset=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](#matplotlib.offsetbox.OffsetBox.set_figure "matplotlib.offsetbox.OffsetBox.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`height`](#matplotlib.offsetbox.OffsetBox.set_height "matplotlib.offsetbox.OffsetBox.set_height") | float |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`offset`](#matplotlib.offsetbox.OffsetBox.set_offset "matplotlib.offsetbox.OffsetBox.set_offset") | (float, float) or callable |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](#matplotlib.offsetbox.OffsetBox.set_width "matplotlib.offsetbox.OffsetBox.set_width") | float |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L205-L215)
Set the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") for the [`OffsetBox`](#matplotlib.offsetbox.OffsetBox "matplotlib.offsetbox.OffsetBox") and all its children.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
set\_height(*height*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L306-L315)
Set the height of the box.
Parameters:
**height**float
set\_offset(*xy*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L258-L274)
Set the offset.
Parameters:
**xy**(float, float) or callable
The (x, y) coordinates of the offset in display units. These can either be given explicitly as a tuple (x, y), or by providing a function that converts the extent into the offset. This function must have the signature:
```
def offset(width, height, xdescent, ydescent, renderer) -> (float, float)
```
set\_width(*width*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L295-L304)
Set the width of the box.
Parameters:
**width**float
*class*matplotlib.offsetbox.OffsetImage(*arr*, *\**, *zoom=1*, *cmap=None*, *norm=None*, *interpolation=None*, *origin=None*, *filternorm=True*, *filterrad=4.0*, *resample=False*, *dpi\_cor=True*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1176-L1258)
Bases: [`OffsetBox`](#matplotlib.offsetbox.OffsetBox "matplotlib.offsetbox.OffsetBox")
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1254-L1258)
Update the location of children if necessary and draw them to the given *renderer*.
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1230-L1231)
Return a list of the child [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s.
get\_data()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1216-L1217)
get\_extent(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1241-L1252)
Return a tuple `width, height, xdescent, ydescent` of the box.
get\_offset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1226-L1228)
Return offset of the container.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1233-L1239)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
get\_zoom()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1223-L1224)
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *data=<UNSET>*, *gid=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *offset=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *zoom=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`data`](#matplotlib.offsetbox.OffsetImage.set_data "matplotlib.offsetbox.OffsetImage.set_data") | unknown |
| [`figure`](#matplotlib.offsetbox.OffsetBox.set_figure "matplotlib.offsetbox.OffsetBox.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`height`](#matplotlib.offsetbox.OffsetBox.set_height "matplotlib.offsetbox.OffsetBox.set_height") | float |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`offset`](#matplotlib.offsetbox.OffsetBox.set_offset "matplotlib.offsetbox.OffsetBox.set_offset") | (float, float) or callable |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](#matplotlib.offsetbox.OffsetBox.set_width "matplotlib.offsetbox.OffsetBox.set_width") | float |
| [`zoom`](#matplotlib.offsetbox.OffsetImage.set_zoom "matplotlib.offsetbox.OffsetImage.set_zoom") | unknown |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_data(*arr*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1211-L1214)
set\_zoom(*zoom*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L1219-L1221)
*class*matplotlib.offsetbox.PackerBase(*pad=None*, *sep=None*, *width=None*, *height=None*, *align='baseline'*, *mode='fixed'*, *children=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L371-L415)
Bases: [`OffsetBox`](#matplotlib.offsetbox.OffsetBox "matplotlib.offsetbox.OffsetBox")
Parameters:
**pad**float, optional
The boundary padding in points.
**sep**float, optional
The spacing between items in points.
**width, height**float, optional
Width and height of the container box in pixels, calculated if *None*.
**align**{'top', 'bottom', 'left', 'right', 'center', 'baseline'}, default: 'baseline'
Alignment of boxes.
**mode**{'fixed', 'expand', 'equal'}, default: 'fixed'
The packing mode.
* 'fixed' packs the given [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s tight with *sep* spacing.
* 'expand' uses the maximal available space to distribute the artists with equal spacing in between.
* 'equal': Each artist an equal fraction of the available space and is left-aligned (or top-aligned) therein.
**children**list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
The artists to pack.
#### Notes
*pad* and *sep* are in points and will be scaled with the renderer dpi, while *width* and *height* are in pixels.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *gid=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *offset=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](#matplotlib.offsetbox.OffsetBox.set_figure "matplotlib.offsetbox.OffsetBox.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`height`](#matplotlib.offsetbox.OffsetBox.set_height "matplotlib.offsetbox.OffsetBox.set_height") | float |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`offset`](#matplotlib.offsetbox.OffsetBox.set_offset "matplotlib.offsetbox.OffsetBox.set_offset") | (float, float) or callable |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](#matplotlib.offsetbox.OffsetBox.set_width "matplotlib.offsetbox.OffsetBox.set_width") | float |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
*class*matplotlib.offsetbox.PaddedBox(*child*, *pad=None*, *\**, *draw\_frame=False*, *patch\_attrs=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L497-L566)
Bases: [`OffsetBox`](#matplotlib.offsetbox.OffsetBox "matplotlib.offsetbox.OffsetBox")
A container to add a padding around an [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist").
The [`PaddedBox`](#matplotlib.offsetbox.PaddedBox "matplotlib.offsetbox.PaddedBox") contains a [`FancyBboxPatch`](_as_gen/matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") that is used to visualize it when rendering.
Parameters:
**child**[`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
The contained [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist").
**pad**float
The padding in points. This will be scaled with the renderer dpi. In contrast *width* and *height* are in *pixels* and thus not scaled.
**draw\_frame**bool
Whether to draw the contained [`FancyBboxPatch`](_as_gen/matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch").
**patch\_attrs**dict or None
Additional parameters passed to the contained [`FancyBboxPatch`](_as_gen/matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch").
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L543-L555)
Update the location of children if necessary and draw them to the given *renderer*.
draw\_frame(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L563-L566)
get\_extent\_offsets(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L535-L541)
Update offset of the children and return the extent of the box.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
Returns:
width
height
xdescent
ydescent
list of (xoffset, yoffset) pairs
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *gid=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *offset=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](#matplotlib.offsetbox.OffsetBox.set_figure "matplotlib.offsetbox.OffsetBox.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`height`](#matplotlib.offsetbox.OffsetBox.set_height "matplotlib.offsetbox.OffsetBox.set_height") | float |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`offset`](#matplotlib.offsetbox.OffsetBox.set_offset "matplotlib.offsetbox.OffsetBox.set_offset") | (float, float) or callable |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](#matplotlib.offsetbox.OffsetBox.set_width "matplotlib.offsetbox.OffsetBox.set_width") | float |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
update\_frame(*bbox*, *fontsize=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L557-L561)
*class*matplotlib.offsetbox.TextArea(*s*, *\**, *textprops=None*, *multilinebaseline=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L689-L816)
Bases: [`OffsetBox`](#matplotlib.offsetbox.OffsetBox "matplotlib.offsetbox.OffsetBox")
The TextArea is a container artist for a single Text instance.
The text is placed at (0, 0) with baseline+left alignment, by default. The width and height of the TextArea instance is the width and height of its child text.
Parameters:
**s**str
The text to be displayed.
**textprops**dict, default: {}
Dictionary of keyword parameters to be passed to the [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") instance in the TextArea.
**multilinebaseline**bool, default: False
Whether the baseline for multiline text is adjusted so that it is (approximately) center-aligned with single-line text.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L812-L816)
Update the location of children if necessary and draw them to the given *renderer*.
get\_extent(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L784-L810)
Return a tuple `width, height, xdescent, ydescent` of the box.
get\_multilinebaseline()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L747-L751)
Get multilinebaseline.
get\_offset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L772-L774)
Return offset of the container.
get\_text()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L731-L733)
Return the string representation of this area's text.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L776-L782)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *gid=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *multilinebaseline=<UNSET>*, *offset=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *text=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](#matplotlib.offsetbox.OffsetBox.set_figure "matplotlib.offsetbox.OffsetBox.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`height`](#matplotlib.offsetbox.OffsetBox.set_height "matplotlib.offsetbox.OffsetBox.set_height") | float |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`multilinebaseline`](#matplotlib.offsetbox.TextArea.set_multilinebaseline "matplotlib.offsetbox.TextArea.set_multilinebaseline") | unknown |
| [`offset`](#matplotlib.offsetbox.TextArea.set_offset "matplotlib.offsetbox.TextArea.set_offset") | (float, float) |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`text`](#matplotlib.offsetbox.TextArea.set_text "matplotlib.offsetbox.TextArea.set_text") | unknown |
| [`transform`](#matplotlib.offsetbox.TextArea.set_transform "matplotlib.offsetbox.TextArea.set_transform") | unknown |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](#matplotlib.offsetbox.OffsetBox.set_width "matplotlib.offsetbox.OffsetBox.set_width") | float |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_multilinebaseline(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L735-L745)
Set multilinebaseline.
If True, the baseline for multiline text is adjusted so that it is (approximately) center-aligned with single-line text. This is used e.g. by the legend implementation so that single-line labels are baseline-aligned, but multiline labels are "center"-aligned with them.
set\_offset(*xy*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L758-L770)
Set the offset of the container.
Parameters:
**xy**(float, float)
The (x, y) coordinates of the offset in display units.
set\_text(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L726-L729)
Set the text of this area as a string.
set\_transform(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L753-L756)
set\_transform is ignored.
*class*matplotlib.offsetbox.VPacker(*pad=None*, *sep=None*, *width=None*, *height=None*, *align='baseline'*, *mode='fixed'*, *children=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L418-L456)
Bases: [`PackerBase`](#matplotlib.offsetbox.PackerBase "matplotlib.offsetbox.PackerBase")
VPacker packs its children vertically, automatically adjusting their relative positions at draw time.
Parameters:
**pad**float, optional
The boundary padding in points.
**sep**float, optional
The spacing between items in points.
**width, height**float, optional
Width and height of the container box in pixels, calculated if *None*.
**align**{'top', 'bottom', 'left', 'right', 'center', 'baseline'}, default: 'baseline'
Alignment of boxes.
**mode**{'fixed', 'expand', 'equal'}, default: 'fixed'
The packing mode.
* 'fixed' packs the given [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s tight with *sep* spacing.
* 'expand' uses the maximal available space to distribute the artists with equal spacing in between.
* 'equal': Each artist an equal fraction of the available space and is left-aligned (or top-aligned) therein.
**children**list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
The artists to pack.
#### Notes
*pad* and *sep* are in points and will be scaled with the renderer dpi, while *width* and *height* are in pixels.
get\_extent\_offsets(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L424-L456)
Update offset of the children and return the extent of the box.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
Returns:
width
height
xdescent
ydescent
list of (xoffset, yoffset) pairs
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *gid=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *offset=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](#matplotlib.offsetbox.OffsetBox.set_figure "matplotlib.offsetbox.OffsetBox.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`height`](#matplotlib.offsetbox.OffsetBox.set_height "matplotlib.offsetbox.OffsetBox.set_height") | float |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`offset`](#matplotlib.offsetbox.OffsetBox.set_offset "matplotlib.offsetbox.OffsetBox.set_offset") | (float, float) or callable |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](#matplotlib.offsetbox.OffsetBox.set_width "matplotlib.offsetbox.OffsetBox.set_width") | float |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
matplotlib.offsetbox.bbox\_artist(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/offsetbox.py#L44-L46)
| programming_docs |
matplotlib matplotlib.backend_managers matplotlib.backend\_managers
============================
*class*matplotlib.backend\_managers.ToolEvent(*name*, *sender*, *tool*, *data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_managers.py#L4-L10)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Event for tool manipulation (add/remove).
*class*matplotlib.backend\_managers.ToolManager(*figure=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_managers.py#L32-L409)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Manager for actions triggered by user interactions (key press, toolbar clicks, ...) on a Figure.
Attributes:
[`figure`](#matplotlib.backend_managers.ToolManager.figure "matplotlib.backend_managers.ToolManager.figure")[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
Figure that holds the canvas.
**keypresslock**[`LockDraw`](widgets_api#matplotlib.widgets.LockDraw "matplotlib.widgets.LockDraw")
[`LockDraw`](widgets_api#matplotlib.widgets.LockDraw "matplotlib.widgets.LockDraw") object to know if the [`canvas`](#matplotlib.backend_managers.ToolManager.canvas "matplotlib.backend_managers.ToolManager.canvas") key\_press\_event is locked.
**messagelock**[`LockDraw`](widgets_api#matplotlib.widgets.LockDraw "matplotlib.widgets.LockDraw")
[`LockDraw`](widgets_api#matplotlib.widgets.LockDraw "matplotlib.widgets.LockDraw") object to know if the message is available to write.
*property*active\_toggle
Currently toggled tools.
add\_tool(*name*, *tool*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_managers.py#L226-L293)
Add *tool* to [`ToolManager`](#matplotlib.backend_managers.ToolManager "matplotlib.backend_managers.ToolManager").
If successful, adds a new event `tool_trigger_{name}` where `{name}` is the *name* of the tool; the event is fired every time the tool is triggered.
Parameters:
**name**str
Name of the tool, treated as the ID, has to be unique.
**tool**type
Class of the tool to be added. A subclass will be used instead if one was registered for the current canvas class.
See also
[`matplotlib.backend_tools.ToolBase`](backend_tools_api#matplotlib.backend_tools.ToolBase "matplotlib.backend_tools.ToolBase")
The base class for tools.
#### Notes
args and kwargs get passed directly to the tools constructor.
*property*canvas
Canvas managed by FigureManager.
*property*figure
Figure that holds the canvas.
get\_tool(*name*, *warn=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_managers.py#L383-L409)
Return the tool object with the given name.
For convenience, this passes tool objects through.
Parameters:
**name**str or [`ToolBase`](backend_tools_api#matplotlib.backend_tools.ToolBase "matplotlib.backend_tools.ToolBase")
Name of the tool, or the tool itself.
**warn**bool, default: True
Whether a warning should be emitted it no tool with the given name exists.
Returns:
[`ToolBase`](backend_tools_api#matplotlib.backend_tools.ToolBase "matplotlib.backend_tools.ToolBase") or None
The tool or None if no tool with the given name exists.
get\_tool\_keymap(*name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_managers.py#L154-L170)
Return the keymap associated with the specified tool.
Parameters:
**name**str
Name of the Tool.
Returns:
list of str
List of keys associated with the tool.
message\_event(*message*, *sender=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_managers.py#L140-L147)
Emit a [`ToolManagerMessageEvent`](#matplotlib.backend_managers.ToolManagerMessageEvent "matplotlib.backend_managers.ToolManagerMessageEvent").
remove\_tool(*name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_managers.py#L198-L224)
Remove tool named *name*.
Parameters:
**name**str
Name of the tool.
set\_figure(*figure*, *update\_tools=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_managers.py#L78-L96)
Bind the given figure to the tools.
Parameters:
**figure**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
**update\_tools**bool, default: True
Force tools to update figure.
toolmanager\_connect(*s*, *func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_managers.py#L98-L126)
Connect event with string *s* to *func*.
Parameters:
**s**str
The name of the event. The following events are recognized:
* 'tool\_message\_event'
* 'tool\_removed\_event'
* 'tool\_added\_event'
For every tool added a new event is created
* 'tool\_trigger\_TOOLNAME', where TOOLNAME is the id of the tool.
**func**callable
Callback function for the toolmanager event with signature:
```
def func(event: ToolEvent) -> Any
```
Returns:
cid
The callback id for the connection. This can be used in [`toolmanager_disconnect`](#matplotlib.backend_managers.ToolManager.toolmanager_disconnect "matplotlib.backend_managers.ToolManager.toolmanager_disconnect").
toolmanager\_disconnect(*cid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_managers.py#L128-L138)
Disconnect callback id *cid*.
Example usage:
```
cid = toolmanager.toolmanager_connect('tool_trigger_zoom', onpress)
#...later
toolmanager.toolmanager_disconnect(cid)
```
*property*tools
A dict mapping tool name -> controlled tool.
trigger\_tool(*name*, *sender=None*, *canvasevent=None*, *data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_managers.py#L338-L367)
Trigger a tool and emit the `tool_trigger_{name}` event.
Parameters:
**name**str
Name of the tool.
**sender**object
Object that wishes to trigger the tool.
**canvasevent**Event
Original Canvas event or None.
**data**object
Extra data to pass to the tool when triggering.
update\_keymap(*name*, *key*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_managers.py#L176-L196)
Set the keymap to associate with the specified tool.
Parameters:
**name**str
Name of the Tool.
**key**str or list of str
Keys to associate with the tool.
*class*matplotlib.backend\_managers.ToolManagerMessageEvent(*name*, *sender*, *message*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_managers.py#L20-L29)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Event carrying messages from toolmanager.
Messages usually get displayed to the user by the toolbar.
*class*matplotlib.backend\_managers.ToolTriggerEvent(*name*, *sender*, *tool*, *canvasevent=None*, *data=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backend_managers.py#L13-L17)
Bases: [`ToolEvent`](#matplotlib.backend_managers.ToolEvent "matplotlib.backend_managers.ToolEvent")
Event to inform that a tool has been triggered.
matplotlib matplotlib.contour matplotlib.contour
==================
Classes to support contour plotting and labelling for the Axes class.
*class*matplotlib.contour.ClabelText(*x=0*, *y=0*, *text=''*, *\**, *color=None*, *verticalalignment='baseline'*, *horizontalalignment='left'*, *multialignment=None*, *fontproperties=None*, *rotation=None*, *linespacing=None*, *rotation\_mode=None*, *usetex=None*, *wrap=False*, *transform\_rotates\_text=False*, *parse\_math=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L34-L44)
Bases: [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")
Unlike the ordinary text, the get\_rotation returns an updated angle in the pixel coordinate assuming that the input rotation is an angle in data coordinate (or whatever transform set).
Create a [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") instance at *x*, *y* with string *text*.
The text is aligned relative to the anchor point (*x*, *y*) according to `horizontalalignment` (default: 'left') and `verticalalignment` (default: 'bottom'). See also [Text alignment](https://matplotlib.org/stable/gallery/text_labels_and_annotations/text_alignment.html).
While Text accepts the 'label' keyword argument, by default it is not added to the handles of a legend.
Valid keyword arguments are:
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`backgroundcolor`](text_api#matplotlib.text.Text.set_backgroundcolor "matplotlib.text.Text.set_backgroundcolor") | color |
| [`bbox`](text_api#matplotlib.text.Text.set_bbox "matplotlib.text.Text.set_bbox") | dict with properties for [`patches.FancyBboxPatch`](_as_gen/matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | unknown |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | unknown |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | unknown |
| [`color`](text_api#matplotlib.text.Text.set_color "matplotlib.text.Text.set_color") or c | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fontfamily`](text_api#matplotlib.text.Text.set_fontfamily "matplotlib.text.Text.set_fontfamily") or family | {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'} |
| [`fontproperties`](text_api#matplotlib.text.Text.set_fontproperties "matplotlib.text.Text.set_fontproperties") or font or font\_properties | [`font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") or [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.10)") |
| [`fontsize`](text_api#matplotlib.text.Text.set_fontsize "matplotlib.text.Text.set_fontsize") or size | float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'} |
| [`fontstretch`](text_api#matplotlib.text.Text.set_fontstretch "matplotlib.text.Text.set_fontstretch") or stretch | {a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'} |
| [`fontstyle`](text_api#matplotlib.text.Text.set_fontstyle "matplotlib.text.Text.set_fontstyle") or style | {'normal', 'italic', 'oblique'} |
| [`fontvariant`](text_api#matplotlib.text.Text.set_fontvariant "matplotlib.text.Text.set_fontvariant") or variant | {'normal', 'small-caps'} |
| [`fontweight`](text_api#matplotlib.text.Text.set_fontweight "matplotlib.text.Text.set_fontweight") or weight | {a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'} |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`horizontalalignment`](text_api#matplotlib.text.Text.set_horizontalalignment "matplotlib.text.Text.set_horizontalalignment") or ha | {'left', 'center', 'right'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linespacing`](text_api#matplotlib.text.Text.set_linespacing "matplotlib.text.Text.set_linespacing") | float (multiple of font size) |
| [`math_fontfamily`](text_api#matplotlib.text.Text.set_math_fontfamily "matplotlib.text.Text.set_math_fontfamily") | str |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`multialignment`](text_api#matplotlib.text.Text.set_multialignment "matplotlib.text.Text.set_multialignment") or ma | {'left', 'right', 'center'} |
| [`parse_math`](text_api#matplotlib.text.Text.set_parse_math "matplotlib.text.Text.set_parse_math") | bool |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](text_api#matplotlib.text.Text.set_position "matplotlib.text.Text.set_position") | (float, float) |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`rotation`](text_api#matplotlib.text.Text.set_rotation "matplotlib.text.Text.set_rotation") | float or {'vertical', 'horizontal'} |
| [`rotation_mode`](text_api#matplotlib.text.Text.set_rotation_mode "matplotlib.text.Text.set_rotation_mode") | {None, 'default', 'anchor'} |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`text`](text_api#matplotlib.text.Text.set_text "matplotlib.text.Text.set_text") | object |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`transform_rotates_text`](text_api#matplotlib.text.Text.set_transform_rotates_text "matplotlib.text.Text.set_transform_rotates_text") | bool |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`usetex`](text_api#matplotlib.text.Text.set_usetex "matplotlib.text.Text.set_usetex") | bool or None |
| [`verticalalignment`](text_api#matplotlib.text.Text.set_verticalalignment "matplotlib.text.Text.set_verticalalignment") or va | {'bottom', 'baseline', 'center', 'center\_baseline', 'top'} |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`wrap`](text_api#matplotlib.text.Text.set_wrap "matplotlib.text.Text.set_wrap") | bool |
| [`x`](text_api#matplotlib.text.Text.set_x "matplotlib.text.Text.set_x") | float |
| [`y`](text_api#matplotlib.text.Text.set_y "matplotlib.text.Text.set_y") | float |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
get\_rotation()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L41-L44)
Return the text angle in degrees between 0 and 360.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *backgroundcolor=<UNSET>*, *bbox=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *fontfamily=<UNSET>*, *fontproperties=<UNSET>*, *fontsize=<UNSET>*, *fontstretch=<UNSET>*, *fontstyle=<UNSET>*, *fontvariant=<UNSET>*, *fontweight=<UNSET>*, *gid=<UNSET>*, *horizontalalignment=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *linespacing=<UNSET>*, *math\_fontfamily=<UNSET>*, *mouseover=<UNSET>*, *multialignment=<UNSET>*, *parse\_math=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *position=<UNSET>*, *rasterized=<UNSET>*, *rotation=<UNSET>*, *rotation\_mode=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *text=<UNSET>*, *transform=<UNSET>*, *transform\_rotates\_text=<UNSET>*, *url=<UNSET>*, *usetex=<UNSET>*, *verticalalignment=<UNSET>*, *visible=<UNSET>*, *wrap=<UNSET>*, *x=<UNSET>*, *y=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`backgroundcolor`](text_api#matplotlib.text.Text.set_backgroundcolor "matplotlib.text.Text.set_backgroundcolor") | color |
| [`bbox`](text_api#matplotlib.text.Text.set_bbox "matplotlib.text.Text.set_bbox") | dict with properties for [`patches.FancyBboxPatch`](_as_gen/matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](text_api#matplotlib.text.Text.set_color "matplotlib.text.Text.set_color") or c | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fontfamily`](text_api#matplotlib.text.Text.set_fontfamily "matplotlib.text.Text.set_fontfamily") or family | {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'} |
| [`fontproperties`](text_api#matplotlib.text.Text.set_fontproperties "matplotlib.text.Text.set_fontproperties") or font or font\_properties | [`font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") or [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.10)") |
| [`fontsize`](text_api#matplotlib.text.Text.set_fontsize "matplotlib.text.Text.set_fontsize") or size | float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'} |
| [`fontstretch`](text_api#matplotlib.text.Text.set_fontstretch "matplotlib.text.Text.set_fontstretch") or stretch | {a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'} |
| [`fontstyle`](text_api#matplotlib.text.Text.set_fontstyle "matplotlib.text.Text.set_fontstyle") or style | {'normal', 'italic', 'oblique'} |
| [`fontvariant`](text_api#matplotlib.text.Text.set_fontvariant "matplotlib.text.Text.set_fontvariant") or variant | {'normal', 'small-caps'} |
| [`fontweight`](text_api#matplotlib.text.Text.set_fontweight "matplotlib.text.Text.set_fontweight") or weight | {a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'} |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`horizontalalignment`](text_api#matplotlib.text.Text.set_horizontalalignment "matplotlib.text.Text.set_horizontalalignment") or ha | {'left', 'center', 'right'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linespacing`](text_api#matplotlib.text.Text.set_linespacing "matplotlib.text.Text.set_linespacing") | float (multiple of font size) |
| [`math_fontfamily`](text_api#matplotlib.text.Text.set_math_fontfamily "matplotlib.text.Text.set_math_fontfamily") | str |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`multialignment`](text_api#matplotlib.text.Text.set_multialignment "matplotlib.text.Text.set_multialignment") or ma | {'left', 'right', 'center'} |
| [`parse_math`](text_api#matplotlib.text.Text.set_parse_math "matplotlib.text.Text.set_parse_math") | bool |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](text_api#matplotlib.text.Text.set_position "matplotlib.text.Text.set_position") | (float, float) |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`rotation`](text_api#matplotlib.text.Text.set_rotation "matplotlib.text.Text.set_rotation") | float or {'vertical', 'horizontal'} |
| [`rotation_mode`](text_api#matplotlib.text.Text.set_rotation_mode "matplotlib.text.Text.set_rotation_mode") | {None, 'default', 'anchor'} |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`text`](text_api#matplotlib.text.Text.set_text "matplotlib.text.Text.set_text") | object |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`transform_rotates_text`](text_api#matplotlib.text.Text.set_transform_rotates_text "matplotlib.text.Text.set_transform_rotates_text") | bool |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`usetex`](text_api#matplotlib.text.Text.set_usetex "matplotlib.text.Text.set_usetex") | bool or None |
| [`verticalalignment`](text_api#matplotlib.text.Text.set_verticalalignment "matplotlib.text.Text.set_verticalalignment") or va | {'bottom', 'baseline', 'center', 'center\_baseline', 'top'} |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`wrap`](text_api#matplotlib.text.Text.set_wrap "matplotlib.text.Text.set_wrap") | bool |
| [`x`](text_api#matplotlib.text.Text.set_x "matplotlib.text.Text.set_x") | float |
| [`y`](text_api#matplotlib.text.Text.set_y "matplotlib.text.Text.set_y") | float |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
*class*matplotlib.contour.ContourLabeler[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L76-L586)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Mixin to provide labelling capability to [`ContourSet`](#matplotlib.contour.ContourSet "matplotlib.contour.ContourSet").
add\_label(*x*, *y*, *rotation*, *lev*, *cvalue*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L454-L459)
Add contour label using [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") class.
add\_label\_clabeltext(*x*, *y*, *rotation*, *lev*, *cvalue*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L461-L470)
Add contour label using [`ClabelText`](#matplotlib.contour.ClabelText "matplotlib.contour.ClabelText") class.
add\_label\_near(*x*, *y*, *inline=True*, *inline\_spacing=5*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L472-L534)
Add a label near the point `(x, y)`.
Parameters:
**x, y**float
The approximate location of the label.
**inline**bool, default: True
If *True* remove the segment of the contour beneath the label.
**inline\_spacing**int, default: 5
Space in pixels to leave on each side of label when placing inline. This spacing will be exact for labels at locations where the contour is straight, less so for labels on curved contours.
**transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") or [`False`](https://docs.python.org/3/library/constants.html#False "(in Python v3.10)"), default: `self.axes.transData`
A transform applied to `(x, y)` before labeling. The default causes `(x, y)` to be interpreted as data coordinates. [`False`](https://docs.python.org/3/library/constants.html#False "(in Python v3.10)") is a synonym for [`IdentityTransform`](transformations#matplotlib.transforms.IdentityTransform "matplotlib.transforms.IdentityTransform"); i.e. `(x, y)` should be interpreted as display coordinates.
calc\_label\_rot\_and\_inline(*slc*, *ind*, *lw*, *lc=None*, *spacing=5*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L330-L418)
Calculate the appropriate label rotation given the linecontour coordinates in screen units, the index of the label location and the label width.
If *lc* is not None or empty, also break contours and compute inlining.
*spacing* is the empty space to leave around the label, in pixels.
Both tasks are done together to avoid calculating path lengths multiple times, which is relatively costly.
The method used here involves computing the path length along the contour in pixel coordinates and then looking approximately (label width / 2) away from central point to determine rotation and then to break contour if desired.
clabel(*levels=None*, *\**, *fontsize=None*, *inline=True*, *inline\_spacing=5*, *fmt=None*, *colors=None*, *use\_clabeltext=False*, *manual=False*, *rightside\_up=True*, *zorder=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L79-L238)
Label a contour plot.
Adds labels to line contours in this [`ContourSet`](#matplotlib.contour.ContourSet "matplotlib.contour.ContourSet") (which inherits from this mixin class).
Parameters:
**levels**array-like, optional
A list of level values, that should be labeled. The list must be a subset of `cs.levels`. If not given, all levels are labeled.
**fontsize**str or float, default: `[rcParams["font.size"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=font.size#matplotlibrc-sample)` (default: `10.0`)
Size in points or relative size e.g., 'smaller', 'x-large'. See [`Text.set_size`](text_api#matplotlib.text.Text.set_size "matplotlib.text.Text.set_size") for accepted string values.
**colors**color or colors or None, default: None
The label colors:
* If *None*, the color of each label matches the color of the corresponding contour.
* If one string color, e.g., *colors* = 'r' or *colors* = 'red', all labels will be plotted in this color.
* If a tuple of colors (string, float, rgb, etc), different labels will be plotted in different colors in the order specified.
**inline**bool, default: True
If `True` the underlying contour is removed where the label is placed.
**inline\_spacing**float, default: 5
Space in pixels to leave on each side of label when placing inline.
This spacing will be exact for labels at locations where the contour is straight, less so for labels on curved contours.
**fmt**[`Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter") or str or callable or dict, optional
How the levels are formatted:
* If a [`Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter"), it is used to format all levels at once, using its [`Formatter.format_ticks`](ticker_api#matplotlib.ticker.Formatter.format_ticks "matplotlib.ticker.Formatter.format_ticks") method.
* If a str, it is interpreted as a %-style format string.
* If a callable, it is called with one level at a time and should return the corresponding label.
* If a dict, it should directly map levels to labels.
The default is to use a standard [`ScalarFormatter`](ticker_api#matplotlib.ticker.ScalarFormatter "matplotlib.ticker.ScalarFormatter").
**manual**bool or iterable, default: False
If `True`, contour labels will be placed manually using mouse clicks. Click the first button near a contour to add a label, click the second button (or potentially both mouse buttons at once) to finish adding labels. The third button can be used to remove the last label added, but only if labels are not inline. Alternatively, the keyboard can be used to select label locations (enter to end label placement, delete or backspace act like the third mouse button, and any other key will select a label location).
*manual* can also be an iterable object of (x, y) tuples. Contour labels will be created as if mouse is clicked at each (x, y) position.
**rightside\_up**bool, default: True
If `True`, label rotations will always be plus or minus 90 degrees from level.
**use\_clabeltext**bool, default: False
If `True`, [`ClabelText`](#matplotlib.contour.ClabelText "matplotlib.contour.ClabelText") class (instead of [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")) is used to create labels. [`ClabelText`](#matplotlib.contour.ClabelText "matplotlib.contour.ClabelText") recalculates rotation angles of texts during the drawing time, therefore this can be used if aspect of the axes changes.
**zorder**float or None, default: `(2 + contour.get_zorder())`
zorder of the contour labels.
Returns:
labels
A list of [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") instances for the labels.
get\_label\_width(*lev*, *fmt*, *fsize*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L263-L274)
[*Deprecated*] Return the width of the label in points.
#### Notes
Deprecated since version 3.5.
get\_text(*lev*, *fmt*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L283-L294)
Get the text of the label.
labels(*inline*, *inline\_spacing*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L542-L586)
locate\_label(*linecontour*, *labelwidth*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L296-L328)
Find good place to draw a label (relatively flat part of the contour).
pop\_label(*index=-1*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L536-L540)
Defaults to removing last label, but any index can be supplied
print\_label(*linecontour*, *labelwidth*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L240-L243)
Return whether a contour is long enough to hold a label.
set\_label\_props(*label*, *text*, *color*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L276-L281)
Set the label properties - color, fontsize, text.
too\_close(*x*, *y*, *lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L245-L249)
Return whether a label is already near this location.
*class*matplotlib.contour.ContourSet(*ax*, *\*args*, *levels=None*, *filled=False*, *linewidths=None*, *linestyles=None*, *hatches=(None,)*, *alpha=None*, *origin=None*, *extent=None*, *cmap=None*, *colors=None*, *norm=None*, *vmin=None*, *vmax=None*, *extend='neither'*, *antialiased=None*, *nchunk=0*, *locator=None*, *transform=None*, *negative\_linestyles=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L653-L1390)
Bases: [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable"), [`ContourLabeler`](#matplotlib.contour.ContourLabeler "matplotlib.contour.ContourLabeler")
Store a set of contour lines or filled regions.
User-callable method: [`clabel`](_as_gen/matplotlib.axes.axes.clabel#matplotlib.axes.Axes.clabel "matplotlib.axes.Axes.clabel")
Parameters:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
**levels**[level0, level1, ..., leveln]
A list of floating point numbers indicating the contour levels.
**allsegs**[level0segs, level1segs, ...]
List of all the polygon segments for all the *levels*. For contour lines `len(allsegs) == len(levels)`, and for filled contour regions `len(allsegs) = len(levels)-1`. The lists should look like
```
level0segs = [polygon0, polygon1, ...]
polygon0 = [[x0, y0], [x1, y1], ...]
```
**allkinds**`None` or [level0kinds, level1kinds, ...]
Optional list of all the polygon vertex kinds (code types), as described and used in Path. This is used to allow multiply- connected paths such as holes within filled polygons. If not `None`, `len(allkinds) == len(allsegs)`. The lists should look like
```
level0kinds = [polygon0kinds, ...]
polygon0kinds = [vertexcode0, vertexcode1, ...]
```
If *allkinds* is not `None`, usually all polygons for a particular contour level are grouped together so that `level0segs = [polygon0]` and `level0kinds = [polygon0kinds]`.
**\*\*kwargs**
Keyword arguments are as described in the docstring of [`contour`](_as_gen/matplotlib.axes.axes.contour#matplotlib.axes.Axes.contour "matplotlib.axes.Axes.contour").
Attributes:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The Axes object in which the contours are drawn.
**collections**[`silent_list`](cbook_api#matplotlib.cbook.silent_list "matplotlib.cbook.silent_list") of [`PathCollection`](collections_api#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection")s
The [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s representing the contour. This is a list of [`PathCollection`](collections_api#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection")s for both line and filled contours.
**levels**array
The values of the contour levels.
**layers**array
Same as levels for line contours; half-way between levels for filled contours. See `ContourSet._process_colors`.
Draw contour lines or filled regions, depending on whether keyword arg *filled* is `False` (default) or `True`.
Call signature:
```
ContourSet(ax, levels, allsegs, [allkinds], **kwargs)
```
Parameters:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") object to draw on.
**levels**[level0, level1, ..., leveln]
A list of floating point numbers indicating the contour levels.
**allsegs**[level0segs, level1segs, ...]
List of all the polygon segments for all the *levels*. For contour lines `len(allsegs) == len(levels)`, and for filled contour regions `len(allsegs) = len(levels)-1`. The lists should look like
```
level0segs = [polygon0, polygon1, ...]
polygon0 = [[x0, y0], [x1, y1], ...]
```
**allkinds**[level0kinds, level1kinds, ...], optional
Optional list of all the polygon vertex kinds (code types), as described and used in Path. This is used to allow multiply- connected paths such as holes within filled polygons. If not `None`, `len(allkinds) == len(allsegs)`. The lists should look like
```
level0kinds = [polygon0kinds, ...]
polygon0kinds = [vertexcode0, vertexcode1, ...]
```
If *allkinds* is not `None`, usually all polygons for a particular contour level are grouped together so that `level0segs = [polygon0]` and `level0kinds = [polygon0kinds]`.
**\*\*kwargs**
Keyword arguments are as described in the docstring of [`contour`](_as_gen/matplotlib.axes.axes.contour#matplotlib.axes.Axes.contour "matplotlib.axes.Axes.contour").
changed()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L1074-L1100)
Call this whenever the mappable is changed to notify all the callbackSM listeners to the 'changed' signal.
find\_nearest\_contour(*x*, *y*, *indices=None*, *pixel=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L1314-L1390)
Find the point in the contour plot that is closest to `(x, y)`.
This method does not support filled contours.
Parameters:
**x, y**float
The reference point.
**indices**list of int or None, default: None
Indices of contour levels to consider. If None (the default), all levels are considered.
**pixel**bool, default: True
If *True*, measure distance in pixel (screen) space, which is useful for manual contour labeling; else, measure distance in axes space.
Returns:
**contour**[`Collection`](collections_api#matplotlib.collections.Collection "matplotlib.collections.Collection")
The contour that is closest to `(x, y)`.
**segment**int
The index of the [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") in *contour* that is closest to `(x, y)`.
**index**int
The index of the path segment in *segment* that is closest to `(x, y)`.
**xmin, ymin**float
The point in the contour plot that is closest to `(x, y)`.
**d2**float
The squared distance from `(xmin, ymin)` to `(x, y)`.
get\_alpha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L1302-L1304)
Return alpha to be applied to all ContourSet artists.
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L912-L919)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this ContourSet.
legend\_elements(*variable\_name='x'*, *str\_format=<class 'str'>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L929-L987)
Return a list of artists and labels suitable for passing through to [`legend`](_as_gen/matplotlib.axes.axes.legend#matplotlib.axes.Axes.legend "matplotlib.axes.Axes.legend") which represent this ContourSet.
The labels have the form "0 < x <= 1" stating the data ranges which the artists represent.
Parameters:
**variable\_name**str
The string used inside the inequality used on the labels.
**str\_format**function: float -> str
Function used to format the numbers in the labels.
Returns:
**artists**list[[`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")]
A list of the artists.
**labels**list[str]
A list of the labels.
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L1306-L1312)
Set the alpha blending value for all ContourSet artists. *alpha* must be between 0 (transparent) and 1 (opaque).
*class*matplotlib.contour.QuadContourSet(*ax*, *\*args*, *levels=None*, *filled=False*, *linewidths=None*, *linestyles=None*, *hatches=(None,)*, *alpha=None*, *origin=None*, *extent=None*, *cmap=None*, *colors=None*, *norm=None*, *vmin=None*, *vmax=None*, *extend='neither'*, *antialiased=None*, *nchunk=0*, *locator=None*, *transform=None*, *negative\_linestyles=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/contour.py#L1393-L1571)
Bases: [`ContourSet`](#matplotlib.contour.ContourSet "matplotlib.contour.ContourSet")
Create and store a set of contour lines or filled regions.
This class is typically not instantiated directly by the user but by [`contour`](_as_gen/matplotlib.axes.axes.contour#matplotlib.axes.Axes.contour "matplotlib.axes.Axes.contour") and [`contourf`](_as_gen/matplotlib.axes.axes.contourf#matplotlib.axes.Axes.contourf "matplotlib.axes.Axes.contourf").
Attributes:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The Axes object in which the contours are drawn.
**collections**[`silent_list`](cbook_api#matplotlib.cbook.silent_list "matplotlib.cbook.silent_list") of [`PathCollection`](collections_api#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection")s
The [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s representing the contour. This is a list of [`PathCollection`](collections_api#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection")s for both line and filled contours.
**levels**array
The values of the contour levels.
**layers**array
Same as levels for line contours; half-way between levels for filled contours. See `ContourSet._process_colors`.
Draw contour lines or filled regions, depending on whether keyword arg *filled* is `False` (default) or `True`.
Call signature:
```
ContourSet(ax, levels, allsegs, [allkinds], **kwargs)
```
Parameters:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") object to draw on.
**levels**[level0, level1, ..., leveln]
A list of floating point numbers indicating the contour levels.
**allsegs**[level0segs, level1segs, ...]
List of all the polygon segments for all the *levels*. For contour lines `len(allsegs) == len(levels)`, and for filled contour regions `len(allsegs) = len(levels)-1`. The lists should look like
```
level0segs = [polygon0, polygon1, ...]
polygon0 = [[x0, y0], [x1, y1], ...]
```
**allkinds**[level0kinds, level1kinds, ...], optional
Optional list of all the polygon vertex kinds (code types), as described and used in Path. This is used to allow multiply- connected paths such as holes within filled polygons. If not `None`, `len(allkinds) == len(allsegs)`. The lists should look like
```
level0kinds = [polygon0kinds, ...]
polygon0kinds = [vertexcode0, vertexcode1, ...]
```
If *allkinds* is not `None`, usually all polygons for a particular contour level are grouped together so that `level0segs = [polygon0]` and `level0kinds = [polygon0kinds]`.
**\*\*kwargs**
Keyword arguments are as described in the docstring of [`contour`](_as_gen/matplotlib.axes.axes.contour#matplotlib.axes.Axes.contour "matplotlib.axes.Axes.contour").
| programming_docs |
matplotlib backend_svg backend\_svg
============
matplotlib.backends.backend\_svg.FigureCanvas[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L1311-L1376)
alias of [`FigureCanvasSVG`](#matplotlib.backends.backend_svg.FigureCanvasSVG "matplotlib.backends.backend_svg.FigureCanvasSVG")
*class*matplotlib.backends.backend\_svg.FigureCanvasSVG(*figure=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L1311-L1376)
Bases: [`FigureCanvasBase`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase "matplotlib.backend_bases.FigureCanvasBase")
draw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L1374-L1376)
Render the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure").
This method must walk the artist tree, even if no output is produced, because it triggers deferred work that users may want to access before saving output to disk. For example computing limits, auto-limits, and tick values.
filetypes*={'svg': 'Scalable Vector Graphics', 'svgz': 'Scalable Vector Graphics'}*
fixed\_dpi*=72*
get\_default\_filetype()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L1371-L1372)
Return the default savefig file format as specified in `[rcParams["savefig.format"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=savefig.format#matplotlibrc-sample)` (default: `'png'`).
The returned string does not include a period. This method is overridden in backends that only support a single file type.
print\_svg(*filename*, *\*args*, *bbox\_inches\_restore=None*, *metadata=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L1317-L1363)
Parameters:
**filename**str or path-like or file-like
Output target; if a string, a file will be opened for writing.
**metadata**dict[str, Any], optional
Metadata in the SVG file defined as key-value pairs of strings, datetimes, or lists of strings, e.g., `{'Creator': 'My software',
'Contributor': ['Me', 'My Friend'], 'Title': 'Awesome'}`.
The standard keys and their value types are:
* *str*: `'Coverage'`, `'Description'`, `'Format'`, `'Identifier'`, `'Language'`, `'Relation'`, `'Source'`, `'Title'`, and `'Type'`.
* *str* or *list of str*: `'Contributor'`, `'Creator'`, `'Keywords'`, `'Publisher'`, and `'Rights'`.
* *str*, *date*, *datetime*, or *tuple* of same: `'Date'`. If a non-*str*, then it will be formatted as ISO 8601.
Values have been predefined for `'Creator'`, `'Date'`, `'Format'`, and `'Type'`. They can be removed by setting them to [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)").
Information is encoded as [Dublin Core Metadata](https://www.dublincore.org/specifications/dublin-core/).
print\_svgz(*filename*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L1365-L1369)
*class*matplotlib.backends.backend\_svg.RendererSVG(*width*, *height*, *svgwriter*, *basename=None*, *image\_dpi=72*, *\**, *metadata=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L318-L1308)
Bases: [`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase")
close\_group(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L671-L673)
Close a grouping element with label *s*.
Only used by the SVG renderer.
draw\_gouraud\_triangle(*gc*, *points*, *colors*, *trans*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L802-L932)
Draw a Gouraud-shaded triangle.
Parameters:
**gc**[`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
The graphics context.
**points**(3, 2) array-like
Array of (x, y) points for the triangle.
**colors**(3, 4) array-like
RGBA colors for each point of the triangle.
**transform**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
An affine transform to apply to the points.
draw\_gouraud\_triangles(*gc*, *triangles\_array*, *colors\_array*, *transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L934-L940)
Draw a series of Gouraud triangles.
Parameters:
**points**(N, 3, 2) array-like
Array of *N* (x, y) points for the triangles.
**colors**(N, 3, 4) array-like
Array of *N* RGBA colors for each point of the triangles.
**transform**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
An affine transform to apply to the points.
draw\_image(*gc*, *x*, *y*, *im*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L949-L1026)
Draw an RGBA image.
Parameters:
**gc**[`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
A graphics context with clipping information.
**x**scalar
The distance in physical units (i.e., dots or pixels) from the left hand side of the canvas.
**y**scalar
The distance in physical units (i.e., dots or pixels) from the bottom side of the canvas.
**im**(N, M, 4) array-like of np.uint8
An array of RGBA pixels.
**transform**[`matplotlib.transforms.Affine2DBase`](transformations#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")
If and only if the concrete backend is written such that [`option_scale_image`](#matplotlib.backends.backend_svg.RendererSVG.option_scale_image "matplotlib.backends.backend_svg.RendererSVG.option_scale_image") returns `True`, an affine transformation (i.e., an [`Affine2DBase`](transformations#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")) *may* be passed to [`draw_image`](#matplotlib.backends.backend_svg.RendererSVG.draw_image "matplotlib.backends.backend_svg.RendererSVG.draw_image"). The translation vector of the transformation is given in physical units (i.e., dots or pixels). Note that the transformation does not override *x* and *y*, and has to be applied *before* translating the result by *x* and *y* (this can be accomplished by adding *x* and *y* to the translation vector defined by *transform*).
draw\_markers(*gc*, *marker\_path*, *marker\_trans*, *path*, *trans*, *rgbFace=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L705-L742)
Draw a marker at each of *path*'s vertices (excluding control points).
The base (fallback) implementation makes multiple calls to [`draw_path`](#matplotlib.backends.backend_svg.RendererSVG.draw_path "matplotlib.backends.backend_svg.RendererSVG.draw_path"). Backends may want to override this method in order to draw the marker only once and reuse it multiple times.
Parameters:
**gc**[`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
The graphics context.
**marker\_trans**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
An affine transform applied to the marker.
**trans**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
An affine transform applied to the path.
draw\_path(*gc*, *path*, *transform*, *rgbFace=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L689-L703)
Draw a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") instance using the given affine transform.
draw\_path\_collection(*gc*, *master\_transform*, *paths*, *all\_transforms*, *offsets*, *offset\_trans*, *facecolors*, *edgecolors*, *linewidths*, *linestyles*, *antialiaseds*, *urls*, *offset\_position*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L744-L800)
Draw a collection of *paths*.
Each path is first transformed by the corresponding entry in *all\_transforms* (a list of (3, 3) matrices) and then by *master\_transform*. They are then translated by the corresponding entry in *offsets*, which has been first transformed by *offset\_trans*.
*facecolors*, *edgecolors*, *linewidths*, *linestyles*, and *antialiased* are lists that set the corresponding properties.
*offset\_position* is unused now, but the argument is kept for backwards compatibility.
The base (fallback) implementation makes multiple calls to [`draw_path`](#matplotlib.backends.backend_svg.RendererSVG.draw_path "matplotlib.backends.backend_svg.RendererSVG.draw_path"). Backends may want to override this in order to render each set of path data only once, and then reference that path multiple times with the different offsets, colors, styles etc. The generator methods `_iter_collection_raw_paths` and `_iter_collection` are provided to help with (and standardize) the implementation across backends. It is highly recommended to use those generators, so that changes to the behavior of [`draw_path_collection`](#matplotlib.backends.backend_svg.RendererSVG.draw_path_collection "matplotlib.backends.backend_svg.RendererSVG.draw_path_collection") can be made globally.
draw\_tex(*gc*, *x*, *y*, *s*, *prop*, *angle*, *\**, *mtext=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L1271-L1273)
draw\_text(*gc*, *x*, *y*, *s*, *prop*, *angle*, *ismath=False*, *mtext=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L1275-L1296)
Draw a text instance.
Parameters:
**gc**[`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
The graphics context.
**x**float
The x location of the text in display coords.
**y**float
The y location of the text baseline in display coords.
**s**str
The text string.
**prop**[`matplotlib.font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties")
The font properties.
**angle**float
The rotation angle in degrees anti-clockwise.
**mtext**[`matplotlib.text.Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")
The original text object to be rendered.
#### Notes
**Note for backend implementers:**
When you are trying to determine if you have gotten your bounding box right (which is what enables the text layout/alignment to work properly), it helps to change the line in text.py:
```
if 0: bbox_artist(self, renderer)
```
to if 1, and then the actual bounding box will be plotted along with your text.
finalize()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L357-L361)
flipy()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L1298-L1300)
Return whether y values increase from top to bottom.
Note that this only affects drawing of texts.
get\_canvas\_width\_height()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L1302-L1304)
Return the canvas width and height in display coords.
get\_image\_magnification()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L946-L947)
Get the factor by which to magnify images passed to [`draw_image`](#matplotlib.backends.backend_svg.RendererSVG.draw_image "matplotlib.backends.backend_svg.RendererSVG.draw_image"). Allows a backend to have images at a different resolution to other artists.
get\_text\_width\_height\_descent(*s*, *prop*, *ismath*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L1306-L1308)
Get the width, height, and descent (offset from the bottom to the baseline), in display coords, of the string *s* with [`FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") *prop*.
open\_group(*s*, *gid=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L663-L669)
Open a grouping element with label *s* and *gid* (if set) as id.
Only used by the SVG renderer.
option\_image\_nocomposite()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L675-L677)
Return whether image composition by Matplotlib should be skipped.
Raster backends should usually return False (letting the C-level rasterizer take care of image composition); vector backends should usually return `not rcParams["image.composite_image"]`.
option\_scale\_image()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L942-L944)
Return whether arbitrary affine transformations in [`draw_image`](#matplotlib.backends.backend_svg.RendererSVG.draw_image "matplotlib.backends.backend_svg.RendererSVG.draw_image") are supported (True for most vector backends).
*class*matplotlib.backends.backend\_svg.XMLWriter(*file*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L127-L267)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Parameters:
**file**writable text file-like object
close(*id*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L241-L252)
Close open elements, up to (and including) the element identified by the given identifier.
Parameters:
**id**
Element identifier, as returned by the [`start()`](#matplotlib.backends.backend_svg.XMLWriter.start "matplotlib.backends.backend_svg.XMLWriter.start") method.
comment(*comment*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L189-L200)
Add a comment to the output stream.
Parameters:
**comment**str
Comment text.
data(*text*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L202-L211)
Add character data to the output stream.
Parameters:
**text**str
Character data.
element(*tag*, *text=None*, *attrib={}*, *\*\*extra*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L254-L263)
Add an entire element. This is the same as calling [`start()`](#matplotlib.backends.backend_svg.XMLWriter.start "matplotlib.backends.backend_svg.XMLWriter.start"), [`data()`](#matplotlib.backends.backend_svg.XMLWriter.data "matplotlib.backends.backend_svg.XMLWriter.data"), and [`end()`](#matplotlib.backends.backend_svg.XMLWriter.end "matplotlib.backends.backend_svg.XMLWriter.end") in sequence. The *text* argument can be omitted.
end(*tag=None*, *indent=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L213-L239)
Close the current element (opened by the most recent call to [`start()`](#matplotlib.backends.backend_svg.XMLWriter.start "matplotlib.backends.backend_svg.XMLWriter.start")).
Parameters:
**tag**
Element tag. If given, the tag must match the start tag. If omitted, the current element is closed.
flush()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L265-L267)
Flush the output stream.
start(*tag*, *attrib={}*, *\*\*extra*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L156-L187)
Open a new element. Attributes can be given as keyword arguments, or as a string/string dictionary. The method returns an opaque identifier that can be passed to the [`close()`](#matplotlib.backends.backend_svg.XMLWriter.close "matplotlib.backends.backend_svg.XMLWriter.close") method, to close all open elements up to and including this one.
Parameters:
**tag**
Element tag.
**attrib**
Attribute dictionary. Alternatively, attributes can be given as keyword arguments.
Returns:
An element identifier.
matplotlib.backends.backend\_svg.escape\_attrib(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L94-L96)
[*Deprecated*]
#### Notes
Deprecated since version 3.6: Use a vendored copy of \_escape\_attrib instead.
matplotlib.backends.backend\_svg.escape\_cdata(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L69-L71)
[*Deprecated*]
#### Notes
Deprecated since version 3.6: Use a vendored copy of \_escape\_cdata instead.
matplotlib.backends.backend\_svg.escape\_comment(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L84-L86)
[*Deprecated*]
#### Notes
Deprecated since version 3.6: Use a vendored copy of \_escape\_comment instead.
matplotlib.backends.backend\_svg.generate\_css(*attrib=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L293-L295)
[*Deprecated*]
#### Notes
Deprecated since version 3.6:
matplotlib.backends.backend\_svg.generate\_transform(*transform\_list=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L284-L286)
[*Deprecated*]
#### Notes
Deprecated since version 3.6:
matplotlib.backends.backend\_svg.short\_float\_fmt(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_svg.py#L114-L116)
[*Deprecated*]
#### Notes
Deprecated since version 3.6: Use a vendored copy of \_short\_float\_fmt instead.
matplotlib matplotlib.colors matplotlib.colors
=================
Note
The Color [tutorials](https://matplotlib.org/stable/tutorials/colors/index.html#tutorials-colors) and [examples](https://matplotlib.org/stable/gallery/color/index.html#color-examples) demonstrate how to set colors and colormaps. You may want to read those instead.
A module for converting numbers or color arguments to *RGB* or *RGBA*.
*RGB* and *RGBA* are sequences of, respectively, 3 or 4 floats in the range 0-1.
This module includes functions and classes for color specification conversions, and for mapping numbers to colors in a 1-D array of colors called a colormap.
Mapping data onto colors using a colormap typically involves two steps: a data array is first mapped onto the range 0-1 using a subclass of [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize"), then this number is mapped to a color using a subclass of [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"). Two subclasses of [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") provided here: [`LinearSegmentedColormap`](_as_gen/matplotlib.colors.linearsegmentedcolormap#matplotlib.colors.LinearSegmentedColormap "matplotlib.colors.LinearSegmentedColormap"), which uses piecewise-linear interpolation to define colormaps, and [`ListedColormap`](_as_gen/matplotlib.colors.listedcolormap#matplotlib.colors.ListedColormap "matplotlib.colors.ListedColormap"), which makes a colormap from a list of colors.
See also
[Creating Colormaps in Matplotlib](https://matplotlib.org/stable/tutorials/colors/colormap-manipulation.html) for examples of how to make colormaps and
[Choosing Colormaps in Matplotlib](https://matplotlib.org/stable/tutorials/colors/colormaps.html) for a list of built-in colormaps.
[Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html) for more details about data normalization
More colormaps are available at [palettable](https://jiffyclub.github.io/palettable/).
The module also provides functions for checking whether an object can be interpreted as a color ([`is_color_like`](_as_gen/matplotlib.colors.is_color_like#matplotlib.colors.is_color_like "matplotlib.colors.is_color_like")), for converting such an object to an RGBA tuple ([`to_rgba`](_as_gen/matplotlib.colors.to_rgba#matplotlib.colors.to_rgba "matplotlib.colors.to_rgba")) or to an HTML-like hex string in the "#rrggbb" format ([`to_hex`](_as_gen/matplotlib.colors.to_hex#matplotlib.colors.to_hex "matplotlib.colors.to_hex")), and a sequence of colors to an (n, 4) RGBA array ([`to_rgba_array`](_as_gen/matplotlib.colors.to_rgba_array#matplotlib.colors.to_rgba_array "matplotlib.colors.to_rgba_array")). Caching is used for efficiency.
Colors that Matplotlib recognizes are listed at [Specifying Colors](https://matplotlib.org/stable/tutorials/colors/colors.html).
Color norms
-----------
| | |
| --- | --- |
| [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize")([vmin, vmax, clip]) | A class which, when called, linearly normalizes data into the `[0.0, 1.0]` interval. |
| [`NoNorm`](_as_gen/matplotlib.colors.nonorm#matplotlib.colors.NoNorm "matplotlib.colors.NoNorm")([vmin, vmax, clip]) | Dummy replacement for [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize"), for the case where we want to use indices directly in a [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable"). |
| [`AsinhNorm`](_as_gen/matplotlib.colors.asinhnorm#matplotlib.colors.AsinhNorm "matplotlib.colors.AsinhNorm")([linear\_width, vmin, vmax, clip]) | The inverse hyperbolic sine scale is approximately linear near the origin, but becomes logarithmic for larger positive or negative values. |
| [`BoundaryNorm`](_as_gen/matplotlib.colors.boundarynorm#matplotlib.colors.BoundaryNorm "matplotlib.colors.BoundaryNorm")(boundaries, ncolors[, clip, extend]) | Generate a colormap index based on discrete intervals. |
| [`CenteredNorm`](_as_gen/matplotlib.colors.centerednorm#matplotlib.colors.CenteredNorm "matplotlib.colors.CenteredNorm")([vcenter, halfrange, clip]) | Normalize symmetrical data around a center (0 by default). |
| [`FuncNorm`](_as_gen/matplotlib.colors.funcnorm#matplotlib.colors.FuncNorm "matplotlib.colors.FuncNorm")(functions[, vmin, vmax, clip]) | Arbitrary normalization using functions for the forward and inverse. |
| [`LogNorm`](_as_gen/matplotlib.colors.lognorm#matplotlib.colors.LogNorm "matplotlib.colors.LogNorm")([vmin, vmax, clip]) | Normalize a given value to the 0-1 range on a log scale. |
| [`PowerNorm`](_as_gen/matplotlib.colors.powernorm#matplotlib.colors.PowerNorm "matplotlib.colors.PowerNorm")(gamma[, vmin, vmax, clip]) | Linearly map a given value to the 0-1 range and then apply a power-law normalization over that range. |
| [`SymLogNorm`](_as_gen/matplotlib.colors.symlognorm#matplotlib.colors.SymLogNorm "matplotlib.colors.SymLogNorm")(linthresh[, linscale, vmin, ...]) | The symmetrical logarithmic scale is logarithmic in both the positive and negative directions from the origin. |
| [`TwoSlopeNorm`](_as_gen/matplotlib.colors.twoslopenorm#matplotlib.colors.TwoSlopeNorm "matplotlib.colors.TwoSlopeNorm")(vcenter[, vmin, vmax]) | Normalize data with a set center. |
Colormaps
---------
| | |
| --- | --- |
| [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap")(name[, N]) | Baseclass for all scalar to RGBA mappings. |
| [`LinearSegmentedColormap`](_as_gen/matplotlib.colors.linearsegmentedcolormap#matplotlib.colors.LinearSegmentedColormap "matplotlib.colors.LinearSegmentedColormap")(name, segmentdata[, ...]) | Colormap objects based on lookup tables using linear segments. |
| [`ListedColormap`](_as_gen/matplotlib.colors.listedcolormap#matplotlib.colors.ListedColormap "matplotlib.colors.ListedColormap")(colors[, name, N]) | Colormap object generated from a list of colors. |
Other classes
-------------
| | |
| --- | --- |
| [`ColorSequenceRegistry`](_as_gen/matplotlib.colors.colorsequenceregistry#matplotlib.colors.ColorSequenceRegistry "matplotlib.colors.ColorSequenceRegistry")() | Container for sequences of colors that are known to Matplotlib by name. |
| [`LightSource`](_as_gen/matplotlib.colors.lightsource#matplotlib.colors.LightSource "matplotlib.colors.LightSource")([azdeg, altdeg, hsv\_min\_val, ...]) | Create a light source coming from the specified azimuth and elevation. |
Functions
---------
| | |
| --- | --- |
| [`from_levels_and_colors`](_as_gen/matplotlib.colors.from_levels_and_colors#matplotlib.colors.from_levels_and_colors "matplotlib.colors.from_levels_and_colors")(levels, colors[, extend]) | A helper routine to generate a cmap and a norm instance which behave similar to contourf's levels and colors arguments. |
| [`hsv_to_rgb`](_as_gen/matplotlib.colors.hsv_to_rgb#matplotlib.colors.hsv_to_rgb "matplotlib.colors.hsv_to_rgb")(hsv) | Convert hsv values to rgb. |
| [`rgb_to_hsv`](_as_gen/matplotlib.colors.rgb_to_hsv#matplotlib.colors.rgb_to_hsv "matplotlib.colors.rgb_to_hsv")(arr) | Convert float rgb values (in the range [0, 1]), in a numpy array to hsv values. |
| [`to_hex`](_as_gen/matplotlib.colors.to_hex#matplotlib.colors.to_hex "matplotlib.colors.to_hex")(c[, keep\_alpha]) | Convert *c* to a hex color. |
| [`to_rgb`](_as_gen/matplotlib.colors.to_rgb#matplotlib.colors.to_rgb "matplotlib.colors.to_rgb")(c) | Convert *c* to an RGB color, silently dropping the alpha channel. |
| [`to_rgba`](_as_gen/matplotlib.colors.to_rgba#matplotlib.colors.to_rgba "matplotlib.colors.to_rgba")(c[, alpha]) | Convert *c* to an RGBA color. |
| [`to_rgba_array`](_as_gen/matplotlib.colors.to_rgba_array#matplotlib.colors.to_rgba_array "matplotlib.colors.to_rgba_array")(c[, alpha]) | Convert *c* to a (n, 4) array of RGBA colors. |
| [`is_color_like`](_as_gen/matplotlib.colors.is_color_like#matplotlib.colors.is_color_like "matplotlib.colors.is_color_like")(c) | Return whether *c* can be interpreted as an RGB(A) color. |
| [`same_color`](_as_gen/matplotlib.colors.same_color#matplotlib.colors.same_color "matplotlib.colors.same_color")(c1, c2) | Return whether the colors *c1* and *c2* are the same. |
| [`get_named_colors_mapping`](_as_gen/matplotlib.colors.get_named_colors_mapping#matplotlib.colors.get_named_colors_mapping "matplotlib.colors.get_named_colors_mapping")() | Return the global mapping of names to named colors. |
| [`make_norm_from_scale`](_as_gen/matplotlib.colors.make_norm_from_scale#matplotlib.colors.make_norm_from_scale "matplotlib.colors.make_norm_from_scale")(scale\_cls[, ...]) | Decorator for building a [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") subclass from a [`ScaleBase`](scale_api#matplotlib.scale.ScaleBase "matplotlib.scale.ScaleBase") subclass. |
| programming_docs |
matplotlib API Reference API Reference
=============
When using the library you will typically create [Figure](figure_api) and [Axes](axes_api) objects and call their methods to add content and modify the appearance.
* [`matplotlib.figure`](figure_api#module-matplotlib.figure "matplotlib.figure"): axes creation, figure-level content
* [`matplotlib.axes`](axes_api#module-matplotlib.axes "matplotlib.axes"): most plotting methods, Axes labels, access to axis styling, etc.
Example: We create a Figure `fig` and Axes `ax`. Then we call methods on them to plot data, add axis labels and a figure title.
```
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(0, 4, 0.05)
y = np.sin(x*np.pi)
fig, ax = plt.subplots(figsize=(3,2), constrained_layout=True)
ax.plot(x, y)
ax.set_xlabel('t [s]')
ax.set_ylabel('S [V]')
ax.set_title('Sine wave')
fig.set_facecolor('lightsteelblue')
```
([Source code](index-1.py), [png](index-1.png))
Usage patterns
--------------
Below we describe several common approaches to plotting with Matplotlib. See [Matplotlib Application Interfaces (APIs)](https://matplotlib.org/stable/users/explain/api_interfaces.html#api-interfaces) for an explanation of the trade-offs between the supported user APIs.
### The explicit API
At its core, Matplotlib is an object-oriented library. We recommend directly working with the objects if you need more control and customization of your plots.
In many cases you will create a [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") and one or more [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") using [`pyplot.subplots`](_as_gen/matplotlib.pyplot.subplots#matplotlib.pyplot.subplots "matplotlib.pyplot.subplots") and from then on only work on these objects. However, it's also possible to create [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")s explicitly (e.g. when including them in GUI applications).
Further reading:
* [`matplotlib.axes.Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") and [`matplotlib.figure.Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") for an overview of plotting functions.
* Most of the [examples](https://matplotlib.org/stable/gallery/index.html#examples-index) use the object-oriented approach (except for the pyplot section)
### The implicit API
[`matplotlib.pyplot`](pyplot_summary#module-matplotlib.pyplot "matplotlib.pyplot") is a collection of functions that make Matplotlib work like MATLAB. Each pyplot function makes some change to a figure: e.g., creates a figure, creates a plotting area in a figure, plots some lines in a plotting area, decorates the plot with labels, etc.
[`pyplot`](pyplot_summary#module-matplotlib.pyplot "matplotlib.pyplot") is mainly intended for interactive plots and simple cases of programmatic plot generation.
Further reading:
* The [`matplotlib.pyplot`](pyplot_summary#module-matplotlib.pyplot "matplotlib.pyplot") function reference
* [Pyplot tutorial](https://matplotlib.org/stable/tutorials/introductory/pyplot.html)
* [Pyplot examples](https://matplotlib.org/stable/gallery/pyplots/index.html#pyplots-examples)
### The pylab API (discouraged)
Warning
Since heavily importing into the global namespace may result in unexpected behavior, the use of pylab is strongly discouraged. Use [`matplotlib.pyplot`](pyplot_summary#module-matplotlib.pyplot "matplotlib.pyplot") instead.
[`pylab`](#module-pylab "pylab") is a module that includes [`matplotlib.pyplot`](pyplot_summary#module-matplotlib.pyplot "matplotlib.pyplot"), [`numpy`](https://numpy.org/doc/stable/reference/index.html#module-numpy "(in NumPy v1.23)"), [`numpy.fft`](https://numpy.org/doc/stable/reference/routines.fft.html#module-numpy.fft "(in NumPy v1.23)"), [`numpy.linalg`](https://numpy.org/doc/stable/reference/routines.linalg.html#module-numpy.linalg "(in NumPy v1.23)"), [`numpy.random`](https://numpy.org/doc/stable/reference/random/index.html#module-numpy.random "(in NumPy v1.23)"), and some additional functions, all within a single namespace. Its original purpose was to mimic a MATLAB-like way of working by importing all functions into the global namespace. This is considered bad style nowadays.
Modules
-------
Alphabetical list of modules:
* [`matplotlib`](matplotlib_configuration_api)
* [`matplotlib.afm`](afm_api)
* [`matplotlib.animation`](animation_api)
* [`matplotlib.artist`](artist_api)
* [`matplotlib.axes`](axes_api)
* [`matplotlib.axis`](axis_api)
* [`matplotlib.backend_bases`](backend_bases_api)
* [`matplotlib.backend_managers`](backend_managers_api)
* [`matplotlib.backend_tools`](backend_tools_api)
* [`matplotlib.backends`](index_backend_api)
* [`matplotlib.bezier`](bezier_api)
* [`matplotlib.blocking_input`](blocking_input_api)
* [`matplotlib.category`](category_api)
* [`matplotlib.cbook`](cbook_api)
* [`matplotlib.cm`](cm_api)
* [`matplotlib.collections`](collections_api)
* [`matplotlib.colorbar`](colorbar_api)
* [`matplotlib.colors`](colors_api)
* [`matplotlib.container`](container_api)
* [`matplotlib.contour`](contour_api)
* [`matplotlib.dates`](dates_api)
* [`matplotlib.docstring`](docstring_api)
* [`matplotlib.dviread`](dviread)
* [`matplotlib.figure`](figure_api)
* [`matplotlib.font_manager`](font_manager_api)
* [`matplotlib.fontconfig_pattern`](fontconfig_pattern_api)
* [`matplotlib.ft2font`](ft2font)
* [`matplotlib.gridspec`](gridspec_api)
* [`matplotlib.hatch`](hatch_api)
* [`matplotlib.image`](image_api)
* [`matplotlib.layout_engine`](layout_engine_api)
* [`matplotlib.legend`](legend_api)
* [`matplotlib.legend_handler`](legend_handler_api)
* [`matplotlib.lines`](lines_api)
* [`matplotlib.markers`](markers_api)
* [`matplotlib.mathtext`](mathtext_api)
* [`matplotlib.mlab`](mlab_api)
* [`matplotlib.offsetbox`](offsetbox_api)
* [`matplotlib.patches`](patches_api)
* [`matplotlib.path`](path_api)
* [`matplotlib.patheffects`](patheffects_api)
* [`matplotlib.pyplot`](pyplot_summary)
* [`matplotlib.projections`](projections_api)
* [`matplotlib.quiver`](quiver_api)
* [`matplotlib.rcsetup`](rcsetup_api)
* [`matplotlib.sankey`](sankey_api)
* [`matplotlib.scale`](scale_api)
* [`matplotlib.sphinxext.mathmpl`](sphinxext_mathmpl_api)
* [`matplotlib.sphinxext.plot_directive`](sphinxext_plot_directive_api)
* [`matplotlib.spines`](spines_api)
* [`matplotlib.style`](style_api)
* [`matplotlib.table`](table_api)
* [`matplotlib.testing`](testing_api)
* [`matplotlib.text`](text_api)
* [`matplotlib.texmanager`](texmanager_api)
* [`matplotlib.textpath`](textpath_api)
* [`matplotlib.ticker`](ticker_api)
* [`matplotlib.tight_bbox`](tight_bbox_api)
* [`matplotlib.tight_layout`](tight_layout_api)
* [`matplotlib.transforms`](transformations)
* [`matplotlib.tri`](tri_api)
* [`matplotlib.type1font`](type1font)
* [`matplotlib.units`](units_api)
* [`matplotlib.widgets`](widgets_api)
* [`matplotlib._api`](_api_api)
* [`matplotlib._enums`](_enums_api)
* [`mpl_toolkits.mplot3d`](toolkits/mplot3d)
* [`mpl_toolkits.axes_grid1`](toolkits/axes_grid1)
* [`mpl_toolkits.axisartist`](toolkits/axisartist)
matplotlib matplotlib.axis matplotlib.axis
===============
Table of Contents
* [Inheritance](#inheritance)
* [`Axis` objects](#axis-objects)
+ [Formatters and Locators](#formatters-and-locators)
+ [Axis Label](#axis-label)
+ [Ticks, tick labels and Offset text](#ticks-tick-labels-and-offset-text)
+ [Data and view intervals](#data-and-view-intervals)
+ [Rendering helpers](#rendering-helpers)
+ [Interactive](#interactive)
+ [Units](#units)
+ [XAxis Specific](#xaxis-specific)
+ [YAxis Specific](#yaxis-specific)
+ [Other](#other)
+ [Discouraged](#discouraged)
* [`Tick` objects](#tick-objects)
Classes for the ticks and x and y axis.
Inheritance
-----------
`Axis` objects
---------------
*class*matplotlib.axis.Axis(*axes*, *\**, *pickradius=15*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L609-L2151)
Base class for [`XAxis`](#matplotlib.axis.XAxis "matplotlib.axis.XAxis") and [`YAxis`](#matplotlib.axis.YAxis "matplotlib.axis.YAxis").
Attributes:
**isDefault\_label**bool
[`axes`](_as_gen/matplotlib.axis.axis.axes#matplotlib.axis.Axis.axes "matplotlib.axis.Axis.axes")[`matplotlib.axes.Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance the artist resides in, or *None*.
**major**[`matplotlib.axis.Ticker`](#matplotlib.axis.Ticker "matplotlib.axis.Ticker")
Determines the major tick positions and their label format.
**minor**[`matplotlib.axis.Ticker`](#matplotlib.axis.Ticker "matplotlib.axis.Ticker")
Determines the minor tick positions and their label format.
**callbacks**[`matplotlib.cbook.CallbackRegistry`](cbook_api#matplotlib.cbook.CallbackRegistry "matplotlib.cbook.CallbackRegistry")
**label**[`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")
The axis label.
**labelpad**float
The distance between the axis label and the tick labels. Defaults to `[rcParams["axes.labelpad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=axes.labelpad#matplotlibrc-sample)` (default: `4.0`) = 4.
**offsetText**[`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")
A [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") object containing the data offset of the ticks (if any).
[`pickradius`](_as_gen/matplotlib.axis.axis.pickradius#matplotlib.axis.Axis.pickradius "matplotlib.axis.Axis.pickradius")float
The acceptance radius for containment tests.
**majorTicks**list of [`Tick`](#matplotlib.axis.Tick "matplotlib.axis.Tick")
The major ticks.
**minorTicks**list of [`Tick`](#matplotlib.axis.Tick "matplotlib.axis.Tick")
The minor ticks.
Parameters:
**axes**[`matplotlib.axes.Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") to which the created Axis belongs.
**pickradius**float
The acceptance radius for containment tests. See also [`Axis.contains`](_as_gen/matplotlib.axis.axis.contains#matplotlib.axis.Axis.contains "matplotlib.axis.Axis.contains").
*class*matplotlib.axis.XAxis(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L2184-L2432)
Parameters:
**axes**[`matplotlib.axes.Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") to which the created Axis belongs.
**pickradius**float
The acceptance radius for containment tests. See also [`Axis.contains`](_as_gen/matplotlib.axis.axis.contains#matplotlib.axis.Axis.contains "matplotlib.axis.Axis.contains").
*class*matplotlib.axis.YAxis(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L2435-L2683)
Parameters:
**axes**[`matplotlib.axes.Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") to which the created Axis belongs.
**pickradius**float
The acceptance radius for containment tests. See also [`Axis.contains`](_as_gen/matplotlib.axis.axis.contains#matplotlib.axis.Axis.contains "matplotlib.axis.Axis.contains").
*class*matplotlib.axis.Ticker[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L536-L574)
A container for the objects defining tick position and format.
Attributes:
**locator**[`matplotlib.ticker.Locator`](ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator") subclass
Determines the positions of the ticks.
**formatter**[`matplotlib.ticker.Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter") subclass
Determines the format of the tick labels.
| | |
| --- | --- |
| [`Axis.clear`](_as_gen/matplotlib.axis.axis.clear#matplotlib.axis.Axis.clear "matplotlib.axis.Axis.clear") | Clear the axis. |
| [`Axis.get_scale`](_as_gen/matplotlib.axis.axis.get_scale#matplotlib.axis.Axis.get_scale "matplotlib.axis.Axis.get_scale") | Return this Axis' scale (as a str). |
### Formatters and Locators
| | |
| --- | --- |
| [`Axis.get_major_formatter`](_as_gen/matplotlib.axis.axis.get_major_formatter#matplotlib.axis.Axis.get_major_formatter "matplotlib.axis.Axis.get_major_formatter") | Get the formatter of the major ticker. |
| [`Axis.get_major_locator`](_as_gen/matplotlib.axis.axis.get_major_locator#matplotlib.axis.Axis.get_major_locator "matplotlib.axis.Axis.get_major_locator") | Get the locator of the major ticker. |
| [`Axis.get_minor_formatter`](_as_gen/matplotlib.axis.axis.get_minor_formatter#matplotlib.axis.Axis.get_minor_formatter "matplotlib.axis.Axis.get_minor_formatter") | Get the formatter of the minor ticker. |
| [`Axis.get_minor_locator`](_as_gen/matplotlib.axis.axis.get_minor_locator#matplotlib.axis.Axis.get_minor_locator "matplotlib.axis.Axis.get_minor_locator") | Get the locator of the minor ticker. |
| [`Axis.set_major_formatter`](_as_gen/matplotlib.axis.axis.set_major_formatter#matplotlib.axis.Axis.set_major_formatter "matplotlib.axis.Axis.set_major_formatter") | Set the formatter of the major ticker. |
| [`Axis.set_major_locator`](_as_gen/matplotlib.axis.axis.set_major_locator#matplotlib.axis.Axis.set_major_locator "matplotlib.axis.Axis.set_major_locator") | Set the locator of the major ticker. |
| [`Axis.set_minor_formatter`](_as_gen/matplotlib.axis.axis.set_minor_formatter#matplotlib.axis.Axis.set_minor_formatter "matplotlib.axis.Axis.set_minor_formatter") | Set the formatter of the minor ticker. |
| [`Axis.set_minor_locator`](_as_gen/matplotlib.axis.axis.set_minor_locator#matplotlib.axis.Axis.set_minor_locator "matplotlib.axis.Axis.set_minor_locator") | Set the locator of the minor ticker. |
| [`Axis.remove_overlapping_locs`](_as_gen/matplotlib.axis.axis.remove_overlapping_locs#matplotlib.axis.Axis.remove_overlapping_locs "matplotlib.axis.Axis.remove_overlapping_locs") | If minor ticker locations that overlap with major ticker locations should be trimmed. |
| [`Axis.get_remove_overlapping_locs`](_as_gen/matplotlib.axis.axis.get_remove_overlapping_locs#matplotlib.axis.Axis.get_remove_overlapping_locs "matplotlib.axis.Axis.get_remove_overlapping_locs") | |
| [`Axis.set_remove_overlapping_locs`](_as_gen/matplotlib.axis.axis.set_remove_overlapping_locs#matplotlib.axis.Axis.set_remove_overlapping_locs "matplotlib.axis.Axis.set_remove_overlapping_locs") | |
### Axis Label
| | |
| --- | --- |
| [`Axis.set_label_coords`](_as_gen/matplotlib.axis.axis.set_label_coords#matplotlib.axis.Axis.set_label_coords "matplotlib.axis.Axis.set_label_coords") | Set the coordinates of the label. |
| [`Axis.set_label_position`](_as_gen/matplotlib.axis.axis.set_label_position#matplotlib.axis.Axis.set_label_position "matplotlib.axis.Axis.set_label_position") | Set the label position (top or bottom) |
| [`Axis.set_label_text`](_as_gen/matplotlib.axis.axis.set_label_text#matplotlib.axis.Axis.set_label_text "matplotlib.axis.Axis.set_label_text") | Set the text value of the axis label. |
| [`Axis.get_label`](_as_gen/matplotlib.axis.axis.get_label#matplotlib.axis.Axis.get_label "matplotlib.axis.Axis.get_label") | Return the axis label as a Text instance. |
| [`Axis.get_label_position`](_as_gen/matplotlib.axis.axis.get_label_position#matplotlib.axis.Axis.get_label_position "matplotlib.axis.Axis.get_label_position") | Return the label position (top or bottom) |
| [`Axis.get_label_text`](_as_gen/matplotlib.axis.axis.get_label_text#matplotlib.axis.Axis.get_label_text "matplotlib.axis.Axis.get_label_text") | Get the text of the label. |
### Ticks, tick labels and Offset text
| | |
| --- | --- |
| [`Axis.get_major_ticks`](_as_gen/matplotlib.axis.axis.get_major_ticks#matplotlib.axis.Axis.get_major_ticks "matplotlib.axis.Axis.get_major_ticks") | Return the list of major [`Tick`](#matplotlib.axis.Tick "matplotlib.axis.Tick")s. |
| [`Axis.get_majorticklabels`](_as_gen/matplotlib.axis.axis.get_majorticklabels#matplotlib.axis.Axis.get_majorticklabels "matplotlib.axis.Axis.get_majorticklabels") | Return this Axis' major tick labels, as a list of [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text"). |
| [`Axis.get_majorticklines`](_as_gen/matplotlib.axis.axis.get_majorticklines#matplotlib.axis.Axis.get_majorticklines "matplotlib.axis.Axis.get_majorticklines") | Return this Axis' major tick lines as a list of [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")s. |
| [`Axis.get_majorticklocs`](_as_gen/matplotlib.axis.axis.get_majorticklocs#matplotlib.axis.Axis.get_majorticklocs "matplotlib.axis.Axis.get_majorticklocs") | Return this Axis' major tick locations in data coordinates. |
| [`Axis.get_minor_ticks`](_as_gen/matplotlib.axis.axis.get_minor_ticks#matplotlib.axis.Axis.get_minor_ticks "matplotlib.axis.Axis.get_minor_ticks") | Return the list of minor [`Tick`](#matplotlib.axis.Tick "matplotlib.axis.Tick")s. |
| [`Axis.get_minorticklabels`](_as_gen/matplotlib.axis.axis.get_minorticklabels#matplotlib.axis.Axis.get_minorticklabels "matplotlib.axis.Axis.get_minorticklabels") | Return this Axis' minor tick labels, as a list of [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text"). |
| [`Axis.get_minorticklines`](_as_gen/matplotlib.axis.axis.get_minorticklines#matplotlib.axis.Axis.get_minorticklines "matplotlib.axis.Axis.get_minorticklines") | Return this Axis' minor tick lines as a list of [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")s. |
| [`Axis.get_minorticklocs`](_as_gen/matplotlib.axis.axis.get_minorticklocs#matplotlib.axis.Axis.get_minorticklocs "matplotlib.axis.Axis.get_minorticklocs") | Return this Axis' minor tick locations in data coordinates. |
| [`Axis.get_offset_text`](_as_gen/matplotlib.axis.axis.get_offset_text#matplotlib.axis.Axis.get_offset_text "matplotlib.axis.Axis.get_offset_text") | Return the axis offsetText as a Text instance. |
| [`Axis.get_tick_padding`](_as_gen/matplotlib.axis.axis.get_tick_padding#matplotlib.axis.Axis.get_tick_padding "matplotlib.axis.Axis.get_tick_padding") | |
| [`Axis.get_ticklabels`](_as_gen/matplotlib.axis.axis.get_ticklabels#matplotlib.axis.Axis.get_ticklabels "matplotlib.axis.Axis.get_ticklabels") | Get this Axis' tick labels. |
| [`Axis.get_ticklines`](_as_gen/matplotlib.axis.axis.get_ticklines#matplotlib.axis.Axis.get_ticklines "matplotlib.axis.Axis.get_ticklines") | Return this Axis' tick lines as a list of [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")s. |
| [`Axis.get_ticklocs`](_as_gen/matplotlib.axis.axis.get_ticklocs#matplotlib.axis.Axis.get_ticklocs "matplotlib.axis.Axis.get_ticklocs") | Return this Axis' tick locations in data coordinates. |
| [`Axis.get_gridlines`](_as_gen/matplotlib.axis.axis.get_gridlines#matplotlib.axis.Axis.get_gridlines "matplotlib.axis.Axis.get_gridlines") | Return this Axis' grid lines as a list of [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")s. |
| [`Axis.grid`](_as_gen/matplotlib.axis.axis.grid#matplotlib.axis.Axis.grid "matplotlib.axis.Axis.grid") | Configure the grid lines. |
| [`Axis.set_tick_params`](_as_gen/matplotlib.axis.axis.set_tick_params#matplotlib.axis.Axis.set_tick_params "matplotlib.axis.Axis.set_tick_params") | Set appearance parameters for ticks, ticklabels, and gridlines. |
| [`Axis.axis_date`](_as_gen/matplotlib.axis.axis.axis_date#matplotlib.axis.Axis.axis_date "matplotlib.axis.Axis.axis_date") | Set up axis ticks and labels to treat data along this Axis as dates. |
### Data and view intervals
| | |
| --- | --- |
| [`Axis.get_data_interval`](_as_gen/matplotlib.axis.axis.get_data_interval#matplotlib.axis.Axis.get_data_interval "matplotlib.axis.Axis.get_data_interval") | Return the `(min, max)` data limits of this axis. |
| [`Axis.get_view_interval`](_as_gen/matplotlib.axis.axis.get_view_interval#matplotlib.axis.Axis.get_view_interval "matplotlib.axis.Axis.get_view_interval") | Return the `(min, max)` view limits of this axis. |
| [`Axis.get_inverted`](_as_gen/matplotlib.axis.axis.get_inverted#matplotlib.axis.Axis.get_inverted "matplotlib.axis.Axis.get_inverted") | Return whether this Axis is oriented in the "inverse" direction. |
| [`Axis.set_data_interval`](_as_gen/matplotlib.axis.axis.set_data_interval#matplotlib.axis.Axis.set_data_interval "matplotlib.axis.Axis.set_data_interval") | Set the axis data limits. |
| [`Axis.set_view_interval`](_as_gen/matplotlib.axis.axis.set_view_interval#matplotlib.axis.Axis.set_view_interval "matplotlib.axis.Axis.set_view_interval") | Set the axis view limits. |
| [`Axis.set_inverted`](_as_gen/matplotlib.axis.axis.set_inverted#matplotlib.axis.Axis.set_inverted "matplotlib.axis.Axis.set_inverted") | Set whether this Axis is oriented in the "inverse" direction. |
### Rendering helpers
| | |
| --- | --- |
| [`Axis.get_minpos`](_as_gen/matplotlib.axis.axis.get_minpos#matplotlib.axis.Axis.get_minpos "matplotlib.axis.Axis.get_minpos") | |
| [`Axis.get_tick_space`](_as_gen/matplotlib.axis.axis.get_tick_space#matplotlib.axis.Axis.get_tick_space "matplotlib.axis.Axis.get_tick_space") | Return the estimated number of ticks that can fit on the axis. |
| [`Axis.get_ticklabel_extents`](_as_gen/matplotlib.axis.axis.get_ticklabel_extents#matplotlib.axis.Axis.get_ticklabel_extents "matplotlib.axis.Axis.get_ticklabel_extents") | [*Deprecated*] Get the extents of the tick labels on either side of the axes. |
| [`Axis.get_tightbbox`](_as_gen/matplotlib.axis.axis.get_tightbbox#matplotlib.axis.Axis.get_tightbbox "matplotlib.axis.Axis.get_tightbbox") | Return a bounding box that encloses the axis. |
### Interactive
| | |
| --- | --- |
| [`Axis.contains`](_as_gen/matplotlib.axis.axis.contains#matplotlib.axis.Axis.contains "matplotlib.axis.Axis.contains") | Test whether the artist contains the mouse event. |
| [`Axis.pickradius`](_as_gen/matplotlib.axis.axis.pickradius#matplotlib.axis.Axis.pickradius "matplotlib.axis.Axis.pickradius") | The acceptance radius for containment tests. |
| [`Axis.get_pickradius`](_as_gen/matplotlib.axis.axis.get_pickradius#matplotlib.axis.Axis.get_pickradius "matplotlib.axis.Axis.get_pickradius") | Return the depth of the axis used by the picker. |
| [`Axis.set_pickradius`](_as_gen/matplotlib.axis.axis.set_pickradius#matplotlib.axis.Axis.set_pickradius "matplotlib.axis.Axis.set_pickradius") | Set the depth of the axis used by the picker. |
### Units
| | |
| --- | --- |
| [`Axis.convert_units`](_as_gen/matplotlib.axis.axis.convert_units#matplotlib.axis.Axis.convert_units "matplotlib.axis.Axis.convert_units") | |
| [`Axis.set_units`](_as_gen/matplotlib.axis.axis.set_units#matplotlib.axis.Axis.set_units "matplotlib.axis.Axis.set_units") | Set the units for axis. |
| [`Axis.get_units`](_as_gen/matplotlib.axis.axis.get_units#matplotlib.axis.Axis.get_units "matplotlib.axis.Axis.get_units") | Return the units for axis. |
| [`Axis.update_units`](_as_gen/matplotlib.axis.axis.update_units#matplotlib.axis.Axis.update_units "matplotlib.axis.Axis.update_units") | Introspect *data* for units converter and update the axis.converter instance if necessary. |
### XAxis Specific
| | |
| --- | --- |
| [`XAxis.axis_name`](_as_gen/matplotlib.axis.xaxis.axis_name#matplotlib.axis.XAxis.axis_name "matplotlib.axis.XAxis.axis_name") | Read-only name identifying the axis. |
| [`XAxis.get_text_heights`](_as_gen/matplotlib.axis.xaxis.get_text_heights#matplotlib.axis.XAxis.get_text_heights "matplotlib.axis.XAxis.get_text_heights") | [*Deprecated*] Return how much space should be reserved for text above and below the Axes, as a pair of floats. |
| [`XAxis.get_ticks_position`](_as_gen/matplotlib.axis.xaxis.get_ticks_position#matplotlib.axis.XAxis.get_ticks_position "matplotlib.axis.XAxis.get_ticks_position") | Return the ticks position ("top", "bottom", "default", or "unknown"). |
| [`XAxis.set_ticks_position`](_as_gen/matplotlib.axis.xaxis.set_ticks_position#matplotlib.axis.XAxis.set_ticks_position "matplotlib.axis.XAxis.set_ticks_position") | Set the ticks position. |
| [`XAxis.set_label_position`](_as_gen/matplotlib.axis.xaxis.set_label_position#matplotlib.axis.XAxis.set_label_position "matplotlib.axis.XAxis.set_label_position") | Set the label position (top or bottom) |
| [`XAxis.tick_bottom`](_as_gen/matplotlib.axis.xaxis.tick_bottom#matplotlib.axis.XAxis.tick_bottom "matplotlib.axis.XAxis.tick_bottom") | Move ticks and ticklabels (if present) to the bottom of the Axes. |
| [`XAxis.tick_top`](_as_gen/matplotlib.axis.xaxis.tick_top#matplotlib.axis.XAxis.tick_top "matplotlib.axis.XAxis.tick_top") | Move ticks and ticklabels (if present) to the top of the Axes. |
### YAxis Specific
| | |
| --- | --- |
| [`YAxis.axis_name`](_as_gen/matplotlib.axis.yaxis.axis_name#matplotlib.axis.YAxis.axis_name "matplotlib.axis.YAxis.axis_name") | Read-only name identifying the axis. |
| [`YAxis.get_text_widths`](_as_gen/matplotlib.axis.yaxis.get_text_widths#matplotlib.axis.YAxis.get_text_widths "matplotlib.axis.YAxis.get_text_widths") | [*Deprecated*] |
| [`YAxis.get_ticks_position`](_as_gen/matplotlib.axis.yaxis.get_ticks_position#matplotlib.axis.YAxis.get_ticks_position "matplotlib.axis.YAxis.get_ticks_position") | Return the ticks position ("left", "right", "default", or "unknown"). |
| [`YAxis.set_offset_position`](_as_gen/matplotlib.axis.yaxis.set_offset_position#matplotlib.axis.YAxis.set_offset_position "matplotlib.axis.YAxis.set_offset_position") | Parameters:
|
| [`YAxis.set_ticks_position`](_as_gen/matplotlib.axis.yaxis.set_ticks_position#matplotlib.axis.YAxis.set_ticks_position "matplotlib.axis.YAxis.set_ticks_position") | Set the ticks position. |
| [`YAxis.set_label_position`](_as_gen/matplotlib.axis.yaxis.set_label_position#matplotlib.axis.YAxis.set_label_position "matplotlib.axis.YAxis.set_label_position") | Set the label position (left or right) |
| [`YAxis.tick_left`](_as_gen/matplotlib.axis.yaxis.tick_left#matplotlib.axis.YAxis.tick_left "matplotlib.axis.YAxis.tick_left") | Move ticks and ticklabels (if present) to the left of the Axes. |
| [`YAxis.tick_right`](_as_gen/matplotlib.axis.yaxis.tick_right#matplotlib.axis.YAxis.tick_right "matplotlib.axis.YAxis.tick_right") | Move ticks and ticklabels (if present) to the right of the Axes. |
### Other
| | |
| --- | --- |
| [`Axis.OFFSETTEXTPAD`](_as_gen/matplotlib.axis.axis.offsettextpad#matplotlib.axis.Axis.OFFSETTEXTPAD "matplotlib.axis.Axis.OFFSETTEXTPAD") | |
| [`Axis.axes`](_as_gen/matplotlib.axis.axis.axes#matplotlib.axis.Axis.axes "matplotlib.axis.Axis.axes") | The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance the artist resides in, or *None*. |
| [`Axis.limit_range_for_scale`](_as_gen/matplotlib.axis.axis.limit_range_for_scale#matplotlib.axis.Axis.limit_range_for_scale "matplotlib.axis.Axis.limit_range_for_scale") | |
| [`Axis.reset_ticks`](_as_gen/matplotlib.axis.axis.reset_ticks#matplotlib.axis.Axis.reset_ticks "matplotlib.axis.Axis.reset_ticks") | Re-initialize the major and minor Tick lists. |
| [`Axis.set_default_intervals`](_as_gen/matplotlib.axis.axis.set_default_intervals#matplotlib.axis.Axis.set_default_intervals "matplotlib.axis.Axis.set_default_intervals") | Set the default limits for the axis data and view interval if they have not been not mutated yet. |
### Discouraged
These methods should be used together with care, calling `set_ticks` to specify the desired tick locations **before** calling `set_ticklabels` to specify a matching series of labels. Calling `set_ticks` makes a [`FixedLocator`](ticker_api#matplotlib.ticker.FixedLocator "matplotlib.ticker.FixedLocator"); it's list of locations is then used by `set_ticklabels` to make an appropriate [`FuncFormatter`](ticker_api#matplotlib.ticker.FuncFormatter "matplotlib.ticker.FuncFormatter").
| | |
| --- | --- |
| [`Axis.set_ticks`](_as_gen/matplotlib.axis.axis.set_ticks#matplotlib.axis.Axis.set_ticks "matplotlib.axis.Axis.set_ticks") | Set this Axis' tick locations and optionally labels. |
| [`Axis.set_ticklabels`](_as_gen/matplotlib.axis.axis.set_ticklabels#matplotlib.axis.Axis.set_ticklabels "matplotlib.axis.Axis.set_ticklabels") | [*Discouraged*] Set the text values of the tick labels. |
`Tick` objects
---------------
*class*matplotlib.axis.Tick(*axes*, *loc*, *\**, *size=None*, *width=None*, *color=None*, *tickdir=None*, *pad=None*, *labelsize=None*, *labelcolor=None*, *zorder=None*, *gridOn=None*, *tick1On=True*, *tick2On=True*, *label1On=True*, *label2On=False*, *major=True*, *labelrotation=0*, *grid\_color=None*, *grid\_linestyle=None*, *grid\_linewidth=None*, *grid\_alpha=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L36-L411)
Abstract base class for the axis ticks, grid lines and labels.
Ticks mark a position on an Axis. They contain two lines as markers and two labels; one each for the bottom and top positions (in case of an [`XAxis`](#matplotlib.axis.XAxis "matplotlib.axis.XAxis")) or for the left and right positions (in case of a [`YAxis`](#matplotlib.axis.YAxis "matplotlib.axis.YAxis")).
Attributes:
**tick1line**[`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
The left/bottom tick marker.
**tick2line**[`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
The right/top tick marker.
**gridline**[`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
The grid line associated with the label position.
**label1**[`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")
The left/bottom tick label.
**label2**[`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")
The right/top tick label.
bbox is the Bound2D bounding box in display coords of the Axes loc is the tick location in data coords size is the tick size in points
*class*matplotlib.axis.XTick(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L414-L472)
Contains all the Artists needed to make an x tick - the tick line, the label text and the grid line
bbox is the Bound2D bounding box in display coords of the Axes loc is the tick location in data coords size is the tick size in points
*class*matplotlib.axis.YTick(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/axis.py#L475-L533)
Contains all the Artists needed to make a Y tick - the tick line, the label text and the grid line
bbox is the Bound2D bounding box in display coords of the Axes loc is the tick location in data coords size is the tick size in points
| | |
| --- | --- |
| [`Tick.get_loc`](_as_gen/matplotlib.axis.tick.get_loc#matplotlib.axis.Tick.get_loc "matplotlib.axis.Tick.get_loc") | Return the tick location (data coords) as a scalar. |
| [`Tick.get_pad`](_as_gen/matplotlib.axis.tick.get_pad#matplotlib.axis.Tick.get_pad "matplotlib.axis.Tick.get_pad") | Get the value of the tick label pad in points. |
| [`Tick.get_pad_pixels`](_as_gen/matplotlib.axis.tick.get_pad_pixels#matplotlib.axis.Tick.get_pad_pixels "matplotlib.axis.Tick.get_pad_pixels") | [*Deprecated*] |
| [`Tick.get_tick_padding`](_as_gen/matplotlib.axis.tick.get_tick_padding#matplotlib.axis.Tick.get_tick_padding "matplotlib.axis.Tick.get_tick_padding") | Get the length of the tick outside of the Axes. |
| [`Tick.get_tickdir`](_as_gen/matplotlib.axis.tick.get_tickdir#matplotlib.axis.Tick.get_tickdir "matplotlib.axis.Tick.get_tickdir") | |
| [`Tick.get_view_interval`](_as_gen/matplotlib.axis.tick.get_view_interval#matplotlib.axis.Tick.get_view_interval "matplotlib.axis.Tick.get_view_interval") | Return the view limits `(min, max)` of the axis the tick belongs to. |
| [`Tick.set_label1`](_as_gen/matplotlib.axis.tick.set_label1#matplotlib.axis.Tick.set_label1 "matplotlib.axis.Tick.set_label1") | Set the label1 text. |
| [`Tick.set_label2`](_as_gen/matplotlib.axis.tick.set_label2#matplotlib.axis.Tick.set_label2 "matplotlib.axis.Tick.set_label2") | Set the label2 text. |
| [`Tick.set_pad`](_as_gen/matplotlib.axis.tick.set_pad#matplotlib.axis.Tick.set_pad "matplotlib.axis.Tick.set_pad") | Set the tick label pad in points |
| [`Tick.set_url`](_as_gen/matplotlib.axis.tick.set_url#matplotlib.axis.Tick.set_url "matplotlib.axis.Tick.set_url") | Set the url of label1 and label2. |
| [`Tick.update_position`](_as_gen/matplotlib.axis.tick.update_position#matplotlib.axis.Tick.update_position "matplotlib.axis.Tick.update_position") | Set the location of tick in data coords with scalar *loc*. |
| programming_docs |
matplotlib matplotlib.gridspec matplotlib.gridspec
===================
[`gridspec`](#module-matplotlib.gridspec "matplotlib.gridspec") contains classes that help to layout multiple [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") in a grid-like pattern within a figure.
The [`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec") specifies the overall grid structure. Individual cells within the grid are referenced by [`SubplotSpec`](_as_gen/matplotlib.gridspec.subplotspec#matplotlib.gridspec.SubplotSpec "matplotlib.gridspec.SubplotSpec")s.
Often, users need not access this module directly, and can use higher-level methods like [`subplots`](_as_gen/matplotlib.pyplot.subplots#matplotlib.pyplot.subplots "matplotlib.pyplot.subplots"), [`subplot_mosaic`](_as_gen/matplotlib.pyplot.subplot_mosaic#matplotlib.pyplot.subplot_mosaic "matplotlib.pyplot.subplot_mosaic") and [`subfigures`](figure_api#matplotlib.figure.Figure.subfigures "matplotlib.figure.Figure.subfigures"). See the tutorial [Arranging multiple Axes in a Figure](https://matplotlib.org/stable/tutorials/intermediate/arranging_axes.html) for a guide.
Classes
-------
| | |
| --- | --- |
| [`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec")(nrows, ncols[, figure, left, ...]) | A grid layout to place subplots within a figure. |
| [`SubplotSpec`](_as_gen/matplotlib.gridspec.subplotspec#matplotlib.gridspec.SubplotSpec "matplotlib.gridspec.SubplotSpec")(gridspec, num1[, num2]) | The location of a subplot in a [`GridSpec`](_as_gen/matplotlib.gridspec.gridspec#matplotlib.gridspec.GridSpec "matplotlib.gridspec.GridSpec"). |
| [`GridSpecBase`](_as_gen/matplotlib.gridspec.gridspecbase#matplotlib.gridspec.GridSpecBase "matplotlib.gridspec.GridSpecBase")(nrows, ncols[, height\_ratios, ...]) | A base class of GridSpec that specifies the geometry of the grid that a subplot will be placed. |
| [`GridSpecFromSubplotSpec`](_as_gen/matplotlib.gridspec.gridspecfromsubplotspec#matplotlib.gridspec.GridSpecFromSubplotSpec "matplotlib.gridspec.GridSpecFromSubplotSpec")(nrows, ncols, ...[, ...]) | GridSpec whose subplot layout parameters are inherited from the location specified by a given SubplotSpec. |
matplotlib matplotlib.cm matplotlib.cm
=============
Builtin colormaps, colormap handling utilities, and the [`ScalarMappable`](#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") mixin.
See also
[Colormap reference](https://matplotlib.org/stable/gallery/color/colormap_reference.html) for a list of builtin colormaps.
[Creating Colormaps in Matplotlib](https://matplotlib.org/stable/tutorials/colors/colormap-manipulation.html) for examples of how to make colormaps.
[Choosing Colormaps in Matplotlib](https://matplotlib.org/stable/tutorials/colors/colormaps.html) an in-depth discussion of choosing colormaps.
[Colormap Normalization](https://matplotlib.org/stable/tutorials/colors/colormapnorms.html) for more details about data normalization.
*class*matplotlib.cm.ColormapRegistry(*cmaps*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L60-L194)
Bases: [`Mapping`](https://docs.python.org/3/library/collections.abc.html#collections.abc.Mapping "(in Python v3.10)")
Container for colormaps that are known to Matplotlib by name.
Experimental
While we expect the API to be final, we formally mark it as experimental for 3.5 because we want to keep the option to still adapt the API for 3.6 should the need arise.
The universal registry instance is [`matplotlib.colormaps`](matplotlib_configuration_api#matplotlib.colormaps "matplotlib.colormaps"). There should be no need for users to instantiate [`ColormapRegistry`](#matplotlib.cm.ColormapRegistry "matplotlib.cm.ColormapRegistry") themselves.
Read access uses a dict-like interface mapping names to [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap")s:
```
import matplotlib as mpl
cmap = mpl.colormaps['viridis']
```
Returned [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap")s are copies, so that their modification does not change the global definition of the colormap.
Additional colormaps can be added via [`ColormapRegistry.register`](#matplotlib.cm.ColormapRegistry.register "matplotlib.cm.ColormapRegistry.register"):
```
mpl.colormaps.register(my_colormap)
```
register(*cmap*, *\**, *name=None*, *force=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L117-L162)
Register a new colormap.
The colormap name can then be used as a string argument to any `cmap` parameter in Matplotlib. It is also available in `pyplot.get_cmap`.
The colormap registry stores a copy of the given colormap, so that future changes to the original colormap instance do not affect the registered colormap. Think of this as the registry taking a snapshot of the colormap at registration.
Parameters:
**cmap**matplotlib.colors.Colormap
The colormap to register.
**name**str, optional
The name for the colormap. If not given, `cmap.name` is used.
**force**bool, default: False
If False, a ValueError is raised if trying to overwrite an already registered name. True supports overwriting registered colormaps other than the builtin colormaps.
unregister(*name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L164-L194)
Remove a colormap from the registry.
You cannot remove built-in colormaps.
If the named colormap is not registered, returns with no error, raises if you try to de-register a default colormap.
Warning
Colormap names are currently a shared namespace that may be used by multiple packages. Use [`unregister`](#matplotlib.cm.ColormapRegistry.unregister "matplotlib.cm.ColormapRegistry.unregister") only if you know you have registered that name before. In particular, do not unregister just in case to clean the name before registering a new colormap.
Parameters:
**name**str
The name of the colormap to be removed.
Raises:
ValueError
If you try to remove a default built-in colormap.
*class*matplotlib.cm.ScalarMappable(*norm=None*, *cmap=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L358-L653)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A mixin class to map scalar data to RGBA.
The ScalarMappable applies data normalization before returning RGBA colors from the given colormap.
Parameters:
**norm**[`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") (or subclass thereof) or str or None
The normalizing object which scales data, typically into the interval `[0, 1]`. If a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"), a [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") subclass is dynamically generated based on the scale with the corresponding name. If *None*, *norm* defaults to a *colors.Normalize* object which initializes its scaling based on the first data processed.
**cmap**str or [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap")
The colormap used to map normalized data values to RGBA colors.
autoscale()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L625-L634)
Autoscale the scalar limits on the norm instance using the current array
autoscale\_None()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L636-L645)
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
*property*callbacksSM[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
changed()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L647-L653)
Call this whenever the mappable is changed to notify all the callbackSM listeners to the 'changed' signal.
colorbar
The last colorbar associated with this ScalarMappable. May be None.
get\_alpha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L552-L560)
Returns:
float
Always returns 1.
get\_array()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L507-L514)
Return the array of values, that are mapped to colors.
The base class [`ScalarMappable`](#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the array.
get\_clim()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L520-L524)
Return the values (min, max) that are mapped to the colormap limits.
get\_cmap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L516-L518)
Return the [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") instance.
*property*norm
set\_array(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L484-L505)
Set the value array from array-like *A*.
Parameters:
**A**array-like or None
The values that are mapped to colors.
The base class [`ScalarMappable`](#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the value array *A*.
set\_clim(*vmin=None*, *vmax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L526-L550)
Set the norm limits for image scaling.
Parameters:
**vmin, vmax**float
The limits.
The limits may also be passed as a tuple (*vmin*, *vmax*) as a single positional argument.
set\_cmap(*cmap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L562-L574)
Set the colormap for luminance data.
Parameters:
**cmap**[`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None
set\_norm(*norm*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L609-L623)
Set the normalization instance.
Parameters:
**norm**[`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None
#### Notes
If there are any colorbars using the mappable for this norm, setting the norm of the mappable will reset the norm, locator, and formatters on the colorbar to default.
to\_rgba(*x*, *alpha=None*, *bytes=False*, *norm=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L414-L482)
Return a normalized rgba array corresponding to *x*.
In the normal case, *x* is a 1D or 2D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If *x* is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the *alpha* kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the *alpha* kwarg is ignored; it does not replace the preexisting alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if *bytes* is *False* (default), the rgba array will be floats in the 0-1 range; if it is *True*, the returned rgba array will be uint8 in the 0 to 255 range.
If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1).
matplotlib.cm.get\_cmap(*name=None*, *lut=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L252-L278)
[*Deprecated*] Get a colormap instance, defaulting to rc values if *name* is None.
Parameters:
**name**[`matplotlib.colors.Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None, default: None
If a [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") instance, it will be returned. Otherwise, the name of a colormap known to Matplotlib, which will be resampled by *lut*. The default, None, means `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`).
**lut**int or None, default: None
If *name* is not already a Colormap instance and *lut* is not None, the colormap will be resampled to have *lut* entries in the lookup table.
Returns:
Colormap
#### Notes
Deprecated since version 3.6: Use `matplotlib.colormaps[name]` instead.
matplotlib.cm.register\_cmap(*name=None*, *cmap=None*, *\**, *override\_builtin=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L204-L249)
[*Deprecated*] Add a colormap to the set recognized by [`get_cmap()`](#matplotlib.cm.get_cmap "matplotlib.cm.get_cmap").
Register a new colormap to be accessed by name
```
LinearSegmentedColormap('swirly', data, lut)
register_cmap(cmap=swirly_cmap)
```
Parameters:
**name**str, optional
The name that can be used in [`get_cmap()`](#matplotlib.cm.get_cmap "matplotlib.cm.get_cmap") or `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
If absent, the name will be the `name` attribute of the *cmap*.
**cmap**matplotlib.colors.Colormap
Despite being the second argument and having a default value, this is a required argument.
**override\_builtin**bool
Allow built-in colormaps to be overridden by a user-supplied colormap.
Please do not use this unless you are sure you need it.
#### Notes
Deprecated since version 3.6: Use `matplotlib.colormaps.register(name)` instead.
matplotlib.cm.unregister\_cmap(*name*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L288-L327)
[*Deprecated*] Remove a colormap recognized by [`get_cmap()`](#matplotlib.cm.get_cmap "matplotlib.cm.get_cmap").
You may not remove built-in colormaps.
If the named colormap is not registered, returns with no error, raises if you try to de-register a default colormap.
Warning
Colormap names are currently a shared namespace that may be used by multiple packages. Use [`unregister_cmap`](#matplotlib.cm.unregister_cmap "matplotlib.cm.unregister_cmap") only if you know you have registered that name before. In particular, do not unregister just in case to clean the name before registering a new colormap.
Parameters:
**name**str
The name of the colormap to be un-registered
Returns:
ColorMap or None
If the colormap was registered, return it if not return [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)")
Raises:
ValueError
If you try to de-register a default built-in colormap.
#### Notes
Deprecated since version 3.6: Use `matplotlib.colormaps.unregister(name)` instead.
matplotlib matplotlib.font_manager matplotlib.font\_manager
========================
A module for finding, managing, and using fonts across platforms.
This module provides a single [`FontManager`](#matplotlib.font_manager.FontManager "matplotlib.font_manager.FontManager") instance, `fontManager`, that can be shared across backends and platforms. The [`findfont`](#matplotlib.font_manager.findfont "matplotlib.font_manager.findfont") function returns the best TrueType (TTF) font file in the local or system font path that matches the specified [`FontProperties`](#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") instance. The [`FontManager`](#matplotlib.font_manager.FontManager "matplotlib.font_manager.FontManager") also handles Adobe Font Metrics (AFM) font files for use by the PostScript backend.
The design is based on the [W3C Cascading Style Sheet, Level 1 (CSS1) font specification](http://www.w3.org/TR/1998/REC-CSS2-19980512/). Future versions may implement the Level 2 or 2.1 specifications.
*class*matplotlib.font\_manager.FontManager(*size=None*, *weight='normal'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L1065-L1521)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
On import, the [`FontManager`](#matplotlib.font_manager.FontManager "matplotlib.font_manager.FontManager") singleton instance creates a list of ttf and afm fonts and caches their [`FontProperties`](#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties"). The [`FontManager.findfont`](#matplotlib.font_manager.FontManager.findfont "matplotlib.font_manager.FontManager.findfont") method does a nearest neighbor search to find the font that most closely matches the specification. If no good enough match is found, the default font is returned.
addfont(*path*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L1114-L1135)
Cache the properties of the font at *path* to make it available to the [`FontManager`](#matplotlib.font_manager.FontManager "matplotlib.font_manager.FontManager"). The type of font is inferred from the path suffix.
Parameters:
**path**str or path-like
*property*defaultFont
findfont(*prop*, *fontext='ttf'*, *directory=None*, *fallback\_to\_default=True*, *rebuild\_if\_missing=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L1289-L1350)
Find a font that most closely matches the given font properties.
Parameters:
**prop**str or [`FontProperties`](#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties")
The font properties to search for. This can be either a [`FontProperties`](#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") object or a string defining a [fontconfig patterns](https://www.freedesktop.org/software/fontconfig/fontconfig-user.html).
**fontext**{'ttf', 'afm'}, default: 'ttf'
The extension of the font file:
* 'ttf': TrueType and OpenType fonts (.ttf, .ttc, .otf)
* 'afm': Adobe Font Metrics (.afm)
**directory**str, optional
If given, only search this directory and its subdirectories.
**fallback\_to\_default**bool
If True, will fallback to the default font family (usually "DejaVu Sans" or "Helvetica") if the first lookup hard-fails.
**rebuild\_if\_missing**bool
Whether to rebuild the font cache and search again if the first match appears to point to a nonexisting font (i.e., the font cache contains outdated entries).
Returns:
str
The filename of the best matching font.
#### Notes
This performs a nearest neighbor search. Each font is given a similarity score to the target font properties. The first font with the highest score is returned. If no matches below a certain threshold are found, the default font (usually DejaVu Sans) is returned.
The result is cached, so subsequent lookups don't have to perform the O(n) nearest neighbor search.
See the [W3C Cascading Style Sheet, Level 1](http://www.w3.org/TR/1998/REC-CSS2-19980512/) documentation for a description of the font finding algorithm.
*static*get\_default\_size()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L1150-L1155)
Return the default font size.
get\_default\_weight()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L1144-L1148)
Return the default font weight.
get\_font\_names()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L1352-L1354)
Return the list of available fonts.
score\_family(*families*, *family2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L1171-L1199)
Return a match score between the list of font families in *families* and the font family name *family2*.
An exact match at the head of the list returns 0.0.
A match further down the list will return between 0 and 1.
No match will return 1.0.
score\_size(*size1*, *size2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L1265-L1287)
Return a match score between *size1* and *size2*.
If *size2* (the size specified in the font file) is 'scalable', this function always returns 0.0, since any font size can be generated.
Otherwise, the result is the absolute distance between *size1* and *size2*, normalized so that the usual range of font sizes (6pt - 72pt) will lie between 0.0 and 1.0.
score\_stretch(*stretch1*, *stretch2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L1229-L1245)
Return a match score between *stretch1* and *stretch2*.
The result is the absolute value of the difference between the CSS numeric values of *stretch1* and *stretch2*, normalized between 0.0 and 1.0.
score\_style(*style1*, *style2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L1201-L1216)
Return a match score between *style1* and *style2*.
An exact match returns 0.0.
A match between 'italic' and 'oblique' returns 0.1.
No match returns 1.0.
score\_variant(*variant1*, *variant2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L1218-L1227)
Return a match score between *variant1* and *variant2*.
An exact match returns 0.0, otherwise 1.0.
score\_weight(*weight1*, *weight2*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L1247-L1263)
Return a match score between *weight1* and *weight2*.
The result is 0.0 if both weight1 and weight 2 are given as strings and have the same value.
Otherwise, the result is the absolute value of the difference between the CSS numeric values of *weight1* and *weight2*, normalized between 0.05 and 1.0.
set\_default\_weight(*weight*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L1157-L1161)
Set the default font weight. The initial value is 'normal'.
*class*matplotlib.font\_manager.FontProperties(*family=None*, *style=None*, *variant=None*, *weight=None*, *stretch=None*, *size=None*, *fname=None*, *math\_fontfamily=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L614-L990)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A class for storing and manipulating font properties.
The font properties are the six properties described in the [W3C Cascading Style Sheet, Level 1](http://www.w3.org/TR/1998/REC-CSS2-19980512/) font specification and *math\_fontfamily* for math fonts:
* family: A list of font names in decreasing order of priority. The items may include a generic font family name, either 'sans-serif', 'serif', 'cursive', 'fantasy', or 'monospace'. In that case, the actual font to be used will be looked up from the associated rcParam during the search process in [`findfont`](#matplotlib.font_manager.findfont "matplotlib.font_manager.findfont"). Default: `[rcParams["font.family"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=font.family#matplotlibrc-sample)` (default: `['sans-serif']`)
* style: Either 'normal', 'italic' or 'oblique'. Default: `[rcParams["font.style"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=font.style#matplotlibrc-sample)` (default: `'normal'`)
* variant: Either 'normal' or 'small-caps'. Default: `[rcParams["font.variant"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=font.variant#matplotlibrc-sample)` (default: `'normal'`)
* stretch: A numeric value in the range 0-1000 or one of 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded' or 'ultra-expanded'. Default: `[rcParams["font.stretch"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=font.stretch#matplotlibrc-sample)` (default: `'normal'`)
* weight: A numeric value in the range 0-1000 or one of 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'. Default: `[rcParams["font.weight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=font.weight#matplotlibrc-sample)` (default: `'normal'`)
* size: Either an relative value of 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large' or an absolute font size, e.g., 10. Default: `[rcParams["font.size"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=font.size#matplotlibrc-sample)` (default: `10.0`)
* math\_fontfamily: The family of fonts used to render math text. Supported values are: 'dejavusans', 'dejavuserif', 'cm', 'stix', 'stixsans' and 'custom'. Default: `[rcParams["mathtext.fontset"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=mathtext.fontset#matplotlibrc-sample)` (default: `'dejavusans'`)
Alternatively, a font may be specified using the absolute path to a font file, by using the *fname* kwarg. However, in this case, it is typically simpler to just pass the path (as a [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.10)"), not a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)")) to the *font* kwarg of the [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") object.
The preferred usage of font sizes is to use the relative values, e.g., 'large', instead of absolute font sizes, e.g., 12. This approach allows all text sizes to be made larger or smaller based on the font manager's default font size.
This class will also accept a [fontconfig](https://www.freedesktop.org/wiki/Software/fontconfig/) [pattern](https://www.freedesktop.org/software/fontconfig/fontconfig-user.html), if it is the only argument provided. This support does not depend on fontconfig; we are merely borrowing its pattern syntax for use here.
Note that Matplotlib's internal font manager and fontconfig use a different algorithm to lookup fonts, so the results of the same pattern may be different in Matplotlib than in other applications that use fontconfig.
copy()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L982-L984)
Return a copy of self.
get\_family()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L737-L745)
Return a list of individual font family names or generic family names.
The font families or generic font families (which will be resolved from their respective rcParams when searching for a matching font) in the order of preference.
get\_file()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L788-L792)
Return the filename of the associated font.
get\_fontconfig\_pattern()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L794-L802)
Get a [fontconfig](https://www.freedesktop.org/wiki/Software/fontconfig/) [pattern](https://www.freedesktop.org/software/fontconfig/fontconfig-user.html) suitable for looking up the font as specified with fontconfig's `fc-match` utility.
This support does not depend on fontconfig; we are merely borrowing its pattern syntax for use here.
get\_math\_fontfamily()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L946-L952)
Return the name of the font family used for math text.
The default font is `[rcParams["mathtext.fontset"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=mathtext.fontset#matplotlibrc-sample)` (default: `'dejavusans'`).
get\_name()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L747-L751)
Return the name of the font that best matches the font properties.
get\_size()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L782-L786)
Return the font size.
get\_size\_in\_points()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L782-L786)
Return the font size.
get\_slant()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L753-L757)
Return the font style. Values are: 'normal', 'italic' or 'oblique'.
get\_stretch()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L774-L780)
Return the font stretch or width. Options are: 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'.
get\_style()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L753-L757)
Return the font style. Values are: 'normal', 'italic' or 'oblique'.
get\_variant()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L759-L763)
Return the font variant. Values are: 'normal' or 'small-caps'.
get\_weight()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L765-L772)
Set the font weight. Options are: A numeric value in the range 0-1000 or one of 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'
set\_family(*family*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L804-L816)
Change the font family. May be either an alias (generic name is CSS parlance), such as: 'serif', 'sans-serif', 'cursive', 'fantasy', or 'monospace', a real font name or a list of real font names. Real font names are not supported when `[rcParams["text.usetex"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=text.usetex#matplotlibrc-sample)` (default: `False`) is [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)"). Default: `[rcParams["font.family"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=font.family#matplotlibrc-sample)` (default: `['sans-serif']`)
set\_file(*file*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L926-L931)
Set the filename of the fontfile to use. In this case, all other properties will be ignored.
set\_fontconfig\_pattern(*pattern*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L933-L944)
Set the properties by parsing a [fontconfig](https://www.freedesktop.org/wiki/Software/fontconfig/) *pattern*.
This support does not depend on fontconfig; we are merely borrowing its pattern syntax for use here.
set\_math\_fontfamily(*fontfamily*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L954-L980)
Set the font family for text in math mode.
If not set explicitly, `[rcParams["mathtext.fontset"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=mathtext.fontset#matplotlibrc-sample)` (default: `'dejavusans'`) will be used.
Parameters:
**fontfamily**str
The name of the font family.
Available font families are defined in the matplotlibrc.template file [here](https://matplotlib.org/stable/tutorials/introductory/customizing.html#customizing-with-matplotlibrc-files)
See also
[`text.Text.get_math_fontfamily`](text_api#matplotlib.text.Text.get_math_fontfamily "matplotlib.text.Text.get_math_fontfamily")
set\_name(*family*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L804-L816)
Change the font family. May be either an alias (generic name is CSS parlance), such as: 'serif', 'sans-serif', 'cursive', 'fantasy', or 'monospace', a real font name or a list of real font names. Real font names are not supported when `[rcParams["text.usetex"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=text.usetex#matplotlibrc-sample)` (default: `False`) is [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)"). Default: `[rcParams["font.family"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=font.family#matplotlibrc-sample)` (default: `['sans-serif']`)
set\_size(*size*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L896-L924)
Set the font size.
Parameters:
**size**float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}, default: `[rcParams["font.size"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=font.size#matplotlibrc-sample)` (default: `10.0`)
If float, the font size in points. The string values denote sizes relative to the default font size.
set\_slant(*style*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L818-L829)
Set the font style.
Parameters:
**style**{'normal', 'italic', 'oblique'}, default: `[rcParams["font.style"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=font.style#matplotlibrc-sample)` (default: `'normal'`)
set\_stretch(*stretch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L870-L894)
Set the font stretch or width.
Parameters:
**stretch**int or {'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'}, default: `[rcParams["font.stretch"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=font.stretch#matplotlibrc-sample)` (default: `'normal'`)
If int, must be in the range 0-1000.
set\_style(*style*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L818-L829)
Set the font style.
Parameters:
**style**{'normal', 'italic', 'oblique'}, default: `[rcParams["font.style"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=font.style#matplotlibrc-sample)` (default: `'normal'`)
set\_variant(*variant*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L831-L842)
Set the font variant.
Parameters:
**variant**{'normal', 'small-caps'}, default: `[rcParams["font.variant"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=font.variant#matplotlibrc-sample)` (default: `'normal'`)
set\_weight(*weight*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L844-L868)
Set the font weight.
Parameters:
**weight**int or {'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'}, default: `[rcParams["font.weight"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=font.weight#matplotlibrc-sample)` (default: `'normal'`)
If int, must be in the range 0-1000.
matplotlib.font\_manager.afmFontProperty(*fontpath*, *font*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L546-L611)
Extract information from an AFM font file.
Parameters:
**font**AFM
The AFM font file from which information will be extracted.
Returns:
[`FontEntry`](#matplotlib.font_manager.FontEntry "matplotlib.font_manager.FontEntry")
The extracted font properties.
matplotlib.font\_manager.findSystemFonts(*fontpaths=None*, *fontext='ttf'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L348-L378)
Search for fonts in the specified font paths. If no paths are given, will use a standard set of system paths, as well as the list of fonts tracked by fontconfig if fontconfig is installed and available. A list of TrueType fonts are returned by default with AFM fonts as an option.
matplotlib.font\_manager.findfont(*prop*, *fontext='ttf'*, *directory=None*, *fallback\_to\_default=True*, *rebuild\_if\_missing=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L1289-L1350)
Find a font that most closely matches the given font properties.
Parameters:
**prop**str or [`FontProperties`](#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties")
The font properties to search for. This can be either a [`FontProperties`](#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") object or a string defining a [fontconfig patterns](https://www.freedesktop.org/software/fontconfig/fontconfig-user.html).
**fontext**{'ttf', 'afm'}, default: 'ttf'
The extension of the font file:
* 'ttf': TrueType and OpenType fonts (.ttf, .ttc, .otf)
* 'afm': Adobe Font Metrics (.afm)
**directory**str, optional
If given, only search this directory and its subdirectories.
**fallback\_to\_default**bool
If True, will fallback to the default font family (usually "DejaVu Sans" or "Helvetica") if the first lookup hard-fails.
**rebuild\_if\_missing**bool
Whether to rebuild the font cache and search again if the first match appears to point to a nonexisting font (i.e., the font cache contains outdated entries).
Returns:
str
The filename of the best matching font.
#### Notes
This performs a nearest neighbor search. Each font is given a similarity score to the target font properties. The first font with the highest score is returned. If no matches below a certain threshold are found, the default font (usually DejaVu Sans) is returned.
The result is cached, so subsequent lookups don't have to perform the O(n) nearest neighbor search.
See the [W3C Cascading Style Sheet, Level 1](http://www.w3.org/TR/1998/REC-CSS2-19980512/) documentation for a description of the font finding algorithm.
matplotlib.font\_manager.get\_font(*font\_filepaths*, *hinting\_factor=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L1570-L1607)
Get an [`ft2font.FT2Font`](ft2font#matplotlib.ft2font.FT2Font "matplotlib.ft2font.FT2Font") object given a list of file paths.
Parameters:
**font\_filepaths**Iterable[str, Path, bytes], str, Path, bytes
Relative or absolute paths to the font files to be used.
If a single string, bytes, or [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.10)"), then it will be treated as a list with that entry only.
If more than one filepath is passed, then the returned FT2Font object will fall back through the fonts, in the order given, to find a needed glyph.
Returns:
[`ft2font.FT2Font`](ft2font#matplotlib.ft2font.FT2Font "matplotlib.ft2font.FT2Font")
matplotlib.font\_manager.get\_font\_names()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L1352-L1354)
Return the list of available fonts.
matplotlib.font\_manager.get\_fontconfig\_fonts(*fontext='ttf'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L340-L345)
[*Deprecated*] List font filenames known to `fc-list` having the given extension.
#### Notes
Deprecated since version 3.5.
matplotlib.font\_manager.get\_fontext\_synonyms(*fontext*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L170-L180)
Return a list of file extensions that are synonyms for the given file extension *fileext*.
matplotlib.font\_manager.is\_opentype\_cff\_font(*filename*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L1524-L1535)
Return whether the given font is a Postscript Compact Font Format Font embedded in an OpenType wrapper. Used by the PostScript and PDF backends that can not subset these fonts.
matplotlib.font\_manager.json\_dump(*data*, *filename*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L1029-L1050)
Dump [`FontManager`](#matplotlib.font_manager.FontManager "matplotlib.font_manager.FontManager") *data* as JSON to the file named *filename*.
See also
[`json_load`](#matplotlib.font_manager.json_load "matplotlib.font_manager.json_load")
#### Notes
File paths that are children of the Matplotlib data path (typically, fonts shipped with Matplotlib) are stored relative to that data path (to remain valid across virtualenvs).
This function temporarily locks the output file to prevent multiple processes from overwriting one another's output.
matplotlib.font\_manager.json\_load(*filename*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L1053-L1062)
Load a [`FontManager`](#matplotlib.font_manager.FontManager "matplotlib.font_manager.FontManager") from the JSON file named *filename*.
See also
[`json_dump`](#matplotlib.font_manager.json_dump "matplotlib.font_manager.json_dump")
matplotlib.font\_manager.list\_fonts(*directory*, *extensions*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L183-L198)
Return a list of all fonts matching any of the extensions, found recursively under the directory.
matplotlib.font\_manager.ttfFontProperty(*font*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L419-L543)
Extract information from a TrueType font file.
Parameters:
**font**[`FT2Font`](ft2font#matplotlib.ft2font.FT2Font "matplotlib.ft2font.FT2Font")
The TrueType font file from which information will be extracted.
Returns:
[`FontEntry`](#matplotlib.font_manager.FontEntry "matplotlib.font_manager.FontEntry")
The extracted font properties.
matplotlib.font\_manager.win32FontDirectory()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L201-L215)
Return the user-specified font directory for Win32. This is looked up from the registry key
```
\\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Fonts
```
If the key is not found, `%WINDIR%\Fonts` will be returned.
matplotlib.font\_manager.win32InstalledFonts(*directory=None*, *fontext='ttf'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/font_manager.py#L266-L291)
[*Deprecated*] Search for fonts in the specified font directory, or use the system directories if none given. Additionally, it is searched for user fonts installed. A list of TrueType font filenames are returned by default, or AFM fonts if *fontext* == 'afm'.
#### Notes
Deprecated since version 3.5.
*class*matplotlib.font\_manager.FontEntry(*fname:[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)")=''*, *name:[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)")=''*, *style:[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)")='normal'*, *variant:[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)")='normal'*, *weight:[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)")='normal'*, *stretch:[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)")='normal'*, *size:[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)")='medium'*)
A class for storing Font properties.
It is used when populating the font lookup dictionary.
| programming_docs |
matplotlib matplotlib.artist matplotlib.artist
=================
Inheritance Diagrams
--------------------
`Artist` class
---------------
*class*matplotlib.artist.Artist[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L96-L1368)
Abstract base class for objects that render into a FigureCanvas.
Typically, all visible elements in a figure are subclasses of Artist.
### Interactive
| | |
| --- | --- |
| [`Artist.add_callback`](_as_gen/matplotlib.artist.artist.add_callback#matplotlib.artist.Artist.add_callback "matplotlib.artist.Artist.add_callback") | Add a callback function that will be called whenever one of the [`Artist`](#matplotlib.artist.Artist "matplotlib.artist.Artist")'s properties changes. |
| [`Artist.remove_callback`](_as_gen/matplotlib.artist.artist.remove_callback#matplotlib.artist.Artist.remove_callback "matplotlib.artist.Artist.remove_callback") | Remove a callback based on its observer id. |
| [`Artist.pchanged`](_as_gen/matplotlib.artist.artist.pchanged#matplotlib.artist.Artist.pchanged "matplotlib.artist.Artist.pchanged") | Call all of the registered callbacks. |
| [`Artist.get_cursor_data`](_as_gen/matplotlib.artist.artist.get_cursor_data#matplotlib.artist.Artist.get_cursor_data "matplotlib.artist.Artist.get_cursor_data") | Return the cursor data for a given event. |
| [`Artist.format_cursor_data`](_as_gen/matplotlib.artist.artist.format_cursor_data#matplotlib.artist.Artist.format_cursor_data "matplotlib.artist.Artist.format_cursor_data") | Return a string representation of *data*. |
| [`Artist.set_mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | Set whether this artist is queried for custom context information when the mouse cursor moves over it. |
| [`Artist.get_mouseover`](_as_gen/matplotlib.artist.artist.get_mouseover#matplotlib.artist.Artist.get_mouseover "matplotlib.artist.Artist.get_mouseover") | Return whether this artist is queried for custom context information when the mouse cursor moves over it. |
| [`Artist.mouseover`](_as_gen/matplotlib.artist.artist.mouseover#matplotlib.artist.Artist.mouseover "matplotlib.artist.Artist.mouseover") | Return whether this artist is queried for custom context information when the mouse cursor moves over it. |
| [`Artist.contains`](_as_gen/matplotlib.artist.artist.contains#matplotlib.artist.Artist.contains "matplotlib.artist.Artist.contains") | Test whether the artist contains the mouse event. |
| [`Artist.pick`](_as_gen/matplotlib.artist.artist.pick#matplotlib.artist.Artist.pick "matplotlib.artist.Artist.pick") | Process a pick event. |
| [`Artist.pickable`](_as_gen/matplotlib.artist.artist.pickable#matplotlib.artist.Artist.pickable "matplotlib.artist.Artist.pickable") | Return whether the artist is pickable. |
| [`Artist.set_picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | Define the picking behavior of the artist. |
| [`Artist.get_picker`](_as_gen/matplotlib.artist.artist.get_picker#matplotlib.artist.Artist.get_picker "matplotlib.artist.Artist.get_picker") | Return the picking behavior of the artist. |
### Clipping
| | |
| --- | --- |
| [`Artist.set_clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | Set whether the artist uses clipping. |
| [`Artist.get_clip_on`](_as_gen/matplotlib.artist.artist.get_clip_on#matplotlib.artist.Artist.get_clip_on "matplotlib.artist.Artist.get_clip_on") | Return whether the artist uses clipping. |
| [`Artist.set_clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | Set the artist's clip [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox"). |
| [`Artist.get_clip_box`](_as_gen/matplotlib.artist.artist.get_clip_box#matplotlib.artist.Artist.get_clip_box "matplotlib.artist.Artist.get_clip_box") | Return the clipbox. |
| [`Artist.set_clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Set the artist's clip path. |
| [`Artist.get_clip_path`](_as_gen/matplotlib.artist.artist.get_clip_path#matplotlib.artist.Artist.get_clip_path "matplotlib.artist.Artist.get_clip_path") | Return the clip path. |
### Bulk Properties
| | |
| --- | --- |
| [`Artist.update`](_as_gen/matplotlib.artist.artist.update#matplotlib.artist.Artist.update "matplotlib.artist.Artist.update") | Update this artist's properties from the dict *props*. |
| [`Artist.update_from`](_as_gen/matplotlib.artist.artist.update_from#matplotlib.artist.Artist.update_from "matplotlib.artist.Artist.update_from") | Copy properties from *other* to *self*. |
| [`Artist.properties`](_as_gen/matplotlib.artist.artist.properties#matplotlib.artist.Artist.properties "matplotlib.artist.Artist.properties") | Return a dictionary of all the properties of the artist. |
| [`Artist.set`](_as_gen/matplotlib.artist.artist.set#matplotlib.artist.Artist.set "matplotlib.artist.Artist.set") | Set multiple properties at once. |
### Drawing
| | |
| --- | --- |
| [`Artist.draw`](_as_gen/matplotlib.artist.artist.draw#matplotlib.artist.Artist.draw "matplotlib.artist.Artist.draw") | Draw the Artist (and its children) using the given renderer. |
| [`Artist.set_animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | Set whether the artist is intended to be used in an animation. |
| [`Artist.get_animated`](_as_gen/matplotlib.artist.artist.get_animated#matplotlib.artist.Artist.get_animated "matplotlib.artist.Artist.get_animated") | Return whether the artist is animated. |
| [`Artist.set_alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | Set the alpha value used for blending - not supported on all backends. |
| [`Artist.get_alpha`](_as_gen/matplotlib.artist.artist.get_alpha#matplotlib.artist.Artist.get_alpha "matplotlib.artist.Artist.get_alpha") | Return the alpha value used for blending - not supported on all backends. |
| [`Artist.set_snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | Set the snapping behavior. |
| [`Artist.get_snap`](_as_gen/matplotlib.artist.artist.get_snap#matplotlib.artist.Artist.get_snap "matplotlib.artist.Artist.get_snap") | Return the snap setting. |
| [`Artist.set_visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | Set the artist's visibility. |
| [`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") | Return the visibility. |
| [`Artist.zorder`](_as_gen/matplotlib.artist.artist.zorder#matplotlib.artist.Artist.zorder "matplotlib.artist.Artist.zorder") | |
| [`Artist.set_zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | Set the zorder for the artist. |
| [`Artist.get_zorder`](_as_gen/matplotlib.artist.artist.get_zorder#matplotlib.artist.Artist.get_zorder "matplotlib.artist.Artist.get_zorder") | Return the artist's zorder. |
| [`Artist.set_agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | Set the agg filter. |
| [`Artist.set_sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | Set the sketch parameters. |
| [`Artist.get_sketch_params`](_as_gen/matplotlib.artist.artist.get_sketch_params#matplotlib.artist.Artist.get_sketch_params "matplotlib.artist.Artist.get_sketch_params") | Return the sketch parameters for the artist. |
| [`Artist.set_rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | Force rasterized (bitmap) drawing for vector graphics output. |
| [`Artist.get_rasterized`](_as_gen/matplotlib.artist.artist.get_rasterized#matplotlib.artist.Artist.get_rasterized "matplotlib.artist.Artist.get_rasterized") | Return whether the artist is to be rasterized. |
| [`Artist.set_path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | Set the path effects. |
| [`Artist.get_path_effects`](_as_gen/matplotlib.artist.artist.get_path_effects#matplotlib.artist.Artist.get_path_effects "matplotlib.artist.Artist.get_path_effects") | |
| [`Artist.get_agg_filter`](_as_gen/matplotlib.artist.artist.get_agg_filter#matplotlib.artist.Artist.get_agg_filter "matplotlib.artist.Artist.get_agg_filter") | Return filter function to be used for agg filter. |
| [`Artist.get_window_extent`](_as_gen/matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent") | Get the artist's bounding box in display space. |
| [`Artist.get_tightbbox`](_as_gen/matplotlib.artist.artist.get_tightbbox#matplotlib.artist.Artist.get_tightbbox "matplotlib.artist.Artist.get_tightbbox") | Like [`Artist.get_window_extent`](_as_gen/matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent"), but includes any clipping. |
| [`Artist.get_transformed_clip_path_and_affine`](_as_gen/matplotlib.artist.artist.get_transformed_clip_path_and_affine#matplotlib.artist.Artist.get_transformed_clip_path_and_affine "matplotlib.artist.Artist.get_transformed_clip_path_and_affine") | Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation. |
### Figure and Axes
| | |
| --- | --- |
| [`Artist.remove`](_as_gen/matplotlib.artist.artist.remove#matplotlib.artist.Artist.remove "matplotlib.artist.Artist.remove") | Remove the artist from the figure if possible. |
| [`Artist.axes`](_as_gen/matplotlib.artist.artist.axes#matplotlib.artist.Artist.axes "matplotlib.artist.Artist.axes") | The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance the artist resides in, or *None*. |
| [`Artist.set_figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | Set the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to. |
| [`Artist.get_figure`](_as_gen/matplotlib.artist.artist.get_figure#matplotlib.artist.Artist.get_figure "matplotlib.artist.Artist.get_figure") | Return the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to. |
### Children
| | |
| --- | --- |
| [`Artist.get_children`](_as_gen/matplotlib.artist.artist.get_children#matplotlib.artist.Artist.get_children "matplotlib.artist.Artist.get_children") | Return a list of the child [`Artist`](#matplotlib.artist.Artist "matplotlib.artist.Artist")s of this [`Artist`](#matplotlib.artist.Artist "matplotlib.artist.Artist"). |
| [`Artist.findobj`](_as_gen/matplotlib.artist.artist.findobj#matplotlib.artist.Artist.findobj "matplotlib.artist.Artist.findobj") | Find artist objects. |
### Transform
| | |
| --- | --- |
| [`Artist.set_transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | Set the artist transform. |
| [`Artist.get_transform`](_as_gen/matplotlib.artist.artist.get_transform#matplotlib.artist.Artist.get_transform "matplotlib.artist.Artist.get_transform") | Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist. |
| [`Artist.is_transform_set`](_as_gen/matplotlib.artist.artist.is_transform_set#matplotlib.artist.Artist.is_transform_set "matplotlib.artist.Artist.is_transform_set") | Return whether the Artist has an explicitly set transform. |
### Units
| | |
| --- | --- |
| [`Artist.convert_xunits`](_as_gen/matplotlib.artist.artist.convert_xunits#matplotlib.artist.Artist.convert_xunits "matplotlib.artist.Artist.convert_xunits") | Convert *x* using the unit type of the xaxis. |
| [`Artist.convert_yunits`](_as_gen/matplotlib.artist.artist.convert_yunits#matplotlib.artist.Artist.convert_yunits "matplotlib.artist.Artist.convert_yunits") | Convert *y* using the unit type of the yaxis. |
| [`Artist.have_units`](_as_gen/matplotlib.artist.artist.have_units#matplotlib.artist.Artist.have_units "matplotlib.artist.Artist.have_units") | Return whether units are set on any axis. |
### Metadata
| | |
| --- | --- |
| [`Artist.set_gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | Set the (group) id for the artist. |
| [`Artist.get_gid`](_as_gen/matplotlib.artist.artist.get_gid#matplotlib.artist.Artist.get_gid "matplotlib.artist.Artist.get_gid") | Return the group id. |
| [`Artist.set_label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | Set a label that will be displayed in the legend. |
| [`Artist.get_label`](_as_gen/matplotlib.artist.artist.get_label#matplotlib.artist.Artist.get_label "matplotlib.artist.Artist.get_label") | Return the label used for this artist in the legend. |
| [`Artist.set_url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | Set the url for the artist. |
| [`Artist.get_url`](_as_gen/matplotlib.artist.artist.get_url#matplotlib.artist.Artist.get_url "matplotlib.artist.Artist.get_url") | Return the url. |
### Miscellaneous
| | |
| --- | --- |
| [`Artist.sticky_edges`](_as_gen/matplotlib.artist.artist.sticky_edges#matplotlib.artist.Artist.sticky_edges "matplotlib.artist.Artist.sticky_edges") | `x` and `y` sticky edge lists for autoscaling. |
| [`Artist.set_in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | Set if artist is to be included in layout calculations, E.g. |
| [`Artist.get_in_layout`](_as_gen/matplotlib.artist.artist.get_in_layout#matplotlib.artist.Artist.get_in_layout "matplotlib.artist.Artist.get_in_layout") | Return boolean flag, `True` if artist is included in layout calculations. |
| [`Artist.stale`](_as_gen/matplotlib.artist.artist.stale#matplotlib.artist.Artist.stale "matplotlib.artist.Artist.stale") | Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist. |
Functions
---------
| | |
| --- | --- |
| [`allow_rasterization`](_as_gen/matplotlib.artist.allow_rasterization#matplotlib.artist.allow_rasterization "matplotlib.artist.allow_rasterization") | Decorator for Artist.draw method. |
| [`get`](_as_gen/matplotlib.artist.get#matplotlib.artist.get "matplotlib.artist.get") | Return the value of an [`Artist`](#matplotlib.artist.Artist "matplotlib.artist.Artist")'s *property*, or print all of them. |
| [`getp`](_as_gen/matplotlib.artist.getp#matplotlib.artist.getp "matplotlib.artist.getp") | Return the value of an [`Artist`](#matplotlib.artist.Artist "matplotlib.artist.Artist")'s *property*, or print all of them. |
| [`setp`](_as_gen/matplotlib.artist.setp#matplotlib.artist.setp "matplotlib.artist.setp") | Set one or more properties on an [`Artist`](#matplotlib.artist.Artist "matplotlib.artist.Artist"), or list allowed values. |
| [`kwdoc`](_as_gen/matplotlib.artist.kwdoc#matplotlib.artist.kwdoc "matplotlib.artist.kwdoc") | Inspect an [`Artist`](#matplotlib.artist.Artist "matplotlib.artist.Artist") class (using [`ArtistInspector`](_as_gen/matplotlib.artist.artistinspector#matplotlib.artist.ArtistInspector "matplotlib.artist.ArtistInspector")) and return information about its settable properties and their current values. |
| [`ArtistInspector`](_as_gen/matplotlib.artist.artistinspector#matplotlib.artist.ArtistInspector "matplotlib.artist.ArtistInspector") | A helper class to inspect an [`Artist`](#matplotlib.artist.Artist "matplotlib.artist.Artist") and return information about its settable properties and their current values. |
matplotlib matplotlib.backends matplotlib.backends
===================
* [`backend_mixed`](backend_mixed_api)
* [`backend_template`](backend_template_api)
* [`backend_agg`](backend_agg_api)
* [`backend_cairo`](backend_cairo_api)
* [`backend_gtk3agg`, `backend_gtk3cairo`](backend_gtk3_api)
* [`backend_gtk4agg`, `backend_gtk4cairo`](backend_gtk4_api)
* [`backend_nbagg`](backend_nbagg_api)
* [`backend_pdf`](backend_pdf_api)
* [`backend_pgf`](backend_pgf_api)
* [`backend_ps`](backend_ps_api)
* [`backend_qtagg`, `backend_qtcairo`](backend_qt_api)
* [`backend_svg`](backend_svg_api)
* [`backend_tkagg`, `backend_tkcairo`](backend_tk_api)
* [`backend_webagg`](backend_webagg_api)
* [`backend_wxagg`, `backend_wxcairo`](backend_wx_api)
matplotlib matplotlib.collections matplotlib.collections
======================
Classes for the efficient drawing of large collections of objects that share most properties, e.g., a large number of line segments or polygons.
The classes are not meant to be as flexible as their single element counterparts (e.g., you may not be able to select all line styles) but they are meant to be fast for common use cases (e.g., a large set of solid line segments).
*class*matplotlib.collections.AsteriskPolygonCollection(*numsides*, *\**, *rotation=0*, *sizes=(1,)*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1347-L1349)
Bases: [`RegularPolyCollection`](#matplotlib.collections.RegularPolyCollection "matplotlib.collections.RegularPolyCollection")
Draw a collection of regular asterisks with *numsides* points.
Parameters:
**numsides**int
The number of sides of the polygon.
**rotation**float
The rotation of the polygon in radians.
**sizes**tuple of float
The area of the circle circumscribing the polygon in points^2.
**\*\*kwargs**
Forwarded to [`Collection`](#matplotlib.collections.Collection "matplotlib.collections.Collection").
#### Examples
See [Lasso Demo](https://matplotlib.org/stable/gallery/event_handling/lasso_demo.html) for a complete example:
```
offsets = np.random.rand(20, 2)
facecolors = [cm.jet(x) for x in np.random.rand(20)]
collection = RegularPolyCollection(
numsides=5, # a pentagon
rotation=0, sizes=(50,),
facecolors=facecolors,
edgecolors=("black",),
linewidths=(1,),
offsets=offsets,
offset_transform=ax.transData,
)
```
add\_callback(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L348-L375)
Add a callback function that will be called whenever one of the [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")'s properties changes.
Parameters:
**func**callable
The callback function. It must have the signature:
```
def func(artist: Artist) -> Any
```
where *artist* is the calling [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"). Return values may exist but are ignored.
Returns:
int
The observer id associated with the callback. This id can be used for removing the callback with [`remove_callback`](#matplotlib.collections.AsteriskPolygonCollection.remove_callback "matplotlib.collections.AsteriskPolygonCollection.remove_callback") later.
See also
[`remove_callback`](#matplotlib.collections.AsteriskPolygonCollection.remove_callback "matplotlib.collections.AsteriskPolygonCollection.remove_callback")
autoscale()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L625-L634)
Autoscale the scalar limits on the norm instance using the current array
autoscale\_None()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L636-L645)
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
*property*axes
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance the artist resides in, or *None*.
*property*callbacksSM[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
changed()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L647-L653)
Call this whenever the mappable is changed to notify all the callbackSM listeners to the 'changed' signal.
colorbar
The last colorbar associated with this ScalarMappable. May be None.
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L437-L472)
Test whether the mouse event occurred in the collection.
Returns `bool, dict(ind=itemlist)`, where every item in itemlist contains the event.
convert\_xunits(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L241-L251)
Convert *x* using the unit type of the xaxis.
If the artist is not contained in an Axes or if the xaxis does not have units, *x* itself is returned.
convert\_yunits(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L253-L263)
Convert *y* using the unit type of the yaxis.
If the artist is not contained in an Axes or if the yaxis does not have units, *y* itself is returned.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1330-L1339)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
findobj(*match=None*, *include\_self=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1208-L1249)
Find artist objects.
Recursively find all [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") instances contained in the artist.
Parameters:
**match**
A filter criterion for the matches. This can be
* *None*: Return all objects contained in artist.
* A function with signature `def match(artist: Artist) -> bool`. The result will only contain artists for which the function returns *True*.
* A class instance: e.g., [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"). The result will only contain artists of this class or its subclasses (`isinstance` check).
**include\_self**bool
Include *self* in the list to be checked for a match.
Returns:
list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
format\_cursor\_data(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1282-L1336)
Return a string representation of *data*.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
The default implementation converts ints and floats and arrays of ints and floats into a comma-separated string enclosed in square brackets, unless the artist has an associated colorbar, in which case scalar values are formatted using the colorbar's formatter.
See also
[`get_cursor_data`](#matplotlib.collections.AsteriskPolygonCollection.get_cursor_data "matplotlib.collections.AsteriskPolygonCollection.get_cursor_data")
get\_agg\_filter()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L929-L931)
Return filter function to be used for agg filter.
get\_alpha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L805-L810)
Return the alpha value used for blending - not supported on all backends.
get\_animated()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L816-L818)
Return whether the artist is animated.
get\_array()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L507-L514)
Return the array of values, that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the array.
get\_capstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L641-L642)
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L430-L432)
Return a list of the child [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s of this [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist").
get\_clim()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L520-L524)
Return the values (min, max) that are mapped to the colormap limits.
get\_clip\_box()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L859-L861)
Return the clipbox.
get\_clip\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L855-L857)
Return whether the artist uses clipping.
get\_clip\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L863-L865)
Return the clip path.
get\_cmap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L516-L518)
Return the [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") instance.
get\_cursor\_data(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1251-L1280)
Return the cursor data for a given event.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
Cursor data can be used by Artists to provide additional context information for a given event. The default implementation just returns *None*.
Subclasses can override the method and return arbitrary data. However, when doing so, they must ensure that [`format_cursor_data`](#matplotlib.collections.AsteriskPolygonCollection.format_cursor_data "matplotlib.collections.AsteriskPolygonCollection.format_cursor_data") can convert the data to a string representation.
The only current use case is displaying the z-value of an [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") in the status bar of a plot window, while moving the mouse.
Parameters:
**event**[`matplotlib.backend_bases.MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
See also
[`format_cursor_data`](#matplotlib.collections.AsteriskPolygonCollection.format_cursor_data "matplotlib.collections.AsteriskPolygonCollection.format_cursor_data")
get\_dashes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.AsteriskPolygonCollection.get_linestyle "matplotlib.collections.AsteriskPolygonCollection.get_linestyle").
get\_datalim(*transData*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L235-L301)
get\_ec()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.AsteriskPolygonCollection.get_edgecolor "matplotlib.collections.AsteriskPolygonCollection.get_edgecolor").
get\_edgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
get\_edgecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.AsteriskPolygonCollection.get_edgecolor "matplotlib.collections.AsteriskPolygonCollection.get_edgecolor").
get\_facecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
get\_facecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.AsteriskPolygonCollection.get_facecolor "matplotlib.collections.AsteriskPolygonCollection.get_facecolor").
get\_fc()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.AsteriskPolygonCollection.get_facecolor "matplotlib.collections.AsteriskPolygonCollection.get_facecolor").
get\_figure()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L703-L705)
Return the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
get\_fill()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L903-L905)
Return whether face is colored.
get\_gid()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L588-L590)
Return the group id.
get\_hatch()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L534-L536)
Return the current hatching pattern.
get\_in\_layout()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L820-L829)
Return boolean flag, `True` if artist is included in layout calculations.
E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
get\_joinstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L655-L656)
get\_label()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1056-L1058)
Return the label used for this artist in the legend.
get\_linestyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
get\_linestyles()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.AsteriskPolygonCollection.get_linestyle "matplotlib.collections.AsteriskPolygonCollection.get_linestyle").
get\_linewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
get\_linewidths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.AsteriskPolygonCollection.get_linewidth "matplotlib.collections.AsteriskPolygonCollection.get_linewidth").
get\_ls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.AsteriskPolygonCollection.get_linestyle "matplotlib.collections.AsteriskPolygonCollection.get_linestyle").
get\_lw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.AsteriskPolygonCollection.get_linewidth "matplotlib.collections.AsteriskPolygonCollection.get_linewidth").
get\_mouseover()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1338-L1343)
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
get\_numsides()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1324-L1325)
get\_offset\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist offset.
get\_offsets()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L554-L557)
Return the offsets for the collection.
get\_path\_effects()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L700-L701)
get\_paths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L205-L206)
get\_picker()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L562-L572)
Return the picking behavior of the artist.
The possible values are described in [`set_picker`](#matplotlib.collections.AsteriskPolygonCollection.set_picker "matplotlib.collections.AsteriskPolygonCollection.set_picker").
See also
[`set_picker`](#matplotlib.collections.AsteriskPolygonCollection.set_picker "matplotlib.collections.AsteriskPolygonCollection.set_picker"), [`pickable`](#matplotlib.collections.AsteriskPolygonCollection.pickable "matplotlib.collections.AsteriskPolygonCollection.pickable"), [`pick`](#matplotlib.collections.AsteriskPolygonCollection.pick "matplotlib.collections.AsteriskPolygonCollection.pick")
get\_pickradius()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L434-L435)
get\_rasterized()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L904-L906)
Return whether the artist is to be rasterized.
get\_rotation()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1327-L1328)
get\_sizes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L938-L947)
Return the sizes ('areas') of the elements in the collection.
Returns:
array
The 'area' of each element.
get\_sketch\_params()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L641-L659)
Return the sketch parameters for the artist.
Returns:
tuple or None
A 3-tuple with the following elements:
* *scale*: The amplitude of the wiggle perpendicular to the source line.
* *length*: The length of the wiggle along the line.
* *randomness*: The scale factor by which the length is shrunken or expanded.
Returns *None* if no sketch parameters were set.
get\_snap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L602-L611)
Return the snap setting.
See [`set_snap`](#matplotlib.collections.AsteriskPolygonCollection.set_snap "matplotlib.collections.AsteriskPolygonCollection.set_snap") for details.
get\_tightbbox(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L322-L346)
Like [`Artist.get_window_extent`](_as_gen/matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent"), but includes any clipping.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
Returns:
[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The enclosing bounding box (in figure pixel coordinates).
get\_transOffset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Alias for [`get_offset_transform`](#matplotlib.collections.AsteriskPolygonCollection.get_offset_transform "matplotlib.collections.AsteriskPolygonCollection.get_offset_transform").
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L421-L428)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist.
get\_transformed\_clip\_path\_and\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L867-L875)
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
get\_transforms()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L211-L212)
get\_url()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L574-L576)
Return the url.
get\_urls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L488-L495)
Return a list of URLs, one for each element of the collection.
The list contains *None* for elements without a URL. See [Hyperlinks](https://matplotlib.org/stable/gallery/misc/hyperlinks_sgskip.html) for an example.
get\_visible()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L812-L814)
Return the visibility.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L303-L306)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
get\_zorder()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1076-L1078)
Return the artist's zorder.
have\_units()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L236-L239)
Return whether units are set on any axis.
is\_transform\_set()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L400-L406)
Return whether the Artist has an explicitly set transform.
This is *True* after [`set_transform`](#matplotlib.collections.AsteriskPolygonCollection.set_transform "matplotlib.collections.AsteriskPolygonCollection.set_transform") has been called.
*property*mouseover
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
*property*norm
pchanged()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L387-L398)
Call all of the registered callbacks.
This function is triggered internally when a property is changed.
See also
[`add_callback`](#matplotlib.collections.AsteriskPolygonCollection.add_callback "matplotlib.collections.AsteriskPolygonCollection.add_callback")
[`remove_callback`](#matplotlib.collections.AsteriskPolygonCollection.remove_callback "matplotlib.collections.AsteriskPolygonCollection.remove_callback")
pick(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L490-L525)
Process a pick event.
Each child artist will fire a pick event if *mouseevent* is over the artist and the artist has picker set.
See also
[`set_picker`](#matplotlib.collections.AsteriskPolygonCollection.set_picker "matplotlib.collections.AsteriskPolygonCollection.set_picker"), [`get_picker`](#matplotlib.collections.AsteriskPolygonCollection.get_picker "matplotlib.collections.AsteriskPolygonCollection.get_picker"), [`pickable`](#matplotlib.collections.AsteriskPolygonCollection.pickable "matplotlib.collections.AsteriskPolygonCollection.pickable")
pickable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L480-L488)
Return whether the artist is pickable.
See also
[`set_picker`](#matplotlib.collections.AsteriskPolygonCollection.set_picker "matplotlib.collections.AsteriskPolygonCollection.set_picker"), [`get_picker`](#matplotlib.collections.AsteriskPolygonCollection.get_picker "matplotlib.collections.AsteriskPolygonCollection.get_picker"), [`pick`](#matplotlib.collections.AsteriskPolygonCollection.pick "matplotlib.collections.AsteriskPolygonCollection.pick")
properties()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1139-L1141)
Return a dictionary of all the properties of the artist.
remove()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L193-L234)
Remove the artist from the figure if possible.
The effect will not be visible until the figure is redrawn, e.g., with [`FigureCanvasBase.draw_idle`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase.draw_idle "matplotlib.backend_bases.FigureCanvasBase.draw_idle"). Call [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") to update the axes limits if desired.
Note: [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") will not see collections even if the collection was added to the axes with *autolim* = True.
Note: there is no support for removing the artist's legend entry.
remove\_callback(*oid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L377-L385)
Remove a callback based on its observer id.
See also
[`add_callback`](#matplotlib.collections.AsteriskPolygonCollection.add_callback "matplotlib.collections.AsteriskPolygonCollection.add_callback")
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *array=<UNSET>*, *capstyle=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *offset\_transform=<UNSET>*, *offsets=<UNSET>*, *path\_effects=<UNSET>*, *paths=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *sizes=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *urls=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](#matplotlib.collections.Collection.set_paths "matplotlib.collections.Collection.set_paths") | unknown |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `sizes` | ndarray or None |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_aa(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.AsteriskPolygonCollection.set_antialiased "matplotlib.collections.AsteriskPolygonCollection.set_antialiased").
set\_agg\_filter(*filter\_func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L933-L949)
Set the agg filter.
Parameters:
**filter\_func**callable
A filter function, which takes a (m, n, depth) float array and a dpi value, and returns a (m, n, depth) array and two offsets from the bottom left corner of the image
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L807-L821)
Set the alpha value used for blending - not supported on all backends.
Parameters:
**alpha**array-like or scalar or None
All values must be within the 0-1 range, inclusive. Masked values and nans are not supported.
set\_animated(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1023-L1041)
Set whether the artist is intended to be used in an animation.
If True, the artist is excluded from regular drawing of the figure. You have to call [`Figure.draw_artist`](figure_api#matplotlib.figure.Figure.draw_artist "matplotlib.figure.Figure.draw_artist") / [`Axes.draw_artist`](_as_gen/matplotlib.axes.axes.draw_artist#matplotlib.axes.Axes.draw_artist "matplotlib.axes.Axes.draw_artist") explicitly on the artist. This approach is used to speed up animations using blitting.
See also [`matplotlib.animation`](animation_api#module-matplotlib.animation "matplotlib.animation") and [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html).
Parameters:
**b**bool
set\_antialiased(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Set the antialiasing state for rendering.
Parameters:
**aa**bool or list of bools
set\_antialiaseds(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.AsteriskPolygonCollection.set_antialiased "matplotlib.collections.AsteriskPolygonCollection.set_antialiased").
set\_array(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L484-L505)
Set the value array from array-like *A*.
Parameters:
**A**array-like or None
The values that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the value array *A*.
set\_capstyle(*cs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L630-L639)
Set the [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") for the collection (for all its elements).
Parameters:
**cs**[`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'}
set\_clim(*vmin=None*, *vmax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L526-L550)
Set the norm limits for image scaling.
Parameters:
**vmin, vmax**float
The limits.
The limits may also be passed as a tuple (*vmin*, *vmax*) as a single positional argument.
set\_clip\_box(*clipbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L731-L741)
Set the artist's clip [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
Parameters:
**clipbox**[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
set\_clip\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L877-L892)
Set whether the artist uses clipping.
When False artists will be visible outside of the Axes which can lead to unexpected results.
Parameters:
**b**bool
set\_clip\_path(*path*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L743-L803)
Set the artist's clip path.
Parameters:
**path**[`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") or [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") or [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") or None
The clip path. If given a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), *transform* must be provided as well. If *None*, a previously set clip path is removed.
**transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
Only used if *path* is a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), in which case the given [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") is converted to a [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") using *transform*.
#### Notes
For efficiency, if *path* is a [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") this method will set the clipping box to the corresponding rectangle and set the clipping path to `None`.
For technical reasons (support of [`set`](_as_gen/matplotlib.artist.artist.set#matplotlib.artist.Artist.set "matplotlib.artist.Artist.set")), a tuple (*path*, *transform*) is also accepted as a single positional parameter.
set\_cmap(*cmap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L562-L574)
Set the colormap for luminance data.
Parameters:
**cmap**[`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None
set\_color(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L713-L727)
Set both the edgecolor and the facecolor.
Parameters:
**c**color or list of rgba tuples
See also
[`Collection.set_facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor"), [`Collection.set_edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor")
For setting the edge or face color individually.
set\_dashes(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.AsteriskPolygonCollection.set_linestyle "matplotlib.collections.AsteriskPolygonCollection.set_linestyle").
set\_ec(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.AsteriskPolygonCollection.set_edgecolor "matplotlib.collections.AsteriskPolygonCollection.set_edgecolor").
set\_edgecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Set the edgecolor(s) of the collection.
Parameters:
**c**color or list of colors or 'face'
The collection edgecolor(s). If a sequence, the patches cycle through it. If 'face', match the facecolor.
set\_edgecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.AsteriskPolygonCollection.set_edgecolor "matplotlib.collections.AsteriskPolygonCollection.set_edgecolor").
set\_facecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Set the facecolor(s) of the collection. *c* can be a color (all patches have same color), or a sequence of colors; if it is a sequence the patches will cycle through the sequence.
If *c* is 'none', the patch will not be filled.
Parameters:
**c**color or list of colors
set\_facecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.AsteriskPolygonCollection.set_facecolor "matplotlib.collections.AsteriskPolygonCollection.set_facecolor").
set\_fc(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.AsteriskPolygonCollection.set_facecolor "matplotlib.collections.AsteriskPolygonCollection.set_facecolor").
set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L707-L729)
Set the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
set\_gid(*gid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L592-L600)
Set the (group) id for the artist.
Parameters:
**gid**str
set\_hatch(*hatch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L497-L532)
Set the hatching pattern
*hatch* can be one of:
```
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
```
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
Parameters:
**hatch**{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'}
set\_in\_layout(*in\_layout*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1043-L1054)
Set if artist is to be included in layout calculations, E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
Parameters:
**in\_layout**bool
set\_joinstyle(*js*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L644-L653)
Set the [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") for the collection (for all its elements).
Parameters:
**js**[`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'}
set\_label(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1060-L1074)
Set a label that will be displayed in the legend.
Parameters:
**s**object
*s* will be converted to a string by calling [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)").
set\_linestyle(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Set the linestyle(s) for the collection.
| linestyle | description |
| --- | --- |
| `'-'` or `'solid'` | solid line |
| `'--'` or `'dashed'` | dashed line |
| `'-.'` or `'dashdot'` | dash-dotted line |
| `':'` or `'dotted'` | dotted line |
Alternatively a dash tuple of the following form can be provided:
```
(offset, onoffseq),
```
where `onoffseq` is an even length tuple of on and off ink in points.
Parameters:
**ls**str or tuple or list thereof
Valid values for individual linestyles include {'-', '--', '-.', ':', '', (offset, on-off-seq)}. See [`Line2D.set_linestyle`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") for a complete description.
set\_linestyles(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.AsteriskPolygonCollection.set_linestyle "matplotlib.collections.AsteriskPolygonCollection.set_linestyle").
set\_linewidth(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Set the linewidth(s) for the collection. *lw* can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence
Parameters:
**lw**float or list of floats
set\_linewidths(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.AsteriskPolygonCollection.set_linewidth "matplotlib.collections.AsteriskPolygonCollection.set_linewidth").
set\_ls(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.AsteriskPolygonCollection.set_linestyle "matplotlib.collections.AsteriskPolygonCollection.set_linestyle").
set\_lw(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.AsteriskPolygonCollection.set_linewidth "matplotlib.collections.AsteriskPolygonCollection.set_linewidth").
set\_mouseover(*mouseover*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1345-L1366)
Set whether this artist is queried for custom context information when the mouse cursor moves over it.
Parameters:
**mouseover**bool
See also
[`get_cursor_data`](#matplotlib.collections.AsteriskPolygonCollection.get_cursor_data "matplotlib.collections.AsteriskPolygonCollection.get_cursor_data")
[`ToolCursorPosition`](backend_tools_api#matplotlib.backend_tools.ToolCursorPosition "matplotlib.backend_tools.ToolCursorPosition")
[`NavigationToolbar2`](backend_bases_api#matplotlib.backend_bases.NavigationToolbar2 "matplotlib.backend_bases.NavigationToolbar2")
set\_norm(*norm*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L609-L623)
Set the normalization instance.
Parameters:
**norm**[`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None
#### Notes
If there are any colorbars using the mappable for this norm, setting the norm of the mappable will reset the norm, locator, and formatters on the colorbar to default.
set\_offset\_transform(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Set the artist offset transform.
Parameters:
**offset\_transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_offsets(*offsets*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L538-L552)
Set the offsets for the collection.
Parameters:
**offsets**(N, 2) or (2,) array-like
set\_path\_effects(*path\_effects*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L689-L698)
Set the path effects.
Parameters:
**path\_effects**[`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
set\_paths(*paths*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L208-L209)
set\_picker(*picker*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L527-L560)
Define the picking behavior of the artist.
Parameters:
**picker**None or bool or float or callable
This can be one of the following:
* *None*: Picking is disabled for this artist (default).
* A boolean: If *True* then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist.
* A float: If picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if its data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event
* A function: If picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event:
```
hit, props = picker(artist, mouseevent)
```
to determine the hit test. if the mouse event is over the artist, return *hit=True* and props is a dictionary of properties you want added to the PickEvent attributes.
set\_pickradius(*pickradius*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L422-L432)
Set the pick radius used for containment tests.
Parameters:
**pickradius**float
Pick radius, in points.
set\_rasterized(*rasterized*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L908-L927)
Force rasterized (bitmap) drawing for vector graphics output.
Rasterized drawing is not supported by all artists. If you try to enable this on an artist that does not support it, the command has no effect and a warning will be issued.
This setting is ignored for pixel-based output.
See also [Rasterization for vector graphics](https://matplotlib.org/stable/gallery/misc/rasterization_demo.html).
Parameters:
**rasterized**bool
set\_sizes(*sizes*, *dpi=72.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L949-L971)
Set the sizes of each member of the collection.
Parameters:
**sizes**ndarray or None
The size to set for each element of the collection. The value is the 'area' of the element.
**dpi**float, default: 72
The dpi of the canvas.
set\_sketch\_params(*scale=None*, *length=None*, *randomness=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L661-L687)
Set the sketch parameters.
Parameters:
**scale**float, optional
The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), or not provided, no sketch filter will be provided.
**length**float, optional
The length of the wiggle along the line, in pixels (default 128.0)
**randomness**float, optional
The scale factor by which the length is shrunken or expanded (default 16.0)
The PGF backend uses this argument as an RNG seed and not as described above. Using the same seed yields the same random shape.
set\_snap(*snap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L613-L639)
Set the snapping behavior.
Snapping aligns positions with the pixel grid, which results in clearer images. For example, if a black line of 1px width was defined at a position in between two pixels, the resulting image would contain the interpolated value of that line in the pixel grid, which would be a grey value on both adjacent pixel positions. In contrast, snapping will move the line to the nearest integer pixel value, so that the resulting image will really contain a 1px wide black line.
Snapping is currently only supported by the Agg and MacOSX backends.
Parameters:
**snap**bool or None
Possible values:
* *True*: Snap vertices to the nearest pixel center.
* *False*: Do not modify vertex positions.
* *None*: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center.
set\_transOffset(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Alias for [`set_offset_transform`](#matplotlib.collections.AsteriskPolygonCollection.set_offset_transform "matplotlib.collections.AsteriskPolygonCollection.set_offset_transform").
set\_transform(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L408-L419)
Set the artist transform.
Parameters:
**t**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_url(*url*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L578-L586)
Set the url for the artist.
Parameters:
**url**str
set\_urls(*urls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L474-L486)
Parameters:
**urls**list of str or None
#### Notes
URLs are currently only implemented by the SVG backend. They are ignored by all other backends.
set\_visible(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1011-L1021)
Set the artist's visibility.
Parameters:
**b**bool
set\_zorder(*level*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1080-L1093)
Set the zorder for the artist. Artists with lower zorder values are drawn first.
Parameters:
**level**float
*property*stale
Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist.
*property*sticky\_edges
`x` and `y` sticky edge lists for autoscaling.
When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added--the view limit "sticks" to the edge. A typical use case is histograms, where one usually expects no margin on the bottom edge (0) of the histogram.
Moreover, margin expansion "bumps" against sticky edges and cannot cross them. For example, if the upper data limit is 1.0, the upper view limit computed by simple margin application is 1.2, but there is a sticky edge at 1.1, then the actual upper view limit will be 1.1.
This attribute cannot be assigned to; however, the `x` and `y` lists can be modified in place as needed.
#### Examples
```
>>> artist.sticky_edges.x[:] = (xmin, xmax)
>>> artist.sticky_edges.y[:] = (ymin, ymax)
```
to\_rgba(*x*, *alpha=None*, *bytes=False*, *norm=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L414-L482)
Return a normalized rgba array corresponding to *x*.
In the normal case, *x* is a 1D or 2D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If *x* is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the *alpha* kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the *alpha* kwarg is ignored; it does not replace the preexisting alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if *bytes* is *False* (default), the rgba array will be floats in the 0-1 range; if it is *True*, the returned rgba array will be uint8 in the 0 to 255 range.
If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1).
update(*props*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1168-L1177)
Update this artist's properties from the dict *props*.
Parameters:
**props**dict
update\_from(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L907-L929)
Copy properties from other to self.
update\_scalarmappable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L865-L901)
Update colors from the scalar mappable array, if any.
Assign colors to edges and faces based on the array and/or colors that were directly set, as appropriate.
zorder*=0*
*class*matplotlib.collections.BrokenBarHCollection(*xranges*, *yrange*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1233-L1273)
Bases: [`PolyCollection`](#matplotlib.collections.PolyCollection "matplotlib.collections.PolyCollection")
A collection of horizontal bars spanning *yrange* with a sequence of *xranges*.
Parameters:
**xranges**list of (float, float)
The sequence of (left-edge-position, width) pairs for each bar.
**yrange**(float, float)
The (lower-edge, height) common to all bars.
**\*\*kwargs**
Forwarded to [`Collection`](#matplotlib.collections.Collection "matplotlib.collections.Collection").
add\_callback(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L348-L375)
Add a callback function that will be called whenever one of the [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")'s properties changes.
Parameters:
**func**callable
The callback function. It must have the signature:
```
def func(artist: Artist) -> Any
```
where *artist* is the calling [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"). Return values may exist but are ignored.
Returns:
int
The observer id associated with the callback. This id can be used for removing the callback with [`remove_callback`](#matplotlib.collections.BrokenBarHCollection.remove_callback "matplotlib.collections.BrokenBarHCollection.remove_callback") later.
See also
[`remove_callback`](#matplotlib.collections.BrokenBarHCollection.remove_callback "matplotlib.collections.BrokenBarHCollection.remove_callback")
autoscale()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L625-L634)
Autoscale the scalar limits on the norm instance using the current array
autoscale\_None()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L636-L645)
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
*property*axes
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance the artist resides in, or *None*.
*property*callbacksSM[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
changed()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L647-L653)
Call this whenever the mappable is changed to notify all the callbackSM listeners to the 'changed' signal.
colorbar
The last colorbar associated with this ScalarMappable. May be None.
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L437-L472)
Test whether the mouse event occurred in the collection.
Returns `bool, dict(ind=itemlist)`, where every item in itemlist contains the event.
convert\_xunits(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L241-L251)
Convert *x* using the unit type of the xaxis.
If the artist is not contained in an Axes or if the xaxis does not have units, *x* itself is returned.
convert\_yunits(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L253-L263)
Convert *y* using the unit type of the yaxis.
If the artist is not contained in an Axes or if the yaxis does not have units, *y* itself is returned.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L973-L976)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
findobj(*match=None*, *include\_self=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1208-L1249)
Find artist objects.
Recursively find all [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") instances contained in the artist.
Parameters:
**match**
A filter criterion for the matches. This can be
* *None*: Return all objects contained in artist.
* A function with signature `def match(artist: Artist) -> bool`. The result will only contain artists for which the function returns *True*.
* A class instance: e.g., [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"). The result will only contain artists of this class or its subclasses (`isinstance` check).
**include\_self**bool
Include *self* in the list to be checked for a match.
Returns:
list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
format\_cursor\_data(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1282-L1336)
Return a string representation of *data*.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
The default implementation converts ints and floats and arrays of ints and floats into a comma-separated string enclosed in square brackets, unless the artist has an associated colorbar, in which case scalar values are formatted using the colorbar's formatter.
See also
[`get_cursor_data`](#matplotlib.collections.BrokenBarHCollection.get_cursor_data "matplotlib.collections.BrokenBarHCollection.get_cursor_data")
get\_agg\_filter()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L929-L931)
Return filter function to be used for agg filter.
get\_alpha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L805-L810)
Return the alpha value used for blending - not supported on all backends.
get\_animated()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L816-L818)
Return whether the artist is animated.
get\_array()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L507-L514)
Return the array of values, that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the array.
get\_capstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L641-L642)
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L430-L432)
Return a list of the child [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s of this [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist").
get\_clim()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L520-L524)
Return the values (min, max) that are mapped to the colormap limits.
get\_clip\_box()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L859-L861)
Return the clipbox.
get\_clip\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L855-L857)
Return whether the artist uses clipping.
get\_clip\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L863-L865)
Return the clip path.
get\_cmap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L516-L518)
Return the [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") instance.
get\_cursor\_data(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1251-L1280)
Return the cursor data for a given event.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
Cursor data can be used by Artists to provide additional context information for a given event. The default implementation just returns *None*.
Subclasses can override the method and return arbitrary data. However, when doing so, they must ensure that [`format_cursor_data`](#matplotlib.collections.BrokenBarHCollection.format_cursor_data "matplotlib.collections.BrokenBarHCollection.format_cursor_data") can convert the data to a string representation.
The only current use case is displaying the z-value of an [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") in the status bar of a plot window, while moving the mouse.
Parameters:
**event**[`matplotlib.backend_bases.MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
See also
[`format_cursor_data`](#matplotlib.collections.BrokenBarHCollection.format_cursor_data "matplotlib.collections.BrokenBarHCollection.format_cursor_data")
get\_dashes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.BrokenBarHCollection.get_linestyle "matplotlib.collections.BrokenBarHCollection.get_linestyle").
get\_datalim(*transData*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L235-L301)
get\_ec()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.BrokenBarHCollection.get_edgecolor "matplotlib.collections.BrokenBarHCollection.get_edgecolor").
get\_edgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
get\_edgecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.BrokenBarHCollection.get_edgecolor "matplotlib.collections.BrokenBarHCollection.get_edgecolor").
get\_facecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
get\_facecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.BrokenBarHCollection.get_facecolor "matplotlib.collections.BrokenBarHCollection.get_facecolor").
get\_fc()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.BrokenBarHCollection.get_facecolor "matplotlib.collections.BrokenBarHCollection.get_facecolor").
get\_figure()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L703-L705)
Return the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
get\_fill()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L903-L905)
Return whether face is colored.
get\_gid()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L588-L590)
Return the group id.
get\_hatch()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L534-L536)
Return the current hatching pattern.
get\_in\_layout()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L820-L829)
Return boolean flag, `True` if artist is included in layout calculations.
E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
get\_joinstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L655-L656)
get\_label()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1056-L1058)
Return the label used for this artist in the legend.
get\_linestyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
get\_linestyles()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.BrokenBarHCollection.get_linestyle "matplotlib.collections.BrokenBarHCollection.get_linestyle").
get\_linewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
get\_linewidths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.BrokenBarHCollection.get_linewidth "matplotlib.collections.BrokenBarHCollection.get_linewidth").
get\_ls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.BrokenBarHCollection.get_linestyle "matplotlib.collections.BrokenBarHCollection.get_linestyle").
get\_lw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.BrokenBarHCollection.get_linewidth "matplotlib.collections.BrokenBarHCollection.get_linewidth").
get\_mouseover()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1338-L1343)
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
get\_offset\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist offset.
get\_offsets()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L554-L557)
Return the offsets for the collection.
get\_path\_effects()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L700-L701)
get\_paths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L205-L206)
get\_picker()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L562-L572)
Return the picking behavior of the artist.
The possible values are described in [`set_picker`](#matplotlib.collections.BrokenBarHCollection.set_picker "matplotlib.collections.BrokenBarHCollection.set_picker").
See also
[`set_picker`](#matplotlib.collections.BrokenBarHCollection.set_picker "matplotlib.collections.BrokenBarHCollection.set_picker"), [`pickable`](#matplotlib.collections.BrokenBarHCollection.pickable "matplotlib.collections.BrokenBarHCollection.pickable"), [`pick`](#matplotlib.collections.BrokenBarHCollection.pick "matplotlib.collections.BrokenBarHCollection.pick")
get\_pickradius()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L434-L435)
get\_rasterized()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L904-L906)
Return whether the artist is to be rasterized.
get\_sizes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L938-L947)
Return the sizes ('areas') of the elements in the collection.
Returns:
array
The 'area' of each element.
get\_sketch\_params()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L641-L659)
Return the sketch parameters for the artist.
Returns:
tuple or None
A 3-tuple with the following elements:
* *scale*: The amplitude of the wiggle perpendicular to the source line.
* *length*: The length of the wiggle along the line.
* *randomness*: The scale factor by which the length is shrunken or expanded.
Returns *None* if no sketch parameters were set.
get\_snap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L602-L611)
Return the snap setting.
See [`set_snap`](#matplotlib.collections.BrokenBarHCollection.set_snap "matplotlib.collections.BrokenBarHCollection.set_snap") for details.
get\_tightbbox(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L322-L346)
Like [`Artist.get_window_extent`](_as_gen/matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent"), but includes any clipping.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
Returns:
[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The enclosing bounding box (in figure pixel coordinates).
get\_transOffset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Alias for [`get_offset_transform`](#matplotlib.collections.BrokenBarHCollection.get_offset_transform "matplotlib.collections.BrokenBarHCollection.get_offset_transform").
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L421-L428)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist.
get\_transformed\_clip\_path\_and\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L867-L875)
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
get\_transforms()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L211-L212)
get\_url()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L574-L576)
Return the url.
get\_urls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L488-L495)
Return a list of URLs, one for each element of the collection.
The list contains *None* for elements without a URL. See [Hyperlinks](https://matplotlib.org/stable/gallery/misc/hyperlinks_sgskip.html) for an example.
get\_visible()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L812-L814)
Return the visibility.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L303-L306)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
get\_zorder()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1076-L1078)
Return the artist's zorder.
have\_units()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L236-L239)
Return whether units are set on any axis.
is\_transform\_set()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L400-L406)
Return whether the Artist has an explicitly set transform.
This is *True* after [`set_transform`](#matplotlib.collections.BrokenBarHCollection.set_transform "matplotlib.collections.BrokenBarHCollection.set_transform") has been called.
*property*mouseover
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
*property*norm
pchanged()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L387-L398)
Call all of the registered callbacks.
This function is triggered internally when a property is changed.
See also
[`add_callback`](#matplotlib.collections.BrokenBarHCollection.add_callback "matplotlib.collections.BrokenBarHCollection.add_callback")
[`remove_callback`](#matplotlib.collections.BrokenBarHCollection.remove_callback "matplotlib.collections.BrokenBarHCollection.remove_callback")
pick(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L490-L525)
Process a pick event.
Each child artist will fire a pick event if *mouseevent* is over the artist and the artist has picker set.
See also
[`set_picker`](#matplotlib.collections.BrokenBarHCollection.set_picker "matplotlib.collections.BrokenBarHCollection.set_picker"), [`get_picker`](#matplotlib.collections.BrokenBarHCollection.get_picker "matplotlib.collections.BrokenBarHCollection.get_picker"), [`pickable`](#matplotlib.collections.BrokenBarHCollection.pickable "matplotlib.collections.BrokenBarHCollection.pickable")
pickable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L480-L488)
Return whether the artist is pickable.
See also
[`set_picker`](#matplotlib.collections.BrokenBarHCollection.set_picker "matplotlib.collections.BrokenBarHCollection.set_picker"), [`get_picker`](#matplotlib.collections.BrokenBarHCollection.get_picker "matplotlib.collections.BrokenBarHCollection.get_picker"), [`pick`](#matplotlib.collections.BrokenBarHCollection.pick "matplotlib.collections.BrokenBarHCollection.pick")
properties()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1139-L1141)
Return a dictionary of all the properties of the artist.
remove()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L193-L234)
Remove the artist from the figure if possible.
The effect will not be visible until the figure is redrawn, e.g., with [`FigureCanvasBase.draw_idle`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase.draw_idle "matplotlib.backend_bases.FigureCanvasBase.draw_idle"). Call [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") to update the axes limits if desired.
Note: [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") will not see collections even if the collection was added to the axes with *autolim* = True.
Note: there is no support for removing the artist's legend entry.
remove\_callback(*oid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L377-L385)
Remove a callback based on its observer id.
See also
[`add_callback`](#matplotlib.collections.BrokenBarHCollection.add_callback "matplotlib.collections.BrokenBarHCollection.add_callback")
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *array=<UNSET>*, *capstyle=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *offset\_transform=<UNSET>*, *offsets=<UNSET>*, *path\_effects=<UNSET>*, *paths=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *sizes=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *urls=<UNSET>*, *verts=<UNSET>*, *verts\_and\_codes=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `sizes` | ndarray or None |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`verts`](#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`verts_and_codes`](#matplotlib.collections.PolyCollection.set_verts_and_codes "matplotlib.collections.PolyCollection.set_verts_and_codes") | unknown |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_aa(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.BrokenBarHCollection.set_antialiased "matplotlib.collections.BrokenBarHCollection.set_antialiased").
set\_agg\_filter(*filter\_func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L933-L949)
Set the agg filter.
Parameters:
**filter\_func**callable
A filter function, which takes a (m, n, depth) float array and a dpi value, and returns a (m, n, depth) array and two offsets from the bottom left corner of the image
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L807-L821)
Set the alpha value used for blending - not supported on all backends.
Parameters:
**alpha**array-like or scalar or None
All values must be within the 0-1 range, inclusive. Masked values and nans are not supported.
set\_animated(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1023-L1041)
Set whether the artist is intended to be used in an animation.
If True, the artist is excluded from regular drawing of the figure. You have to call [`Figure.draw_artist`](figure_api#matplotlib.figure.Figure.draw_artist "matplotlib.figure.Figure.draw_artist") / [`Axes.draw_artist`](_as_gen/matplotlib.axes.axes.draw_artist#matplotlib.axes.Axes.draw_artist "matplotlib.axes.Axes.draw_artist") explicitly on the artist. This approach is used to speed up animations using blitting.
See also [`matplotlib.animation`](animation_api#module-matplotlib.animation "matplotlib.animation") and [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html).
Parameters:
**b**bool
set\_antialiased(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Set the antialiasing state for rendering.
Parameters:
**aa**bool or list of bools
set\_antialiaseds(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.BrokenBarHCollection.set_antialiased "matplotlib.collections.BrokenBarHCollection.set_antialiased").
set\_array(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L484-L505)
Set the value array from array-like *A*.
Parameters:
**A**array-like or None
The values that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the value array *A*.
set\_capstyle(*cs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L630-L639)
Set the [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") for the collection (for all its elements).
Parameters:
**cs**[`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'}
set\_clim(*vmin=None*, *vmax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L526-L550)
Set the norm limits for image scaling.
Parameters:
**vmin, vmax**float
The limits.
The limits may also be passed as a tuple (*vmin*, *vmax*) as a single positional argument.
set\_clip\_box(*clipbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L731-L741)
Set the artist's clip [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
Parameters:
**clipbox**[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
set\_clip\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L877-L892)
Set whether the artist uses clipping.
When False artists will be visible outside of the Axes which can lead to unexpected results.
Parameters:
**b**bool
set\_clip\_path(*path*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L743-L803)
Set the artist's clip path.
Parameters:
**path**[`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") or [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") or [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") or None
The clip path. If given a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), *transform* must be provided as well. If *None*, a previously set clip path is removed.
**transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
Only used if *path* is a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), in which case the given [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") is converted to a [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") using *transform*.
#### Notes
For efficiency, if *path* is a [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") this method will set the clipping box to the corresponding rectangle and set the clipping path to `None`.
For technical reasons (support of [`set`](_as_gen/matplotlib.artist.artist.set#matplotlib.artist.Artist.set "matplotlib.artist.Artist.set")), a tuple (*path*, *transform*) is also accepted as a single positional parameter.
set\_cmap(*cmap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L562-L574)
Set the colormap for luminance data.
Parameters:
**cmap**[`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None
set\_color(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L713-L727)
Set both the edgecolor and the facecolor.
Parameters:
**c**color or list of rgba tuples
See also
[`Collection.set_facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor"), [`Collection.set_edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor")
For setting the edge or face color individually.
set\_dashes(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.BrokenBarHCollection.set_linestyle "matplotlib.collections.BrokenBarHCollection.set_linestyle").
set\_ec(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.BrokenBarHCollection.set_edgecolor "matplotlib.collections.BrokenBarHCollection.set_edgecolor").
set\_edgecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Set the edgecolor(s) of the collection.
Parameters:
**c**color or list of colors or 'face'
The collection edgecolor(s). If a sequence, the patches cycle through it. If 'face', match the facecolor.
set\_edgecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.BrokenBarHCollection.set_edgecolor "matplotlib.collections.BrokenBarHCollection.set_edgecolor").
set\_facecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Set the facecolor(s) of the collection. *c* can be a color (all patches have same color), or a sequence of colors; if it is a sequence the patches will cycle through the sequence.
If *c* is 'none', the patch will not be filled.
Parameters:
**c**color or list of colors
set\_facecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.BrokenBarHCollection.set_facecolor "matplotlib.collections.BrokenBarHCollection.set_facecolor").
set\_fc(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.BrokenBarHCollection.set_facecolor "matplotlib.collections.BrokenBarHCollection.set_facecolor").
set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L707-L729)
Set the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
set\_gid(*gid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L592-L600)
Set the (group) id for the artist.
Parameters:
**gid**str
set\_hatch(*hatch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L497-L532)
Set the hatching pattern
*hatch* can be one of:
```
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
```
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
Parameters:
**hatch**{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'}
set\_in\_layout(*in\_layout*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1043-L1054)
Set if artist is to be included in layout calculations, E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
Parameters:
**in\_layout**bool
set\_joinstyle(*js*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L644-L653)
Set the [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") for the collection (for all its elements).
Parameters:
**js**[`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'}
set\_label(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1060-L1074)
Set a label that will be displayed in the legend.
Parameters:
**s**object
*s* will be converted to a string by calling [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)").
set\_linestyle(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Set the linestyle(s) for the collection.
| linestyle | description |
| --- | --- |
| `'-'` or `'solid'` | solid line |
| `'--'` or `'dashed'` | dashed line |
| `'-.'` or `'dashdot'` | dash-dotted line |
| `':'` or `'dotted'` | dotted line |
Alternatively a dash tuple of the following form can be provided:
```
(offset, onoffseq),
```
where `onoffseq` is an even length tuple of on and off ink in points.
Parameters:
**ls**str or tuple or list thereof
Valid values for individual linestyles include {'-', '--', '-.', ':', '', (offset, on-off-seq)}. See [`Line2D.set_linestyle`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") for a complete description.
set\_linestyles(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.BrokenBarHCollection.set_linestyle "matplotlib.collections.BrokenBarHCollection.set_linestyle").
set\_linewidth(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Set the linewidth(s) for the collection. *lw* can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence
Parameters:
**lw**float or list of floats
set\_linewidths(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.BrokenBarHCollection.set_linewidth "matplotlib.collections.BrokenBarHCollection.set_linewidth").
set\_ls(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.BrokenBarHCollection.set_linestyle "matplotlib.collections.BrokenBarHCollection.set_linestyle").
set\_lw(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.BrokenBarHCollection.set_linewidth "matplotlib.collections.BrokenBarHCollection.set_linewidth").
set\_mouseover(*mouseover*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1345-L1366)
Set whether this artist is queried for custom context information when the mouse cursor moves over it.
Parameters:
**mouseover**bool
See also
[`get_cursor_data`](#matplotlib.collections.BrokenBarHCollection.get_cursor_data "matplotlib.collections.BrokenBarHCollection.get_cursor_data")
[`ToolCursorPosition`](backend_tools_api#matplotlib.backend_tools.ToolCursorPosition "matplotlib.backend_tools.ToolCursorPosition")
[`NavigationToolbar2`](backend_bases_api#matplotlib.backend_bases.NavigationToolbar2 "matplotlib.backend_bases.NavigationToolbar2")
set\_norm(*norm*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L609-L623)
Set the normalization instance.
Parameters:
**norm**[`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None
#### Notes
If there are any colorbars using the mappable for this norm, setting the norm of the mappable will reset the norm, locator, and formatters on the colorbar to default.
set\_offset\_transform(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Set the artist offset transform.
Parameters:
**offset\_transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_offsets(*offsets*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L538-L552)
Set the offsets for the collection.
Parameters:
**offsets**(N, 2) or (2,) array-like
set\_path\_effects(*path\_effects*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L689-L698)
Set the path effects.
Parameters:
**path\_effects**[`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
set\_paths(*verts*, *closed=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1179-L1219)
Set the vertices of the polygons.
Parameters:
**verts**list of array-like
The sequence of polygons [*verts0*, *verts1*, ...] where each element *verts\_i* defines the vertices of polygon *i* as a 2D array-like of shape (M, 2).
**closed**bool, default: True
Whether the polygon should be closed by adding a CLOSEPOLY connection at the end.
set\_picker(*picker*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L527-L560)
Define the picking behavior of the artist.
Parameters:
**picker**None or bool or float or callable
This can be one of the following:
* *None*: Picking is disabled for this artist (default).
* A boolean: If *True* then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist.
* A float: If picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if its data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event
* A function: If picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event:
```
hit, props = picker(artist, mouseevent)
```
to determine the hit test. if the mouse event is over the artist, return *hit=True* and props is a dictionary of properties you want added to the PickEvent attributes.
set\_pickradius(*pickradius*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L422-L432)
Set the pick radius used for containment tests.
Parameters:
**pickradius**float
Pick radius, in points.
set\_rasterized(*rasterized*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L908-L927)
Force rasterized (bitmap) drawing for vector graphics output.
Rasterized drawing is not supported by all artists. If you try to enable this on an artist that does not support it, the command has no effect and a warning will be issued.
This setting is ignored for pixel-based output.
See also [Rasterization for vector graphics](https://matplotlib.org/stable/gallery/misc/rasterization_demo.html).
Parameters:
**rasterized**bool
set\_sizes(*sizes*, *dpi=72.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L949-L971)
Set the sizes of each member of the collection.
Parameters:
**sizes**ndarray or None
The size to set for each element of the collection. The value is the 'area' of the element.
**dpi**float, default: 72
The dpi of the canvas.
set\_sketch\_params(*scale=None*, *length=None*, *randomness=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L661-L687)
Set the sketch parameters.
Parameters:
**scale**float, optional
The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), or not provided, no sketch filter will be provided.
**length**float, optional
The length of the wiggle along the line, in pixels (default 128.0)
**randomness**float, optional
The scale factor by which the length is shrunken or expanded (default 16.0)
The PGF backend uses this argument as an RNG seed and not as described above. Using the same seed yields the same random shape.
set\_snap(*snap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L613-L639)
Set the snapping behavior.
Snapping aligns positions with the pixel grid, which results in clearer images. For example, if a black line of 1px width was defined at a position in between two pixels, the resulting image would contain the interpolated value of that line in the pixel grid, which would be a grey value on both adjacent pixel positions. In contrast, snapping will move the line to the nearest integer pixel value, so that the resulting image will really contain a 1px wide black line.
Snapping is currently only supported by the Agg and MacOSX backends.
Parameters:
**snap**bool or None
Possible values:
* *True*: Snap vertices to the nearest pixel center.
* *False*: Do not modify vertex positions.
* *None*: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center.
set\_transOffset(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Alias for [`set_offset_transform`](#matplotlib.collections.BrokenBarHCollection.set_offset_transform "matplotlib.collections.BrokenBarHCollection.set_offset_transform").
set\_transform(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L408-L419)
Set the artist transform.
Parameters:
**t**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_url(*url*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L578-L586)
Set the url for the artist.
Parameters:
**url**str
set\_urls(*urls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L474-L486)
Parameters:
**urls**list of str or None
#### Notes
URLs are currently only implemented by the SVG backend. They are ignored by all other backends.
set\_verts(*verts*, *closed=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1179-L1219)
Set the vertices of the polygons.
Parameters:
**verts**list of array-like
The sequence of polygons [*verts0*, *verts1*, ...] where each element *verts\_i* defines the vertices of polygon *i* as a 2D array-like of shape (M, 2).
**closed**bool, default: True
Whether the polygon should be closed by adding a CLOSEPOLY connection at the end.
set\_verts\_and\_codes(*verts*, *codes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1223-L1230)
Initialize vertices with path codes.
set\_visible(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1011-L1021)
Set the artist's visibility.
Parameters:
**b**bool
set\_zorder(*level*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1080-L1093)
Set the zorder for the artist. Artists with lower zorder values are drawn first.
Parameters:
**level**float
*classmethod*span\_where(*x*, *ymin*, *ymax*, *where*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1258-L1273)
Return a [`BrokenBarHCollection`](#matplotlib.collections.BrokenBarHCollection "matplotlib.collections.BrokenBarHCollection") that plots horizontal bars from over the regions in *x* where *where* is True. The bars range on the y-axis from *ymin* to *ymax*
*kwargs* are passed on to the collection.
*property*stale
Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist.
*property*sticky\_edges
`x` and `y` sticky edge lists for autoscaling.
When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added--the view limit "sticks" to the edge. A typical use case is histograms, where one usually expects no margin on the bottom edge (0) of the histogram.
Moreover, margin expansion "bumps" against sticky edges and cannot cross them. For example, if the upper data limit is 1.0, the upper view limit computed by simple margin application is 1.2, but there is a sticky edge at 1.1, then the actual upper view limit will be 1.1.
This attribute cannot be assigned to; however, the `x` and `y` lists can be modified in place as needed.
#### Examples
```
>>> artist.sticky_edges.x[:] = (xmin, xmax)
>>> artist.sticky_edges.y[:] = (ymin, ymax)
```
to\_rgba(*x*, *alpha=None*, *bytes=False*, *norm=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L414-L482)
Return a normalized rgba array corresponding to *x*.
In the normal case, *x* is a 1D or 2D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If *x* is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the *alpha* kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the *alpha* kwarg is ignored; it does not replace the preexisting alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if *bytes* is *False* (default), the rgba array will be floats in the 0-1 range; if it is *True*, the returned rgba array will be uint8 in the 0 to 255 range.
If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1).
update(*props*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1168-L1177)
Update this artist's properties from the dict *props*.
Parameters:
**props**dict
update\_from(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L907-L929)
Copy properties from other to self.
update\_scalarmappable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L865-L901)
Update colors from the scalar mappable array, if any.
Assign colors to edges and faces based on the array and/or colors that were directly set, as appropriate.
zorder*=0*
*class*matplotlib.collections.CircleCollection(*sizes*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1668-L1685)
Bases: `_CollectionWithSizes`
A collection of circles, drawn using splines.
Parameters:
**sizes**float or array-like
The area of each circle in points^2.
**\*\*kwargs**
Forwarded to [`Collection`](#matplotlib.collections.Collection "matplotlib.collections.Collection").
add\_callback(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L348-L375)
Add a callback function that will be called whenever one of the [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")'s properties changes.
Parameters:
**func**callable
The callback function. It must have the signature:
```
def func(artist: Artist) -> Any
```
where *artist* is the calling [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"). Return values may exist but are ignored.
Returns:
int
The observer id associated with the callback. This id can be used for removing the callback with [`remove_callback`](#matplotlib.collections.CircleCollection.remove_callback "matplotlib.collections.CircleCollection.remove_callback") later.
See also
[`remove_callback`](#matplotlib.collections.CircleCollection.remove_callback "matplotlib.collections.CircleCollection.remove_callback")
autoscale()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L625-L634)
Autoscale the scalar limits on the norm instance using the current array
autoscale\_None()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L636-L645)
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
*property*axes
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance the artist resides in, or *None*.
*property*callbacksSM[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
changed()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L647-L653)
Call this whenever the mappable is changed to notify all the callbackSM listeners to the 'changed' signal.
colorbar
The last colorbar associated with this ScalarMappable. May be None.
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L437-L472)
Test whether the mouse event occurred in the collection.
Returns `bool, dict(ind=itemlist)`, where every item in itemlist contains the event.
convert\_xunits(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L241-L251)
Convert *x* using the unit type of the xaxis.
If the artist is not contained in an Axes or if the xaxis does not have units, *x* itself is returned.
convert\_yunits(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L253-L263)
Convert *y* using the unit type of the yaxis.
If the artist is not contained in an Axes or if the yaxis does not have units, *y* itself is returned.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L973-L976)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
findobj(*match=None*, *include\_self=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1208-L1249)
Find artist objects.
Recursively find all [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") instances contained in the artist.
Parameters:
**match**
A filter criterion for the matches. This can be
* *None*: Return all objects contained in artist.
* A function with signature `def match(artist: Artist) -> bool`. The result will only contain artists for which the function returns *True*.
* A class instance: e.g., [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"). The result will only contain artists of this class or its subclasses (`isinstance` check).
**include\_self**bool
Include *self* in the list to be checked for a match.
Returns:
list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
format\_cursor\_data(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1282-L1336)
Return a string representation of *data*.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
The default implementation converts ints and floats and arrays of ints and floats into a comma-separated string enclosed in square brackets, unless the artist has an associated colorbar, in which case scalar values are formatted using the colorbar's formatter.
See also
[`get_cursor_data`](#matplotlib.collections.CircleCollection.get_cursor_data "matplotlib.collections.CircleCollection.get_cursor_data")
get\_agg\_filter()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L929-L931)
Return filter function to be used for agg filter.
get\_alpha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L805-L810)
Return the alpha value used for blending - not supported on all backends.
get\_animated()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L816-L818)
Return whether the artist is animated.
get\_array()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L507-L514)
Return the array of values, that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the array.
get\_capstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L641-L642)
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L430-L432)
Return a list of the child [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s of this [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist").
get\_clim()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L520-L524)
Return the values (min, max) that are mapped to the colormap limits.
get\_clip\_box()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L859-L861)
Return the clipbox.
get\_clip\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L855-L857)
Return whether the artist uses clipping.
get\_clip\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L863-L865)
Return the clip path.
get\_cmap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L516-L518)
Return the [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") instance.
get\_cursor\_data(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1251-L1280)
Return the cursor data for a given event.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
Cursor data can be used by Artists to provide additional context information for a given event. The default implementation just returns *None*.
Subclasses can override the method and return arbitrary data. However, when doing so, they must ensure that [`format_cursor_data`](#matplotlib.collections.CircleCollection.format_cursor_data "matplotlib.collections.CircleCollection.format_cursor_data") can convert the data to a string representation.
The only current use case is displaying the z-value of an [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") in the status bar of a plot window, while moving the mouse.
Parameters:
**event**[`matplotlib.backend_bases.MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
See also
[`format_cursor_data`](#matplotlib.collections.CircleCollection.format_cursor_data "matplotlib.collections.CircleCollection.format_cursor_data")
get\_dashes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.CircleCollection.get_linestyle "matplotlib.collections.CircleCollection.get_linestyle").
get\_datalim(*transData*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L235-L301)
get\_ec()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.CircleCollection.get_edgecolor "matplotlib.collections.CircleCollection.get_edgecolor").
get\_edgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
get\_edgecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.CircleCollection.get_edgecolor "matplotlib.collections.CircleCollection.get_edgecolor").
get\_facecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
get\_facecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.CircleCollection.get_facecolor "matplotlib.collections.CircleCollection.get_facecolor").
get\_fc()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.CircleCollection.get_facecolor "matplotlib.collections.CircleCollection.get_facecolor").
get\_figure()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L703-L705)
Return the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
get\_fill()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L903-L905)
Return whether face is colored.
get\_gid()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L588-L590)
Return the group id.
get\_hatch()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L534-L536)
Return the current hatching pattern.
get\_in\_layout()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L820-L829)
Return boolean flag, `True` if artist is included in layout calculations.
E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
get\_joinstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L655-L656)
get\_label()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1056-L1058)
Return the label used for this artist in the legend.
get\_linestyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
get\_linestyles()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.CircleCollection.get_linestyle "matplotlib.collections.CircleCollection.get_linestyle").
get\_linewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
get\_linewidths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.CircleCollection.get_linewidth "matplotlib.collections.CircleCollection.get_linewidth").
get\_ls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.CircleCollection.get_linestyle "matplotlib.collections.CircleCollection.get_linestyle").
get\_lw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.CircleCollection.get_linewidth "matplotlib.collections.CircleCollection.get_linewidth").
get\_mouseover()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1338-L1343)
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
get\_offset\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist offset.
get\_offsets()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L554-L557)
Return the offsets for the collection.
get\_path\_effects()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L700-L701)
get\_paths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L205-L206)
get\_picker()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L562-L572)
Return the picking behavior of the artist.
The possible values are described in [`set_picker`](#matplotlib.collections.CircleCollection.set_picker "matplotlib.collections.CircleCollection.set_picker").
See also
[`set_picker`](#matplotlib.collections.CircleCollection.set_picker "matplotlib.collections.CircleCollection.set_picker"), [`pickable`](#matplotlib.collections.CircleCollection.pickable "matplotlib.collections.CircleCollection.pickable"), [`pick`](#matplotlib.collections.CircleCollection.pick "matplotlib.collections.CircleCollection.pick")
get\_pickradius()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L434-L435)
get\_rasterized()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L904-L906)
Return whether the artist is to be rasterized.
get\_sizes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L938-L947)
Return the sizes ('areas') of the elements in the collection.
Returns:
array
The 'area' of each element.
get\_sketch\_params()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L641-L659)
Return the sketch parameters for the artist.
Returns:
tuple or None
A 3-tuple with the following elements:
* *scale*: The amplitude of the wiggle perpendicular to the source line.
* *length*: The length of the wiggle along the line.
* *randomness*: The scale factor by which the length is shrunken or expanded.
Returns *None* if no sketch parameters were set.
get\_snap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L602-L611)
Return the snap setting.
See [`set_snap`](#matplotlib.collections.CircleCollection.set_snap "matplotlib.collections.CircleCollection.set_snap") for details.
get\_tightbbox(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L322-L346)
Like [`Artist.get_window_extent`](_as_gen/matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent"), but includes any clipping.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
Returns:
[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The enclosing bounding box (in figure pixel coordinates).
get\_transOffset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Alias for [`get_offset_transform`](#matplotlib.collections.CircleCollection.get_offset_transform "matplotlib.collections.CircleCollection.get_offset_transform").
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L421-L428)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist.
get\_transformed\_clip\_path\_and\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L867-L875)
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
get\_transforms()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L211-L212)
get\_url()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L574-L576)
Return the url.
get\_urls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L488-L495)
Return a list of URLs, one for each element of the collection.
The list contains *None* for elements without a URL. See [Hyperlinks](https://matplotlib.org/stable/gallery/misc/hyperlinks_sgskip.html) for an example.
get\_visible()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L812-L814)
Return the visibility.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L303-L306)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
get\_zorder()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1076-L1078)
Return the artist's zorder.
have\_units()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L236-L239)
Return whether units are set on any axis.
is\_transform\_set()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L400-L406)
Return whether the Artist has an explicitly set transform.
This is *True* after [`set_transform`](#matplotlib.collections.CircleCollection.set_transform "matplotlib.collections.CircleCollection.set_transform") has been called.
*property*mouseover
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
*property*norm
pchanged()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L387-L398)
Call all of the registered callbacks.
This function is triggered internally when a property is changed.
See also
[`add_callback`](#matplotlib.collections.CircleCollection.add_callback "matplotlib.collections.CircleCollection.add_callback")
[`remove_callback`](#matplotlib.collections.CircleCollection.remove_callback "matplotlib.collections.CircleCollection.remove_callback")
pick(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L490-L525)
Process a pick event.
Each child artist will fire a pick event if *mouseevent* is over the artist and the artist has picker set.
See also
[`set_picker`](#matplotlib.collections.CircleCollection.set_picker "matplotlib.collections.CircleCollection.set_picker"), [`get_picker`](#matplotlib.collections.CircleCollection.get_picker "matplotlib.collections.CircleCollection.get_picker"), [`pickable`](#matplotlib.collections.CircleCollection.pickable "matplotlib.collections.CircleCollection.pickable")
pickable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L480-L488)
Return whether the artist is pickable.
See also
[`set_picker`](#matplotlib.collections.CircleCollection.set_picker "matplotlib.collections.CircleCollection.set_picker"), [`get_picker`](#matplotlib.collections.CircleCollection.get_picker "matplotlib.collections.CircleCollection.get_picker"), [`pick`](#matplotlib.collections.CircleCollection.pick "matplotlib.collections.CircleCollection.pick")
properties()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1139-L1141)
Return a dictionary of all the properties of the artist.
remove()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L193-L234)
Remove the artist from the figure if possible.
The effect will not be visible until the figure is redrawn, e.g., with [`FigureCanvasBase.draw_idle`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase.draw_idle "matplotlib.backend_bases.FigureCanvasBase.draw_idle"). Call [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") to update the axes limits if desired.
Note: [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") will not see collections even if the collection was added to the axes with *autolim* = True.
Note: there is no support for removing the artist's legend entry.
remove\_callback(*oid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L377-L385)
Remove a callback based on its observer id.
See also
[`add_callback`](#matplotlib.collections.CircleCollection.add_callback "matplotlib.collections.CircleCollection.add_callback")
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *array=<UNSET>*, *capstyle=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *offset\_transform=<UNSET>*, *offsets=<UNSET>*, *path\_effects=<UNSET>*, *paths=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *sizes=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *urls=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](#matplotlib.collections.Collection.set_paths "matplotlib.collections.Collection.set_paths") | unknown |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `sizes` | ndarray or None |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_aa(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.CircleCollection.set_antialiased "matplotlib.collections.CircleCollection.set_antialiased").
set\_agg\_filter(*filter\_func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L933-L949)
Set the agg filter.
Parameters:
**filter\_func**callable
A filter function, which takes a (m, n, depth) float array and a dpi value, and returns a (m, n, depth) array and two offsets from the bottom left corner of the image
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L807-L821)
Set the alpha value used for blending - not supported on all backends.
Parameters:
**alpha**array-like or scalar or None
All values must be within the 0-1 range, inclusive. Masked values and nans are not supported.
set\_animated(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1023-L1041)
Set whether the artist is intended to be used in an animation.
If True, the artist is excluded from regular drawing of the figure. You have to call [`Figure.draw_artist`](figure_api#matplotlib.figure.Figure.draw_artist "matplotlib.figure.Figure.draw_artist") / [`Axes.draw_artist`](_as_gen/matplotlib.axes.axes.draw_artist#matplotlib.axes.Axes.draw_artist "matplotlib.axes.Axes.draw_artist") explicitly on the artist. This approach is used to speed up animations using blitting.
See also [`matplotlib.animation`](animation_api#module-matplotlib.animation "matplotlib.animation") and [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html).
Parameters:
**b**bool
set\_antialiased(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Set the antialiasing state for rendering.
Parameters:
**aa**bool or list of bools
set\_antialiaseds(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.CircleCollection.set_antialiased "matplotlib.collections.CircleCollection.set_antialiased").
set\_array(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L484-L505)
Set the value array from array-like *A*.
Parameters:
**A**array-like or None
The values that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the value array *A*.
set\_capstyle(*cs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L630-L639)
Set the [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") for the collection (for all its elements).
Parameters:
**cs**[`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'}
set\_clim(*vmin=None*, *vmax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L526-L550)
Set the norm limits for image scaling.
Parameters:
**vmin, vmax**float
The limits.
The limits may also be passed as a tuple (*vmin*, *vmax*) as a single positional argument.
set\_clip\_box(*clipbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L731-L741)
Set the artist's clip [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
Parameters:
**clipbox**[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
set\_clip\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L877-L892)
Set whether the artist uses clipping.
When False artists will be visible outside of the Axes which can lead to unexpected results.
Parameters:
**b**bool
set\_clip\_path(*path*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L743-L803)
Set the artist's clip path.
Parameters:
**path**[`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") or [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") or [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") or None
The clip path. If given a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), *transform* must be provided as well. If *None*, a previously set clip path is removed.
**transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
Only used if *path* is a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), in which case the given [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") is converted to a [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") using *transform*.
#### Notes
For efficiency, if *path* is a [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") this method will set the clipping box to the corresponding rectangle and set the clipping path to `None`.
For technical reasons (support of [`set`](_as_gen/matplotlib.artist.artist.set#matplotlib.artist.Artist.set "matplotlib.artist.Artist.set")), a tuple (*path*, *transform*) is also accepted as a single positional parameter.
set\_cmap(*cmap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L562-L574)
Set the colormap for luminance data.
Parameters:
**cmap**[`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None
set\_color(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L713-L727)
Set both the edgecolor and the facecolor.
Parameters:
**c**color or list of rgba tuples
See also
[`Collection.set_facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor"), [`Collection.set_edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor")
For setting the edge or face color individually.
set\_dashes(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.CircleCollection.set_linestyle "matplotlib.collections.CircleCollection.set_linestyle").
set\_ec(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.CircleCollection.set_edgecolor "matplotlib.collections.CircleCollection.set_edgecolor").
set\_edgecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Set the edgecolor(s) of the collection.
Parameters:
**c**color or list of colors or 'face'
The collection edgecolor(s). If a sequence, the patches cycle through it. If 'face', match the facecolor.
set\_edgecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.CircleCollection.set_edgecolor "matplotlib.collections.CircleCollection.set_edgecolor").
set\_facecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Set the facecolor(s) of the collection. *c* can be a color (all patches have same color), or a sequence of colors; if it is a sequence the patches will cycle through the sequence.
If *c* is 'none', the patch will not be filled.
Parameters:
**c**color or list of colors
set\_facecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.CircleCollection.set_facecolor "matplotlib.collections.CircleCollection.set_facecolor").
set\_fc(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.CircleCollection.set_facecolor "matplotlib.collections.CircleCollection.set_facecolor").
set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L707-L729)
Set the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
set\_gid(*gid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L592-L600)
Set the (group) id for the artist.
Parameters:
**gid**str
set\_hatch(*hatch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L497-L532)
Set the hatching pattern
*hatch* can be one of:
```
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
```
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
Parameters:
**hatch**{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'}
set\_in\_layout(*in\_layout*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1043-L1054)
Set if artist is to be included in layout calculations, E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
Parameters:
**in\_layout**bool
set\_joinstyle(*js*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L644-L653)
Set the [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") for the collection (for all its elements).
Parameters:
**js**[`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'}
set\_label(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1060-L1074)
Set a label that will be displayed in the legend.
Parameters:
**s**object
*s* will be converted to a string by calling [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)").
set\_linestyle(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Set the linestyle(s) for the collection.
| linestyle | description |
| --- | --- |
| `'-'` or `'solid'` | solid line |
| `'--'` or `'dashed'` | dashed line |
| `'-.'` or `'dashdot'` | dash-dotted line |
| `':'` or `'dotted'` | dotted line |
Alternatively a dash tuple of the following form can be provided:
```
(offset, onoffseq),
```
where `onoffseq` is an even length tuple of on and off ink in points.
Parameters:
**ls**str or tuple or list thereof
Valid values for individual linestyles include {'-', '--', '-.', ':', '', (offset, on-off-seq)}. See [`Line2D.set_linestyle`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") for a complete description.
set\_linestyles(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.CircleCollection.set_linestyle "matplotlib.collections.CircleCollection.set_linestyle").
set\_linewidth(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Set the linewidth(s) for the collection. *lw* can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence
Parameters:
**lw**float or list of floats
set\_linewidths(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.CircleCollection.set_linewidth "matplotlib.collections.CircleCollection.set_linewidth").
set\_ls(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.CircleCollection.set_linestyle "matplotlib.collections.CircleCollection.set_linestyle").
set\_lw(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.CircleCollection.set_linewidth "matplotlib.collections.CircleCollection.set_linewidth").
set\_mouseover(*mouseover*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1345-L1366)
Set whether this artist is queried for custom context information when the mouse cursor moves over it.
Parameters:
**mouseover**bool
See also
[`get_cursor_data`](#matplotlib.collections.CircleCollection.get_cursor_data "matplotlib.collections.CircleCollection.get_cursor_data")
[`ToolCursorPosition`](backend_tools_api#matplotlib.backend_tools.ToolCursorPosition "matplotlib.backend_tools.ToolCursorPosition")
[`NavigationToolbar2`](backend_bases_api#matplotlib.backend_bases.NavigationToolbar2 "matplotlib.backend_bases.NavigationToolbar2")
set\_norm(*norm*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L609-L623)
Set the normalization instance.
Parameters:
**norm**[`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None
#### Notes
If there are any colorbars using the mappable for this norm, setting the norm of the mappable will reset the norm, locator, and formatters on the colorbar to default.
set\_offset\_transform(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Set the artist offset transform.
Parameters:
**offset\_transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_offsets(*offsets*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L538-L552)
Set the offsets for the collection.
Parameters:
**offsets**(N, 2) or (2,) array-like
set\_path\_effects(*path\_effects*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L689-L698)
Set the path effects.
Parameters:
**path\_effects**[`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
set\_paths(*paths*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L208-L209)
set\_picker(*picker*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L527-L560)
Define the picking behavior of the artist.
Parameters:
**picker**None or bool or float or callable
This can be one of the following:
* *None*: Picking is disabled for this artist (default).
* A boolean: If *True* then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist.
* A float: If picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if its data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event
* A function: If picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event:
```
hit, props = picker(artist, mouseevent)
```
to determine the hit test. if the mouse event is over the artist, return *hit=True* and props is a dictionary of properties you want added to the PickEvent attributes.
set\_pickradius(*pickradius*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L422-L432)
Set the pick radius used for containment tests.
Parameters:
**pickradius**float
Pick radius, in points.
set\_rasterized(*rasterized*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L908-L927)
Force rasterized (bitmap) drawing for vector graphics output.
Rasterized drawing is not supported by all artists. If you try to enable this on an artist that does not support it, the command has no effect and a warning will be issued.
This setting is ignored for pixel-based output.
See also [Rasterization for vector graphics](https://matplotlib.org/stable/gallery/misc/rasterization_demo.html).
Parameters:
**rasterized**bool
set\_sizes(*sizes*, *dpi=72.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L949-L971)
Set the sizes of each member of the collection.
Parameters:
**sizes**ndarray or None
The size to set for each element of the collection. The value is the 'area' of the element.
**dpi**float, default: 72
The dpi of the canvas.
set\_sketch\_params(*scale=None*, *length=None*, *randomness=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L661-L687)
Set the sketch parameters.
Parameters:
**scale**float, optional
The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), or not provided, no sketch filter will be provided.
**length**float, optional
The length of the wiggle along the line, in pixels (default 128.0)
**randomness**float, optional
The scale factor by which the length is shrunken or expanded (default 16.0)
The PGF backend uses this argument as an RNG seed and not as described above. Using the same seed yields the same random shape.
set\_snap(*snap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L613-L639)
Set the snapping behavior.
Snapping aligns positions with the pixel grid, which results in clearer images. For example, if a black line of 1px width was defined at a position in between two pixels, the resulting image would contain the interpolated value of that line in the pixel grid, which would be a grey value on both adjacent pixel positions. In contrast, snapping will move the line to the nearest integer pixel value, so that the resulting image will really contain a 1px wide black line.
Snapping is currently only supported by the Agg and MacOSX backends.
Parameters:
**snap**bool or None
Possible values:
* *True*: Snap vertices to the nearest pixel center.
* *False*: Do not modify vertex positions.
* *None*: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center.
set\_transOffset(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Alias for [`set_offset_transform`](#matplotlib.collections.CircleCollection.set_offset_transform "matplotlib.collections.CircleCollection.set_offset_transform").
set\_transform(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L408-L419)
Set the artist transform.
Parameters:
**t**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_url(*url*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L578-L586)
Set the url for the artist.
Parameters:
**url**str
set\_urls(*urls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L474-L486)
Parameters:
**urls**list of str or None
#### Notes
URLs are currently only implemented by the SVG backend. They are ignored by all other backends.
set\_visible(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1011-L1021)
Set the artist's visibility.
Parameters:
**b**bool
set\_zorder(*level*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1080-L1093)
Set the zorder for the artist. Artists with lower zorder values are drawn first.
Parameters:
**level**float
*property*stale
Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist.
*property*sticky\_edges
`x` and `y` sticky edge lists for autoscaling.
When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added--the view limit "sticks" to the edge. A typical use case is histograms, where one usually expects no margin on the bottom edge (0) of the histogram.
Moreover, margin expansion "bumps" against sticky edges and cannot cross them. For example, if the upper data limit is 1.0, the upper view limit computed by simple margin application is 1.2, but there is a sticky edge at 1.1, then the actual upper view limit will be 1.1.
This attribute cannot be assigned to; however, the `x` and `y` lists can be modified in place as needed.
#### Examples
```
>>> artist.sticky_edges.x[:] = (xmin, xmax)
>>> artist.sticky_edges.y[:] = (ymin, ymax)
```
to\_rgba(*x*, *alpha=None*, *bytes=False*, *norm=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L414-L482)
Return a normalized rgba array corresponding to *x*.
In the normal case, *x* is a 1D or 2D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If *x* is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the *alpha* kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the *alpha* kwarg is ignored; it does not replace the preexisting alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if *bytes* is *False* (default), the rgba array will be floats in the 0-1 range; if it is *True*, the returned rgba array will be uint8 in the 0 to 255 range.
If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1).
update(*props*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1168-L1177)
Update this artist's properties from the dict *props*.
Parameters:
**props**dict
update\_from(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L907-L929)
Copy properties from other to self.
update\_scalarmappable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L865-L901)
Update colors from the scalar mappable array, if any.
Assign colors to edges and faces based on the array and/or colors that were directly set, as appropriate.
zorder*=0*
*class*matplotlib.collections.Collection(*\**, *edgecolors=None*, *facecolors=None*, *linewidths=None*, *linestyles='solid'*, *capstyle=None*, *joinstyle=None*, *antialiaseds=None*, *offsets=None*, *offset\_transform=None*, *norm=None*, *cmap=None*, *pickradius=5.0*, *hatch=None*, *urls=None*, *zorder=1*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L27-L929)
Bases: [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"), [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable")
Base class for Collections. Must be subclassed to be usable.
A Collection represents a sequence of [`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch")es that can be drawn more efficiently together than individually. For example, when a single path is being drawn repeatedly at different offsets, the renderer can typically execute a `draw_marker()` call much more efficiently than a series of repeated calls to `draw_path()` with the offsets put in one-by-one.
Most properties of a collection can be configured per-element. Therefore, Collections have "plural" versions of many of the properties of a [`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") (e.g. [`Collection.get_paths`](#matplotlib.collections.Collection.get_paths "matplotlib.collections.Collection.get_paths") instead of [`Patch.get_path`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.get_path "matplotlib.patches.Patch.get_path")). Exceptions are the *zorder*, *hatch*, *pickradius*, *capstyle* and *joinstyle* properties, which can only be set globally for the whole collection.
Besides these exceptions, all properties can be specified as single values (applying to all elements) or sequences of values. The property of the `i`th element of the collection is:
```
prop[i % len(prop)]
```
Each Collection can optionally be used as its own [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") by passing the *norm* and *cmap* parameters to its constructor. If the Collection's [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") matrix `_A` has been set (via a call to [`Collection.set_array`](#matplotlib.collections.Collection.set_array "matplotlib.collections.Collection.set_array")), then at draw time this internal scalar mappable will be used to set the `facecolors` and `edgecolors`, ignoring those that were manually passed in.
Parameters:
**edgecolors**color or list of colors, default: `[rcParams["patch.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.edgecolor#matplotlibrc-sample)` (default: `'black'`)
Edge color for each patch making up the collection. The special value 'face' can be passed to make the edgecolor match the facecolor.
**facecolors**color or list of colors, default: `[rcParams["patch.facecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.facecolor#matplotlibrc-sample)` (default: `'C0'`)
Face color for each patch making up the collection.
**linewidths**float or list of floats, default: `[rcParams["patch.linewidth"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.linewidth#matplotlibrc-sample)` (default: `1.0`)
Line width for each patch making up the collection.
**linestyles**str or tuple or list thereof, default: 'solid'
Valid strings are ['solid', 'dashed', 'dashdot', 'dotted', '-', '--', '-.', ':']. Dash tuples should be of the form:
```
(offset, onoffseq),
```
where *onoffseq* is an even length tuple of on and off ink lengths in points. For examples, see [Linestyles](https://matplotlib.org/stable/gallery/lines_bars_and_markers/linestyles.html).
**capstyle**[`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle")-like, default: `[rcParams["patch.capstyle"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.capstyle#matplotlibrc-sample)`
Style to use for capping lines for all paths in the collection. Allowed values are {'butt', 'projecting', 'round'}.
**joinstyle**[`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle")-like, default: `[rcParams["patch.joinstyle"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.joinstyle#matplotlibrc-sample)`
Style to use for joining lines for all paths in the collection. Allowed values are {'miter', 'round', 'bevel'}.
**antialiaseds**bool or list of bool, default: `[rcParams["patch.antialiased"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.antialiased#matplotlibrc-sample)` (default: `True`)
Whether each patch in the collection should be drawn with antialiasing.
**offsets**(float, float) or list thereof, default: (0, 0)
A vector by which to translate each patch after rendering (default is no translation). The translation is performed in screen (pixel) coordinates (i.e. after the Artist's transform is applied).
**offset\_transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), default: [`IdentityTransform`](transformations#matplotlib.transforms.IdentityTransform "matplotlib.transforms.IdentityTransform")
A single transform which will be applied to each *offsets* vector before it is used.
**cmap, norm**
Data normalization and colormapping parameters. See [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") for a detailed description.
**hatch**str, optional
Hatching pattern to use in filled paths, if any. Valid strings are ['/', '', '|', '-', '+', 'x', 'o', 'O', '.', '\*']. See [Hatch style reference](https://matplotlib.org/stable/gallery/shapes_and_collections/hatch_style_reference.html) for the meaning of each hatch type.
**pickradius**float, default: 5.0
If `pickradius <= 0`, then [`Collection.contains`](#matplotlib.collections.Collection.contains "matplotlib.collections.Collection.contains") will return `True` whenever the test point is inside of one of the polygons formed by the control points of a Path in the Collection. On the other hand, if it is greater than 0, then we instead check if the test point is contained in a stroke of width `2*pickradius` following any of the Paths in the Collection.
**urls**list of str, default: None
A URL for each patch to link to once drawn. Currently only works for the SVG backend. See [Hyperlinks](https://matplotlib.org/stable/gallery/misc/hyperlinks_sgskip.html) for examples.
**zorder**float, default: 1
The drawing order, shared by all Patches in the Collection. See [Zorder Demo](https://matplotlib.org/stable/gallery/misc/zorder_demo.html) for all defaults and examples.
add\_callback(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L348-L375)
Add a callback function that will be called whenever one of the [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")'s properties changes.
Parameters:
**func**callable
The callback function. It must have the signature:
```
def func(artist: Artist) -> Any
```
where *artist* is the calling [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"). Return values may exist but are ignored.
Returns:
int
The observer id associated with the callback. This id can be used for removing the callback with [`remove_callback`](#matplotlib.collections.Collection.remove_callback "matplotlib.collections.Collection.remove_callback") later.
See also
[`remove_callback`](#matplotlib.collections.Collection.remove_callback "matplotlib.collections.Collection.remove_callback")
autoscale()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L625-L634)
Autoscale the scalar limits on the norm instance using the current array
autoscale\_None()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L636-L645)
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
*property*axes
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance the artist resides in, or *None*.
*property*callbacksSM[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
changed()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L647-L653)
Call this whenever the mappable is changed to notify all the callbackSM listeners to the 'changed' signal.
colorbar
The last colorbar associated with this ScalarMappable. May be None.
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L437-L472)
Test whether the mouse event occurred in the collection.
Returns `bool, dict(ind=itemlist)`, where every item in itemlist contains the event.
convert\_xunits(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L241-L251)
Convert *x* using the unit type of the xaxis.
If the artist is not contained in an Axes or if the xaxis does not have units, *x* itself is returned.
convert\_yunits(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L253-L263)
Convert *y* using the unit type of the yaxis.
If the artist is not contained in an Axes or if the yaxis does not have units, *y* itself is returned.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L344-L420)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
findobj(*match=None*, *include\_self=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1208-L1249)
Find artist objects.
Recursively find all [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") instances contained in the artist.
Parameters:
**match**
A filter criterion for the matches. This can be
* *None*: Return all objects contained in artist.
* A function with signature `def match(artist: Artist) -> bool`. The result will only contain artists for which the function returns *True*.
* A class instance: e.g., [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"). The result will only contain artists of this class or its subclasses (`isinstance` check).
**include\_self**bool
Include *self* in the list to be checked for a match.
Returns:
list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
format\_cursor\_data(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1282-L1336)
Return a string representation of *data*.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
The default implementation converts ints and floats and arrays of ints and floats into a comma-separated string enclosed in square brackets, unless the artist has an associated colorbar, in which case scalar values are formatted using the colorbar's formatter.
See also
[`get_cursor_data`](#matplotlib.collections.Collection.get_cursor_data "matplotlib.collections.Collection.get_cursor_data")
get\_agg\_filter()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L929-L931)
Return filter function to be used for agg filter.
get\_alpha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L805-L810)
Return the alpha value used for blending - not supported on all backends.
get\_animated()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L816-L818)
Return whether the artist is animated.
get\_array()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L507-L514)
Return the array of values, that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the array.
get\_capstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L641-L642)
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L430-L432)
Return a list of the child [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s of this [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist").
get\_clim()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L520-L524)
Return the values (min, max) that are mapped to the colormap limits.
get\_clip\_box()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L859-L861)
Return the clipbox.
get\_clip\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L855-L857)
Return whether the artist uses clipping.
get\_clip\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L863-L865)
Return the clip path.
get\_cmap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L516-L518)
Return the [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") instance.
get\_cursor\_data(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1251-L1280)
Return the cursor data for a given event.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
Cursor data can be used by Artists to provide additional context information for a given event. The default implementation just returns *None*.
Subclasses can override the method and return arbitrary data. However, when doing so, they must ensure that [`format_cursor_data`](#matplotlib.collections.Collection.format_cursor_data "matplotlib.collections.Collection.format_cursor_data") can convert the data to a string representation.
The only current use case is displaying the z-value of an [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") in the status bar of a plot window, while moving the mouse.
Parameters:
**event**[`matplotlib.backend_bases.MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
See also
[`format_cursor_data`](#matplotlib.collections.Collection.format_cursor_data "matplotlib.collections.Collection.format_cursor_data")
get\_dashes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.Collection.get_linestyle "matplotlib.collections.Collection.get_linestyle").
get\_datalim(*transData*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L235-L301)
get\_ec()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.Collection.get_edgecolor "matplotlib.collections.Collection.get_edgecolor").
get\_edgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
get\_edgecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.Collection.get_edgecolor "matplotlib.collections.Collection.get_edgecolor").
get\_facecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
get\_facecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.Collection.get_facecolor "matplotlib.collections.Collection.get_facecolor").
get\_fc()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.Collection.get_facecolor "matplotlib.collections.Collection.get_facecolor").
get\_figure()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L703-L705)
Return the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
get\_fill()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L903-L905)
Return whether face is colored.
get\_gid()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L588-L590)
Return the group id.
get\_hatch()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L534-L536)
Return the current hatching pattern.
get\_in\_layout()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L820-L829)
Return boolean flag, `True` if artist is included in layout calculations.
E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
get\_joinstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L655-L656)
get\_label()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1056-L1058)
Return the label used for this artist in the legend.
get\_linestyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
get\_linestyles()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.Collection.get_linestyle "matplotlib.collections.Collection.get_linestyle").
get\_linewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
get\_linewidths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.Collection.get_linewidth "matplotlib.collections.Collection.get_linewidth").
get\_ls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.Collection.get_linestyle "matplotlib.collections.Collection.get_linestyle").
get\_lw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.Collection.get_linewidth "matplotlib.collections.Collection.get_linewidth").
get\_mouseover()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1338-L1343)
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
get\_offset\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist offset.
get\_offsets()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L554-L557)
Return the offsets for the collection.
get\_path\_effects()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L700-L701)
get\_paths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L205-L206)
get\_picker()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L562-L572)
Return the picking behavior of the artist.
The possible values are described in [`set_picker`](#matplotlib.collections.Collection.set_picker "matplotlib.collections.Collection.set_picker").
See also
[`set_picker`](#matplotlib.collections.Collection.set_picker "matplotlib.collections.Collection.set_picker"), [`pickable`](#matplotlib.collections.Collection.pickable "matplotlib.collections.Collection.pickable"), [`pick`](#matplotlib.collections.Collection.pick "matplotlib.collections.Collection.pick")
get\_pickradius()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L434-L435)
get\_rasterized()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L904-L906)
Return whether the artist is to be rasterized.
get\_sketch\_params()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L641-L659)
Return the sketch parameters for the artist.
Returns:
tuple or None
A 3-tuple with the following elements:
* *scale*: The amplitude of the wiggle perpendicular to the source line.
* *length*: The length of the wiggle along the line.
* *randomness*: The scale factor by which the length is shrunken or expanded.
Returns *None* if no sketch parameters were set.
get\_snap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L602-L611)
Return the snap setting.
See [`set_snap`](#matplotlib.collections.Collection.set_snap "matplotlib.collections.Collection.set_snap") for details.
get\_tightbbox(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L322-L346)
Like [`Artist.get_window_extent`](_as_gen/matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent"), but includes any clipping.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
Returns:
[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The enclosing bounding box (in figure pixel coordinates).
get\_transOffset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Alias for [`get_offset_transform`](#matplotlib.collections.Collection.get_offset_transform "matplotlib.collections.Collection.get_offset_transform").
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L421-L428)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist.
get\_transformed\_clip\_path\_and\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L867-L875)
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
get\_transforms()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L211-L212)
get\_url()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L574-L576)
Return the url.
get\_urls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L488-L495)
Return a list of URLs, one for each element of the collection.
The list contains *None* for elements without a URL. See [Hyperlinks](https://matplotlib.org/stable/gallery/misc/hyperlinks_sgskip.html) for an example.
get\_visible()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L812-L814)
Return the visibility.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L303-L306)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
get\_zorder()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1076-L1078)
Return the artist's zorder.
have\_units()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L236-L239)
Return whether units are set on any axis.
is\_transform\_set()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L400-L406)
Return whether the Artist has an explicitly set transform.
This is *True* after [`set_transform`](#matplotlib.collections.Collection.set_transform "matplotlib.collections.Collection.set_transform") has been called.
*property*mouseover
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
*property*norm
pchanged()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L387-L398)
Call all of the registered callbacks.
This function is triggered internally when a property is changed.
See also
[`add_callback`](#matplotlib.collections.Collection.add_callback "matplotlib.collections.Collection.add_callback")
[`remove_callback`](#matplotlib.collections.Collection.remove_callback "matplotlib.collections.Collection.remove_callback")
pick(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L490-L525)
Process a pick event.
Each child artist will fire a pick event if *mouseevent* is over the artist and the artist has picker set.
See also
[`set_picker`](#matplotlib.collections.Collection.set_picker "matplotlib.collections.Collection.set_picker"), [`get_picker`](#matplotlib.collections.Collection.get_picker "matplotlib.collections.Collection.get_picker"), [`pickable`](#matplotlib.collections.Collection.pickable "matplotlib.collections.Collection.pickable")
pickable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L480-L488)
Return whether the artist is pickable.
See also
[`set_picker`](#matplotlib.collections.Collection.set_picker "matplotlib.collections.Collection.set_picker"), [`get_picker`](#matplotlib.collections.Collection.get_picker "matplotlib.collections.Collection.get_picker"), [`pick`](#matplotlib.collections.Collection.pick "matplotlib.collections.Collection.pick")
properties()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1139-L1141)
Return a dictionary of all the properties of the artist.
remove()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L193-L234)
Remove the artist from the figure if possible.
The effect will not be visible until the figure is redrawn, e.g., with [`FigureCanvasBase.draw_idle`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase.draw_idle "matplotlib.backend_bases.FigureCanvasBase.draw_idle"). Call [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") to update the axes limits if desired.
Note: [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") will not see collections even if the collection was added to the axes with *autolim* = True.
Note: there is no support for removing the artist's legend entry.
remove\_callback(*oid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L377-L385)
Remove a callback based on its observer id.
See also
[`add_callback`](#matplotlib.collections.Collection.add_callback "matplotlib.collections.Collection.add_callback")
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *array=<UNSET>*, *capstyle=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *offset\_transform=<UNSET>*, *offsets=<UNSET>*, *path\_effects=<UNSET>*, *paths=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *urls=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") | bool or list of bools |
| [`array`](cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") | color or list of colors or 'face' |
| [`facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") | color or list of colors |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") | str or tuple or list thereof |
| [`linewidth`](#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") | float or list of floats |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") | unknown |
| [`offsets`](#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](#matplotlib.collections.Collection.set_paths "matplotlib.collections.Collection.set_paths") | unknown |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_aa(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased").
set\_agg\_filter(*filter\_func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L933-L949)
Set the agg filter.
Parameters:
**filter\_func**callable
A filter function, which takes a (m, n, depth) float array and a dpi value, and returns a (m, n, depth) array and two offsets from the bottom left corner of the image
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L807-L821)
Set the alpha value used for blending - not supported on all backends.
Parameters:
**alpha**array-like or scalar or None
All values must be within the 0-1 range, inclusive. Masked values and nans are not supported.
set\_animated(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1023-L1041)
Set whether the artist is intended to be used in an animation.
If True, the artist is excluded from regular drawing of the figure. You have to call [`Figure.draw_artist`](figure_api#matplotlib.figure.Figure.draw_artist "matplotlib.figure.Figure.draw_artist") / [`Axes.draw_artist`](_as_gen/matplotlib.axes.axes.draw_artist#matplotlib.axes.Axes.draw_artist "matplotlib.axes.Axes.draw_artist") explicitly on the artist. This approach is used to speed up animations using blitting.
See also [`matplotlib.animation`](animation_api#module-matplotlib.animation "matplotlib.animation") and [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html).
Parameters:
**b**bool
set\_antialiased(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Set the antialiasing state for rendering.
Parameters:
**aa**bool or list of bools
set\_antialiaseds(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased").
set\_array(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L484-L505)
Set the value array from array-like *A*.
Parameters:
**A**array-like or None
The values that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the value array *A*.
set\_capstyle(*cs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L630-L639)
Set the [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") for the collection (for all its elements).
Parameters:
**cs**[`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'}
set\_clim(*vmin=None*, *vmax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L526-L550)
Set the norm limits for image scaling.
Parameters:
**vmin, vmax**float
The limits.
The limits may also be passed as a tuple (*vmin*, *vmax*) as a single positional argument.
set\_clip\_box(*clipbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L731-L741)
Set the artist's clip [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
Parameters:
**clipbox**[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
set\_clip\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L877-L892)
Set whether the artist uses clipping.
When False artists will be visible outside of the Axes which can lead to unexpected results.
Parameters:
**b**bool
set\_clip\_path(*path*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L743-L803)
Set the artist's clip path.
Parameters:
**path**[`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") or [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") or [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") or None
The clip path. If given a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), *transform* must be provided as well. If *None*, a previously set clip path is removed.
**transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
Only used if *path* is a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), in which case the given [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") is converted to a [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") using *transform*.
#### Notes
For efficiency, if *path* is a [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") this method will set the clipping box to the corresponding rectangle and set the clipping path to `None`.
For technical reasons (support of [`set`](_as_gen/matplotlib.artist.artist.set#matplotlib.artist.Artist.set "matplotlib.artist.Artist.set")), a tuple (*path*, *transform*) is also accepted as a single positional parameter.
set\_cmap(*cmap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L562-L574)
Set the colormap for luminance data.
Parameters:
**cmap**[`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None
set\_color(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L713-L727)
Set both the edgecolor and the facecolor.
Parameters:
**c**color or list of rgba tuples
See also
[`Collection.set_facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor"), [`Collection.set_edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor")
For setting the edge or face color individually.
set\_dashes(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle").
set\_ec(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor").
set\_edgecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Set the edgecolor(s) of the collection.
Parameters:
**c**color or list of colors or 'face'
The collection edgecolor(s). If a sequence, the patches cycle through it. If 'face', match the facecolor.
set\_edgecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor").
set\_facecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Set the facecolor(s) of the collection. *c* can be a color (all patches have same color), or a sequence of colors; if it is a sequence the patches will cycle through the sequence.
If *c* is 'none', the patch will not be filled.
Parameters:
**c**color or list of colors
set\_facecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor").
set\_fc(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor").
set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L707-L729)
Set the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
set\_gid(*gid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L592-L600)
Set the (group) id for the artist.
Parameters:
**gid**str
set\_hatch(*hatch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L497-L532)
Set the hatching pattern
*hatch* can be one of:
```
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
```
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
Parameters:
**hatch**{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'}
set\_in\_layout(*in\_layout*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1043-L1054)
Set if artist is to be included in layout calculations, E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
Parameters:
**in\_layout**bool
set\_joinstyle(*js*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L644-L653)
Set the [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") for the collection (for all its elements).
Parameters:
**js**[`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'}
set\_label(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1060-L1074)
Set a label that will be displayed in the legend.
Parameters:
**s**object
*s* will be converted to a string by calling [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)").
set\_linestyle(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Set the linestyle(s) for the collection.
| linestyle | description |
| --- | --- |
| `'-'` or `'solid'` | solid line |
| `'--'` or `'dashed'` | dashed line |
| `'-.'` or `'dashdot'` | dash-dotted line |
| `':'` or `'dotted'` | dotted line |
Alternatively a dash tuple of the following form can be provided:
```
(offset, onoffseq),
```
where `onoffseq` is an even length tuple of on and off ink in points.
Parameters:
**ls**str or tuple or list thereof
Valid values for individual linestyles include {'-', '--', '-.', ':', '', (offset, on-off-seq)}. See [`Line2D.set_linestyle`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") for a complete description.
set\_linestyles(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle").
set\_linewidth(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Set the linewidth(s) for the collection. *lw* can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence
Parameters:
**lw**float or list of floats
set\_linewidths(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth").
set\_ls(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle").
set\_lw(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth").
set\_mouseover(*mouseover*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1345-L1366)
Set whether this artist is queried for custom context information when the mouse cursor moves over it.
Parameters:
**mouseover**bool
See also
[`get_cursor_data`](#matplotlib.collections.Collection.get_cursor_data "matplotlib.collections.Collection.get_cursor_data")
[`ToolCursorPosition`](backend_tools_api#matplotlib.backend_tools.ToolCursorPosition "matplotlib.backend_tools.ToolCursorPosition")
[`NavigationToolbar2`](backend_bases_api#matplotlib.backend_bases.NavigationToolbar2 "matplotlib.backend_bases.NavigationToolbar2")
set\_norm(*norm*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L609-L623)
Set the normalization instance.
Parameters:
**norm**[`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None
#### Notes
If there are any colorbars using the mappable for this norm, setting the norm of the mappable will reset the norm, locator, and formatters on the colorbar to default.
set\_offset\_transform(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Set the artist offset transform.
Parameters:
**offset\_transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_offsets(*offsets*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L538-L552)
Set the offsets for the collection.
Parameters:
**offsets**(N, 2) or (2,) array-like
set\_path\_effects(*path\_effects*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L689-L698)
Set the path effects.
Parameters:
**path\_effects**[`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
set\_paths(*paths*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L208-L209)
set\_picker(*picker*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L527-L560)
Define the picking behavior of the artist.
Parameters:
**picker**None or bool or float or callable
This can be one of the following:
* *None*: Picking is disabled for this artist (default).
* A boolean: If *True* then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist.
* A float: If picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if its data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event
* A function: If picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event:
```
hit, props = picker(artist, mouseevent)
```
to determine the hit test. if the mouse event is over the artist, return *hit=True* and props is a dictionary of properties you want added to the PickEvent attributes.
set\_pickradius(*pickradius*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L422-L432)
Set the pick radius used for containment tests.
Parameters:
**pickradius**float
Pick radius, in points.
set\_rasterized(*rasterized*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L908-L927)
Force rasterized (bitmap) drawing for vector graphics output.
Rasterized drawing is not supported by all artists. If you try to enable this on an artist that does not support it, the command has no effect and a warning will be issued.
This setting is ignored for pixel-based output.
See also [Rasterization for vector graphics](https://matplotlib.org/stable/gallery/misc/rasterization_demo.html).
Parameters:
**rasterized**bool
set\_sketch\_params(*scale=None*, *length=None*, *randomness=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L661-L687)
Set the sketch parameters.
Parameters:
**scale**float, optional
The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), or not provided, no sketch filter will be provided.
**length**float, optional
The length of the wiggle along the line, in pixels (default 128.0)
**randomness**float, optional
The scale factor by which the length is shrunken or expanded (default 16.0)
The PGF backend uses this argument as an RNG seed and not as described above. Using the same seed yields the same random shape.
set\_snap(*snap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L613-L639)
Set the snapping behavior.
Snapping aligns positions with the pixel grid, which results in clearer images. For example, if a black line of 1px width was defined at a position in between two pixels, the resulting image would contain the interpolated value of that line in the pixel grid, which would be a grey value on both adjacent pixel positions. In contrast, snapping will move the line to the nearest integer pixel value, so that the resulting image will really contain a 1px wide black line.
Snapping is currently only supported by the Agg and MacOSX backends.
Parameters:
**snap**bool or None
Possible values:
* *True*: Snap vertices to the nearest pixel center.
* *False*: Do not modify vertex positions.
* *None*: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center.
set\_transOffset(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Alias for [`set_offset_transform`](#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform").
set\_transform(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L408-L419)
Set the artist transform.
Parameters:
**t**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_url(*url*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L578-L586)
Set the url for the artist.
Parameters:
**url**str
set\_urls(*urls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L474-L486)
Parameters:
**urls**list of str or None
#### Notes
URLs are currently only implemented by the SVG backend. They are ignored by all other backends.
set\_visible(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1011-L1021)
Set the artist's visibility.
Parameters:
**b**bool
set\_zorder(*level*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1080-L1093)
Set the zorder for the artist. Artists with lower zorder values are drawn first.
Parameters:
**level**float
*property*stale
Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist.
*property*sticky\_edges
`x` and `y` sticky edge lists for autoscaling.
When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added--the view limit "sticks" to the edge. A typical use case is histograms, where one usually expects no margin on the bottom edge (0) of the histogram.
Moreover, margin expansion "bumps" against sticky edges and cannot cross them. For example, if the upper data limit is 1.0, the upper view limit computed by simple margin application is 1.2, but there is a sticky edge at 1.1, then the actual upper view limit will be 1.1.
This attribute cannot be assigned to; however, the `x` and `y` lists can be modified in place as needed.
#### Examples
```
>>> artist.sticky_edges.x[:] = (xmin, xmax)
>>> artist.sticky_edges.y[:] = (ymin, ymax)
```
to\_rgba(*x*, *alpha=None*, *bytes=False*, *norm=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L414-L482)
Return a normalized rgba array corresponding to *x*.
In the normal case, *x* is a 1D or 2D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If *x* is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the *alpha* kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the *alpha* kwarg is ignored; it does not replace the preexisting alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if *bytes* is *False* (default), the rgba array will be floats in the 0-1 range; if it is *True*, the returned rgba array will be uint8 in the 0 to 255 range.
If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1).
update(*props*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1168-L1177)
Update this artist's properties from the dict *props*.
Parameters:
**props**dict
update\_from(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L907-L929)
Copy properties from other to self.
update\_scalarmappable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L865-L901)
Update colors from the scalar mappable array, if any.
Assign colors to edges and faces based on the array and/or colors that were directly set, as appropriate.
zorder*=0*
*class*matplotlib.collections.EllipseCollection(*widths*, *heights*, *angles*, *\**, *units='points'*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1688-L1767)
Bases: [`Collection`](#matplotlib.collections.Collection "matplotlib.collections.Collection")
A collection of ellipses, drawn using splines.
Parameters:
**widths**array-like
The lengths of the first axes (e.g., major axis lengths).
**heights**array-like
The lengths of second axes.
**angles**array-like
The angles of the first axes, degrees CCW from the x-axis.
**units**{'points', 'inches', 'dots', 'width', 'height', 'x', 'y', 'xy'}
The units in which majors and minors are given; 'width' and 'height' refer to the dimensions of the axes, while 'x' and 'y' refer to the *offsets* data units. 'xy' differs from all others in that the angle as plotted varies with the aspect ratio, and equals the specified angle only when the aspect ratio is unity. Hence it behaves the same as the [`Ellipse`](_as_gen/matplotlib.patches.ellipse#matplotlib.patches.Ellipse "matplotlib.patches.Ellipse") with `axes.transData` as its transform.
**\*\*kwargs**
Forwarded to [`Collection`](#matplotlib.collections.Collection "matplotlib.collections.Collection").
add\_callback(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L348-L375)
Add a callback function that will be called whenever one of the [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")'s properties changes.
Parameters:
**func**callable
The callback function. It must have the signature:
```
def func(artist: Artist) -> Any
```
where *artist* is the calling [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"). Return values may exist but are ignored.
Returns:
int
The observer id associated with the callback. This id can be used for removing the callback with [`remove_callback`](#matplotlib.collections.EllipseCollection.remove_callback "matplotlib.collections.EllipseCollection.remove_callback") later.
See also
[`remove_callback`](#matplotlib.collections.EllipseCollection.remove_callback "matplotlib.collections.EllipseCollection.remove_callback")
autoscale()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L625-L634)
Autoscale the scalar limits on the norm instance using the current array
autoscale\_None()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L636-L645)
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
*property*axes
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance the artist resides in, or *None*.
*property*callbacksSM[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
changed()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L647-L653)
Call this whenever the mappable is changed to notify all the callbackSM listeners to the 'changed' signal.
colorbar
The last colorbar associated with this ScalarMappable. May be None.
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L437-L472)
Test whether the mouse event occurred in the collection.
Returns `bool, dict(ind=itemlist)`, where every item in itemlist contains the event.
convert\_xunits(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L241-L251)
Convert *x* using the unit type of the xaxis.
If the artist is not contained in an Axes or if the xaxis does not have units, *x* itself is returned.
convert\_yunits(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L253-L263)
Convert *y* using the unit type of the yaxis.
If the artist is not contained in an Axes or if the yaxis does not have units, *y* itself is returned.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1764-L1767)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
findobj(*match=None*, *include\_self=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1208-L1249)
Find artist objects.
Recursively find all [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") instances contained in the artist.
Parameters:
**match**
A filter criterion for the matches. This can be
* *None*: Return all objects contained in artist.
* A function with signature `def match(artist: Artist) -> bool`. The result will only contain artists for which the function returns *True*.
* A class instance: e.g., [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"). The result will only contain artists of this class or its subclasses (`isinstance` check).
**include\_self**bool
Include *self* in the list to be checked for a match.
Returns:
list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
format\_cursor\_data(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1282-L1336)
Return a string representation of *data*.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
The default implementation converts ints and floats and arrays of ints and floats into a comma-separated string enclosed in square brackets, unless the artist has an associated colorbar, in which case scalar values are formatted using the colorbar's formatter.
See also
[`get_cursor_data`](#matplotlib.collections.EllipseCollection.get_cursor_data "matplotlib.collections.EllipseCollection.get_cursor_data")
get\_agg\_filter()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L929-L931)
Return filter function to be used for agg filter.
get\_alpha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L805-L810)
Return the alpha value used for blending - not supported on all backends.
get\_animated()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L816-L818)
Return whether the artist is animated.
get\_array()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L507-L514)
Return the array of values, that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the array.
get\_capstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L641-L642)
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L430-L432)
Return a list of the child [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s of this [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist").
get\_clim()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L520-L524)
Return the values (min, max) that are mapped to the colormap limits.
get\_clip\_box()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L859-L861)
Return the clipbox.
get\_clip\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L855-L857)
Return whether the artist uses clipping.
get\_clip\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L863-L865)
Return the clip path.
get\_cmap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L516-L518)
Return the [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") instance.
get\_cursor\_data(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1251-L1280)
Return the cursor data for a given event.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
Cursor data can be used by Artists to provide additional context information for a given event. The default implementation just returns *None*.
Subclasses can override the method and return arbitrary data. However, when doing so, they must ensure that [`format_cursor_data`](#matplotlib.collections.EllipseCollection.format_cursor_data "matplotlib.collections.EllipseCollection.format_cursor_data") can convert the data to a string representation.
The only current use case is displaying the z-value of an [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") in the status bar of a plot window, while moving the mouse.
Parameters:
**event**[`matplotlib.backend_bases.MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
See also
[`format_cursor_data`](#matplotlib.collections.EllipseCollection.format_cursor_data "matplotlib.collections.EllipseCollection.format_cursor_data")
get\_dashes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.EllipseCollection.get_linestyle "matplotlib.collections.EllipseCollection.get_linestyle").
get\_datalim(*transData*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L235-L301)
get\_ec()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.EllipseCollection.get_edgecolor "matplotlib.collections.EllipseCollection.get_edgecolor").
get\_edgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
get\_edgecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.EllipseCollection.get_edgecolor "matplotlib.collections.EllipseCollection.get_edgecolor").
get\_facecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
get\_facecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.EllipseCollection.get_facecolor "matplotlib.collections.EllipseCollection.get_facecolor").
get\_fc()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.EllipseCollection.get_facecolor "matplotlib.collections.EllipseCollection.get_facecolor").
get\_figure()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L703-L705)
Return the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
get\_fill()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L903-L905)
Return whether face is colored.
get\_gid()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L588-L590)
Return the group id.
get\_hatch()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L534-L536)
Return the current hatching pattern.
get\_in\_layout()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L820-L829)
Return boolean flag, `True` if artist is included in layout calculations.
E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
get\_joinstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L655-L656)
get\_label()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1056-L1058)
Return the label used for this artist in the legend.
get\_linestyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
get\_linestyles()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.EllipseCollection.get_linestyle "matplotlib.collections.EllipseCollection.get_linestyle").
get\_linewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
get\_linewidths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.EllipseCollection.get_linewidth "matplotlib.collections.EllipseCollection.get_linewidth").
get\_ls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.EllipseCollection.get_linestyle "matplotlib.collections.EllipseCollection.get_linestyle").
get\_lw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.EllipseCollection.get_linewidth "matplotlib.collections.EllipseCollection.get_linewidth").
get\_mouseover()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1338-L1343)
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
get\_offset\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist offset.
get\_offsets()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L554-L557)
Return the offsets for the collection.
get\_path\_effects()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L700-L701)
get\_paths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L205-L206)
get\_picker()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L562-L572)
Return the picking behavior of the artist.
The possible values are described in [`set_picker`](#matplotlib.collections.EllipseCollection.set_picker "matplotlib.collections.EllipseCollection.set_picker").
See also
[`set_picker`](#matplotlib.collections.EllipseCollection.set_picker "matplotlib.collections.EllipseCollection.set_picker"), [`pickable`](#matplotlib.collections.EllipseCollection.pickable "matplotlib.collections.EllipseCollection.pickable"), [`pick`](#matplotlib.collections.EllipseCollection.pick "matplotlib.collections.EllipseCollection.pick")
get\_pickradius()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L434-L435)
get\_rasterized()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L904-L906)
Return whether the artist is to be rasterized.
get\_sketch\_params()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L641-L659)
Return the sketch parameters for the artist.
Returns:
tuple or None
A 3-tuple with the following elements:
* *scale*: The amplitude of the wiggle perpendicular to the source line.
* *length*: The length of the wiggle along the line.
* *randomness*: The scale factor by which the length is shrunken or expanded.
Returns *None* if no sketch parameters were set.
get\_snap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L602-L611)
Return the snap setting.
See [`set_snap`](#matplotlib.collections.EllipseCollection.set_snap "matplotlib.collections.EllipseCollection.set_snap") for details.
get\_tightbbox(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L322-L346)
Like [`Artist.get_window_extent`](_as_gen/matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent"), but includes any clipping.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
Returns:
[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The enclosing bounding box (in figure pixel coordinates).
get\_transOffset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Alias for [`get_offset_transform`](#matplotlib.collections.EllipseCollection.get_offset_transform "matplotlib.collections.EllipseCollection.get_offset_transform").
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L421-L428)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist.
get\_transformed\_clip\_path\_and\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L867-L875)
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
get\_transforms()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L211-L212)
get\_url()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L574-L576)
Return the url.
get\_urls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L488-L495)
Return a list of URLs, one for each element of the collection.
The list contains *None* for elements without a URL. See [Hyperlinks](https://matplotlib.org/stable/gallery/misc/hyperlinks_sgskip.html) for an example.
get\_visible()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L812-L814)
Return the visibility.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L303-L306)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
get\_zorder()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1076-L1078)
Return the artist's zorder.
have\_units()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L236-L239)
Return whether units are set on any axis.
is\_transform\_set()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L400-L406)
Return whether the Artist has an explicitly set transform.
This is *True* after [`set_transform`](#matplotlib.collections.EllipseCollection.set_transform "matplotlib.collections.EllipseCollection.set_transform") has been called.
*property*mouseover
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
*property*norm
pchanged()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L387-L398)
Call all of the registered callbacks.
This function is triggered internally when a property is changed.
See also
[`add_callback`](#matplotlib.collections.EllipseCollection.add_callback "matplotlib.collections.EllipseCollection.add_callback")
[`remove_callback`](#matplotlib.collections.EllipseCollection.remove_callback "matplotlib.collections.EllipseCollection.remove_callback")
pick(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L490-L525)
Process a pick event.
Each child artist will fire a pick event if *mouseevent* is over the artist and the artist has picker set.
See also
[`set_picker`](#matplotlib.collections.EllipseCollection.set_picker "matplotlib.collections.EllipseCollection.set_picker"), [`get_picker`](#matplotlib.collections.EllipseCollection.get_picker "matplotlib.collections.EllipseCollection.get_picker"), [`pickable`](#matplotlib.collections.EllipseCollection.pickable "matplotlib.collections.EllipseCollection.pickable")
pickable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L480-L488)
Return whether the artist is pickable.
See also
[`set_picker`](#matplotlib.collections.EllipseCollection.set_picker "matplotlib.collections.EllipseCollection.set_picker"), [`get_picker`](#matplotlib.collections.EllipseCollection.get_picker "matplotlib.collections.EllipseCollection.get_picker"), [`pick`](#matplotlib.collections.EllipseCollection.pick "matplotlib.collections.EllipseCollection.pick")
properties()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1139-L1141)
Return a dictionary of all the properties of the artist.
remove()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L193-L234)
Remove the artist from the figure if possible.
The effect will not be visible until the figure is redrawn, e.g., with [`FigureCanvasBase.draw_idle`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase.draw_idle "matplotlib.backend_bases.FigureCanvasBase.draw_idle"). Call [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") to update the axes limits if desired.
Note: [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") will not see collections even if the collection was added to the axes with *autolim* = True.
Note: there is no support for removing the artist's legend entry.
remove\_callback(*oid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L377-L385)
Remove a callback based on its observer id.
See also
[`add_callback`](#matplotlib.collections.EllipseCollection.add_callback "matplotlib.collections.EllipseCollection.add_callback")
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *array=<UNSET>*, *capstyle=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *offset\_transform=<UNSET>*, *offsets=<UNSET>*, *path\_effects=<UNSET>*, *paths=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *urls=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](#matplotlib.collections.Collection.set_paths "matplotlib.collections.Collection.set_paths") | unknown |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_aa(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.EllipseCollection.set_antialiased "matplotlib.collections.EllipseCollection.set_antialiased").
set\_agg\_filter(*filter\_func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L933-L949)
Set the agg filter.
Parameters:
**filter\_func**callable
A filter function, which takes a (m, n, depth) float array and a dpi value, and returns a (m, n, depth) array and two offsets from the bottom left corner of the image
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L807-L821)
Set the alpha value used for blending - not supported on all backends.
Parameters:
**alpha**array-like or scalar or None
All values must be within the 0-1 range, inclusive. Masked values and nans are not supported.
set\_animated(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1023-L1041)
Set whether the artist is intended to be used in an animation.
If True, the artist is excluded from regular drawing of the figure. You have to call [`Figure.draw_artist`](figure_api#matplotlib.figure.Figure.draw_artist "matplotlib.figure.Figure.draw_artist") / [`Axes.draw_artist`](_as_gen/matplotlib.axes.axes.draw_artist#matplotlib.axes.Axes.draw_artist "matplotlib.axes.Axes.draw_artist") explicitly on the artist. This approach is used to speed up animations using blitting.
See also [`matplotlib.animation`](animation_api#module-matplotlib.animation "matplotlib.animation") and [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html).
Parameters:
**b**bool
set\_antialiased(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Set the antialiasing state for rendering.
Parameters:
**aa**bool or list of bools
set\_antialiaseds(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.EllipseCollection.set_antialiased "matplotlib.collections.EllipseCollection.set_antialiased").
set\_array(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L484-L505)
Set the value array from array-like *A*.
Parameters:
**A**array-like or None
The values that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the value array *A*.
set\_capstyle(*cs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L630-L639)
Set the [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") for the collection (for all its elements).
Parameters:
**cs**[`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'}
set\_clim(*vmin=None*, *vmax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L526-L550)
Set the norm limits for image scaling.
Parameters:
**vmin, vmax**float
The limits.
The limits may also be passed as a tuple (*vmin*, *vmax*) as a single positional argument.
set\_clip\_box(*clipbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L731-L741)
Set the artist's clip [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
Parameters:
**clipbox**[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
set\_clip\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L877-L892)
Set whether the artist uses clipping.
When False artists will be visible outside of the Axes which can lead to unexpected results.
Parameters:
**b**bool
set\_clip\_path(*path*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L743-L803)
Set the artist's clip path.
Parameters:
**path**[`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") or [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") or [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") or None
The clip path. If given a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), *transform* must be provided as well. If *None*, a previously set clip path is removed.
**transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
Only used if *path* is a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), in which case the given [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") is converted to a [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") using *transform*.
#### Notes
For efficiency, if *path* is a [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") this method will set the clipping box to the corresponding rectangle and set the clipping path to `None`.
For technical reasons (support of [`set`](_as_gen/matplotlib.artist.artist.set#matplotlib.artist.Artist.set "matplotlib.artist.Artist.set")), a tuple (*path*, *transform*) is also accepted as a single positional parameter.
set\_cmap(*cmap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L562-L574)
Set the colormap for luminance data.
Parameters:
**cmap**[`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None
set\_color(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L713-L727)
Set both the edgecolor and the facecolor.
Parameters:
**c**color or list of rgba tuples
See also
[`Collection.set_facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor"), [`Collection.set_edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor")
For setting the edge or face color individually.
set\_dashes(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.EllipseCollection.set_linestyle "matplotlib.collections.EllipseCollection.set_linestyle").
set\_ec(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.EllipseCollection.set_edgecolor "matplotlib.collections.EllipseCollection.set_edgecolor").
set\_edgecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Set the edgecolor(s) of the collection.
Parameters:
**c**color or list of colors or 'face'
The collection edgecolor(s). If a sequence, the patches cycle through it. If 'face', match the facecolor.
set\_edgecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.EllipseCollection.set_edgecolor "matplotlib.collections.EllipseCollection.set_edgecolor").
set\_facecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Set the facecolor(s) of the collection. *c* can be a color (all patches have same color), or a sequence of colors; if it is a sequence the patches will cycle through the sequence.
If *c* is 'none', the patch will not be filled.
Parameters:
**c**color or list of colors
set\_facecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.EllipseCollection.set_facecolor "matplotlib.collections.EllipseCollection.set_facecolor").
set\_fc(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.EllipseCollection.set_facecolor "matplotlib.collections.EllipseCollection.set_facecolor").
set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L707-L729)
Set the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
set\_gid(*gid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L592-L600)
Set the (group) id for the artist.
Parameters:
**gid**str
set\_hatch(*hatch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L497-L532)
Set the hatching pattern
*hatch* can be one of:
```
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
```
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
Parameters:
**hatch**{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'}
set\_in\_layout(*in\_layout*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1043-L1054)
Set if artist is to be included in layout calculations, E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
Parameters:
**in\_layout**bool
set\_joinstyle(*js*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L644-L653)
Set the [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") for the collection (for all its elements).
Parameters:
**js**[`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'}
set\_label(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1060-L1074)
Set a label that will be displayed in the legend.
Parameters:
**s**object
*s* will be converted to a string by calling [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)").
set\_linestyle(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Set the linestyle(s) for the collection.
| linestyle | description |
| --- | --- |
| `'-'` or `'solid'` | solid line |
| `'--'` or `'dashed'` | dashed line |
| `'-.'` or `'dashdot'` | dash-dotted line |
| `':'` or `'dotted'` | dotted line |
Alternatively a dash tuple of the following form can be provided:
```
(offset, onoffseq),
```
where `onoffseq` is an even length tuple of on and off ink in points.
Parameters:
**ls**str or tuple or list thereof
Valid values for individual linestyles include {'-', '--', '-.', ':', '', (offset, on-off-seq)}. See [`Line2D.set_linestyle`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") for a complete description.
set\_linestyles(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.EllipseCollection.set_linestyle "matplotlib.collections.EllipseCollection.set_linestyle").
set\_linewidth(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Set the linewidth(s) for the collection. *lw* can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence
Parameters:
**lw**float or list of floats
set\_linewidths(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.EllipseCollection.set_linewidth "matplotlib.collections.EllipseCollection.set_linewidth").
set\_ls(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.EllipseCollection.set_linestyle "matplotlib.collections.EllipseCollection.set_linestyle").
set\_lw(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.EllipseCollection.set_linewidth "matplotlib.collections.EllipseCollection.set_linewidth").
set\_mouseover(*mouseover*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1345-L1366)
Set whether this artist is queried for custom context information when the mouse cursor moves over it.
Parameters:
**mouseover**bool
See also
[`get_cursor_data`](#matplotlib.collections.EllipseCollection.get_cursor_data "matplotlib.collections.EllipseCollection.get_cursor_data")
[`ToolCursorPosition`](backend_tools_api#matplotlib.backend_tools.ToolCursorPosition "matplotlib.backend_tools.ToolCursorPosition")
[`NavigationToolbar2`](backend_bases_api#matplotlib.backend_bases.NavigationToolbar2 "matplotlib.backend_bases.NavigationToolbar2")
set\_norm(*norm*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L609-L623)
Set the normalization instance.
Parameters:
**norm**[`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None
#### Notes
If there are any colorbars using the mappable for this norm, setting the norm of the mappable will reset the norm, locator, and formatters on the colorbar to default.
set\_offset\_transform(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Set the artist offset transform.
Parameters:
**offset\_transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_offsets(*offsets*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L538-L552)
Set the offsets for the collection.
Parameters:
**offsets**(N, 2) or (2,) array-like
set\_path\_effects(*path\_effects*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L689-L698)
Set the path effects.
Parameters:
**path\_effects**[`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
set\_paths(*paths*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L208-L209)
set\_picker(*picker*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L527-L560)
Define the picking behavior of the artist.
Parameters:
**picker**None or bool or float or callable
This can be one of the following:
* *None*: Picking is disabled for this artist (default).
* A boolean: If *True* then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist.
* A float: If picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if its data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event
* A function: If picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event:
```
hit, props = picker(artist, mouseevent)
```
to determine the hit test. if the mouse event is over the artist, return *hit=True* and props is a dictionary of properties you want added to the PickEvent attributes.
set\_pickradius(*pickradius*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L422-L432)
Set the pick radius used for containment tests.
Parameters:
**pickradius**float
Pick radius, in points.
set\_rasterized(*rasterized*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L908-L927)
Force rasterized (bitmap) drawing for vector graphics output.
Rasterized drawing is not supported by all artists. If you try to enable this on an artist that does not support it, the command has no effect and a warning will be issued.
This setting is ignored for pixel-based output.
See also [Rasterization for vector graphics](https://matplotlib.org/stable/gallery/misc/rasterization_demo.html).
Parameters:
**rasterized**bool
set\_sketch\_params(*scale=None*, *length=None*, *randomness=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L661-L687)
Set the sketch parameters.
Parameters:
**scale**float, optional
The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), or not provided, no sketch filter will be provided.
**length**float, optional
The length of the wiggle along the line, in pixels (default 128.0)
**randomness**float, optional
The scale factor by which the length is shrunken or expanded (default 16.0)
The PGF backend uses this argument as an RNG seed and not as described above. Using the same seed yields the same random shape.
set\_snap(*snap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L613-L639)
Set the snapping behavior.
Snapping aligns positions with the pixel grid, which results in clearer images. For example, if a black line of 1px width was defined at a position in between two pixels, the resulting image would contain the interpolated value of that line in the pixel grid, which would be a grey value on both adjacent pixel positions. In contrast, snapping will move the line to the nearest integer pixel value, so that the resulting image will really contain a 1px wide black line.
Snapping is currently only supported by the Agg and MacOSX backends.
Parameters:
**snap**bool or None
Possible values:
* *True*: Snap vertices to the nearest pixel center.
* *False*: Do not modify vertex positions.
* *None*: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center.
set\_transOffset(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Alias for [`set_offset_transform`](#matplotlib.collections.EllipseCollection.set_offset_transform "matplotlib.collections.EllipseCollection.set_offset_transform").
set\_transform(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L408-L419)
Set the artist transform.
Parameters:
**t**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_url(*url*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L578-L586)
Set the url for the artist.
Parameters:
**url**str
set\_urls(*urls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L474-L486)
Parameters:
**urls**list of str or None
#### Notes
URLs are currently only implemented by the SVG backend. They are ignored by all other backends.
set\_visible(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1011-L1021)
Set the artist's visibility.
Parameters:
**b**bool
set\_zorder(*level*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1080-L1093)
Set the zorder for the artist. Artists with lower zorder values are drawn first.
Parameters:
**level**float
*property*stale
Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist.
*property*sticky\_edges
`x` and `y` sticky edge lists for autoscaling.
When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added--the view limit "sticks" to the edge. A typical use case is histograms, where one usually expects no margin on the bottom edge (0) of the histogram.
Moreover, margin expansion "bumps" against sticky edges and cannot cross them. For example, if the upper data limit is 1.0, the upper view limit computed by simple margin application is 1.2, but there is a sticky edge at 1.1, then the actual upper view limit will be 1.1.
This attribute cannot be assigned to; however, the `x` and `y` lists can be modified in place as needed.
#### Examples
```
>>> artist.sticky_edges.x[:] = (xmin, xmax)
>>> artist.sticky_edges.y[:] = (ymin, ymax)
```
to\_rgba(*x*, *alpha=None*, *bytes=False*, *norm=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L414-L482)
Return a normalized rgba array corresponding to *x*.
In the normal case, *x* is a 1D or 2D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If *x* is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the *alpha* kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the *alpha* kwarg is ignored; it does not replace the preexisting alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if *bytes* is *False* (default), the rgba array will be floats in the 0-1 range; if it is *True*, the returned rgba array will be uint8 in the 0 to 255 range.
If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1).
update(*props*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1168-L1177)
Update this artist's properties from the dict *props*.
Parameters:
**props**dict
update\_from(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L907-L929)
Copy properties from other to self.
update\_scalarmappable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L865-L901)
Update colors from the scalar mappable array, if any.
Assign colors to edges and faces based on the array and/or colors that were directly set, as appropriate.
zorder*=0*
*class*matplotlib.collections.EventCollection(*positions*, *orientation='horizontal'*, *\**, *lineoffset=0*, *linelength=1*, *linewidth=None*, *color=None*, *linestyle='solid'*, *antialiased=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1485-L1665)
Bases: [`LineCollection`](#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection")
A collection of locations along a single axis at which an "event" occurred.
The events are given by a 1-dimensional array. They do not have an amplitude and are displayed as parallel lines.
Parameters:
**positions**1D array-like
Each value is an event.
**orientation**{'horizontal', 'vertical'}, default: 'horizontal'
The sequence of events is plotted along this direction. The marker lines of the single events are along the orthogonal direction.
**lineoffset**float, default: 0
The offset of the center of the markers from the origin, in the direction orthogonal to *orientation*.
**linelength**float, default: 1
The total height of the marker (i.e. the marker stretches from `lineoffset - linelength/2` to `lineoffset + linelength/2`).
**linewidth**float or list thereof, default: `[rcParams["lines.linewidth"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.linewidth#matplotlibrc-sample)` (default: `1.5`)
The line width of the event lines, in points.
**color**color or list of colors, default: `[rcParams["lines.color"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.color#matplotlibrc-sample)` (default: `'C0'`)
The color of the event lines.
**linestyle**str or tuple or list thereof, default: 'solid'
Valid strings are ['solid', 'dashed', 'dashdot', 'dotted', '-', '--', '-.', ':']. Dash tuples should be of the form:
```
(offset, onoffseq),
```
where *onoffseq* is an even length tuple of on and off ink in points.
**antialiased**bool or list thereof, default: `[rcParams["lines.antialiased"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.antialiased#matplotlibrc-sample)` (default: `True`)
Whether to use antialiasing for drawing the lines.
**\*\*kwargs**
Forwarded to [`LineCollection`](#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection").
#### Examples
([Source code](https://matplotlib.org/stable/gallery/lines_bars_and_markers/eventcollection_demo.py), [png](https://matplotlib.org/stable/gallery/lines_bars_and_markers/eventcollection_demo.png))
add\_callback(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L348-L375)
Add a callback function that will be called whenever one of the [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")'s properties changes.
Parameters:
**func**callable
The callback function. It must have the signature:
```
def func(artist: Artist) -> Any
```
where *artist* is the calling [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"). Return values may exist but are ignored.
Returns:
int
The observer id associated with the callback. This id can be used for removing the callback with [`remove_callback`](#matplotlib.collections.EventCollection.remove_callback "matplotlib.collections.EventCollection.remove_callback") later.
See also
[`remove_callback`](#matplotlib.collections.EventCollection.remove_callback "matplotlib.collections.EventCollection.remove_callback")
add\_positions(*position*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1575-L1582)
Add one or more events at the specified positions.
append\_positions(*position*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1575-L1582)
Add one or more events at the specified positions.
autoscale()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L625-L634)
Autoscale the scalar limits on the norm instance using the current array
autoscale\_None()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L636-L645)
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
*property*axes
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance the artist resides in, or *None*.
*property*callbacksSM[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
changed()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L647-L653)
Call this whenever the mappable is changed to notify all the callbackSM listeners to the 'changed' signal.
colorbar
The last colorbar associated with this ScalarMappable. May be None.
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L437-L472)
Test whether the mouse event occurred in the collection.
Returns `bool, dict(ind=itemlist)`, where every item in itemlist contains the event.
convert\_xunits(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L241-L251)
Convert *x* using the unit type of the xaxis.
If the artist is not contained in an Axes or if the xaxis does not have units, *x* itself is returned.
convert\_yunits(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L253-L263)
Convert *y* using the unit type of the yaxis.
If the artist is not contained in an Axes or if the yaxis does not have units, *y* itself is returned.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L344-L420)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
extend\_positions(*position*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1575-L1582)
Add one or more events at the specified positions.
findobj(*match=None*, *include\_self=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1208-L1249)
Find artist objects.
Recursively find all [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") instances contained in the artist.
Parameters:
**match**
A filter criterion for the matches. This can be
* *None*: Return all objects contained in artist.
* A function with signature `def match(artist: Artist) -> bool`. The result will only contain artists for which the function returns *True*.
* A class instance: e.g., [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"). The result will only contain artists of this class or its subclasses (`isinstance` check).
**include\_self**bool
Include *self* in the list to be checked for a match.
Returns:
list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
format\_cursor\_data(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1282-L1336)
Return a string representation of *data*.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
The default implementation converts ints and floats and arrays of ints and floats into a comma-separated string enclosed in square brackets, unless the artist has an associated colorbar, in which case scalar values are formatted using the colorbar's formatter.
See also
[`get_cursor_data`](#matplotlib.collections.EventCollection.get_cursor_data "matplotlib.collections.EventCollection.get_cursor_data")
get\_agg\_filter()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L929-L931)
Return filter function to be used for agg filter.
get\_alpha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L805-L810)
Return the alpha value used for blending - not supported on all backends.
get\_animated()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L816-L818)
Return whether the artist is animated.
get\_array()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L507-L514)
Return the array of values, that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the array.
get\_capstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L641-L642)
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L430-L432)
Return a list of the child [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s of this [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist").
get\_clim()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L520-L524)
Return the values (min, max) that are mapped to the colormap limits.
get\_clip\_box()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L859-L861)
Return the clipbox.
get\_clip\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L855-L857)
Return whether the artist uses clipping.
get\_clip\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L863-L865)
Return the clip path.
get\_cmap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L516-L518)
Return the [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") instance.
get\_color()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1663-L1665)
Return the color of the lines used to mark each event.
get\_colors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1479-L1480)
get\_cursor\_data(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1251-L1280)
Return the cursor data for a given event.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
Cursor data can be used by Artists to provide additional context information for a given event. The default implementation just returns *None*.
Subclasses can override the method and return arbitrary data. However, when doing so, they must ensure that [`format_cursor_data`](#matplotlib.collections.EventCollection.format_cursor_data "matplotlib.collections.EventCollection.format_cursor_data") can convert the data to a string representation.
The only current use case is displaying the z-value of an [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") in the status bar of a plot window, while moving the mouse.
Parameters:
**event**[`matplotlib.backend_bases.MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
See also
[`format_cursor_data`](#matplotlib.collections.EventCollection.format_cursor_data "matplotlib.collections.EventCollection.format_cursor_data")
get\_dashes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.EventCollection.get_linestyle "matplotlib.collections.EventCollection.get_linestyle").
get\_datalim(*transData*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L235-L301)
get\_ec()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.EventCollection.get_edgecolor "matplotlib.collections.EventCollection.get_edgecolor").
get\_edgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
get\_edgecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.EventCollection.get_edgecolor "matplotlib.collections.EventCollection.get_edgecolor").
get\_facecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
get\_facecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.EventCollection.get_facecolor "matplotlib.collections.EventCollection.get_facecolor").
get\_fc()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.EventCollection.get_facecolor "matplotlib.collections.EventCollection.get_facecolor").
get\_figure()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L703-L705)
Return the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
get\_fill()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L903-L905)
Return whether face is colored.
get\_gid()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L588-L590)
Return the group id.
get\_hatch()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L534-L536)
Return the current hatching pattern.
get\_in\_layout()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L820-L829)
Return boolean flag, `True` if artist is included in layout calculations.
E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
get\_joinstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L655-L656)
get\_label()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1056-L1058)
Return the label used for this artist in the legend.
get\_linelength()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1622-L1624)
Return the length of the lines used to mark each event.
get\_lineoffset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1639-L1641)
Return the offset of the lines used to mark each event.
get\_linestyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
get\_linestyles()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.EventCollection.get_linestyle "matplotlib.collections.EventCollection.get_linestyle").
get\_linewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1656-L1658)
Get the width of the lines used to mark each event.
get\_linewidths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1660-L1661)
Alias for [`get_linewidth`](#matplotlib.collections.EventCollection.get_linewidth "matplotlib.collections.EventCollection.get_linewidth").
get\_ls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.EventCollection.get_linestyle "matplotlib.collections.EventCollection.get_linestyle").
get\_lw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.EventCollection.get_linewidth "matplotlib.collections.EventCollection.get_linewidth").
get\_mouseover()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1338-L1343)
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
get\_offset\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist offset.
get\_offsets()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L554-L557)
Return the offsets for the collection.
get\_orientation()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1589-L1593)
Return the orientation of the event line ('horizontal' or 'vertical').
get\_path\_effects()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L700-L701)
get\_paths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L205-L206)
get\_picker()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L562-L572)
Return the picking behavior of the artist.
The possible values are described in [`set_picker`](#matplotlib.collections.EventCollection.set_picker "matplotlib.collections.EventCollection.set_picker").
See also
[`set_picker`](#matplotlib.collections.EventCollection.set_picker "matplotlib.collections.EventCollection.set_picker"), [`pickable`](#matplotlib.collections.EventCollection.pickable "matplotlib.collections.EventCollection.pickable"), [`pick`](#matplotlib.collections.EventCollection.pick "matplotlib.collections.EventCollection.pick")
get\_pickradius()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L434-L435)
get\_positions()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1553-L1558)
Return an array containing the floating-point values of the positions.
get\_rasterized()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L904-L906)
Return whether the artist is to be rasterized.
get\_segments()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1428-L1450)
Returns:
list
List of segments in the LineCollection. Each list item contains an array of vertices.
get\_sketch\_params()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L641-L659)
Return the sketch parameters for the artist.
Returns:
tuple or None
A 3-tuple with the following elements:
* *scale*: The amplitude of the wiggle perpendicular to the source line.
* *length*: The length of the wiggle along the line.
* *randomness*: The scale factor by which the length is shrunken or expanded.
Returns *None* if no sketch parameters were set.
get\_snap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L602-L611)
Return the snap setting.
See [`set_snap`](#matplotlib.collections.EventCollection.set_snap "matplotlib.collections.EventCollection.set_snap") for details.
get\_tightbbox(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L322-L346)
Like [`Artist.get_window_extent`](_as_gen/matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent"), but includes any clipping.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
Returns:
[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The enclosing bounding box (in figure pixel coordinates).
get\_transOffset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Alias for [`get_offset_transform`](#matplotlib.collections.EventCollection.get_offset_transform "matplotlib.collections.EventCollection.get_offset_transform").
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L421-L428)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist.
get\_transformed\_clip\_path\_and\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L867-L875)
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
get\_transforms()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L211-L212)
get\_url()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L574-L576)
Return the url.
get\_urls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L488-L495)
Return a list of URLs, one for each element of the collection.
The list contains *None* for elements without a URL. See [Hyperlinks](https://matplotlib.org/stable/gallery/misc/hyperlinks_sgskip.html) for an example.
get\_visible()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L812-L814)
Return the visibility.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L303-L306)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
get\_zorder()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1076-L1078)
Return the artist's zorder.
have\_units()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L236-L239)
Return whether units are set on any axis.
is\_horizontal()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1585-L1587)
True if the eventcollection is horizontal, False if vertical.
is\_transform\_set()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L400-L406)
Return whether the Artist has an explicitly set transform.
This is *True* after [`set_transform`](#matplotlib.collections.EventCollection.set_transform "matplotlib.collections.EventCollection.set_transform") has been called.
*property*mouseover
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
*property*norm
pchanged()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L387-L398)
Call all of the registered callbacks.
This function is triggered internally when a property is changed.
See also
[`add_callback`](#matplotlib.collections.EventCollection.add_callback "matplotlib.collections.EventCollection.add_callback")
[`remove_callback`](#matplotlib.collections.EventCollection.remove_callback "matplotlib.collections.EventCollection.remove_callback")
pick(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L490-L525)
Process a pick event.
Each child artist will fire a pick event if *mouseevent* is over the artist and the artist has picker set.
See also
[`set_picker`](#matplotlib.collections.EventCollection.set_picker "matplotlib.collections.EventCollection.set_picker"), [`get_picker`](#matplotlib.collections.EventCollection.get_picker "matplotlib.collections.EventCollection.get_picker"), [`pickable`](#matplotlib.collections.EventCollection.pickable "matplotlib.collections.EventCollection.pickable")
pickable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L480-L488)
Return whether the artist is pickable.
See also
[`set_picker`](#matplotlib.collections.EventCollection.set_picker "matplotlib.collections.EventCollection.set_picker"), [`get_picker`](#matplotlib.collections.EventCollection.get_picker "matplotlib.collections.EventCollection.get_picker"), [`pick`](#matplotlib.collections.EventCollection.pick "matplotlib.collections.EventCollection.pick")
properties()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1139-L1141)
Return a dictionary of all the properties of the artist.
remove()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L193-L234)
Remove the artist from the figure if possible.
The effect will not be visible until the figure is redrawn, e.g., with [`FigureCanvasBase.draw_idle`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase.draw_idle "matplotlib.backend_bases.FigureCanvasBase.draw_idle"). Call [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") to update the axes limits if desired.
Note: [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") will not see collections even if the collection was added to the axes with *autolim* = True.
Note: there is no support for removing the artist's legend entry.
remove\_callback(*oid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L377-L385)
Remove a callback based on its observer id.
See also
[`add_callback`](#matplotlib.collections.EventCollection.add_callback "matplotlib.collections.EventCollection.add_callback")
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *array=<UNSET>*, *capstyle=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *color=<UNSET>*, *colors=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linelength=<UNSET>*, *lineoffset=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *offset\_transform=<UNSET>*, *offsets=<UNSET>*, *orientation=<UNSET>*, *path\_effects=<UNSET>*, *paths=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *positions=<UNSET>*, *rasterized=<UNSET>*, *segments=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *urls=<UNSET>*, *verts=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](#matplotlib.collections.LineCollection.set_color "matplotlib.collections.LineCollection.set_color") | color or list of colors |
| [`colors`](#matplotlib.collections.LineCollection.set_color "matplotlib.collections.LineCollection.set_color") | color or list of colors |
| [`edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linelength`](#matplotlib.collections.EventCollection.set_linelength "matplotlib.collections.EventCollection.set_linelength") | unknown |
| [`lineoffset`](#matplotlib.collections.EventCollection.set_lineoffset "matplotlib.collections.EventCollection.set_lineoffset") | unknown |
| [`linestyle`](#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`orientation`](#matplotlib.collections.EventCollection.set_orientation "matplotlib.collections.EventCollection.set_orientation") | {'horizontal', 'vertical'} |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](#matplotlib.collections.LineCollection.set_segments "matplotlib.collections.LineCollection.set_segments") | unknown |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`positions`](#matplotlib.collections.EventCollection.set_positions "matplotlib.collections.EventCollection.set_positions") | unknown |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`segments`](#matplotlib.collections.LineCollection.set_segments "matplotlib.collections.LineCollection.set_segments") | unknown |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`verts`](#matplotlib.collections.LineCollection.set_segments "matplotlib.collections.LineCollection.set_segments") | unknown |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_aa(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.EventCollection.set_antialiased "matplotlib.collections.EventCollection.set_antialiased").
set\_agg\_filter(*filter\_func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L933-L949)
Set the agg filter.
Parameters:
**filter\_func**callable
A filter function, which takes a (m, n, depth) float array and a dpi value, and returns a (m, n, depth) array and two offsets from the bottom left corner of the image
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L807-L821)
Set the alpha value used for blending - not supported on all backends.
Parameters:
**alpha**array-like or scalar or None
All values must be within the 0-1 range, inclusive. Masked values and nans are not supported.
set\_animated(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1023-L1041)
Set whether the artist is intended to be used in an animation.
If True, the artist is excluded from regular drawing of the figure. You have to call [`Figure.draw_artist`](figure_api#matplotlib.figure.Figure.draw_artist "matplotlib.figure.Figure.draw_artist") / [`Axes.draw_artist`](_as_gen/matplotlib.axes.axes.draw_artist#matplotlib.axes.Axes.draw_artist "matplotlib.axes.Axes.draw_artist") explicitly on the artist. This approach is used to speed up animations using blitting.
See also [`matplotlib.animation`](animation_api#module-matplotlib.animation "matplotlib.animation") and [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html).
Parameters:
**b**bool
set\_antialiased(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Set the antialiasing state for rendering.
Parameters:
**aa**bool or list of bools
set\_antialiaseds(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.EventCollection.set_antialiased "matplotlib.collections.EventCollection.set_antialiased").
set\_array(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L484-L505)
Set the value array from array-like *A*.
Parameters:
**A**array-like or None
The values that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the value array *A*.
set\_capstyle(*cs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L630-L639)
Set the [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") for the collection (for all its elements).
Parameters:
**cs**[`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'}
set\_clim(*vmin=None*, *vmax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L526-L550)
Set the norm limits for image scaling.
Parameters:
**vmin, vmax**float
The limits.
The limits may also be passed as a tuple (*vmin*, *vmax*) as a single positional argument.
set\_clip\_box(*clipbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L731-L741)
Set the artist's clip [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
Parameters:
**clipbox**[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
set\_clip\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L877-L892)
Set whether the artist uses clipping.
When False artists will be visible outside of the Axes which can lead to unexpected results.
Parameters:
**b**bool
set\_clip\_path(*path*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L743-L803)
Set the artist's clip path.
Parameters:
**path**[`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") or [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") or [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") or None
The clip path. If given a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), *transform* must be provided as well. If *None*, a previously set clip path is removed.
**transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
Only used if *path* is a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), in which case the given [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") is converted to a [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") using *transform*.
#### Notes
For efficiency, if *path* is a [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") this method will set the clipping box to the corresponding rectangle and set the clipping path to `None`.
For technical reasons (support of [`set`](_as_gen/matplotlib.artist.artist.set#matplotlib.artist.Artist.set "matplotlib.artist.Artist.set")), a tuple (*path*, *transform*) is also accepted as a single positional parameter.
set\_cmap(*cmap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L562-L574)
Set the colormap for luminance data.
Parameters:
**cmap**[`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None
set\_color(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1464-L1475)
Set the edgecolor(s) of the LineCollection.
Parameters:
**c**color or list of colors
Single color (all lines have same color), or a sequence of rgba tuples; if it is a sequence the lines will cycle through the sequence.
set\_colors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1464-L1475)
Set the edgecolor(s) of the LineCollection.
Parameters:
**c**color or list of colors
Single color (all lines have same color), or a sequence of rgba tuples; if it is a sequence the lines will cycle through the sequence.
set\_dashes(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.EventCollection.set_linestyle "matplotlib.collections.EventCollection.set_linestyle").
set\_ec(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.EventCollection.set_edgecolor "matplotlib.collections.EventCollection.set_edgecolor").
set\_edgecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Set the edgecolor(s) of the collection.
Parameters:
**c**color or list of colors or 'face'
The collection edgecolor(s). If a sequence, the patches cycle through it. If 'face', match the facecolor.
set\_edgecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.EventCollection.set_edgecolor "matplotlib.collections.EventCollection.set_edgecolor").
set\_facecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Set the facecolor(s) of the collection. *c* can be a color (all patches have same color), or a sequence of colors; if it is a sequence the patches will cycle through the sequence.
If *c* is 'none', the patch will not be filled.
Parameters:
**c**color or list of colors
set\_facecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.EventCollection.set_facecolor "matplotlib.collections.EventCollection.set_facecolor").
set\_fc(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.EventCollection.set_facecolor "matplotlib.collections.EventCollection.set_facecolor").
set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L707-L729)
Set the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
set\_gid(*gid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L592-L600)
Set the (group) id for the artist.
Parameters:
**gid**str
set\_hatch(*hatch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L497-L532)
Set the hatching pattern
*hatch* can be one of:
```
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
```
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
Parameters:
**hatch**{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'}
set\_in\_layout(*in\_layout*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1043-L1054)
Set if artist is to be included in layout calculations, E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
Parameters:
**in\_layout**bool
set\_joinstyle(*js*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L644-L653)
Set the [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") for the collection (for all its elements).
Parameters:
**js**[`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'}
set\_label(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1060-L1074)
Set a label that will be displayed in the legend.
Parameters:
**s**object
*s* will be converted to a string by calling [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)").
set\_linelength(*linelength*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1626-L1637)
Set the length of the lines used to mark each event.
set\_lineoffset(*lineoffset*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1643-L1654)
Set the offset of the lines used to mark each event.
set\_linestyle(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Set the linestyle(s) for the collection.
| linestyle | description |
| --- | --- |
| `'-'` or `'solid'` | solid line |
| `'--'` or `'dashed'` | dashed line |
| `'-.'` or `'dashdot'` | dash-dotted line |
| `':'` or `'dotted'` | dotted line |
Alternatively a dash tuple of the following form can be provided:
```
(offset, onoffseq),
```
where `onoffseq` is an even length tuple of on and off ink in points.
Parameters:
**ls**str or tuple or list thereof
Valid values for individual linestyles include {'-', '--', '-.', ':', '', (offset, on-off-seq)}. See [`Line2D.set_linestyle`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") for a complete description.
set\_linestyles(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.EventCollection.set_linestyle "matplotlib.collections.EventCollection.set_linestyle").
set\_linewidth(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Set the linewidth(s) for the collection. *lw* can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence
Parameters:
**lw**float or list of floats
set\_linewidths(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.EventCollection.set_linewidth "matplotlib.collections.EventCollection.set_linewidth").
set\_ls(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.EventCollection.set_linestyle "matplotlib.collections.EventCollection.set_linestyle").
set\_lw(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.EventCollection.set_linewidth "matplotlib.collections.EventCollection.set_linewidth").
set\_mouseover(*mouseover*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1345-L1366)
Set whether this artist is queried for custom context information when the mouse cursor moves over it.
Parameters:
**mouseover**bool
See also
[`get_cursor_data`](#matplotlib.collections.EventCollection.get_cursor_data "matplotlib.collections.EventCollection.get_cursor_data")
[`ToolCursorPosition`](backend_tools_api#matplotlib.backend_tools.ToolCursorPosition "matplotlib.backend_tools.ToolCursorPosition")
[`NavigationToolbar2`](backend_bases_api#matplotlib.backend_bases.NavigationToolbar2 "matplotlib.backend_bases.NavigationToolbar2")
set\_norm(*norm*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L609-L623)
Set the normalization instance.
Parameters:
**norm**[`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None
#### Notes
If there are any colorbars using the mappable for this norm, setting the norm of the mappable will reset the norm, locator, and formatters on the colorbar to default.
set\_offset\_transform(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Set the artist offset transform.
Parameters:
**offset\_transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_offsets(*offsets*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L538-L552)
Set the offsets for the collection.
Parameters:
**offsets**(N, 2) or (2,) array-like
set\_orientation(*orientation*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1607-L1620)
Set the orientation of the event line.
Parameters:
**orientation**{'horizontal', 'vertical'}
set\_path\_effects(*path\_effects*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L689-L698)
Set the path effects.
Parameters:
**path\_effects**[`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
set\_paths(*segments*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1416-L1423)
set\_picker(*picker*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L527-L560)
Define the picking behavior of the artist.
Parameters:
**picker**None or bool or float or callable
This can be one of the following:
* *None*: Picking is disabled for this artist (default).
* A boolean: If *True* then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist.
* A float: If picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if its data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event
* A function: If picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event:
```
hit, props = picker(artist, mouseevent)
```
to determine the hit test. if the mouse event is over the artist, return *hit=True* and props is a dictionary of properties you want added to the PickEvent attributes.
set\_pickradius(*pickradius*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L422-L432)
Set the pick radius used for containment tests.
Parameters:
**pickradius**float
Pick radius, in points.
set\_positions(*positions*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1560-L1573)
Set the positions of the events.
set\_rasterized(*rasterized*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L908-L927)
Force rasterized (bitmap) drawing for vector graphics output.
Rasterized drawing is not supported by all artists. If you try to enable this on an artist that does not support it, the command has no effect and a warning will be issued.
This setting is ignored for pixel-based output.
See also [Rasterization for vector graphics](https://matplotlib.org/stable/gallery/misc/rasterization_demo.html).
Parameters:
**rasterized**bool
set\_segments(*segments*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1416-L1423)
set\_sketch\_params(*scale=None*, *length=None*, *randomness=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L661-L687)
Set the sketch parameters.
Parameters:
**scale**float, optional
The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), or not provided, no sketch filter will be provided.
**length**float, optional
The length of the wiggle along the line, in pixels (default 128.0)
**randomness**float, optional
The scale factor by which the length is shrunken or expanded (default 16.0)
The PGF backend uses this argument as an RNG seed and not as described above. Using the same seed yields the same random shape.
set\_snap(*snap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L613-L639)
Set the snapping behavior.
Snapping aligns positions with the pixel grid, which results in clearer images. For example, if a black line of 1px width was defined at a position in between two pixels, the resulting image would contain the interpolated value of that line in the pixel grid, which would be a grey value on both adjacent pixel positions. In contrast, snapping will move the line to the nearest integer pixel value, so that the resulting image will really contain a 1px wide black line.
Snapping is currently only supported by the Agg and MacOSX backends.
Parameters:
**snap**bool or None
Possible values:
* *True*: Snap vertices to the nearest pixel center.
* *False*: Do not modify vertex positions.
* *None*: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center.
set\_transOffset(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Alias for [`set_offset_transform`](#matplotlib.collections.EventCollection.set_offset_transform "matplotlib.collections.EventCollection.set_offset_transform").
set\_transform(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L408-L419)
Set the artist transform.
Parameters:
**t**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_url(*url*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L578-L586)
Set the url for the artist.
Parameters:
**url**str
set\_urls(*urls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L474-L486)
Parameters:
**urls**list of str or None
#### Notes
URLs are currently only implemented by the SVG backend. They are ignored by all other backends.
set\_verts(*segments*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1416-L1423)
set\_visible(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1011-L1021)
Set the artist's visibility.
Parameters:
**b**bool
set\_zorder(*level*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1080-L1093)
Set the zorder for the artist. Artists with lower zorder values are drawn first.
Parameters:
**level**float
*property*stale
Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist.
*property*sticky\_edges
`x` and `y` sticky edge lists for autoscaling.
When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added--the view limit "sticks" to the edge. A typical use case is histograms, where one usually expects no margin on the bottom edge (0) of the histogram.
Moreover, margin expansion "bumps" against sticky edges and cannot cross them. For example, if the upper data limit is 1.0, the upper view limit computed by simple margin application is 1.2, but there is a sticky edge at 1.1, then the actual upper view limit will be 1.1.
This attribute cannot be assigned to; however, the `x` and `y` lists can be modified in place as needed.
#### Examples
```
>>> artist.sticky_edges.x[:] = (xmin, xmax)
>>> artist.sticky_edges.y[:] = (ymin, ymax)
```
switch\_orientation()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1595-L1605)
Switch the orientation of the event line, either from vertical to horizontal or vice versus.
to\_rgba(*x*, *alpha=None*, *bytes=False*, *norm=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L414-L482)
Return a normalized rgba array corresponding to *x*.
In the normal case, *x* is a 1D or 2D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If *x* is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the *alpha* kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the *alpha* kwarg is ignored; it does not replace the preexisting alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if *bytes* is *False* (default), the rgba array will be floats in the 0-1 range; if it is *True*, the returned rgba array will be uint8 in the 0 to 255 range.
If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1).
update(*props*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1168-L1177)
Update this artist's properties from the dict *props*.
Parameters:
**props**dict
update\_from(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L907-L929)
Copy properties from other to self.
update\_scalarmappable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L865-L901)
Update colors from the scalar mappable array, if any.
Assign colors to edges and faces based on the array and/or colors that were directly set, as appropriate.
zorder*=0*
*class*matplotlib.collections.LineCollection(*segments*, *\**, *zorder=2*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1352-L1482)
Bases: [`Collection`](#matplotlib.collections.Collection "matplotlib.collections.Collection")
Represents a sequence of [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")s that should be drawn together.
This class extends [`Collection`](#matplotlib.collections.Collection "matplotlib.collections.Collection") to represent a sequence of [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")s instead of just a sequence of [`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch")s. Just as in [`Collection`](#matplotlib.collections.Collection "matplotlib.collections.Collection"), each property of a *LineCollection* may be either a single value or a list of values. This list is then used cyclically for each element of the LineCollection, so the property of the `i`th element of the collection is:
```
prop[i % len(prop)]
```
The properties of each member of a *LineCollection* default to their values in `[rcParams["lines.\*"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.*#matplotlibrc-sample)` instead of `[rcParams["patch.\*"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.*#matplotlibrc-sample)`, and the property *colors* is added in place of *edgecolors*.
Parameters:
**segments**list of array-like
A sequence of (*line0*, *line1*, *line2*), where:
```
linen = (x0, y0), (x1, y1), ... (xm, ym)
```
or the equivalent numpy array with two columns. Each line can have a different number of segments.
**linewidths**float or list of float, default: `[rcParams["lines.linewidth"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.linewidth#matplotlibrc-sample)` (default: `1.5`)
The width of each line in points.
**colors**color or list of color, default: `[rcParams["lines.color"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.color#matplotlibrc-sample)` (default: `'C0'`)
A sequence of RGBA tuples (e.g., arbitrary color strings, etc, not allowed).
**antialiaseds**bool or list of bool, default: `[rcParams["lines.antialiased"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=lines.antialiased#matplotlibrc-sample)` (default: `True`)
Whether to use antialiasing for each line.
**zorder**int, default: 2
zorder of the lines once drawn.
**facecolors**color or list of color, default: 'none'
When setting *facecolors*, each line is interpreted as a boundary for an area, implicitly closing the path from the last point to the first point. The enclosed area is filled with *facecolor*. In order to manually specify what should count as the "interior" of each line, please use [`PathCollection`](#matplotlib.collections.PathCollection "matplotlib.collections.PathCollection") instead, where the "interior" can be specified by appropriate usage of [`CLOSEPOLY`](path_api#matplotlib.path.Path.CLOSEPOLY "matplotlib.path.Path.CLOSEPOLY").
**\*\*kwargs**
Forwarded to [`Collection`](#matplotlib.collections.Collection "matplotlib.collections.Collection").
add\_callback(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L348-L375)
Add a callback function that will be called whenever one of the [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")'s properties changes.
Parameters:
**func**callable
The callback function. It must have the signature:
```
def func(artist: Artist) -> Any
```
where *artist* is the calling [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"). Return values may exist but are ignored.
Returns:
int
The observer id associated with the callback. This id can be used for removing the callback with [`remove_callback`](#matplotlib.collections.LineCollection.remove_callback "matplotlib.collections.LineCollection.remove_callback") later.
See also
[`remove_callback`](#matplotlib.collections.LineCollection.remove_callback "matplotlib.collections.LineCollection.remove_callback")
autoscale()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L625-L634)
Autoscale the scalar limits on the norm instance using the current array
autoscale\_None()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L636-L645)
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
*property*axes
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance the artist resides in, or *None*.
*property*callbacksSM[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
changed()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L647-L653)
Call this whenever the mappable is changed to notify all the callbackSM listeners to the 'changed' signal.
colorbar
The last colorbar associated with this ScalarMappable. May be None.
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L437-L472)
Test whether the mouse event occurred in the collection.
Returns `bool, dict(ind=itemlist)`, where every item in itemlist contains the event.
convert\_xunits(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L241-L251)
Convert *x* using the unit type of the xaxis.
If the artist is not contained in an Axes or if the xaxis does not have units, *x* itself is returned.
convert\_yunits(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L253-L263)
Convert *y* using the unit type of the yaxis.
If the artist is not contained in an Axes or if the yaxis does not have units, *y* itself is returned.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L344-L420)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
findobj(*match=None*, *include\_self=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1208-L1249)
Find artist objects.
Recursively find all [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") instances contained in the artist.
Parameters:
**match**
A filter criterion for the matches. This can be
* *None*: Return all objects contained in artist.
* A function with signature `def match(artist: Artist) -> bool`. The result will only contain artists for which the function returns *True*.
* A class instance: e.g., [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"). The result will only contain artists of this class or its subclasses (`isinstance` check).
**include\_self**bool
Include *self* in the list to be checked for a match.
Returns:
list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
format\_cursor\_data(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1282-L1336)
Return a string representation of *data*.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
The default implementation converts ints and floats and arrays of ints and floats into a comma-separated string enclosed in square brackets, unless the artist has an associated colorbar, in which case scalar values are formatted using the colorbar's formatter.
See also
[`get_cursor_data`](#matplotlib.collections.LineCollection.get_cursor_data "matplotlib.collections.LineCollection.get_cursor_data")
get\_agg\_filter()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L929-L931)
Return filter function to be used for agg filter.
get\_alpha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L805-L810)
Return the alpha value used for blending - not supported on all backends.
get\_animated()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L816-L818)
Return whether the artist is animated.
get\_array()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L507-L514)
Return the array of values, that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the array.
get\_capstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L641-L642)
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L430-L432)
Return a list of the child [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s of this [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist").
get\_clim()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L520-L524)
Return the values (min, max) that are mapped to the colormap limits.
get\_clip\_box()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L859-L861)
Return the clipbox.
get\_clip\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L855-L857)
Return whether the artist uses clipping.
get\_clip\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L863-L865)
Return the clip path.
get\_cmap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L516-L518)
Return the [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") instance.
get\_color()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1479-L1480)
get\_colors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1479-L1480)
get\_cursor\_data(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1251-L1280)
Return the cursor data for a given event.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
Cursor data can be used by Artists to provide additional context information for a given event. The default implementation just returns *None*.
Subclasses can override the method and return arbitrary data. However, when doing so, they must ensure that [`format_cursor_data`](#matplotlib.collections.LineCollection.format_cursor_data "matplotlib.collections.LineCollection.format_cursor_data") can convert the data to a string representation.
The only current use case is displaying the z-value of an [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") in the status bar of a plot window, while moving the mouse.
Parameters:
**event**[`matplotlib.backend_bases.MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
See also
[`format_cursor_data`](#matplotlib.collections.LineCollection.format_cursor_data "matplotlib.collections.LineCollection.format_cursor_data")
get\_dashes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.LineCollection.get_linestyle "matplotlib.collections.LineCollection.get_linestyle").
get\_datalim(*transData*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L235-L301)
get\_ec()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.LineCollection.get_edgecolor "matplotlib.collections.LineCollection.get_edgecolor").
get\_edgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
get\_edgecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.LineCollection.get_edgecolor "matplotlib.collections.LineCollection.get_edgecolor").
get\_facecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
get\_facecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.LineCollection.get_facecolor "matplotlib.collections.LineCollection.get_facecolor").
get\_fc()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.LineCollection.get_facecolor "matplotlib.collections.LineCollection.get_facecolor").
get\_figure()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L703-L705)
Return the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
get\_fill()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L903-L905)
Return whether face is colored.
get\_gid()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L588-L590)
Return the group id.
get\_hatch()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L534-L536)
Return the current hatching pattern.
get\_in\_layout()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L820-L829)
Return boolean flag, `True` if artist is included in layout calculations.
E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
get\_joinstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L655-L656)
get\_label()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1056-L1058)
Return the label used for this artist in the legend.
get\_linestyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
get\_linestyles()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.LineCollection.get_linestyle "matplotlib.collections.LineCollection.get_linestyle").
get\_linewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
get\_linewidths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.LineCollection.get_linewidth "matplotlib.collections.LineCollection.get_linewidth").
get\_ls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.LineCollection.get_linestyle "matplotlib.collections.LineCollection.get_linestyle").
get\_lw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.LineCollection.get_linewidth "matplotlib.collections.LineCollection.get_linewidth").
get\_mouseover()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1338-L1343)
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
get\_offset\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist offset.
get\_offsets()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L554-L557)
Return the offsets for the collection.
get\_path\_effects()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L700-L701)
get\_paths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L205-L206)
get\_picker()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L562-L572)
Return the picking behavior of the artist.
The possible values are described in [`set_picker`](#matplotlib.collections.LineCollection.set_picker "matplotlib.collections.LineCollection.set_picker").
See also
[`set_picker`](#matplotlib.collections.LineCollection.set_picker "matplotlib.collections.LineCollection.set_picker"), [`pickable`](#matplotlib.collections.LineCollection.pickable "matplotlib.collections.LineCollection.pickable"), [`pick`](#matplotlib.collections.LineCollection.pick "matplotlib.collections.LineCollection.pick")
get\_pickradius()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L434-L435)
get\_rasterized()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L904-L906)
Return whether the artist is to be rasterized.
get\_segments()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1428-L1450)
Returns:
list
List of segments in the LineCollection. Each list item contains an array of vertices.
get\_sketch\_params()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L641-L659)
Return the sketch parameters for the artist.
Returns:
tuple or None
A 3-tuple with the following elements:
* *scale*: The amplitude of the wiggle perpendicular to the source line.
* *length*: The length of the wiggle along the line.
* *randomness*: The scale factor by which the length is shrunken or expanded.
Returns *None* if no sketch parameters were set.
get\_snap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L602-L611)
Return the snap setting.
See [`set_snap`](#matplotlib.collections.LineCollection.set_snap "matplotlib.collections.LineCollection.set_snap") for details.
get\_tightbbox(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L322-L346)
Like [`Artist.get_window_extent`](_as_gen/matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent"), but includes any clipping.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
Returns:
[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The enclosing bounding box (in figure pixel coordinates).
get\_transOffset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Alias for [`get_offset_transform`](#matplotlib.collections.LineCollection.get_offset_transform "matplotlib.collections.LineCollection.get_offset_transform").
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L421-L428)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist.
get\_transformed\_clip\_path\_and\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L867-L875)
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
get\_transforms()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L211-L212)
get\_url()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L574-L576)
Return the url.
get\_urls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L488-L495)
Return a list of URLs, one for each element of the collection.
The list contains *None* for elements without a URL. See [Hyperlinks](https://matplotlib.org/stable/gallery/misc/hyperlinks_sgskip.html) for an example.
get\_visible()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L812-L814)
Return the visibility.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L303-L306)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
get\_zorder()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1076-L1078)
Return the artist's zorder.
have\_units()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L236-L239)
Return whether units are set on any axis.
is\_transform\_set()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L400-L406)
Return whether the Artist has an explicitly set transform.
This is *True* after [`set_transform`](#matplotlib.collections.LineCollection.set_transform "matplotlib.collections.LineCollection.set_transform") has been called.
*property*mouseover
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
*property*norm
pchanged()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L387-L398)
Call all of the registered callbacks.
This function is triggered internally when a property is changed.
See also
[`add_callback`](#matplotlib.collections.LineCollection.add_callback "matplotlib.collections.LineCollection.add_callback")
[`remove_callback`](#matplotlib.collections.LineCollection.remove_callback "matplotlib.collections.LineCollection.remove_callback")
pick(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L490-L525)
Process a pick event.
Each child artist will fire a pick event if *mouseevent* is over the artist and the artist has picker set.
See also
[`set_picker`](#matplotlib.collections.LineCollection.set_picker "matplotlib.collections.LineCollection.set_picker"), [`get_picker`](#matplotlib.collections.LineCollection.get_picker "matplotlib.collections.LineCollection.get_picker"), [`pickable`](#matplotlib.collections.LineCollection.pickable "matplotlib.collections.LineCollection.pickable")
pickable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L480-L488)
Return whether the artist is pickable.
See also
[`set_picker`](#matplotlib.collections.LineCollection.set_picker "matplotlib.collections.LineCollection.set_picker"), [`get_picker`](#matplotlib.collections.LineCollection.get_picker "matplotlib.collections.LineCollection.get_picker"), [`pick`](#matplotlib.collections.LineCollection.pick "matplotlib.collections.LineCollection.pick")
properties()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1139-L1141)
Return a dictionary of all the properties of the artist.
remove()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L193-L234)
Remove the artist from the figure if possible.
The effect will not be visible until the figure is redrawn, e.g., with [`FigureCanvasBase.draw_idle`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase.draw_idle "matplotlib.backend_bases.FigureCanvasBase.draw_idle"). Call [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") to update the axes limits if desired.
Note: [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") will not see collections even if the collection was added to the axes with *autolim* = True.
Note: there is no support for removing the artist's legend entry.
remove\_callback(*oid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L377-L385)
Remove a callback based on its observer id.
See also
[`add_callback`](#matplotlib.collections.LineCollection.add_callback "matplotlib.collections.LineCollection.add_callback")
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *array=<UNSET>*, *capstyle=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *color=<UNSET>*, *colors=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *offset\_transform=<UNSET>*, *offsets=<UNSET>*, *path\_effects=<UNSET>*, *paths=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *segments=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *urls=<UNSET>*, *verts=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](#matplotlib.collections.LineCollection.set_color "matplotlib.collections.LineCollection.set_color") | color or list of colors |
| [`colors`](#matplotlib.collections.LineCollection.set_color "matplotlib.collections.LineCollection.set_color") | color or list of colors |
| [`edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](#matplotlib.collections.LineCollection.set_segments "matplotlib.collections.LineCollection.set_segments") | unknown |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`segments`](#matplotlib.collections.LineCollection.set_segments "matplotlib.collections.LineCollection.set_segments") | unknown |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`verts`](#matplotlib.collections.LineCollection.set_segments "matplotlib.collections.LineCollection.set_segments") | unknown |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_aa(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.LineCollection.set_antialiased "matplotlib.collections.LineCollection.set_antialiased").
set\_agg\_filter(*filter\_func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L933-L949)
Set the agg filter.
Parameters:
**filter\_func**callable
A filter function, which takes a (m, n, depth) float array and a dpi value, and returns a (m, n, depth) array and two offsets from the bottom left corner of the image
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L807-L821)
Set the alpha value used for blending - not supported on all backends.
Parameters:
**alpha**array-like or scalar or None
All values must be within the 0-1 range, inclusive. Masked values and nans are not supported.
set\_animated(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1023-L1041)
Set whether the artist is intended to be used in an animation.
If True, the artist is excluded from regular drawing of the figure. You have to call [`Figure.draw_artist`](figure_api#matplotlib.figure.Figure.draw_artist "matplotlib.figure.Figure.draw_artist") / [`Axes.draw_artist`](_as_gen/matplotlib.axes.axes.draw_artist#matplotlib.axes.Axes.draw_artist "matplotlib.axes.Axes.draw_artist") explicitly on the artist. This approach is used to speed up animations using blitting.
See also [`matplotlib.animation`](animation_api#module-matplotlib.animation "matplotlib.animation") and [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html).
Parameters:
**b**bool
set\_antialiased(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Set the antialiasing state for rendering.
Parameters:
**aa**bool or list of bools
set\_antialiaseds(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.LineCollection.set_antialiased "matplotlib.collections.LineCollection.set_antialiased").
set\_array(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L484-L505)
Set the value array from array-like *A*.
Parameters:
**A**array-like or None
The values that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the value array *A*.
set\_capstyle(*cs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L630-L639)
Set the [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") for the collection (for all its elements).
Parameters:
**cs**[`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'}
set\_clim(*vmin=None*, *vmax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L526-L550)
Set the norm limits for image scaling.
Parameters:
**vmin, vmax**float
The limits.
The limits may also be passed as a tuple (*vmin*, *vmax*) as a single positional argument.
set\_clip\_box(*clipbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L731-L741)
Set the artist's clip [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
Parameters:
**clipbox**[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
set\_clip\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L877-L892)
Set whether the artist uses clipping.
When False artists will be visible outside of the Axes which can lead to unexpected results.
Parameters:
**b**bool
set\_clip\_path(*path*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L743-L803)
Set the artist's clip path.
Parameters:
**path**[`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") or [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") or [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") or None
The clip path. If given a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), *transform* must be provided as well. If *None*, a previously set clip path is removed.
**transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
Only used if *path* is a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), in which case the given [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") is converted to a [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") using *transform*.
#### Notes
For efficiency, if *path* is a [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") this method will set the clipping box to the corresponding rectangle and set the clipping path to `None`.
For technical reasons (support of [`set`](_as_gen/matplotlib.artist.artist.set#matplotlib.artist.Artist.set "matplotlib.artist.Artist.set")), a tuple (*path*, *transform*) is also accepted as a single positional parameter.
set\_cmap(*cmap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L562-L574)
Set the colormap for luminance data.
Parameters:
**cmap**[`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None
set\_color(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1464-L1475)
Set the edgecolor(s) of the LineCollection.
Parameters:
**c**color or list of colors
Single color (all lines have same color), or a sequence of rgba tuples; if it is a sequence the lines will cycle through the sequence.
set\_colors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1464-L1475)
Set the edgecolor(s) of the LineCollection.
Parameters:
**c**color or list of colors
Single color (all lines have same color), or a sequence of rgba tuples; if it is a sequence the lines will cycle through the sequence.
set\_dashes(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.LineCollection.set_linestyle "matplotlib.collections.LineCollection.set_linestyle").
set\_ec(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.LineCollection.set_edgecolor "matplotlib.collections.LineCollection.set_edgecolor").
set\_edgecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Set the edgecolor(s) of the collection.
Parameters:
**c**color or list of colors or 'face'
The collection edgecolor(s). If a sequence, the patches cycle through it. If 'face', match the facecolor.
set\_edgecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.LineCollection.set_edgecolor "matplotlib.collections.LineCollection.set_edgecolor").
set\_facecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Set the facecolor(s) of the collection. *c* can be a color (all patches have same color), or a sequence of colors; if it is a sequence the patches will cycle through the sequence.
If *c* is 'none', the patch will not be filled.
Parameters:
**c**color or list of colors
set\_facecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.LineCollection.set_facecolor "matplotlib.collections.LineCollection.set_facecolor").
set\_fc(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.LineCollection.set_facecolor "matplotlib.collections.LineCollection.set_facecolor").
set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L707-L729)
Set the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
set\_gid(*gid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L592-L600)
Set the (group) id for the artist.
Parameters:
**gid**str
set\_hatch(*hatch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L497-L532)
Set the hatching pattern
*hatch* can be one of:
```
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
```
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
Parameters:
**hatch**{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'}
set\_in\_layout(*in\_layout*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1043-L1054)
Set if artist is to be included in layout calculations, E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
Parameters:
**in\_layout**bool
set\_joinstyle(*js*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L644-L653)
Set the [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") for the collection (for all its elements).
Parameters:
**js**[`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'}
set\_label(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1060-L1074)
Set a label that will be displayed in the legend.
Parameters:
**s**object
*s* will be converted to a string by calling [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)").
set\_linestyle(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Set the linestyle(s) for the collection.
| linestyle | description |
| --- | --- |
| `'-'` or `'solid'` | solid line |
| `'--'` or `'dashed'` | dashed line |
| `'-.'` or `'dashdot'` | dash-dotted line |
| `':'` or `'dotted'` | dotted line |
Alternatively a dash tuple of the following form can be provided:
```
(offset, onoffseq),
```
where `onoffseq` is an even length tuple of on and off ink in points.
Parameters:
**ls**str or tuple or list thereof
Valid values for individual linestyles include {'-', '--', '-.', ':', '', (offset, on-off-seq)}. See [`Line2D.set_linestyle`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") for a complete description.
set\_linestyles(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.LineCollection.set_linestyle "matplotlib.collections.LineCollection.set_linestyle").
set\_linewidth(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Set the linewidth(s) for the collection. *lw* can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence
Parameters:
**lw**float or list of floats
set\_linewidths(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.LineCollection.set_linewidth "matplotlib.collections.LineCollection.set_linewidth").
set\_ls(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.LineCollection.set_linestyle "matplotlib.collections.LineCollection.set_linestyle").
set\_lw(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.LineCollection.set_linewidth "matplotlib.collections.LineCollection.set_linewidth").
set\_mouseover(*mouseover*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1345-L1366)
Set whether this artist is queried for custom context information when the mouse cursor moves over it.
Parameters:
**mouseover**bool
See also
[`get_cursor_data`](#matplotlib.collections.LineCollection.get_cursor_data "matplotlib.collections.LineCollection.get_cursor_data")
[`ToolCursorPosition`](backend_tools_api#matplotlib.backend_tools.ToolCursorPosition "matplotlib.backend_tools.ToolCursorPosition")
[`NavigationToolbar2`](backend_bases_api#matplotlib.backend_bases.NavigationToolbar2 "matplotlib.backend_bases.NavigationToolbar2")
set\_norm(*norm*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L609-L623)
Set the normalization instance.
Parameters:
**norm**[`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None
#### Notes
If there are any colorbars using the mappable for this norm, setting the norm of the mappable will reset the norm, locator, and formatters on the colorbar to default.
set\_offset\_transform(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Set the artist offset transform.
Parameters:
**offset\_transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_offsets(*offsets*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L538-L552)
Set the offsets for the collection.
Parameters:
**offsets**(N, 2) or (2,) array-like
set\_path\_effects(*path\_effects*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L689-L698)
Set the path effects.
Parameters:
**path\_effects**[`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
set\_paths(*segments*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1416-L1423)
set\_picker(*picker*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L527-L560)
Define the picking behavior of the artist.
Parameters:
**picker**None or bool or float or callable
This can be one of the following:
* *None*: Picking is disabled for this artist (default).
* A boolean: If *True* then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist.
* A float: If picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if its data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event
* A function: If picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event:
```
hit, props = picker(artist, mouseevent)
```
to determine the hit test. if the mouse event is over the artist, return *hit=True* and props is a dictionary of properties you want added to the PickEvent attributes.
set\_pickradius(*pickradius*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L422-L432)
Set the pick radius used for containment tests.
Parameters:
**pickradius**float
Pick radius, in points.
set\_rasterized(*rasterized*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L908-L927)
Force rasterized (bitmap) drawing for vector graphics output.
Rasterized drawing is not supported by all artists. If you try to enable this on an artist that does not support it, the command has no effect and a warning will be issued.
This setting is ignored for pixel-based output.
See also [Rasterization for vector graphics](https://matplotlib.org/stable/gallery/misc/rasterization_demo.html).
Parameters:
**rasterized**bool
set\_segments(*segments*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1416-L1423)
set\_sketch\_params(*scale=None*, *length=None*, *randomness=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L661-L687)
Set the sketch parameters.
Parameters:
**scale**float, optional
The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), or not provided, no sketch filter will be provided.
**length**float, optional
The length of the wiggle along the line, in pixels (default 128.0)
**randomness**float, optional
The scale factor by which the length is shrunken or expanded (default 16.0)
The PGF backend uses this argument as an RNG seed and not as described above. Using the same seed yields the same random shape.
set\_snap(*snap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L613-L639)
Set the snapping behavior.
Snapping aligns positions with the pixel grid, which results in clearer images. For example, if a black line of 1px width was defined at a position in between two pixels, the resulting image would contain the interpolated value of that line in the pixel grid, which would be a grey value on both adjacent pixel positions. In contrast, snapping will move the line to the nearest integer pixel value, so that the resulting image will really contain a 1px wide black line.
Snapping is currently only supported by the Agg and MacOSX backends.
Parameters:
**snap**bool or None
Possible values:
* *True*: Snap vertices to the nearest pixel center.
* *False*: Do not modify vertex positions.
* *None*: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center.
set\_transOffset(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Alias for [`set_offset_transform`](#matplotlib.collections.LineCollection.set_offset_transform "matplotlib.collections.LineCollection.set_offset_transform").
set\_transform(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L408-L419)
Set the artist transform.
Parameters:
**t**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_url(*url*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L578-L586)
Set the url for the artist.
Parameters:
**url**str
set\_urls(*urls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L474-L486)
Parameters:
**urls**list of str or None
#### Notes
URLs are currently only implemented by the SVG backend. They are ignored by all other backends.
set\_verts(*segments*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1416-L1423)
set\_visible(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1011-L1021)
Set the artist's visibility.
Parameters:
**b**bool
set\_zorder(*level*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1080-L1093)
Set the zorder for the artist. Artists with lower zorder values are drawn first.
Parameters:
**level**float
*property*stale
Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist.
*property*sticky\_edges
`x` and `y` sticky edge lists for autoscaling.
When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added--the view limit "sticks" to the edge. A typical use case is histograms, where one usually expects no margin on the bottom edge (0) of the histogram.
Moreover, margin expansion "bumps" against sticky edges and cannot cross them. For example, if the upper data limit is 1.0, the upper view limit computed by simple margin application is 1.2, but there is a sticky edge at 1.1, then the actual upper view limit will be 1.1.
This attribute cannot be assigned to; however, the `x` and `y` lists can be modified in place as needed.
#### Examples
```
>>> artist.sticky_edges.x[:] = (xmin, xmax)
>>> artist.sticky_edges.y[:] = (ymin, ymax)
```
to\_rgba(*x*, *alpha=None*, *bytes=False*, *norm=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L414-L482)
Return a normalized rgba array corresponding to *x*.
In the normal case, *x* is a 1D or 2D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If *x* is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the *alpha* kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the *alpha* kwarg is ignored; it does not replace the preexisting alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if *bytes* is *False* (default), the rgba array will be floats in the 0-1 range; if it is *True*, the returned rgba array will be uint8 in the 0 to 255 range.
If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1).
update(*props*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1168-L1177)
Update this artist's properties from the dict *props*.
Parameters:
**props**dict
update\_from(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L907-L929)
Copy properties from other to self.
update\_scalarmappable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L865-L901)
Update colors from the scalar mappable array, if any.
Assign colors to edges and faces based on the array and/or colors that were directly set, as appropriate.
zorder*=0*
*class*matplotlib.collections.PatchCollection(*patches*, *\**, *match\_original=False*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1770-L1828)
Bases: [`Collection`](#matplotlib.collections.Collection "matplotlib.collections.Collection")
A generic collection of patches.
PatchCollection draws faster than a large number of equivalent individual Patches. It also makes it easier to assign a colormap to a heterogeneous collection of patches.
Parameters:
**patches**list of [`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch")
A sequence of Patch objects. This list may include a heterogeneous assortment of different patch types.
**match\_original**bool, default: False
If True, use the colors and linewidths of the original patches. If False, new colors may be assigned by providing the standard collection arguments, facecolor, edgecolor, linewidths, norm or cmap.
**\*\*kwargs**
All other parameters are forwarded to [`Collection`](#matplotlib.collections.Collection "matplotlib.collections.Collection").
If any of *edgecolors*, *facecolors*, *linewidths*, *antialiaseds* are None, they default to their [`rcParams`](matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams") patch setting, in sequence form.
#### Notes
The use of [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") functionality is optional. If the [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") matrix `_A` has been set (via a call to [`set_array`](cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array")), at draw time a call to scalar mappable will be made to set the face colors.
add\_callback(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L348-L375)
Add a callback function that will be called whenever one of the [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")'s properties changes.
Parameters:
**func**callable
The callback function. It must have the signature:
```
def func(artist: Artist) -> Any
```
where *artist* is the calling [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"). Return values may exist but are ignored.
Returns:
int
The observer id associated with the callback. This id can be used for removing the callback with [`remove_callback`](#matplotlib.collections.PatchCollection.remove_callback "matplotlib.collections.PatchCollection.remove_callback") later.
See also
[`remove_callback`](#matplotlib.collections.PatchCollection.remove_callback "matplotlib.collections.PatchCollection.remove_callback")
autoscale()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L625-L634)
Autoscale the scalar limits on the norm instance using the current array
autoscale\_None()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L636-L645)
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
*property*axes
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance the artist resides in, or *None*.
*property*callbacksSM[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
changed()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L647-L653)
Call this whenever the mappable is changed to notify all the callbackSM listeners to the 'changed' signal.
colorbar
The last colorbar associated with this ScalarMappable. May be None.
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L437-L472)
Test whether the mouse event occurred in the collection.
Returns `bool, dict(ind=itemlist)`, where every item in itemlist contains the event.
convert\_xunits(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L241-L251)
Convert *x* using the unit type of the xaxis.
If the artist is not contained in an Axes or if the xaxis does not have units, *x* itself is returned.
convert\_yunits(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L253-L263)
Convert *y* using the unit type of the yaxis.
If the artist is not contained in an Axes or if the yaxis does not have units, *y* itself is returned.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L344-L420)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
findobj(*match=None*, *include\_self=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1208-L1249)
Find artist objects.
Recursively find all [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") instances contained in the artist.
Parameters:
**match**
A filter criterion for the matches. This can be
* *None*: Return all objects contained in artist.
* A function with signature `def match(artist: Artist) -> bool`. The result will only contain artists for which the function returns *True*.
* A class instance: e.g., [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"). The result will only contain artists of this class or its subclasses (`isinstance` check).
**include\_self**bool
Include *self* in the list to be checked for a match.
Returns:
list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
format\_cursor\_data(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1282-L1336)
Return a string representation of *data*.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
The default implementation converts ints and floats and arrays of ints and floats into a comma-separated string enclosed in square brackets, unless the artist has an associated colorbar, in which case scalar values are formatted using the colorbar's formatter.
See also
[`get_cursor_data`](#matplotlib.collections.PatchCollection.get_cursor_data "matplotlib.collections.PatchCollection.get_cursor_data")
get\_agg\_filter()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L929-L931)
Return filter function to be used for agg filter.
get\_alpha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L805-L810)
Return the alpha value used for blending - not supported on all backends.
get\_animated()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L816-L818)
Return whether the artist is animated.
get\_array()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L507-L514)
Return the array of values, that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the array.
get\_capstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L641-L642)
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L430-L432)
Return a list of the child [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s of this [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist").
get\_clim()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L520-L524)
Return the values (min, max) that are mapped to the colormap limits.
get\_clip\_box()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L859-L861)
Return the clipbox.
get\_clip\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L855-L857)
Return whether the artist uses clipping.
get\_clip\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L863-L865)
Return the clip path.
get\_cmap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L516-L518)
Return the [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") instance.
get\_cursor\_data(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1251-L1280)
Return the cursor data for a given event.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
Cursor data can be used by Artists to provide additional context information for a given event. The default implementation just returns *None*.
Subclasses can override the method and return arbitrary data. However, when doing so, they must ensure that [`format_cursor_data`](#matplotlib.collections.PatchCollection.format_cursor_data "matplotlib.collections.PatchCollection.format_cursor_data") can convert the data to a string representation.
The only current use case is displaying the z-value of an [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") in the status bar of a plot window, while moving the mouse.
Parameters:
**event**[`matplotlib.backend_bases.MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
See also
[`format_cursor_data`](#matplotlib.collections.PatchCollection.format_cursor_data "matplotlib.collections.PatchCollection.format_cursor_data")
get\_dashes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.PatchCollection.get_linestyle "matplotlib.collections.PatchCollection.get_linestyle").
get\_datalim(*transData*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L235-L301)
get\_ec()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.PatchCollection.get_edgecolor "matplotlib.collections.PatchCollection.get_edgecolor").
get\_edgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
get\_edgecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.PatchCollection.get_edgecolor "matplotlib.collections.PatchCollection.get_edgecolor").
get\_facecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
get\_facecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.PatchCollection.get_facecolor "matplotlib.collections.PatchCollection.get_facecolor").
get\_fc()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.PatchCollection.get_facecolor "matplotlib.collections.PatchCollection.get_facecolor").
get\_figure()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L703-L705)
Return the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
get\_fill()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L903-L905)
Return whether face is colored.
get\_gid()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L588-L590)
Return the group id.
get\_hatch()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L534-L536)
Return the current hatching pattern.
get\_in\_layout()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L820-L829)
Return boolean flag, `True` if artist is included in layout calculations.
E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
get\_joinstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L655-L656)
get\_label()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1056-L1058)
Return the label used for this artist in the legend.
get\_linestyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
get\_linestyles()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.PatchCollection.get_linestyle "matplotlib.collections.PatchCollection.get_linestyle").
get\_linewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
get\_linewidths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.PatchCollection.get_linewidth "matplotlib.collections.PatchCollection.get_linewidth").
get\_ls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.PatchCollection.get_linestyle "matplotlib.collections.PatchCollection.get_linestyle").
get\_lw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.PatchCollection.get_linewidth "matplotlib.collections.PatchCollection.get_linewidth").
get\_mouseover()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1338-L1343)
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
get\_offset\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist offset.
get\_offsets()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L554-L557)
Return the offsets for the collection.
get\_path\_effects()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L700-L701)
get\_paths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L205-L206)
get\_picker()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L562-L572)
Return the picking behavior of the artist.
The possible values are described in [`set_picker`](#matplotlib.collections.PatchCollection.set_picker "matplotlib.collections.PatchCollection.set_picker").
See also
[`set_picker`](#matplotlib.collections.PatchCollection.set_picker "matplotlib.collections.PatchCollection.set_picker"), [`pickable`](#matplotlib.collections.PatchCollection.pickable "matplotlib.collections.PatchCollection.pickable"), [`pick`](#matplotlib.collections.PatchCollection.pick "matplotlib.collections.PatchCollection.pick")
get\_pickradius()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L434-L435)
get\_rasterized()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L904-L906)
Return whether the artist is to be rasterized.
get\_sketch\_params()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L641-L659)
Return the sketch parameters for the artist.
Returns:
tuple or None
A 3-tuple with the following elements:
* *scale*: The amplitude of the wiggle perpendicular to the source line.
* *length*: The length of the wiggle along the line.
* *randomness*: The scale factor by which the length is shrunken or expanded.
Returns *None* if no sketch parameters were set.
get\_snap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L602-L611)
Return the snap setting.
See [`set_snap`](#matplotlib.collections.PatchCollection.set_snap "matplotlib.collections.PatchCollection.set_snap") for details.
get\_tightbbox(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L322-L346)
Like [`Artist.get_window_extent`](_as_gen/matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent"), but includes any clipping.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
Returns:
[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The enclosing bounding box (in figure pixel coordinates).
get\_transOffset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Alias for [`get_offset_transform`](#matplotlib.collections.PatchCollection.get_offset_transform "matplotlib.collections.PatchCollection.get_offset_transform").
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L421-L428)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist.
get\_transformed\_clip\_path\_and\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L867-L875)
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
get\_transforms()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L211-L212)
get\_url()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L574-L576)
Return the url.
get\_urls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L488-L495)
Return a list of URLs, one for each element of the collection.
The list contains *None* for elements without a URL. See [Hyperlinks](https://matplotlib.org/stable/gallery/misc/hyperlinks_sgskip.html) for an example.
get\_visible()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L812-L814)
Return the visibility.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L303-L306)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
get\_zorder()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1076-L1078)
Return the artist's zorder.
have\_units()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L236-L239)
Return whether units are set on any axis.
is\_transform\_set()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L400-L406)
Return whether the Artist has an explicitly set transform.
This is *True* after [`set_transform`](#matplotlib.collections.PatchCollection.set_transform "matplotlib.collections.PatchCollection.set_transform") has been called.
*property*mouseover
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
*property*norm
pchanged()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L387-L398)
Call all of the registered callbacks.
This function is triggered internally when a property is changed.
See also
[`add_callback`](#matplotlib.collections.PatchCollection.add_callback "matplotlib.collections.PatchCollection.add_callback")
[`remove_callback`](#matplotlib.collections.PatchCollection.remove_callback "matplotlib.collections.PatchCollection.remove_callback")
pick(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L490-L525)
Process a pick event.
Each child artist will fire a pick event if *mouseevent* is over the artist and the artist has picker set.
See also
[`set_picker`](#matplotlib.collections.PatchCollection.set_picker "matplotlib.collections.PatchCollection.set_picker"), [`get_picker`](#matplotlib.collections.PatchCollection.get_picker "matplotlib.collections.PatchCollection.get_picker"), [`pickable`](#matplotlib.collections.PatchCollection.pickable "matplotlib.collections.PatchCollection.pickable")
pickable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L480-L488)
Return whether the artist is pickable.
See also
[`set_picker`](#matplotlib.collections.PatchCollection.set_picker "matplotlib.collections.PatchCollection.set_picker"), [`get_picker`](#matplotlib.collections.PatchCollection.get_picker "matplotlib.collections.PatchCollection.get_picker"), [`pick`](#matplotlib.collections.PatchCollection.pick "matplotlib.collections.PatchCollection.pick")
properties()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1139-L1141)
Return a dictionary of all the properties of the artist.
remove()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L193-L234)
Remove the artist from the figure if possible.
The effect will not be visible until the figure is redrawn, e.g., with [`FigureCanvasBase.draw_idle`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase.draw_idle "matplotlib.backend_bases.FigureCanvasBase.draw_idle"). Call [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") to update the axes limits if desired.
Note: [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") will not see collections even if the collection was added to the axes with *autolim* = True.
Note: there is no support for removing the artist's legend entry.
remove\_callback(*oid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L377-L385)
Remove a callback based on its observer id.
See also
[`add_callback`](#matplotlib.collections.PatchCollection.add_callback "matplotlib.collections.PatchCollection.add_callback")
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *array=<UNSET>*, *capstyle=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *offset\_transform=<UNSET>*, *offsets=<UNSET>*, *path\_effects=<UNSET>*, *paths=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *urls=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](#matplotlib.collections.PatchCollection.set_paths "matplotlib.collections.PatchCollection.set_paths") | unknown |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_aa(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.PatchCollection.set_antialiased "matplotlib.collections.PatchCollection.set_antialiased").
set\_agg\_filter(*filter\_func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L933-L949)
Set the agg filter.
Parameters:
**filter\_func**callable
A filter function, which takes a (m, n, depth) float array and a dpi value, and returns a (m, n, depth) array and two offsets from the bottom left corner of the image
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L807-L821)
Set the alpha value used for blending - not supported on all backends.
Parameters:
**alpha**array-like or scalar or None
All values must be within the 0-1 range, inclusive. Masked values and nans are not supported.
set\_animated(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1023-L1041)
Set whether the artist is intended to be used in an animation.
If True, the artist is excluded from regular drawing of the figure. You have to call [`Figure.draw_artist`](figure_api#matplotlib.figure.Figure.draw_artist "matplotlib.figure.Figure.draw_artist") / [`Axes.draw_artist`](_as_gen/matplotlib.axes.axes.draw_artist#matplotlib.axes.Axes.draw_artist "matplotlib.axes.Axes.draw_artist") explicitly on the artist. This approach is used to speed up animations using blitting.
See also [`matplotlib.animation`](animation_api#module-matplotlib.animation "matplotlib.animation") and [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html).
Parameters:
**b**bool
set\_antialiased(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Set the antialiasing state for rendering.
Parameters:
**aa**bool or list of bools
set\_antialiaseds(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.PatchCollection.set_antialiased "matplotlib.collections.PatchCollection.set_antialiased").
set\_array(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L484-L505)
Set the value array from array-like *A*.
Parameters:
**A**array-like or None
The values that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the value array *A*.
set\_capstyle(*cs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L630-L639)
Set the [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") for the collection (for all its elements).
Parameters:
**cs**[`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'}
set\_clim(*vmin=None*, *vmax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L526-L550)
Set the norm limits for image scaling.
Parameters:
**vmin, vmax**float
The limits.
The limits may also be passed as a tuple (*vmin*, *vmax*) as a single positional argument.
set\_clip\_box(*clipbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L731-L741)
Set the artist's clip [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
Parameters:
**clipbox**[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
set\_clip\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L877-L892)
Set whether the artist uses clipping.
When False artists will be visible outside of the Axes which can lead to unexpected results.
Parameters:
**b**bool
set\_clip\_path(*path*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L743-L803)
Set the artist's clip path.
Parameters:
**path**[`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") or [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") or [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") or None
The clip path. If given a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), *transform* must be provided as well. If *None*, a previously set clip path is removed.
**transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
Only used if *path* is a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), in which case the given [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") is converted to a [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") using *transform*.
#### Notes
For efficiency, if *path* is a [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") this method will set the clipping box to the corresponding rectangle and set the clipping path to `None`.
For technical reasons (support of [`set`](_as_gen/matplotlib.artist.artist.set#matplotlib.artist.Artist.set "matplotlib.artist.Artist.set")), a tuple (*path*, *transform*) is also accepted as a single positional parameter.
set\_cmap(*cmap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L562-L574)
Set the colormap for luminance data.
Parameters:
**cmap**[`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None
set\_color(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L713-L727)
Set both the edgecolor and the facecolor.
Parameters:
**c**color or list of rgba tuples
See also
[`Collection.set_facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor"), [`Collection.set_edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor")
For setting the edge or face color individually.
set\_dashes(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.PatchCollection.set_linestyle "matplotlib.collections.PatchCollection.set_linestyle").
set\_ec(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.PatchCollection.set_edgecolor "matplotlib.collections.PatchCollection.set_edgecolor").
set\_edgecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Set the edgecolor(s) of the collection.
Parameters:
**c**color or list of colors or 'face'
The collection edgecolor(s). If a sequence, the patches cycle through it. If 'face', match the facecolor.
set\_edgecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.PatchCollection.set_edgecolor "matplotlib.collections.PatchCollection.set_edgecolor").
set\_facecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Set the facecolor(s) of the collection. *c* can be a color (all patches have same color), or a sequence of colors; if it is a sequence the patches will cycle through the sequence.
If *c* is 'none', the patch will not be filled.
Parameters:
**c**color or list of colors
set\_facecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.PatchCollection.set_facecolor "matplotlib.collections.PatchCollection.set_facecolor").
set\_fc(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.PatchCollection.set_facecolor "matplotlib.collections.PatchCollection.set_facecolor").
set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L707-L729)
Set the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
set\_gid(*gid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L592-L600)
Set the (group) id for the artist.
Parameters:
**gid**str
set\_hatch(*hatch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L497-L532)
Set the hatching pattern
*hatch* can be one of:
```
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
```
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
Parameters:
**hatch**{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'}
set\_in\_layout(*in\_layout*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1043-L1054)
Set if artist is to be included in layout calculations, E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
Parameters:
**in\_layout**bool
set\_joinstyle(*js*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L644-L653)
Set the [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") for the collection (for all its elements).
Parameters:
**js**[`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'}
set\_label(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1060-L1074)
Set a label that will be displayed in the legend.
Parameters:
**s**object
*s* will be converted to a string by calling [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)").
set\_linestyle(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Set the linestyle(s) for the collection.
| linestyle | description |
| --- | --- |
| `'-'` or `'solid'` | solid line |
| `'--'` or `'dashed'` | dashed line |
| `'-.'` or `'dashdot'` | dash-dotted line |
| `':'` or `'dotted'` | dotted line |
Alternatively a dash tuple of the following form can be provided:
```
(offset, onoffseq),
```
where `onoffseq` is an even length tuple of on and off ink in points.
Parameters:
**ls**str or tuple or list thereof
Valid values for individual linestyles include {'-', '--', '-.', ':', '', (offset, on-off-seq)}. See [`Line2D.set_linestyle`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") for a complete description.
set\_linestyles(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.PatchCollection.set_linestyle "matplotlib.collections.PatchCollection.set_linestyle").
set\_linewidth(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Set the linewidth(s) for the collection. *lw* can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence
Parameters:
**lw**float or list of floats
set\_linewidths(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.PatchCollection.set_linewidth "matplotlib.collections.PatchCollection.set_linewidth").
set\_ls(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.PatchCollection.set_linestyle "matplotlib.collections.PatchCollection.set_linestyle").
set\_lw(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.PatchCollection.set_linewidth "matplotlib.collections.PatchCollection.set_linewidth").
set\_mouseover(*mouseover*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1345-L1366)
Set whether this artist is queried for custom context information when the mouse cursor moves over it.
Parameters:
**mouseover**bool
See also
[`get_cursor_data`](#matplotlib.collections.PatchCollection.get_cursor_data "matplotlib.collections.PatchCollection.get_cursor_data")
[`ToolCursorPosition`](backend_tools_api#matplotlib.backend_tools.ToolCursorPosition "matplotlib.backend_tools.ToolCursorPosition")
[`NavigationToolbar2`](backend_bases_api#matplotlib.backend_bases.NavigationToolbar2 "matplotlib.backend_bases.NavigationToolbar2")
set\_norm(*norm*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L609-L623)
Set the normalization instance.
Parameters:
**norm**[`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None
#### Notes
If there are any colorbars using the mappable for this norm, setting the norm of the mappable will reset the norm, locator, and formatters on the colorbar to default.
set\_offset\_transform(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Set the artist offset transform.
Parameters:
**offset\_transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_offsets(*offsets*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L538-L552)
Set the offsets for the collection.
Parameters:
**offsets**(N, 2) or (2,) array-like
set\_path\_effects(*path\_effects*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L689-L698)
Set the path effects.
Parameters:
**path\_effects**[`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
set\_paths(*patches*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1825-L1828)
set\_picker(*picker*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L527-L560)
Define the picking behavior of the artist.
Parameters:
**picker**None or bool or float or callable
This can be one of the following:
* *None*: Picking is disabled for this artist (default).
* A boolean: If *True* then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist.
* A float: If picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if its data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event
* A function: If picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event:
```
hit, props = picker(artist, mouseevent)
```
to determine the hit test. if the mouse event is over the artist, return *hit=True* and props is a dictionary of properties you want added to the PickEvent attributes.
set\_pickradius(*pickradius*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L422-L432)
Set the pick radius used for containment tests.
Parameters:
**pickradius**float
Pick radius, in points.
set\_rasterized(*rasterized*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L908-L927)
Force rasterized (bitmap) drawing for vector graphics output.
Rasterized drawing is not supported by all artists. If you try to enable this on an artist that does not support it, the command has no effect and a warning will be issued.
This setting is ignored for pixel-based output.
See also [Rasterization for vector graphics](https://matplotlib.org/stable/gallery/misc/rasterization_demo.html).
Parameters:
**rasterized**bool
set\_sketch\_params(*scale=None*, *length=None*, *randomness=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L661-L687)
Set the sketch parameters.
Parameters:
**scale**float, optional
The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), or not provided, no sketch filter will be provided.
**length**float, optional
The length of the wiggle along the line, in pixels (default 128.0)
**randomness**float, optional
The scale factor by which the length is shrunken or expanded (default 16.0)
The PGF backend uses this argument as an RNG seed and not as described above. Using the same seed yields the same random shape.
set\_snap(*snap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L613-L639)
Set the snapping behavior.
Snapping aligns positions with the pixel grid, which results in clearer images. For example, if a black line of 1px width was defined at a position in between two pixels, the resulting image would contain the interpolated value of that line in the pixel grid, which would be a grey value on both adjacent pixel positions. In contrast, snapping will move the line to the nearest integer pixel value, so that the resulting image will really contain a 1px wide black line.
Snapping is currently only supported by the Agg and MacOSX backends.
Parameters:
**snap**bool or None
Possible values:
* *True*: Snap vertices to the nearest pixel center.
* *False*: Do not modify vertex positions.
* *None*: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center.
set\_transOffset(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Alias for [`set_offset_transform`](#matplotlib.collections.PatchCollection.set_offset_transform "matplotlib.collections.PatchCollection.set_offset_transform").
set\_transform(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L408-L419)
Set the artist transform.
Parameters:
**t**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_url(*url*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L578-L586)
Set the url for the artist.
Parameters:
**url**str
set\_urls(*urls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L474-L486)
Parameters:
**urls**list of str or None
#### Notes
URLs are currently only implemented by the SVG backend. They are ignored by all other backends.
set\_visible(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1011-L1021)
Set the artist's visibility.
Parameters:
**b**bool
set\_zorder(*level*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1080-L1093)
Set the zorder for the artist. Artists with lower zorder values are drawn first.
Parameters:
**level**float
*property*stale
Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist.
*property*sticky\_edges
`x` and `y` sticky edge lists for autoscaling.
When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added--the view limit "sticks" to the edge. A typical use case is histograms, where one usually expects no margin on the bottom edge (0) of the histogram.
Moreover, margin expansion "bumps" against sticky edges and cannot cross them. For example, if the upper data limit is 1.0, the upper view limit computed by simple margin application is 1.2, but there is a sticky edge at 1.1, then the actual upper view limit will be 1.1.
This attribute cannot be assigned to; however, the `x` and `y` lists can be modified in place as needed.
#### Examples
```
>>> artist.sticky_edges.x[:] = (xmin, xmax)
>>> artist.sticky_edges.y[:] = (ymin, ymax)
```
to\_rgba(*x*, *alpha=None*, *bytes=False*, *norm=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L414-L482)
Return a normalized rgba array corresponding to *x*.
In the normal case, *x* is a 1D or 2D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If *x* is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the *alpha* kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the *alpha* kwarg is ignored; it does not replace the preexisting alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if *bytes* is *False* (default), the rgba array will be floats in the 0-1 range; if it is *True*, the returned rgba array will be uint8 in the 0 to 255 range.
If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1).
update(*props*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1168-L1177)
Update this artist's properties from the dict *props*.
Parameters:
**props**dict
update\_from(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L907-L929)
Copy properties from other to self.
update\_scalarmappable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L865-L901)
Update colors from the scalar mappable array, if any.
Assign colors to edges and faces based on the array and/or colors that were directly set, as appropriate.
zorder*=0*
*class*matplotlib.collections.PathCollection(*paths*, *sizes=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L979-L1148)
Bases: `_CollectionWithSizes`
A collection of [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path")s, as created by e.g. [`scatter`](_as_gen/matplotlib.axes.axes.scatter#matplotlib.axes.Axes.scatter "matplotlib.axes.Axes.scatter").
Parameters:
**paths**list of [`path.Path`](path_api#matplotlib.path.Path "matplotlib.path.Path")
The paths that will make up the [`Collection`](#matplotlib.collections.Collection "matplotlib.collections.Collection").
**sizes**array-like
The factor by which to scale each drawn [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"). One unit squared in the Path's data space is scaled to be `sizes**2` points when rendered.
**\*\*kwargs**
Forwarded to [`Collection`](#matplotlib.collections.Collection "matplotlib.collections.Collection").
add\_callback(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L348-L375)
Add a callback function that will be called whenever one of the [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")'s properties changes.
Parameters:
**func**callable
The callback function. It must have the signature:
```
def func(artist: Artist) -> Any
```
where *artist* is the calling [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"). Return values may exist but are ignored.
Returns:
int
The observer id associated with the callback. This id can be used for removing the callback with [`remove_callback`](#matplotlib.collections.PathCollection.remove_callback "matplotlib.collections.PathCollection.remove_callback") later.
See also
[`remove_callback`](#matplotlib.collections.PathCollection.remove_callback "matplotlib.collections.PathCollection.remove_callback")
autoscale()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L625-L634)
Autoscale the scalar limits on the norm instance using the current array
autoscale\_None()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L636-L645)
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
*property*axes
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance the artist resides in, or *None*.
*property*callbacksSM[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
changed()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L647-L653)
Call this whenever the mappable is changed to notify all the callbackSM listeners to the 'changed' signal.
colorbar
The last colorbar associated with this ScalarMappable. May be None.
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L437-L472)
Test whether the mouse event occurred in the collection.
Returns `bool, dict(ind=itemlist)`, where every item in itemlist contains the event.
convert\_xunits(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L241-L251)
Convert *x* using the unit type of the xaxis.
If the artist is not contained in an Axes or if the xaxis does not have units, *x* itself is returned.
convert\_yunits(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L253-L263)
Convert *y* using the unit type of the yaxis.
If the artist is not contained in an Axes or if the yaxis does not have units, *y* itself is returned.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L973-L976)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
findobj(*match=None*, *include\_self=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1208-L1249)
Find artist objects.
Recursively find all [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") instances contained in the artist.
Parameters:
**match**
A filter criterion for the matches. This can be
* *None*: Return all objects contained in artist.
* A function with signature `def match(artist: Artist) -> bool`. The result will only contain artists for which the function returns *True*.
* A class instance: e.g., [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"). The result will only contain artists of this class or its subclasses (`isinstance` check).
**include\_self**bool
Include *self* in the list to be checked for a match.
Returns:
list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
format\_cursor\_data(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1282-L1336)
Return a string representation of *data*.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
The default implementation converts ints and floats and arrays of ints and floats into a comma-separated string enclosed in square brackets, unless the artist has an associated colorbar, in which case scalar values are formatted using the colorbar's formatter.
See also
[`get_cursor_data`](#matplotlib.collections.PathCollection.get_cursor_data "matplotlib.collections.PathCollection.get_cursor_data")
get\_agg\_filter()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L929-L931)
Return filter function to be used for agg filter.
get\_alpha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L805-L810)
Return the alpha value used for blending - not supported on all backends.
get\_animated()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L816-L818)
Return whether the artist is animated.
get\_array()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L507-L514)
Return the array of values, that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the array.
get\_capstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L641-L642)
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L430-L432)
Return a list of the child [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s of this [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist").
get\_clim()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L520-L524)
Return the values (min, max) that are mapped to the colormap limits.
get\_clip\_box()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L859-L861)
Return the clipbox.
get\_clip\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L855-L857)
Return whether the artist uses clipping.
get\_clip\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L863-L865)
Return the clip path.
get\_cmap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L516-L518)
Return the [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") instance.
get\_cursor\_data(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1251-L1280)
Return the cursor data for a given event.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
Cursor data can be used by Artists to provide additional context information for a given event. The default implementation just returns *None*.
Subclasses can override the method and return arbitrary data. However, when doing so, they must ensure that [`format_cursor_data`](#matplotlib.collections.PathCollection.format_cursor_data "matplotlib.collections.PathCollection.format_cursor_data") can convert the data to a string representation.
The only current use case is displaying the z-value of an [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") in the status bar of a plot window, while moving the mouse.
Parameters:
**event**[`matplotlib.backend_bases.MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
See also
[`format_cursor_data`](#matplotlib.collections.PathCollection.format_cursor_data "matplotlib.collections.PathCollection.format_cursor_data")
get\_dashes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.PathCollection.get_linestyle "matplotlib.collections.PathCollection.get_linestyle").
get\_datalim(*transData*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L235-L301)
get\_ec()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.PathCollection.get_edgecolor "matplotlib.collections.PathCollection.get_edgecolor").
get\_edgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
get\_edgecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.PathCollection.get_edgecolor "matplotlib.collections.PathCollection.get_edgecolor").
get\_facecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
get\_facecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.PathCollection.get_facecolor "matplotlib.collections.PathCollection.get_facecolor").
get\_fc()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.PathCollection.get_facecolor "matplotlib.collections.PathCollection.get_facecolor").
get\_figure()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L703-L705)
Return the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
get\_fill()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L903-L905)
Return whether face is colored.
get\_gid()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L588-L590)
Return the group id.
get\_hatch()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L534-L536)
Return the current hatching pattern.
get\_in\_layout()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L820-L829)
Return boolean flag, `True` if artist is included in layout calculations.
E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
get\_joinstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L655-L656)
get\_label()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1056-L1058)
Return the label used for this artist in the legend.
get\_linestyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
get\_linestyles()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.PathCollection.get_linestyle "matplotlib.collections.PathCollection.get_linestyle").
get\_linewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
get\_linewidths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.PathCollection.get_linewidth "matplotlib.collections.PathCollection.get_linewidth").
get\_ls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.PathCollection.get_linestyle "matplotlib.collections.PathCollection.get_linestyle").
get\_lw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.PathCollection.get_linewidth "matplotlib.collections.PathCollection.get_linewidth").
get\_mouseover()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1338-L1343)
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
get\_offset\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist offset.
get\_offsets()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L554-L557)
Return the offsets for the collection.
get\_path\_effects()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L700-L701)
get\_paths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1007-L1008)
get\_picker()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L562-L572)
Return the picking behavior of the artist.
The possible values are described in [`set_picker`](#matplotlib.collections.PathCollection.set_picker "matplotlib.collections.PathCollection.set_picker").
See also
[`set_picker`](#matplotlib.collections.PathCollection.set_picker "matplotlib.collections.PathCollection.set_picker"), [`pickable`](#matplotlib.collections.PathCollection.pickable "matplotlib.collections.PathCollection.pickable"), [`pick`](#matplotlib.collections.PathCollection.pick "matplotlib.collections.PathCollection.pick")
get\_pickradius()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L434-L435)
get\_rasterized()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L904-L906)
Return whether the artist is to be rasterized.
get\_sizes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L938-L947)
Return the sizes ('areas') of the elements in the collection.
Returns:
array
The 'area' of each element.
get\_sketch\_params()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L641-L659)
Return the sketch parameters for the artist.
Returns:
tuple or None
A 3-tuple with the following elements:
* *scale*: The amplitude of the wiggle perpendicular to the source line.
* *length*: The length of the wiggle along the line.
* *randomness*: The scale factor by which the length is shrunken or expanded.
Returns *None* if no sketch parameters were set.
get\_snap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L602-L611)
Return the snap setting.
See [`set_snap`](#matplotlib.collections.PathCollection.set_snap "matplotlib.collections.PathCollection.set_snap") for details.
get\_tightbbox(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L322-L346)
Like [`Artist.get_window_extent`](_as_gen/matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent"), but includes any clipping.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
Returns:
[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The enclosing bounding box (in figure pixel coordinates).
get\_transOffset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Alias for [`get_offset_transform`](#matplotlib.collections.PathCollection.get_offset_transform "matplotlib.collections.PathCollection.get_offset_transform").
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L421-L428)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist.
get\_transformed\_clip\_path\_and\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L867-L875)
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
get\_transforms()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L211-L212)
get\_url()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L574-L576)
Return the url.
get\_urls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L488-L495)
Return a list of URLs, one for each element of the collection.
The list contains *None* for elements without a URL. See [Hyperlinks](https://matplotlib.org/stable/gallery/misc/hyperlinks_sgskip.html) for an example.
get\_visible()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L812-L814)
Return the visibility.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L303-L306)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
get\_zorder()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1076-L1078)
Return the artist's zorder.
have\_units()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L236-L239)
Return whether units are set on any axis.
is\_transform\_set()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L400-L406)
Return whether the Artist has an explicitly set transform.
This is *True* after [`set_transform`](#matplotlib.collections.PathCollection.set_transform "matplotlib.collections.PathCollection.set_transform") has been called.
legend\_elements(*prop='colors'*, *num='auto'*, *fmt=None*, *func=<function PathCollection.<lambda>>*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1010-L1148)
Create legend handles and labels for a PathCollection.
Each legend handle is a [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") representing the Path that was drawn, and each label is a string what each Path represents.
This is useful for obtaining a legend for a [`scatter`](_as_gen/matplotlib.axes.axes.scatter#matplotlib.axes.Axes.scatter "matplotlib.axes.Axes.scatter") plot; e.g.:
```
scatter = plt.scatter([1, 2, 3], [4, 5, 6], c=[7, 2, 3])
plt.legend(*scatter.legend_elements())
```
creates three legend elements, one for each color with the numerical values passed to *c* as the labels.
Also see the [Automated legend creation](https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_with_legend.html#automatedlegendcreation) example.
Parameters:
**prop**{"colors", "sizes"}, default: "colors"
If "colors", the legend handles will show the different colors of the collection. If "sizes", the legend will show the different sizes. To set both, use *kwargs* to directly edit the [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties.
**num**int, None, "auto" (default), array-like, or [`Locator`](ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator")
Target number of elements to create. If None, use all unique elements of the mappable array. If an integer, target to use *num* elements in the normed range. If *"auto"*, try to determine which option better suits the nature of the data. The number of created elements may slightly deviate from *num* due to a [`Locator`](ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator") being used to find useful locations. If a list or array, use exactly those elements for the legend. Finally, a [`Locator`](ticker_api#matplotlib.ticker.Locator "matplotlib.ticker.Locator") can be provided.
**fmt**str, [`Formatter`](ticker_api#matplotlib.ticker.Formatter "matplotlib.ticker.Formatter"), or None (default)
The format or formatter to use for the labels. If a string must be a valid input for a [`StrMethodFormatter`](ticker_api#matplotlib.ticker.StrMethodFormatter "matplotlib.ticker.StrMethodFormatter"). If None (the default), use a [`ScalarFormatter`](ticker_api#matplotlib.ticker.ScalarFormatter "matplotlib.ticker.ScalarFormatter").
**func**function, default: `lambda x: x`
Function to calculate the labels. Often the size (or color) argument to [`scatter`](_as_gen/matplotlib.axes.axes.scatter#matplotlib.axes.Axes.scatter "matplotlib.axes.Axes.scatter") will have been pre-processed by the user using a function `s = f(x)` to make the markers visible; e.g. `size = np.log10(x)`. Providing the inverse of this function here allows that pre-processing to be inverted, so that the legend labels have the correct values; e.g. `func = lambda
x: 10**x`.
**\*\*kwargs**
Allowed keyword arguments are *color* and *size*. E.g. it may be useful to set the color of the markers if *prop="sizes"* is used; similarly to set the size of the markers if *prop="colors"* is used. Any further parameters are passed onto the [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") instance. This may be useful to e.g. specify a different *markeredgecolor* or *alpha* for the legend handles.
Returns:
**handles**list of [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
Visual representation of each element of the legend.
**labels**list of str
The string labels for elements of the legend.
*property*mouseover
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
*property*norm
pchanged()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L387-L398)
Call all of the registered callbacks.
This function is triggered internally when a property is changed.
See also
[`add_callback`](#matplotlib.collections.PathCollection.add_callback "matplotlib.collections.PathCollection.add_callback")
[`remove_callback`](#matplotlib.collections.PathCollection.remove_callback "matplotlib.collections.PathCollection.remove_callback")
pick(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L490-L525)
Process a pick event.
Each child artist will fire a pick event if *mouseevent* is over the artist and the artist has picker set.
See also
[`set_picker`](#matplotlib.collections.PathCollection.set_picker "matplotlib.collections.PathCollection.set_picker"), [`get_picker`](#matplotlib.collections.PathCollection.get_picker "matplotlib.collections.PathCollection.get_picker"), [`pickable`](#matplotlib.collections.PathCollection.pickable "matplotlib.collections.PathCollection.pickable")
pickable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L480-L488)
Return whether the artist is pickable.
See also
[`set_picker`](#matplotlib.collections.PathCollection.set_picker "matplotlib.collections.PathCollection.set_picker"), [`get_picker`](#matplotlib.collections.PathCollection.get_picker "matplotlib.collections.PathCollection.get_picker"), [`pick`](#matplotlib.collections.PathCollection.pick "matplotlib.collections.PathCollection.pick")
properties()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1139-L1141)
Return a dictionary of all the properties of the artist.
remove()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L193-L234)
Remove the artist from the figure if possible.
The effect will not be visible until the figure is redrawn, e.g., with [`FigureCanvasBase.draw_idle`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase.draw_idle "matplotlib.backend_bases.FigureCanvasBase.draw_idle"). Call [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") to update the axes limits if desired.
Note: [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") will not see collections even if the collection was added to the axes with *autolim* = True.
Note: there is no support for removing the artist's legend entry.
remove\_callback(*oid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L377-L385)
Remove a callback based on its observer id.
See also
[`add_callback`](#matplotlib.collections.PathCollection.add_callback "matplotlib.collections.PathCollection.add_callback")
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *array=<UNSET>*, *capstyle=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *offset\_transform=<UNSET>*, *offsets=<UNSET>*, *path\_effects=<UNSET>*, *paths=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *sizes=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *urls=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](#matplotlib.collections.PathCollection.set_paths "matplotlib.collections.PathCollection.set_paths") | unknown |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `sizes` | ndarray or None |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_aa(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.PathCollection.set_antialiased "matplotlib.collections.PathCollection.set_antialiased").
set\_agg\_filter(*filter\_func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L933-L949)
Set the agg filter.
Parameters:
**filter\_func**callable
A filter function, which takes a (m, n, depth) float array and a dpi value, and returns a (m, n, depth) array and two offsets from the bottom left corner of the image
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L807-L821)
Set the alpha value used for blending - not supported on all backends.
Parameters:
**alpha**array-like or scalar or None
All values must be within the 0-1 range, inclusive. Masked values and nans are not supported.
set\_animated(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1023-L1041)
Set whether the artist is intended to be used in an animation.
If True, the artist is excluded from regular drawing of the figure. You have to call [`Figure.draw_artist`](figure_api#matplotlib.figure.Figure.draw_artist "matplotlib.figure.Figure.draw_artist") / [`Axes.draw_artist`](_as_gen/matplotlib.axes.axes.draw_artist#matplotlib.axes.Axes.draw_artist "matplotlib.axes.Axes.draw_artist") explicitly on the artist. This approach is used to speed up animations using blitting.
See also [`matplotlib.animation`](animation_api#module-matplotlib.animation "matplotlib.animation") and [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html).
Parameters:
**b**bool
set\_antialiased(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Set the antialiasing state for rendering.
Parameters:
**aa**bool or list of bools
set\_antialiaseds(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.PathCollection.set_antialiased "matplotlib.collections.PathCollection.set_antialiased").
set\_array(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L484-L505)
Set the value array from array-like *A*.
Parameters:
**A**array-like or None
The values that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the value array *A*.
set\_capstyle(*cs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L630-L639)
Set the [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") for the collection (for all its elements).
Parameters:
**cs**[`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'}
set\_clim(*vmin=None*, *vmax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L526-L550)
Set the norm limits for image scaling.
Parameters:
**vmin, vmax**float
The limits.
The limits may also be passed as a tuple (*vmin*, *vmax*) as a single positional argument.
set\_clip\_box(*clipbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L731-L741)
Set the artist's clip [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
Parameters:
**clipbox**[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
set\_clip\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L877-L892)
Set whether the artist uses clipping.
When False artists will be visible outside of the Axes which can lead to unexpected results.
Parameters:
**b**bool
set\_clip\_path(*path*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L743-L803)
Set the artist's clip path.
Parameters:
**path**[`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") or [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") or [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") or None
The clip path. If given a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), *transform* must be provided as well. If *None*, a previously set clip path is removed.
**transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
Only used if *path* is a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), in which case the given [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") is converted to a [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") using *transform*.
#### Notes
For efficiency, if *path* is a [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") this method will set the clipping box to the corresponding rectangle and set the clipping path to `None`.
For technical reasons (support of [`set`](_as_gen/matplotlib.artist.artist.set#matplotlib.artist.Artist.set "matplotlib.artist.Artist.set")), a tuple (*path*, *transform*) is also accepted as a single positional parameter.
set\_cmap(*cmap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L562-L574)
Set the colormap for luminance data.
Parameters:
**cmap**[`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None
set\_color(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L713-L727)
Set both the edgecolor and the facecolor.
Parameters:
**c**color or list of rgba tuples
See also
[`Collection.set_facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor"), [`Collection.set_edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor")
For setting the edge or face color individually.
set\_dashes(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.PathCollection.set_linestyle "matplotlib.collections.PathCollection.set_linestyle").
set\_ec(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.PathCollection.set_edgecolor "matplotlib.collections.PathCollection.set_edgecolor").
set\_edgecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Set the edgecolor(s) of the collection.
Parameters:
**c**color or list of colors or 'face'
The collection edgecolor(s). If a sequence, the patches cycle through it. If 'face', match the facecolor.
set\_edgecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.PathCollection.set_edgecolor "matplotlib.collections.PathCollection.set_edgecolor").
set\_facecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Set the facecolor(s) of the collection. *c* can be a color (all patches have same color), or a sequence of colors; if it is a sequence the patches will cycle through the sequence.
If *c* is 'none', the patch will not be filled.
Parameters:
**c**color or list of colors
set\_facecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.PathCollection.set_facecolor "matplotlib.collections.PathCollection.set_facecolor").
set\_fc(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.PathCollection.set_facecolor "matplotlib.collections.PathCollection.set_facecolor").
set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L707-L729)
Set the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
set\_gid(*gid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L592-L600)
Set the (group) id for the artist.
Parameters:
**gid**str
set\_hatch(*hatch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L497-L532)
Set the hatching pattern
*hatch* can be one of:
```
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
```
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
Parameters:
**hatch**{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'}
set\_in\_layout(*in\_layout*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1043-L1054)
Set if artist is to be included in layout calculations, E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
Parameters:
**in\_layout**bool
set\_joinstyle(*js*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L644-L653)
Set the [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") for the collection (for all its elements).
Parameters:
**js**[`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'}
set\_label(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1060-L1074)
Set a label that will be displayed in the legend.
Parameters:
**s**object
*s* will be converted to a string by calling [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)").
set\_linestyle(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Set the linestyle(s) for the collection.
| linestyle | description |
| --- | --- |
| `'-'` or `'solid'` | solid line |
| `'--'` or `'dashed'` | dashed line |
| `'-.'` or `'dashdot'` | dash-dotted line |
| `':'` or `'dotted'` | dotted line |
Alternatively a dash tuple of the following form can be provided:
```
(offset, onoffseq),
```
where `onoffseq` is an even length tuple of on and off ink in points.
Parameters:
**ls**str or tuple or list thereof
Valid values for individual linestyles include {'-', '--', '-.', ':', '', (offset, on-off-seq)}. See [`Line2D.set_linestyle`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") for a complete description.
set\_linestyles(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.PathCollection.set_linestyle "matplotlib.collections.PathCollection.set_linestyle").
set\_linewidth(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Set the linewidth(s) for the collection. *lw* can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence
Parameters:
**lw**float or list of floats
set\_linewidths(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.PathCollection.set_linewidth "matplotlib.collections.PathCollection.set_linewidth").
set\_ls(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.PathCollection.set_linestyle "matplotlib.collections.PathCollection.set_linestyle").
set\_lw(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.PathCollection.set_linewidth "matplotlib.collections.PathCollection.set_linewidth").
set\_mouseover(*mouseover*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1345-L1366)
Set whether this artist is queried for custom context information when the mouse cursor moves over it.
Parameters:
**mouseover**bool
See also
[`get_cursor_data`](#matplotlib.collections.PathCollection.get_cursor_data "matplotlib.collections.PathCollection.get_cursor_data")
[`ToolCursorPosition`](backend_tools_api#matplotlib.backend_tools.ToolCursorPosition "matplotlib.backend_tools.ToolCursorPosition")
[`NavigationToolbar2`](backend_bases_api#matplotlib.backend_bases.NavigationToolbar2 "matplotlib.backend_bases.NavigationToolbar2")
set\_norm(*norm*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L609-L623)
Set the normalization instance.
Parameters:
**norm**[`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None
#### Notes
If there are any colorbars using the mappable for this norm, setting the norm of the mappable will reset the norm, locator, and formatters on the colorbar to default.
set\_offset\_transform(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Set the artist offset transform.
Parameters:
**offset\_transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_offsets(*offsets*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L538-L552)
Set the offsets for the collection.
Parameters:
**offsets**(N, 2) or (2,) array-like
set\_path\_effects(*path\_effects*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L689-L698)
Set the path effects.
Parameters:
**path\_effects**[`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
set\_paths(*paths*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1003-L1005)
set\_picker(*picker*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L527-L560)
Define the picking behavior of the artist.
Parameters:
**picker**None or bool or float or callable
This can be one of the following:
* *None*: Picking is disabled for this artist (default).
* A boolean: If *True* then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist.
* A float: If picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if its data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event
* A function: If picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event:
```
hit, props = picker(artist, mouseevent)
```
to determine the hit test. if the mouse event is over the artist, return *hit=True* and props is a dictionary of properties you want added to the PickEvent attributes.
set\_pickradius(*pickradius*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L422-L432)
Set the pick radius used for containment tests.
Parameters:
**pickradius**float
Pick radius, in points.
set\_rasterized(*rasterized*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L908-L927)
Force rasterized (bitmap) drawing for vector graphics output.
Rasterized drawing is not supported by all artists. If you try to enable this on an artist that does not support it, the command has no effect and a warning will be issued.
This setting is ignored for pixel-based output.
See also [Rasterization for vector graphics](https://matplotlib.org/stable/gallery/misc/rasterization_demo.html).
Parameters:
**rasterized**bool
set\_sizes(*sizes*, *dpi=72.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L949-L971)
Set the sizes of each member of the collection.
Parameters:
**sizes**ndarray or None
The size to set for each element of the collection. The value is the 'area' of the element.
**dpi**float, default: 72
The dpi of the canvas.
set\_sketch\_params(*scale=None*, *length=None*, *randomness=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L661-L687)
Set the sketch parameters.
Parameters:
**scale**float, optional
The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), or not provided, no sketch filter will be provided.
**length**float, optional
The length of the wiggle along the line, in pixels (default 128.0)
**randomness**float, optional
The scale factor by which the length is shrunken or expanded (default 16.0)
The PGF backend uses this argument as an RNG seed and not as described above. Using the same seed yields the same random shape.
set\_snap(*snap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L613-L639)
Set the snapping behavior.
Snapping aligns positions with the pixel grid, which results in clearer images. For example, if a black line of 1px width was defined at a position in between two pixels, the resulting image would contain the interpolated value of that line in the pixel grid, which would be a grey value on both adjacent pixel positions. In contrast, snapping will move the line to the nearest integer pixel value, so that the resulting image will really contain a 1px wide black line.
Snapping is currently only supported by the Agg and MacOSX backends.
Parameters:
**snap**bool or None
Possible values:
* *True*: Snap vertices to the nearest pixel center.
* *False*: Do not modify vertex positions.
* *None*: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center.
set\_transOffset(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Alias for [`set_offset_transform`](#matplotlib.collections.PathCollection.set_offset_transform "matplotlib.collections.PathCollection.set_offset_transform").
set\_transform(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L408-L419)
Set the artist transform.
Parameters:
**t**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_url(*url*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L578-L586)
Set the url for the artist.
Parameters:
**url**str
set\_urls(*urls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L474-L486)
Parameters:
**urls**list of str or None
#### Notes
URLs are currently only implemented by the SVG backend. They are ignored by all other backends.
set\_visible(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1011-L1021)
Set the artist's visibility.
Parameters:
**b**bool
set\_zorder(*level*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1080-L1093)
Set the zorder for the artist. Artists with lower zorder values are drawn first.
Parameters:
**level**float
*property*stale
Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist.
*property*sticky\_edges
`x` and `y` sticky edge lists for autoscaling.
When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added--the view limit "sticks" to the edge. A typical use case is histograms, where one usually expects no margin on the bottom edge (0) of the histogram.
Moreover, margin expansion "bumps" against sticky edges and cannot cross them. For example, if the upper data limit is 1.0, the upper view limit computed by simple margin application is 1.2, but there is a sticky edge at 1.1, then the actual upper view limit will be 1.1.
This attribute cannot be assigned to; however, the `x` and `y` lists can be modified in place as needed.
#### Examples
```
>>> artist.sticky_edges.x[:] = (xmin, xmax)
>>> artist.sticky_edges.y[:] = (ymin, ymax)
```
to\_rgba(*x*, *alpha=None*, *bytes=False*, *norm=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L414-L482)
Return a normalized rgba array corresponding to *x*.
In the normal case, *x* is a 1D or 2D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If *x* is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the *alpha* kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the *alpha* kwarg is ignored; it does not replace the preexisting alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if *bytes* is *False* (default), the rgba array will be floats in the 0-1 range; if it is *True*, the returned rgba array will be uint8 in the 0 to 255 range.
If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1).
update(*props*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1168-L1177)
Update this artist's properties from the dict *props*.
Parameters:
**props**dict
update\_from(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L907-L929)
Copy properties from other to self.
update\_scalarmappable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L865-L901)
Update colors from the scalar mappable array, if any.
Assign colors to edges and faces based on the array and/or colors that were directly set, as appropriate.
zorder*=0*
*class*matplotlib.collections.PolyCollection(*verts*, *sizes=None*, *\**, *closed=True*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1151-L1230)
Bases: `_CollectionWithSizes`
Parameters:
**verts**list of array-like
The sequence of polygons [*verts0*, *verts1*, ...] where each element *verts\_i* defines the vertices of polygon *i* as a 2D array-like of shape (M, 2).
**sizes**array-like, default: None
Squared scaling factors for the polygons. The coordinates of each polygon *verts\_i* are multiplied by the square-root of the corresponding entry in *sizes* (i.e., *sizes* specify the scaling of areas). The scaling is applied before the Artist master transform.
**closed**bool, default: True
Whether the polygon should be closed by adding a CLOSEPOLY connection at the end.
**\*\*kwargs**
Forwarded to [`Collection`](#matplotlib.collections.Collection "matplotlib.collections.Collection").
add\_callback(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L348-L375)
Add a callback function that will be called whenever one of the [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")'s properties changes.
Parameters:
**func**callable
The callback function. It must have the signature:
```
def func(artist: Artist) -> Any
```
where *artist* is the calling [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"). Return values may exist but are ignored.
Returns:
int
The observer id associated with the callback. This id can be used for removing the callback with [`remove_callback`](#matplotlib.collections.PolyCollection.remove_callback "matplotlib.collections.PolyCollection.remove_callback") later.
See also
[`remove_callback`](#matplotlib.collections.PolyCollection.remove_callback "matplotlib.collections.PolyCollection.remove_callback")
autoscale()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L625-L634)
Autoscale the scalar limits on the norm instance using the current array
autoscale\_None()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L636-L645)
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
*property*axes
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance the artist resides in, or *None*.
*property*callbacksSM[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
changed()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L647-L653)
Call this whenever the mappable is changed to notify all the callbackSM listeners to the 'changed' signal.
colorbar
The last colorbar associated with this ScalarMappable. May be None.
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L437-L472)
Test whether the mouse event occurred in the collection.
Returns `bool, dict(ind=itemlist)`, where every item in itemlist contains the event.
convert\_xunits(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L241-L251)
Convert *x* using the unit type of the xaxis.
If the artist is not contained in an Axes or if the xaxis does not have units, *x* itself is returned.
convert\_yunits(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L253-L263)
Convert *y* using the unit type of the yaxis.
If the artist is not contained in an Axes or if the yaxis does not have units, *y* itself is returned.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L973-L976)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
findobj(*match=None*, *include\_self=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1208-L1249)
Find artist objects.
Recursively find all [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") instances contained in the artist.
Parameters:
**match**
A filter criterion for the matches. This can be
* *None*: Return all objects contained in artist.
* A function with signature `def match(artist: Artist) -> bool`. The result will only contain artists for which the function returns *True*.
* A class instance: e.g., [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"). The result will only contain artists of this class or its subclasses (`isinstance` check).
**include\_self**bool
Include *self* in the list to be checked for a match.
Returns:
list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
format\_cursor\_data(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1282-L1336)
Return a string representation of *data*.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
The default implementation converts ints and floats and arrays of ints and floats into a comma-separated string enclosed in square brackets, unless the artist has an associated colorbar, in which case scalar values are formatted using the colorbar's formatter.
See also
[`get_cursor_data`](#matplotlib.collections.PolyCollection.get_cursor_data "matplotlib.collections.PolyCollection.get_cursor_data")
get\_agg\_filter()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L929-L931)
Return filter function to be used for agg filter.
get\_alpha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L805-L810)
Return the alpha value used for blending - not supported on all backends.
get\_animated()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L816-L818)
Return whether the artist is animated.
get\_array()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L507-L514)
Return the array of values, that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the array.
get\_capstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L641-L642)
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L430-L432)
Return a list of the child [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s of this [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist").
get\_clim()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L520-L524)
Return the values (min, max) that are mapped to the colormap limits.
get\_clip\_box()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L859-L861)
Return the clipbox.
get\_clip\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L855-L857)
Return whether the artist uses clipping.
get\_clip\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L863-L865)
Return the clip path.
get\_cmap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L516-L518)
Return the [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") instance.
get\_cursor\_data(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1251-L1280)
Return the cursor data for a given event.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
Cursor data can be used by Artists to provide additional context information for a given event. The default implementation just returns *None*.
Subclasses can override the method and return arbitrary data. However, when doing so, they must ensure that [`format_cursor_data`](#matplotlib.collections.PolyCollection.format_cursor_data "matplotlib.collections.PolyCollection.format_cursor_data") can convert the data to a string representation.
The only current use case is displaying the z-value of an [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") in the status bar of a plot window, while moving the mouse.
Parameters:
**event**[`matplotlib.backend_bases.MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
See also
[`format_cursor_data`](#matplotlib.collections.PolyCollection.format_cursor_data "matplotlib.collections.PolyCollection.format_cursor_data")
get\_dashes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.PolyCollection.get_linestyle "matplotlib.collections.PolyCollection.get_linestyle").
get\_datalim(*transData*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L235-L301)
get\_ec()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.PolyCollection.get_edgecolor "matplotlib.collections.PolyCollection.get_edgecolor").
get\_edgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
get\_edgecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.PolyCollection.get_edgecolor "matplotlib.collections.PolyCollection.get_edgecolor").
get\_facecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
get\_facecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.PolyCollection.get_facecolor "matplotlib.collections.PolyCollection.get_facecolor").
get\_fc()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.PolyCollection.get_facecolor "matplotlib.collections.PolyCollection.get_facecolor").
get\_figure()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L703-L705)
Return the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
get\_fill()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L903-L905)
Return whether face is colored.
get\_gid()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L588-L590)
Return the group id.
get\_hatch()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L534-L536)
Return the current hatching pattern.
get\_in\_layout()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L820-L829)
Return boolean flag, `True` if artist is included in layout calculations.
E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
get\_joinstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L655-L656)
get\_label()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1056-L1058)
Return the label used for this artist in the legend.
get\_linestyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
get\_linestyles()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.PolyCollection.get_linestyle "matplotlib.collections.PolyCollection.get_linestyle").
get\_linewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
get\_linewidths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.PolyCollection.get_linewidth "matplotlib.collections.PolyCollection.get_linewidth").
get\_ls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.PolyCollection.get_linestyle "matplotlib.collections.PolyCollection.get_linestyle").
get\_lw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.PolyCollection.get_linewidth "matplotlib.collections.PolyCollection.get_linewidth").
get\_mouseover()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1338-L1343)
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
get\_offset\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist offset.
get\_offsets()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L554-L557)
Return the offsets for the collection.
get\_path\_effects()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L700-L701)
get\_paths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L205-L206)
get\_picker()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L562-L572)
Return the picking behavior of the artist.
The possible values are described in [`set_picker`](#matplotlib.collections.PolyCollection.set_picker "matplotlib.collections.PolyCollection.set_picker").
See also
[`set_picker`](#matplotlib.collections.PolyCollection.set_picker "matplotlib.collections.PolyCollection.set_picker"), [`pickable`](#matplotlib.collections.PolyCollection.pickable "matplotlib.collections.PolyCollection.pickable"), [`pick`](#matplotlib.collections.PolyCollection.pick "matplotlib.collections.PolyCollection.pick")
get\_pickradius()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L434-L435)
get\_rasterized()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L904-L906)
Return whether the artist is to be rasterized.
get\_sizes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L938-L947)
Return the sizes ('areas') of the elements in the collection.
Returns:
array
The 'area' of each element.
get\_sketch\_params()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L641-L659)
Return the sketch parameters for the artist.
Returns:
tuple or None
A 3-tuple with the following elements:
* *scale*: The amplitude of the wiggle perpendicular to the source line.
* *length*: The length of the wiggle along the line.
* *randomness*: The scale factor by which the length is shrunken or expanded.
Returns *None* if no sketch parameters were set.
get\_snap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L602-L611)
Return the snap setting.
See [`set_snap`](#matplotlib.collections.PolyCollection.set_snap "matplotlib.collections.PolyCollection.set_snap") for details.
get\_tightbbox(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L322-L346)
Like [`Artist.get_window_extent`](_as_gen/matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent"), but includes any clipping.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
Returns:
[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The enclosing bounding box (in figure pixel coordinates).
get\_transOffset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Alias for [`get_offset_transform`](#matplotlib.collections.PolyCollection.get_offset_transform "matplotlib.collections.PolyCollection.get_offset_transform").
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L421-L428)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist.
get\_transformed\_clip\_path\_and\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L867-L875)
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
get\_transforms()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L211-L212)
get\_url()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L574-L576)
Return the url.
get\_urls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L488-L495)
Return a list of URLs, one for each element of the collection.
The list contains *None* for elements without a URL. See [Hyperlinks](https://matplotlib.org/stable/gallery/misc/hyperlinks_sgskip.html) for an example.
get\_visible()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L812-L814)
Return the visibility.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L303-L306)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
get\_zorder()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1076-L1078)
Return the artist's zorder.
have\_units()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L236-L239)
Return whether units are set on any axis.
is\_transform\_set()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L400-L406)
Return whether the Artist has an explicitly set transform.
This is *True* after [`set_transform`](#matplotlib.collections.PolyCollection.set_transform "matplotlib.collections.PolyCollection.set_transform") has been called.
*property*mouseover
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
*property*norm
pchanged()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L387-L398)
Call all of the registered callbacks.
This function is triggered internally when a property is changed.
See also
[`add_callback`](#matplotlib.collections.PolyCollection.add_callback "matplotlib.collections.PolyCollection.add_callback")
[`remove_callback`](#matplotlib.collections.PolyCollection.remove_callback "matplotlib.collections.PolyCollection.remove_callback")
pick(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L490-L525)
Process a pick event.
Each child artist will fire a pick event if *mouseevent* is over the artist and the artist has picker set.
See also
[`set_picker`](#matplotlib.collections.PolyCollection.set_picker "matplotlib.collections.PolyCollection.set_picker"), [`get_picker`](#matplotlib.collections.PolyCollection.get_picker "matplotlib.collections.PolyCollection.get_picker"), [`pickable`](#matplotlib.collections.PolyCollection.pickable "matplotlib.collections.PolyCollection.pickable")
pickable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L480-L488)
Return whether the artist is pickable.
See also
[`set_picker`](#matplotlib.collections.PolyCollection.set_picker "matplotlib.collections.PolyCollection.set_picker"), [`get_picker`](#matplotlib.collections.PolyCollection.get_picker "matplotlib.collections.PolyCollection.get_picker"), [`pick`](#matplotlib.collections.PolyCollection.pick "matplotlib.collections.PolyCollection.pick")
properties()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1139-L1141)
Return a dictionary of all the properties of the artist.
remove()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L193-L234)
Remove the artist from the figure if possible.
The effect will not be visible until the figure is redrawn, e.g., with [`FigureCanvasBase.draw_idle`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase.draw_idle "matplotlib.backend_bases.FigureCanvasBase.draw_idle"). Call [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") to update the axes limits if desired.
Note: [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") will not see collections even if the collection was added to the axes with *autolim* = True.
Note: there is no support for removing the artist's legend entry.
remove\_callback(*oid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L377-L385)
Remove a callback based on its observer id.
See also
[`add_callback`](#matplotlib.collections.PolyCollection.add_callback "matplotlib.collections.PolyCollection.add_callback")
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *array=<UNSET>*, *capstyle=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *offset\_transform=<UNSET>*, *offsets=<UNSET>*, *path\_effects=<UNSET>*, *paths=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *sizes=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *urls=<UNSET>*, *verts=<UNSET>*, *verts\_and\_codes=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `sizes` | ndarray or None |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`verts`](#matplotlib.collections.PolyCollection.set_verts "matplotlib.collections.PolyCollection.set_verts") | list of array-like |
| [`verts_and_codes`](#matplotlib.collections.PolyCollection.set_verts_and_codes "matplotlib.collections.PolyCollection.set_verts_and_codes") | unknown |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_aa(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.PolyCollection.set_antialiased "matplotlib.collections.PolyCollection.set_antialiased").
set\_agg\_filter(*filter\_func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L933-L949)
Set the agg filter.
Parameters:
**filter\_func**callable
A filter function, which takes a (m, n, depth) float array and a dpi value, and returns a (m, n, depth) array and two offsets from the bottom left corner of the image
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L807-L821)
Set the alpha value used for blending - not supported on all backends.
Parameters:
**alpha**array-like or scalar or None
All values must be within the 0-1 range, inclusive. Masked values and nans are not supported.
set\_animated(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1023-L1041)
Set whether the artist is intended to be used in an animation.
If True, the artist is excluded from regular drawing of the figure. You have to call [`Figure.draw_artist`](figure_api#matplotlib.figure.Figure.draw_artist "matplotlib.figure.Figure.draw_artist") / [`Axes.draw_artist`](_as_gen/matplotlib.axes.axes.draw_artist#matplotlib.axes.Axes.draw_artist "matplotlib.axes.Axes.draw_artist") explicitly on the artist. This approach is used to speed up animations using blitting.
See also [`matplotlib.animation`](animation_api#module-matplotlib.animation "matplotlib.animation") and [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html).
Parameters:
**b**bool
set\_antialiased(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Set the antialiasing state for rendering.
Parameters:
**aa**bool or list of bools
set\_antialiaseds(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.PolyCollection.set_antialiased "matplotlib.collections.PolyCollection.set_antialiased").
set\_array(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L484-L505)
Set the value array from array-like *A*.
Parameters:
**A**array-like or None
The values that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the value array *A*.
set\_capstyle(*cs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L630-L639)
Set the [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") for the collection (for all its elements).
Parameters:
**cs**[`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'}
set\_clim(*vmin=None*, *vmax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L526-L550)
Set the norm limits for image scaling.
Parameters:
**vmin, vmax**float
The limits.
The limits may also be passed as a tuple (*vmin*, *vmax*) as a single positional argument.
set\_clip\_box(*clipbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L731-L741)
Set the artist's clip [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
Parameters:
**clipbox**[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
set\_clip\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L877-L892)
Set whether the artist uses clipping.
When False artists will be visible outside of the Axes which can lead to unexpected results.
Parameters:
**b**bool
set\_clip\_path(*path*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L743-L803)
Set the artist's clip path.
Parameters:
**path**[`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") or [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") or [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") or None
The clip path. If given a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), *transform* must be provided as well. If *None*, a previously set clip path is removed.
**transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
Only used if *path* is a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), in which case the given [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") is converted to a [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") using *transform*.
#### Notes
For efficiency, if *path* is a [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") this method will set the clipping box to the corresponding rectangle and set the clipping path to `None`.
For technical reasons (support of [`set`](_as_gen/matplotlib.artist.artist.set#matplotlib.artist.Artist.set "matplotlib.artist.Artist.set")), a tuple (*path*, *transform*) is also accepted as a single positional parameter.
set\_cmap(*cmap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L562-L574)
Set the colormap for luminance data.
Parameters:
**cmap**[`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None
set\_color(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L713-L727)
Set both the edgecolor and the facecolor.
Parameters:
**c**color or list of rgba tuples
See also
[`Collection.set_facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor"), [`Collection.set_edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor")
For setting the edge or face color individually.
set\_dashes(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.PolyCollection.set_linestyle "matplotlib.collections.PolyCollection.set_linestyle").
set\_ec(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.PolyCollection.set_edgecolor "matplotlib.collections.PolyCollection.set_edgecolor").
set\_edgecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Set the edgecolor(s) of the collection.
Parameters:
**c**color or list of colors or 'face'
The collection edgecolor(s). If a sequence, the patches cycle through it. If 'face', match the facecolor.
set\_edgecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.PolyCollection.set_edgecolor "matplotlib.collections.PolyCollection.set_edgecolor").
set\_facecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Set the facecolor(s) of the collection. *c* can be a color (all patches have same color), or a sequence of colors; if it is a sequence the patches will cycle through the sequence.
If *c* is 'none', the patch will not be filled.
Parameters:
**c**color or list of colors
set\_facecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.PolyCollection.set_facecolor "matplotlib.collections.PolyCollection.set_facecolor").
set\_fc(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.PolyCollection.set_facecolor "matplotlib.collections.PolyCollection.set_facecolor").
set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L707-L729)
Set the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
set\_gid(*gid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L592-L600)
Set the (group) id for the artist.
Parameters:
**gid**str
set\_hatch(*hatch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L497-L532)
Set the hatching pattern
*hatch* can be one of:
```
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
```
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
Parameters:
**hatch**{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'}
set\_in\_layout(*in\_layout*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1043-L1054)
Set if artist is to be included in layout calculations, E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
Parameters:
**in\_layout**bool
set\_joinstyle(*js*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L644-L653)
Set the [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") for the collection (for all its elements).
Parameters:
**js**[`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'}
set\_label(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1060-L1074)
Set a label that will be displayed in the legend.
Parameters:
**s**object
*s* will be converted to a string by calling [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)").
set\_linestyle(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Set the linestyle(s) for the collection.
| linestyle | description |
| --- | --- |
| `'-'` or `'solid'` | solid line |
| `'--'` or `'dashed'` | dashed line |
| `'-.'` or `'dashdot'` | dash-dotted line |
| `':'` or `'dotted'` | dotted line |
Alternatively a dash tuple of the following form can be provided:
```
(offset, onoffseq),
```
where `onoffseq` is an even length tuple of on and off ink in points.
Parameters:
**ls**str or tuple or list thereof
Valid values for individual linestyles include {'-', '--', '-.', ':', '', (offset, on-off-seq)}. See [`Line2D.set_linestyle`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") for a complete description.
set\_linestyles(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.PolyCollection.set_linestyle "matplotlib.collections.PolyCollection.set_linestyle").
set\_linewidth(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Set the linewidth(s) for the collection. *lw* can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence
Parameters:
**lw**float or list of floats
set\_linewidths(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.PolyCollection.set_linewidth "matplotlib.collections.PolyCollection.set_linewidth").
set\_ls(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.PolyCollection.set_linestyle "matplotlib.collections.PolyCollection.set_linestyle").
set\_lw(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.PolyCollection.set_linewidth "matplotlib.collections.PolyCollection.set_linewidth").
set\_mouseover(*mouseover*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1345-L1366)
Set whether this artist is queried for custom context information when the mouse cursor moves over it.
Parameters:
**mouseover**bool
See also
[`get_cursor_data`](#matplotlib.collections.PolyCollection.get_cursor_data "matplotlib.collections.PolyCollection.get_cursor_data")
[`ToolCursorPosition`](backend_tools_api#matplotlib.backend_tools.ToolCursorPosition "matplotlib.backend_tools.ToolCursorPosition")
[`NavigationToolbar2`](backend_bases_api#matplotlib.backend_bases.NavigationToolbar2 "matplotlib.backend_bases.NavigationToolbar2")
set\_norm(*norm*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L609-L623)
Set the normalization instance.
Parameters:
**norm**[`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None
#### Notes
If there are any colorbars using the mappable for this norm, setting the norm of the mappable will reset the norm, locator, and formatters on the colorbar to default.
set\_offset\_transform(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Set the artist offset transform.
Parameters:
**offset\_transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_offsets(*offsets*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L538-L552)
Set the offsets for the collection.
Parameters:
**offsets**(N, 2) or (2,) array-like
set\_path\_effects(*path\_effects*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L689-L698)
Set the path effects.
Parameters:
**path\_effects**[`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
set\_paths(*verts*, *closed=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1179-L1219)
Set the vertices of the polygons.
Parameters:
**verts**list of array-like
The sequence of polygons [*verts0*, *verts1*, ...] where each element *verts\_i* defines the vertices of polygon *i* as a 2D array-like of shape (M, 2).
**closed**bool, default: True
Whether the polygon should be closed by adding a CLOSEPOLY connection at the end.
set\_picker(*picker*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L527-L560)
Define the picking behavior of the artist.
Parameters:
**picker**None or bool or float or callable
This can be one of the following:
* *None*: Picking is disabled for this artist (default).
* A boolean: If *True* then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist.
* A float: If picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if its data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event
* A function: If picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event:
```
hit, props = picker(artist, mouseevent)
```
to determine the hit test. if the mouse event is over the artist, return *hit=True* and props is a dictionary of properties you want added to the PickEvent attributes.
set\_pickradius(*pickradius*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L422-L432)
Set the pick radius used for containment tests.
Parameters:
**pickradius**float
Pick radius, in points.
set\_rasterized(*rasterized*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L908-L927)
Force rasterized (bitmap) drawing for vector graphics output.
Rasterized drawing is not supported by all artists. If you try to enable this on an artist that does not support it, the command has no effect and a warning will be issued.
This setting is ignored for pixel-based output.
See also [Rasterization for vector graphics](https://matplotlib.org/stable/gallery/misc/rasterization_demo.html).
Parameters:
**rasterized**bool
set\_sizes(*sizes*, *dpi=72.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L949-L971)
Set the sizes of each member of the collection.
Parameters:
**sizes**ndarray or None
The size to set for each element of the collection. The value is the 'area' of the element.
**dpi**float, default: 72
The dpi of the canvas.
set\_sketch\_params(*scale=None*, *length=None*, *randomness=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L661-L687)
Set the sketch parameters.
Parameters:
**scale**float, optional
The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), or not provided, no sketch filter will be provided.
**length**float, optional
The length of the wiggle along the line, in pixels (default 128.0)
**randomness**float, optional
The scale factor by which the length is shrunken or expanded (default 16.0)
The PGF backend uses this argument as an RNG seed and not as described above. Using the same seed yields the same random shape.
set\_snap(*snap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L613-L639)
Set the snapping behavior.
Snapping aligns positions with the pixel grid, which results in clearer images. For example, if a black line of 1px width was defined at a position in between two pixels, the resulting image would contain the interpolated value of that line in the pixel grid, which would be a grey value on both adjacent pixel positions. In contrast, snapping will move the line to the nearest integer pixel value, so that the resulting image will really contain a 1px wide black line.
Snapping is currently only supported by the Agg and MacOSX backends.
Parameters:
**snap**bool or None
Possible values:
* *True*: Snap vertices to the nearest pixel center.
* *False*: Do not modify vertex positions.
* *None*: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center.
set\_transOffset(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Alias for [`set_offset_transform`](#matplotlib.collections.PolyCollection.set_offset_transform "matplotlib.collections.PolyCollection.set_offset_transform").
set\_transform(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L408-L419)
Set the artist transform.
Parameters:
**t**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_url(*url*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L578-L586)
Set the url for the artist.
Parameters:
**url**str
set\_urls(*urls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L474-L486)
Parameters:
**urls**list of str or None
#### Notes
URLs are currently only implemented by the SVG backend. They are ignored by all other backends.
set\_verts(*verts*, *closed=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1179-L1219)
Set the vertices of the polygons.
Parameters:
**verts**list of array-like
The sequence of polygons [*verts0*, *verts1*, ...] where each element *verts\_i* defines the vertices of polygon *i* as a 2D array-like of shape (M, 2).
**closed**bool, default: True
Whether the polygon should be closed by adding a CLOSEPOLY connection at the end.
set\_verts\_and\_codes(*verts*, *codes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1223-L1230)
Initialize vertices with path codes.
set\_visible(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1011-L1021)
Set the artist's visibility.
Parameters:
**b**bool
set\_zorder(*level*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1080-L1093)
Set the zorder for the artist. Artists with lower zorder values are drawn first.
Parameters:
**level**float
*property*stale
Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist.
*property*sticky\_edges
`x` and `y` sticky edge lists for autoscaling.
When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added--the view limit "sticks" to the edge. A typical use case is histograms, where one usually expects no margin on the bottom edge (0) of the histogram.
Moreover, margin expansion "bumps" against sticky edges and cannot cross them. For example, if the upper data limit is 1.0, the upper view limit computed by simple margin application is 1.2, but there is a sticky edge at 1.1, then the actual upper view limit will be 1.1.
This attribute cannot be assigned to; however, the `x` and `y` lists can be modified in place as needed.
#### Examples
```
>>> artist.sticky_edges.x[:] = (xmin, xmax)
>>> artist.sticky_edges.y[:] = (ymin, ymax)
```
to\_rgba(*x*, *alpha=None*, *bytes=False*, *norm=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L414-L482)
Return a normalized rgba array corresponding to *x*.
In the normal case, *x* is a 1D or 2D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If *x* is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the *alpha* kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the *alpha* kwarg is ignored; it does not replace the preexisting alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if *bytes* is *False* (default), the rgba array will be floats in the 0-1 range; if it is *True*, the returned rgba array will be uint8 in the 0 to 255 range.
If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1).
update(*props*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1168-L1177)
Update this artist's properties from the dict *props*.
Parameters:
**props**dict
update\_from(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L907-L929)
Copy properties from other to self.
update\_scalarmappable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L865-L901)
Update colors from the scalar mappable array, if any.
Assign colors to edges and faces based on the array and/or colors that were directly set, as appropriate.
zorder*=0*
*class*matplotlib.collections.QuadMesh(*coordinates*, *\**, *antialiased=True*, *shading='flat'*, *pickradius=0*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1894-L2187)
Bases: [`Collection`](#matplotlib.collections.Collection "matplotlib.collections.Collection")
Class for the efficient drawing of a quadrilateral mesh.
A quadrilateral mesh is a grid of M by N adjacent quadrilaterals that are defined via a (M+1, N+1) grid of vertices. The quadrilateral (m, n) is defined by the vertices
```
(m+1, n) ----------- (m+1, n+1)
/ /
/ /
/ /
(m, n) -------- (m, n+1)
```
The mesh need not be regular and the polygons need not be convex.
Parameters:
**coordinates**(M+1, N+1, 2) array-like
The vertices. `coordinates[m, n]` specifies the (x, y) coordinates of vertex (m, n).
**antialiased**bool, default: True
**shading**{'flat', 'gouraud'}, default: 'flat'
#### Notes
Unlike other [`Collection`](#matplotlib.collections.Collection "matplotlib.collections.Collection")s, the default *pickradius* of [`QuadMesh`](#matplotlib.collections.QuadMesh "matplotlib.collections.QuadMesh") is 0, i.e. [`contains`](_as_gen/matplotlib.artist.artist.contains#matplotlib.artist.Artist.contains "matplotlib.artist.Artist.contains") checks whether the test point is within any of the mesh quadrilaterals.
There exists a deprecated API version `QuadMesh(M, N, coords)`, where the dimensions are given explicitly and `coords` is a (M\*N, 2) array-like. This has been deprecated in Matplotlib 3.5. The following describes the semantics of this deprecated API.
A quadrilateral mesh consists of a grid of vertices. The dimensions of this array are (*meshWidth* + 1, *meshHeight* + 1). Each vertex in the mesh has a different set of "mesh coordinates" representing its position in the topology of the mesh. For any values (*m*, *n*) such that 0 <= *m* <= *meshWidth* and 0 <= *n* <= *meshHeight*, the vertices at mesh coordinates (*m*, *n*), (*m*, *n* + 1), (*m* + 1, *n* + 1), and (*m* + 1, *n*) form one of the quadrilaterals in the mesh. There are thus (*meshWidth* \* *meshHeight*) quadrilaterals in the mesh. The mesh need not be regular and the polygons need not be convex.
A quadrilateral mesh is represented by a (2 x ((*meshWidth* + 1) \* (*meshHeight* + 1))) numpy array *coordinates*, where each row is the *x* and *y* coordinates of one of the vertices. To define the function that maps from a data point to its corresponding color, use the [`set_cmap()`](#matplotlib.collections.QuadMesh.set_cmap "matplotlib.collections.QuadMesh.set_cmap") method. Each of these arrays is indexed in row-major order by the mesh coordinates of the vertex (or the mesh coordinates of the lower left vertex, in the case of the colors).
For example, the first entry in *coordinates* is the coordinates of the vertex at mesh coordinates (0, 0), then the one at (0, 1), then at (0, 2) .. (0, meshWidth), (1, 0), (1, 1), and so on.
Parameters:
**edgecolors**color or list of colors, default: `[rcParams["patch.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.edgecolor#matplotlibrc-sample)` (default: `'black'`)
Edge color for each patch making up the collection. The special value 'face' can be passed to make the edgecolor match the facecolor.
**facecolors**color or list of colors, default: `[rcParams["patch.facecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.facecolor#matplotlibrc-sample)` (default: `'C0'`)
Face color for each patch making up the collection.
**linewidths**float or list of floats, default: `[rcParams["patch.linewidth"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.linewidth#matplotlibrc-sample)` (default: `1.0`)
Line width for each patch making up the collection.
**linestyles**str or tuple or list thereof, default: 'solid'
Valid strings are ['solid', 'dashed', 'dashdot', 'dotted', '-', '--', '-.', ':']. Dash tuples should be of the form:
```
(offset, onoffseq),
```
where *onoffseq* is an even length tuple of on and off ink lengths in points. For examples, see [Linestyles](https://matplotlib.org/stable/gallery/lines_bars_and_markers/linestyles.html).
**capstyle**[`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle")-like, default: `[rcParams["patch.capstyle"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.capstyle#matplotlibrc-sample)`
Style to use for capping lines for all paths in the collection. Allowed values are {'butt', 'projecting', 'round'}.
**joinstyle**[`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle")-like, default: `[rcParams["patch.joinstyle"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.joinstyle#matplotlibrc-sample)`
Style to use for joining lines for all paths in the collection. Allowed values are {'miter', 'round', 'bevel'}.
**antialiaseds**bool or list of bool, default: `[rcParams["patch.antialiased"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.antialiased#matplotlibrc-sample)` (default: `True`)
Whether each patch in the collection should be drawn with antialiasing.
**offsets**(float, float) or list thereof, default: (0, 0)
A vector by which to translate each patch after rendering (default is no translation). The translation is performed in screen (pixel) coordinates (i.e. after the Artist's transform is applied).
**offset\_transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), default: [`IdentityTransform`](transformations#matplotlib.transforms.IdentityTransform "matplotlib.transforms.IdentityTransform")
A single transform which will be applied to each *offsets* vector before it is used.
**cmap, norm**
Data normalization and colormapping parameters. See [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") for a detailed description.
**hatch**str, optional
Hatching pattern to use in filled paths, if any. Valid strings are ['/', '', '|', '-', '+', 'x', 'o', 'O', '.', '\*']. See [Hatch style reference](https://matplotlib.org/stable/gallery/shapes_and_collections/hatch_style_reference.html) for the meaning of each hatch type.
**pickradius**float, default: 5.0
If `pickradius <= 0`, then [`Collection.contains`](#matplotlib.collections.Collection.contains "matplotlib.collections.Collection.contains") will return `True` whenever the test point is inside of one of the polygons formed by the control points of a Path in the Collection. On the other hand, if it is greater than 0, then we instead check if the test point is contained in a stroke of width `2*pickradius` following any of the Paths in the Collection.
**urls**list of str, default: None
A URL for each patch to link to once drawn. Currently only works for the SVG backend. See [Hyperlinks](https://matplotlib.org/stable/gallery/misc/hyperlinks_sgskip.html) for examples.
**zorder**float, default: 1
The drawing order, shared by all Patches in the Collection. See [Zorder Demo](https://matplotlib.org/stable/gallery/misc/zorder_demo.html) for all defaults and examples.
add\_callback(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L348-L375)
Add a callback function that will be called whenever one of the [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")'s properties changes.
Parameters:
**func**callable
The callback function. It must have the signature:
```
def func(artist: Artist) -> Any
```
where *artist* is the calling [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"). Return values may exist but are ignored.
Returns:
int
The observer id associated with the callback. This id can be used for removing the callback with [`remove_callback`](#matplotlib.collections.QuadMesh.remove_callback "matplotlib.collections.QuadMesh.remove_callback") later.
See also
[`remove_callback`](#matplotlib.collections.QuadMesh.remove_callback "matplotlib.collections.QuadMesh.remove_callback")
autoscale()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L625-L634)
Autoscale the scalar limits on the norm instance using the current array
autoscale\_None()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L636-L645)
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
*property*axes
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance the artist resides in, or *None*.
*property*callbacksSM[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
changed()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L647-L653)
Call this whenever the mappable is changed to notify all the callbackSM listeners to the 'changed' signal.
colorbar
The last colorbar associated with this ScalarMappable. May be None.
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L437-L472)
Test whether the mouse event occurred in the collection.
Returns `bool, dict(ind=itemlist)`, where every item in itemlist contains the event.
*static*convert\_mesh\_to\_paths(*meshWidth*, *meshHeight*, *coordinates*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L2065-L2069)
[*Deprecated*]
#### Notes
Deprecated since version 3.5: Use [`QuadMesh(coordinates).get_paths()`](#matplotlib.collections.QuadMesh.get_paths "matplotlib.collections.QuadMesh.get_paths") instead.
convert\_mesh\_to\_triangles(*meshWidth*, *meshHeight*, *coordinates*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L2092-L2094)
[*Deprecated*]
#### Notes
Deprecated since version 3.5:
convert\_xunits(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L241-L251)
Convert *x* using the unit type of the xaxis.
If the artist is not contained in an Axes or if the xaxis does not have units, *x* itself is returned.
convert\_yunits(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L253-L263)
Convert *y* using the unit type of the yaxis.
If the artist is not contained in an Axes or if the yaxis does not have units, *y* itself is returned.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L2134-L2181)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
findobj(*match=None*, *include\_self=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1208-L1249)
Find artist objects.
Recursively find all [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") instances contained in the artist.
Parameters:
**match**
A filter criterion for the matches. This can be
* *None*: Return all objects contained in artist.
* A function with signature `def match(artist: Artist) -> bool`. The result will only contain artists for which the function returns *True*.
* A class instance: e.g., [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"). The result will only contain artists of this class or its subclasses (`isinstance` check).
**include\_self**bool
Include *self* in the list to be checked for a match.
Returns:
list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
format\_cursor\_data(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1282-L1336)
Return a string representation of *data*.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
The default implementation converts ints and floats and arrays of ints and floats into a comma-separated string enclosed in square brackets, unless the artist has an associated colorbar, in which case scalar values are formatted using the colorbar's formatter.
See also
[`get_cursor_data`](#matplotlib.collections.QuadMesh.get_cursor_data "matplotlib.collections.QuadMesh.get_cursor_data")
get\_agg\_filter()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L929-L931)
Return filter function to be used for agg filter.
get\_alpha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L805-L810)
Return the alpha value used for blending - not supported on all backends.
get\_animated()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L816-L818)
Return whether the artist is animated.
get\_array()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L507-L514)
Return the array of values, that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the array.
get\_capstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L641-L642)
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L430-L432)
Return a list of the child [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s of this [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist").
get\_clim()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L520-L524)
Return the values (min, max) that are mapped to the colormap limits.
get\_clip\_box()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L859-L861)
Return the clipbox.
get\_clip\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L855-L857)
Return whether the artist uses clipping.
get\_clip\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L863-L865)
Return the clip path.
get\_cmap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L516-L518)
Return the [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") instance.
get\_coordinates()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L2055-L2063)
Return the vertices of the mesh as an (M+1, N+1, 2) array.
M, N are the number of quadrilaterals in the rows / columns of the mesh, corresponding to (M+1, N+1) vertices. The last dimension specifies the components (x, y).
get\_cursor\_data(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L2183-L2187)
Return the cursor data for a given event.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
Cursor data can be used by Artists to provide additional context information for a given event. The default implementation just returns *None*.
Subclasses can override the method and return arbitrary data. However, when doing so, they must ensure that [`format_cursor_data`](#matplotlib.collections.QuadMesh.format_cursor_data "matplotlib.collections.QuadMesh.format_cursor_data") can convert the data to a string representation.
The only current use case is displaying the z-value of an [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") in the status bar of a plot window, while moving the mouse.
Parameters:
**event**[`matplotlib.backend_bases.MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
See also
[`format_cursor_data`](#matplotlib.collections.QuadMesh.format_cursor_data "matplotlib.collections.QuadMesh.format_cursor_data")
get\_dashes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.QuadMesh.get_linestyle "matplotlib.collections.QuadMesh.get_linestyle").
get\_datalim(*transData*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L2052-L2053)
get\_ec()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.QuadMesh.get_edgecolor "matplotlib.collections.QuadMesh.get_edgecolor").
get\_edgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
get\_edgecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.QuadMesh.get_edgecolor "matplotlib.collections.QuadMesh.get_edgecolor").
get\_facecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
get\_facecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.QuadMesh.get_facecolor "matplotlib.collections.QuadMesh.get_facecolor").
get\_fc()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.QuadMesh.get_facecolor "matplotlib.collections.QuadMesh.get_facecolor").
get\_figure()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L703-L705)
Return the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
get\_fill()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L903-L905)
Return whether face is colored.
get\_gid()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L588-L590)
Return the group id.
get\_hatch()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L534-L536)
Return the current hatching pattern.
get\_in\_layout()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L820-L829)
Return boolean flag, `True` if artist is included in layout calculations.
E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
get\_joinstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L655-L656)
get\_label()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1056-L1058)
Return the label used for this artist in the legend.
get\_linestyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
get\_linestyles()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.QuadMesh.get_linestyle "matplotlib.collections.QuadMesh.get_linestyle").
get\_linewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
get\_linewidths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.QuadMesh.get_linewidth "matplotlib.collections.QuadMesh.get_linewidth").
get\_ls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.QuadMesh.get_linestyle "matplotlib.collections.QuadMesh.get_linestyle").
get\_lw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.QuadMesh.get_linewidth "matplotlib.collections.QuadMesh.get_linewidth").
get\_mouseover()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1338-L1343)
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
get\_offset\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist offset.
get\_offsets()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L554-L557)
Return the offsets for the collection.
get\_path\_effects()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L700-L701)
get\_paths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1996-L1999)
get\_picker()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L562-L572)
Return the picking behavior of the artist.
The possible values are described in [`set_picker`](#matplotlib.collections.QuadMesh.set_picker "matplotlib.collections.QuadMesh.set_picker").
See also
[`set_picker`](#matplotlib.collections.QuadMesh.set_picker "matplotlib.collections.QuadMesh.set_picker"), [`pickable`](#matplotlib.collections.QuadMesh.pickable "matplotlib.collections.QuadMesh.pickable"), [`pick`](#matplotlib.collections.QuadMesh.pick "matplotlib.collections.QuadMesh.pick")
get\_pickradius()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L434-L435)
get\_rasterized()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L904-L906)
Return whether the artist is to be rasterized.
get\_sketch\_params()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L641-L659)
Return the sketch parameters for the artist.
Returns:
tuple or None
A 3-tuple with the following elements:
* *scale*: The amplitude of the wiggle perpendicular to the source line.
* *length*: The length of the wiggle along the line.
* *randomness*: The scale factor by which the length is shrunken or expanded.
Returns *None* if no sketch parameters were set.
get\_snap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L602-L611)
Return the snap setting.
See [`set_snap`](#matplotlib.collections.QuadMesh.set_snap "matplotlib.collections.QuadMesh.set_snap") for details.
get\_tightbbox(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L322-L346)
Like [`Artist.get_window_extent`](_as_gen/matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent"), but includes any clipping.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
Returns:
[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The enclosing bounding box (in figure pixel coordinates).
get\_transOffset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Alias for [`get_offset_transform`](#matplotlib.collections.QuadMesh.get_offset_transform "matplotlib.collections.QuadMesh.get_offset_transform").
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L421-L428)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist.
get\_transformed\_clip\_path\_and\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L867-L875)
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
get\_transforms()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L211-L212)
get\_url()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L574-L576)
Return the url.
get\_urls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L488-L495)
Return a list of URLs, one for each element of the collection.
The list contains *None* for elements without a URL. See [Hyperlinks](https://matplotlib.org/stable/gallery/misc/hyperlinks_sgskip.html) for an example.
get\_visible()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L812-L814)
Return the visibility.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L303-L306)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
get\_zorder()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1076-L1078)
Return the artist's zorder.
have\_units()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L236-L239)
Return whether units are set on any axis.
is\_transform\_set()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L400-L406)
Return whether the Artist has an explicitly set transform.
This is *True* after [`set_transform`](#matplotlib.collections.QuadMesh.set_transform "matplotlib.collections.QuadMesh.set_transform") has been called.
*property*mouseover
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
*property*norm
pchanged()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L387-L398)
Call all of the registered callbacks.
This function is triggered internally when a property is changed.
See also
[`add_callback`](#matplotlib.collections.QuadMesh.add_callback "matplotlib.collections.QuadMesh.add_callback")
[`remove_callback`](#matplotlib.collections.QuadMesh.remove_callback "matplotlib.collections.QuadMesh.remove_callback")
pick(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L490-L525)
Process a pick event.
Each child artist will fire a pick event if *mouseevent* is over the artist and the artist has picker set.
See also
[`set_picker`](#matplotlib.collections.QuadMesh.set_picker "matplotlib.collections.QuadMesh.set_picker"), [`get_picker`](#matplotlib.collections.QuadMesh.get_picker "matplotlib.collections.QuadMesh.get_picker"), [`pickable`](#matplotlib.collections.QuadMesh.pickable "matplotlib.collections.QuadMesh.pickable")
pickable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L480-L488)
Return whether the artist is pickable.
See also
[`set_picker`](#matplotlib.collections.QuadMesh.set_picker "matplotlib.collections.QuadMesh.set_picker"), [`get_picker`](#matplotlib.collections.QuadMesh.get_picker "matplotlib.collections.QuadMesh.get_picker"), [`pick`](#matplotlib.collections.QuadMesh.pick "matplotlib.collections.QuadMesh.pick")
properties()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1139-L1141)
Return a dictionary of all the properties of the artist.
remove()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L193-L234)
Remove the artist from the figure if possible.
The effect will not be visible until the figure is redrawn, e.g., with [`FigureCanvasBase.draw_idle`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase.draw_idle "matplotlib.backend_bases.FigureCanvasBase.draw_idle"). Call [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") to update the axes limits if desired.
Note: [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") will not see collections even if the collection was added to the axes with *autolim* = True.
Note: there is no support for removing the artist's legend entry.
remove\_callback(*oid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L377-L385)
Remove a callback based on its observer id.
See also
[`add_callback`](#matplotlib.collections.QuadMesh.add_callback "matplotlib.collections.QuadMesh.add_callback")
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *array=<UNSET>*, *capstyle=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *offset\_transform=<UNSET>*, *offsets=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *urls=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](#matplotlib.collections.QuadMesh.set_array "matplotlib.collections.QuadMesh.set_array") | (M, N) array-like or M\*N array-like |
| [`capstyle`](#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_aa(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.QuadMesh.set_antialiased "matplotlib.collections.QuadMesh.set_antialiased").
set\_agg\_filter(*filter\_func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L933-L949)
Set the agg filter.
Parameters:
**filter\_func**callable
A filter function, which takes a (m, n, depth) float array and a dpi value, and returns a (m, n, depth) array and two offsets from the bottom left corner of the image
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L807-L821)
Set the alpha value used for blending - not supported on all backends.
Parameters:
**alpha**array-like or scalar or None
All values must be within the 0-1 range, inclusive. Masked values and nans are not supported.
set\_animated(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1023-L1041)
Set whether the artist is intended to be used in an animation.
If True, the artist is excluded from regular drawing of the figure. You have to call [`Figure.draw_artist`](figure_api#matplotlib.figure.Figure.draw_artist "matplotlib.figure.Figure.draw_artist") / [`Axes.draw_artist`](_as_gen/matplotlib.axes.axes.draw_artist#matplotlib.axes.Axes.draw_artist "matplotlib.axes.Axes.draw_artist") explicitly on the artist. This approach is used to speed up animations using blitting.
See also [`matplotlib.animation`](animation_api#module-matplotlib.animation "matplotlib.animation") and [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html).
Parameters:
**b**bool
set\_antialiased(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Set the antialiasing state for rendering.
Parameters:
**aa**bool or list of bools
set\_antialiaseds(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.QuadMesh.set_antialiased "matplotlib.collections.QuadMesh.set_antialiased").
set\_array(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L2005-L2050)
Set the data values.
Parameters:
**A**(M, N) array-like or M\*N array-like
If the values are provided as a 2D grid, the shape must match the coordinates grid. If the values are 1D, they are reshaped to 2D. M, N follow from the coordinates grid, where the coordinates grid shape is (M, N) for 'gouraud' *shading* and (M+1, N+1) for 'flat' shading.
set\_capstyle(*cs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L630-L639)
Set the [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") for the collection (for all its elements).
Parameters:
**cs**[`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'}
set\_clim(*vmin=None*, *vmax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L526-L550)
Set the norm limits for image scaling.
Parameters:
**vmin, vmax**float
The limits.
The limits may also be passed as a tuple (*vmin*, *vmax*) as a single positional argument.
set\_clip\_box(*clipbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L731-L741)
Set the artist's clip [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
Parameters:
**clipbox**[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
set\_clip\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L877-L892)
Set whether the artist uses clipping.
When False artists will be visible outside of the Axes which can lead to unexpected results.
Parameters:
**b**bool
set\_clip\_path(*path*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L743-L803)
Set the artist's clip path.
Parameters:
**path**[`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") or [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") or [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") or None
The clip path. If given a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), *transform* must be provided as well. If *None*, a previously set clip path is removed.
**transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
Only used if *path* is a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), in which case the given [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") is converted to a [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") using *transform*.
#### Notes
For efficiency, if *path* is a [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") this method will set the clipping box to the corresponding rectangle and set the clipping path to `None`.
For technical reasons (support of [`set`](_as_gen/matplotlib.artist.artist.set#matplotlib.artist.Artist.set "matplotlib.artist.Artist.set")), a tuple (*path*, *transform*) is also accepted as a single positional parameter.
set\_cmap(*cmap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L562-L574)
Set the colormap for luminance data.
Parameters:
**cmap**[`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None
set\_color(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L713-L727)
Set both the edgecolor and the facecolor.
Parameters:
**c**color or list of rgba tuples
See also
[`Collection.set_facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor"), [`Collection.set_edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor")
For setting the edge or face color individually.
set\_dashes(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.QuadMesh.set_linestyle "matplotlib.collections.QuadMesh.set_linestyle").
set\_ec(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.QuadMesh.set_edgecolor "matplotlib.collections.QuadMesh.set_edgecolor").
set\_edgecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Set the edgecolor(s) of the collection.
Parameters:
**c**color or list of colors or 'face'
The collection edgecolor(s). If a sequence, the patches cycle through it. If 'face', match the facecolor.
set\_edgecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.QuadMesh.set_edgecolor "matplotlib.collections.QuadMesh.set_edgecolor").
set\_facecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Set the facecolor(s) of the collection. *c* can be a color (all patches have same color), or a sequence of colors; if it is a sequence the patches will cycle through the sequence.
If *c* is 'none', the patch will not be filled.
Parameters:
**c**color or list of colors
set\_facecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.QuadMesh.set_facecolor "matplotlib.collections.QuadMesh.set_facecolor").
set\_fc(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.QuadMesh.set_facecolor "matplotlib.collections.QuadMesh.set_facecolor").
set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L707-L729)
Set the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
set\_gid(*gid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L592-L600)
Set the (group) id for the artist.
Parameters:
**gid**str
set\_hatch(*hatch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L497-L532)
Set the hatching pattern
*hatch* can be one of:
```
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
```
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
Parameters:
**hatch**{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'}
set\_in\_layout(*in\_layout*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1043-L1054)
Set if artist is to be included in layout calculations, E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
Parameters:
**in\_layout**bool
set\_joinstyle(*js*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L644-L653)
Set the [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") for the collection (for all its elements).
Parameters:
**js**[`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'}
set\_label(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1060-L1074)
Set a label that will be displayed in the legend.
Parameters:
**s**object
*s* will be converted to a string by calling [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)").
set\_linestyle(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Set the linestyle(s) for the collection.
| linestyle | description |
| --- | --- |
| `'-'` or `'solid'` | solid line |
| `'--'` or `'dashed'` | dashed line |
| `'-.'` or `'dashdot'` | dash-dotted line |
| `':'` or `'dotted'` | dotted line |
Alternatively a dash tuple of the following form can be provided:
```
(offset, onoffseq),
```
where `onoffseq` is an even length tuple of on and off ink in points.
Parameters:
**ls**str or tuple or list thereof
Valid values for individual linestyles include {'-', '--', '-.', ':', '', (offset, on-off-seq)}. See [`Line2D.set_linestyle`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") for a complete description.
set\_linestyles(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.QuadMesh.set_linestyle "matplotlib.collections.QuadMesh.set_linestyle").
set\_linewidth(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Set the linewidth(s) for the collection. *lw* can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence
Parameters:
**lw**float or list of floats
set\_linewidths(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.QuadMesh.set_linewidth "matplotlib.collections.QuadMesh.set_linewidth").
set\_ls(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.QuadMesh.set_linestyle "matplotlib.collections.QuadMesh.set_linestyle").
set\_lw(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.QuadMesh.set_linewidth "matplotlib.collections.QuadMesh.set_linewidth").
set\_mouseover(*mouseover*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1345-L1366)
Set whether this artist is queried for custom context information when the mouse cursor moves over it.
Parameters:
**mouseover**bool
See also
[`get_cursor_data`](#matplotlib.collections.QuadMesh.get_cursor_data "matplotlib.collections.QuadMesh.get_cursor_data")
[`ToolCursorPosition`](backend_tools_api#matplotlib.backend_tools.ToolCursorPosition "matplotlib.backend_tools.ToolCursorPosition")
[`NavigationToolbar2`](backend_bases_api#matplotlib.backend_bases.NavigationToolbar2 "matplotlib.backend_bases.NavigationToolbar2")
set\_norm(*norm*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L609-L623)
Set the normalization instance.
Parameters:
**norm**[`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None
#### Notes
If there are any colorbars using the mappable for this norm, setting the norm of the mappable will reset the norm, locator, and formatters on the colorbar to default.
set\_offset\_transform(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Set the artist offset transform.
Parameters:
**offset\_transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_offsets(*offsets*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L538-L552)
Set the offsets for the collection.
Parameters:
**offsets**(N, 2) or (2,) array-like
set\_path\_effects(*path\_effects*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L689-L698)
Set the path effects.
Parameters:
**path\_effects**[`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
set\_paths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L2001-L2003)
set\_picker(*picker*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L527-L560)
Define the picking behavior of the artist.
Parameters:
**picker**None or bool or float or callable
This can be one of the following:
* *None*: Picking is disabled for this artist (default).
* A boolean: If *True* then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist.
* A float: If picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if its data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event
* A function: If picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event:
```
hit, props = picker(artist, mouseevent)
```
to determine the hit test. if the mouse event is over the artist, return *hit=True* and props is a dictionary of properties you want added to the PickEvent attributes.
set\_pickradius(*pickradius*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L422-L432)
Set the pick radius used for containment tests.
Parameters:
**pickradius**float
Pick radius, in points.
set\_rasterized(*rasterized*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L908-L927)
Force rasterized (bitmap) drawing for vector graphics output.
Rasterized drawing is not supported by all artists. If you try to enable this on an artist that does not support it, the command has no effect and a warning will be issued.
This setting is ignored for pixel-based output.
See also [Rasterization for vector graphics](https://matplotlib.org/stable/gallery/misc/rasterization_demo.html).
Parameters:
**rasterized**bool
set\_sketch\_params(*scale=None*, *length=None*, *randomness=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L661-L687)
Set the sketch parameters.
Parameters:
**scale**float, optional
The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), or not provided, no sketch filter will be provided.
**length**float, optional
The length of the wiggle along the line, in pixels (default 128.0)
**randomness**float, optional
The scale factor by which the length is shrunken or expanded (default 16.0)
The PGF backend uses this argument as an RNG seed and not as described above. Using the same seed yields the same random shape.
set\_snap(*snap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L613-L639)
Set the snapping behavior.
Snapping aligns positions with the pixel grid, which results in clearer images. For example, if a black line of 1px width was defined at a position in between two pixels, the resulting image would contain the interpolated value of that line in the pixel grid, which would be a grey value on both adjacent pixel positions. In contrast, snapping will move the line to the nearest integer pixel value, so that the resulting image will really contain a 1px wide black line.
Snapping is currently only supported by the Agg and MacOSX backends.
Parameters:
**snap**bool or None
Possible values:
* *True*: Snap vertices to the nearest pixel center.
* *False*: Do not modify vertex positions.
* *None*: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center.
set\_transOffset(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Alias for [`set_offset_transform`](#matplotlib.collections.QuadMesh.set_offset_transform "matplotlib.collections.QuadMesh.set_offset_transform").
set\_transform(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L408-L419)
Set the artist transform.
Parameters:
**t**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_url(*url*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L578-L586)
Set the url for the artist.
Parameters:
**url**str
set\_urls(*urls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L474-L486)
Parameters:
**urls**list of str or None
#### Notes
URLs are currently only implemented by the SVG backend. They are ignored by all other backends.
set\_visible(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1011-L1021)
Set the artist's visibility.
Parameters:
**b**bool
set\_zorder(*level*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1080-L1093)
Set the zorder for the artist. Artists with lower zorder values are drawn first.
Parameters:
**level**float
*property*stale
Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist.
*property*sticky\_edges
`x` and `y` sticky edge lists for autoscaling.
When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added--the view limit "sticks" to the edge. A typical use case is histograms, where one usually expects no margin on the bottom edge (0) of the histogram.
Moreover, margin expansion "bumps" against sticky edges and cannot cross them. For example, if the upper data limit is 1.0, the upper view limit computed by simple margin application is 1.2, but there is a sticky edge at 1.1, then the actual upper view limit will be 1.1.
This attribute cannot be assigned to; however, the `x` and `y` lists can be modified in place as needed.
#### Examples
```
>>> artist.sticky_edges.x[:] = (xmin, xmax)
>>> artist.sticky_edges.y[:] = (ymin, ymax)
```
to\_rgba(*x*, *alpha=None*, *bytes=False*, *norm=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L414-L482)
Return a normalized rgba array corresponding to *x*.
In the normal case, *x* is a 1D or 2D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If *x* is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the *alpha* kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the *alpha* kwarg is ignored; it does not replace the preexisting alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if *bytes* is *False* (default), the rgba array will be floats in the 0-1 range; if it is *True*, the returned rgba array will be uint8 in the 0 to 255 range.
If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1).
update(*props*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1168-L1177)
Update this artist's properties from the dict *props*.
Parameters:
**props**dict
update\_from(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L907-L929)
Copy properties from other to self.
update\_scalarmappable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L865-L901)
Update colors from the scalar mappable array, if any.
Assign colors to edges and faces based on the array and/or colors that were directly set, as appropriate.
zorder*=0*
*class*matplotlib.collections.RegularPolyCollection(*numsides*, *\**, *rotation=0*, *sizes=(1,)*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1276-L1339)
Bases: `_CollectionWithSizes`
A collection of n-sided regular polygons.
Parameters:
**numsides**int
The number of sides of the polygon.
**rotation**float
The rotation of the polygon in radians.
**sizes**tuple of float
The area of the circle circumscribing the polygon in points^2.
**\*\*kwargs**
Forwarded to [`Collection`](#matplotlib.collections.Collection "matplotlib.collections.Collection").
#### Examples
See [Lasso Demo](https://matplotlib.org/stable/gallery/event_handling/lasso_demo.html) for a complete example:
```
offsets = np.random.rand(20, 2)
facecolors = [cm.jet(x) for x in np.random.rand(20)]
collection = RegularPolyCollection(
numsides=5, # a pentagon
rotation=0, sizes=(50,),
facecolors=facecolors,
edgecolors=("black",),
linewidths=(1,),
offsets=offsets,
offset_transform=ax.transData,
)
```
add\_callback(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L348-L375)
Add a callback function that will be called whenever one of the [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")'s properties changes.
Parameters:
**func**callable
The callback function. It must have the signature:
```
def func(artist: Artist) -> Any
```
where *artist* is the calling [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"). Return values may exist but are ignored.
Returns:
int
The observer id associated with the callback. This id can be used for removing the callback with [`remove_callback`](#matplotlib.collections.RegularPolyCollection.remove_callback "matplotlib.collections.RegularPolyCollection.remove_callback") later.
See also
[`remove_callback`](#matplotlib.collections.RegularPolyCollection.remove_callback "matplotlib.collections.RegularPolyCollection.remove_callback")
autoscale()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L625-L634)
Autoscale the scalar limits on the norm instance using the current array
autoscale\_None()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L636-L645)
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
*property*axes
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance the artist resides in, or *None*.
*property*callbacksSM[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
changed()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L647-L653)
Call this whenever the mappable is changed to notify all the callbackSM listeners to the 'changed' signal.
colorbar
The last colorbar associated with this ScalarMappable. May be None.
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L437-L472)
Test whether the mouse event occurred in the collection.
Returns `bool, dict(ind=itemlist)`, where every item in itemlist contains the event.
convert\_xunits(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L241-L251)
Convert *x* using the unit type of the xaxis.
If the artist is not contained in an Axes or if the xaxis does not have units, *x* itself is returned.
convert\_yunits(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L253-L263)
Convert *y* using the unit type of the yaxis.
If the artist is not contained in an Axes or if the yaxis does not have units, *y* itself is returned.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1330-L1339)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
findobj(*match=None*, *include\_self=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1208-L1249)
Find artist objects.
Recursively find all [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") instances contained in the artist.
Parameters:
**match**
A filter criterion for the matches. This can be
* *None*: Return all objects contained in artist.
* A function with signature `def match(artist: Artist) -> bool`. The result will only contain artists for which the function returns *True*.
* A class instance: e.g., [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"). The result will only contain artists of this class or its subclasses (`isinstance` check).
**include\_self**bool
Include *self* in the list to be checked for a match.
Returns:
list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
format\_cursor\_data(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1282-L1336)
Return a string representation of *data*.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
The default implementation converts ints and floats and arrays of ints and floats into a comma-separated string enclosed in square brackets, unless the artist has an associated colorbar, in which case scalar values are formatted using the colorbar's formatter.
See also
[`get_cursor_data`](#matplotlib.collections.RegularPolyCollection.get_cursor_data "matplotlib.collections.RegularPolyCollection.get_cursor_data")
get\_agg\_filter()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L929-L931)
Return filter function to be used for agg filter.
get\_alpha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L805-L810)
Return the alpha value used for blending - not supported on all backends.
get\_animated()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L816-L818)
Return whether the artist is animated.
get\_array()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L507-L514)
Return the array of values, that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the array.
get\_capstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L641-L642)
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L430-L432)
Return a list of the child [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s of this [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist").
get\_clim()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L520-L524)
Return the values (min, max) that are mapped to the colormap limits.
get\_clip\_box()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L859-L861)
Return the clipbox.
get\_clip\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L855-L857)
Return whether the artist uses clipping.
get\_clip\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L863-L865)
Return the clip path.
get\_cmap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L516-L518)
Return the [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") instance.
get\_cursor\_data(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1251-L1280)
Return the cursor data for a given event.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
Cursor data can be used by Artists to provide additional context information for a given event. The default implementation just returns *None*.
Subclasses can override the method and return arbitrary data. However, when doing so, they must ensure that [`format_cursor_data`](#matplotlib.collections.RegularPolyCollection.format_cursor_data "matplotlib.collections.RegularPolyCollection.format_cursor_data") can convert the data to a string representation.
The only current use case is displaying the z-value of an [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") in the status bar of a plot window, while moving the mouse.
Parameters:
**event**[`matplotlib.backend_bases.MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
See also
[`format_cursor_data`](#matplotlib.collections.RegularPolyCollection.format_cursor_data "matplotlib.collections.RegularPolyCollection.format_cursor_data")
get\_dashes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.RegularPolyCollection.get_linestyle "matplotlib.collections.RegularPolyCollection.get_linestyle").
get\_datalim(*transData*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L235-L301)
get\_ec()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.RegularPolyCollection.get_edgecolor "matplotlib.collections.RegularPolyCollection.get_edgecolor").
get\_edgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
get\_edgecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.RegularPolyCollection.get_edgecolor "matplotlib.collections.RegularPolyCollection.get_edgecolor").
get\_facecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
get\_facecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.RegularPolyCollection.get_facecolor "matplotlib.collections.RegularPolyCollection.get_facecolor").
get\_fc()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.RegularPolyCollection.get_facecolor "matplotlib.collections.RegularPolyCollection.get_facecolor").
get\_figure()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L703-L705)
Return the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
get\_fill()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L903-L905)
Return whether face is colored.
get\_gid()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L588-L590)
Return the group id.
get\_hatch()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L534-L536)
Return the current hatching pattern.
get\_in\_layout()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L820-L829)
Return boolean flag, `True` if artist is included in layout calculations.
E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
get\_joinstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L655-L656)
get\_label()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1056-L1058)
Return the label used for this artist in the legend.
get\_linestyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
get\_linestyles()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.RegularPolyCollection.get_linestyle "matplotlib.collections.RegularPolyCollection.get_linestyle").
get\_linewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
get\_linewidths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.RegularPolyCollection.get_linewidth "matplotlib.collections.RegularPolyCollection.get_linewidth").
get\_ls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.RegularPolyCollection.get_linestyle "matplotlib.collections.RegularPolyCollection.get_linestyle").
get\_lw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.RegularPolyCollection.get_linewidth "matplotlib.collections.RegularPolyCollection.get_linewidth").
get\_mouseover()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1338-L1343)
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
get\_numsides()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1324-L1325)
get\_offset\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist offset.
get\_offsets()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L554-L557)
Return the offsets for the collection.
get\_path\_effects()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L700-L701)
get\_paths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L205-L206)
get\_picker()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L562-L572)
Return the picking behavior of the artist.
The possible values are described in [`set_picker`](#matplotlib.collections.RegularPolyCollection.set_picker "matplotlib.collections.RegularPolyCollection.set_picker").
See also
[`set_picker`](#matplotlib.collections.RegularPolyCollection.set_picker "matplotlib.collections.RegularPolyCollection.set_picker"), [`pickable`](#matplotlib.collections.RegularPolyCollection.pickable "matplotlib.collections.RegularPolyCollection.pickable"), [`pick`](#matplotlib.collections.RegularPolyCollection.pick "matplotlib.collections.RegularPolyCollection.pick")
get\_pickradius()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L434-L435)
get\_rasterized()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L904-L906)
Return whether the artist is to be rasterized.
get\_rotation()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1327-L1328)
get\_sizes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L938-L947)
Return the sizes ('areas') of the elements in the collection.
Returns:
array
The 'area' of each element.
get\_sketch\_params()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L641-L659)
Return the sketch parameters for the artist.
Returns:
tuple or None
A 3-tuple with the following elements:
* *scale*: The amplitude of the wiggle perpendicular to the source line.
* *length*: The length of the wiggle along the line.
* *randomness*: The scale factor by which the length is shrunken or expanded.
Returns *None* if no sketch parameters were set.
get\_snap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L602-L611)
Return the snap setting.
See [`set_snap`](#matplotlib.collections.RegularPolyCollection.set_snap "matplotlib.collections.RegularPolyCollection.set_snap") for details.
get\_tightbbox(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L322-L346)
Like [`Artist.get_window_extent`](_as_gen/matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent"), but includes any clipping.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
Returns:
[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The enclosing bounding box (in figure pixel coordinates).
get\_transOffset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Alias for [`get_offset_transform`](#matplotlib.collections.RegularPolyCollection.get_offset_transform "matplotlib.collections.RegularPolyCollection.get_offset_transform").
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L421-L428)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist.
get\_transformed\_clip\_path\_and\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L867-L875)
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
get\_transforms()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L211-L212)
get\_url()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L574-L576)
Return the url.
get\_urls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L488-L495)
Return a list of URLs, one for each element of the collection.
The list contains *None* for elements without a URL. See [Hyperlinks](https://matplotlib.org/stable/gallery/misc/hyperlinks_sgskip.html) for an example.
get\_visible()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L812-L814)
Return the visibility.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L303-L306)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
get\_zorder()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1076-L1078)
Return the artist's zorder.
have\_units()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L236-L239)
Return whether units are set on any axis.
is\_transform\_set()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L400-L406)
Return whether the Artist has an explicitly set transform.
This is *True* after [`set_transform`](#matplotlib.collections.RegularPolyCollection.set_transform "matplotlib.collections.RegularPolyCollection.set_transform") has been called.
*property*mouseover
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
*property*norm
pchanged()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L387-L398)
Call all of the registered callbacks.
This function is triggered internally when a property is changed.
See also
[`add_callback`](#matplotlib.collections.RegularPolyCollection.add_callback "matplotlib.collections.RegularPolyCollection.add_callback")
[`remove_callback`](#matplotlib.collections.RegularPolyCollection.remove_callback "matplotlib.collections.RegularPolyCollection.remove_callback")
pick(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L490-L525)
Process a pick event.
Each child artist will fire a pick event if *mouseevent* is over the artist and the artist has picker set.
See also
[`set_picker`](#matplotlib.collections.RegularPolyCollection.set_picker "matplotlib.collections.RegularPolyCollection.set_picker"), [`get_picker`](#matplotlib.collections.RegularPolyCollection.get_picker "matplotlib.collections.RegularPolyCollection.get_picker"), [`pickable`](#matplotlib.collections.RegularPolyCollection.pickable "matplotlib.collections.RegularPolyCollection.pickable")
pickable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L480-L488)
Return whether the artist is pickable.
See also
[`set_picker`](#matplotlib.collections.RegularPolyCollection.set_picker "matplotlib.collections.RegularPolyCollection.set_picker"), [`get_picker`](#matplotlib.collections.RegularPolyCollection.get_picker "matplotlib.collections.RegularPolyCollection.get_picker"), [`pick`](#matplotlib.collections.RegularPolyCollection.pick "matplotlib.collections.RegularPolyCollection.pick")
properties()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1139-L1141)
Return a dictionary of all the properties of the artist.
remove()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L193-L234)
Remove the artist from the figure if possible.
The effect will not be visible until the figure is redrawn, e.g., with [`FigureCanvasBase.draw_idle`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase.draw_idle "matplotlib.backend_bases.FigureCanvasBase.draw_idle"). Call [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") to update the axes limits if desired.
Note: [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") will not see collections even if the collection was added to the axes with *autolim* = True.
Note: there is no support for removing the artist's legend entry.
remove\_callback(*oid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L377-L385)
Remove a callback based on its observer id.
See also
[`add_callback`](#matplotlib.collections.RegularPolyCollection.add_callback "matplotlib.collections.RegularPolyCollection.add_callback")
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *array=<UNSET>*, *capstyle=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *offset\_transform=<UNSET>*, *offsets=<UNSET>*, *path\_effects=<UNSET>*, *paths=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *sizes=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *urls=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](#matplotlib.collections.Collection.set_paths "matplotlib.collections.Collection.set_paths") | unknown |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `sizes` | ndarray or None |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_aa(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.RegularPolyCollection.set_antialiased "matplotlib.collections.RegularPolyCollection.set_antialiased").
set\_agg\_filter(*filter\_func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L933-L949)
Set the agg filter.
Parameters:
**filter\_func**callable
A filter function, which takes a (m, n, depth) float array and a dpi value, and returns a (m, n, depth) array and two offsets from the bottom left corner of the image
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L807-L821)
Set the alpha value used for blending - not supported on all backends.
Parameters:
**alpha**array-like or scalar or None
All values must be within the 0-1 range, inclusive. Masked values and nans are not supported.
set\_animated(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1023-L1041)
Set whether the artist is intended to be used in an animation.
If True, the artist is excluded from regular drawing of the figure. You have to call [`Figure.draw_artist`](figure_api#matplotlib.figure.Figure.draw_artist "matplotlib.figure.Figure.draw_artist") / [`Axes.draw_artist`](_as_gen/matplotlib.axes.axes.draw_artist#matplotlib.axes.Axes.draw_artist "matplotlib.axes.Axes.draw_artist") explicitly on the artist. This approach is used to speed up animations using blitting.
See also [`matplotlib.animation`](animation_api#module-matplotlib.animation "matplotlib.animation") and [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html).
Parameters:
**b**bool
set\_antialiased(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Set the antialiasing state for rendering.
Parameters:
**aa**bool or list of bools
set\_antialiaseds(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.RegularPolyCollection.set_antialiased "matplotlib.collections.RegularPolyCollection.set_antialiased").
set\_array(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L484-L505)
Set the value array from array-like *A*.
Parameters:
**A**array-like or None
The values that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the value array *A*.
set\_capstyle(*cs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L630-L639)
Set the [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") for the collection (for all its elements).
Parameters:
**cs**[`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'}
set\_clim(*vmin=None*, *vmax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L526-L550)
Set the norm limits for image scaling.
Parameters:
**vmin, vmax**float
The limits.
The limits may also be passed as a tuple (*vmin*, *vmax*) as a single positional argument.
set\_clip\_box(*clipbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L731-L741)
Set the artist's clip [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
Parameters:
**clipbox**[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
set\_clip\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L877-L892)
Set whether the artist uses clipping.
When False artists will be visible outside of the Axes which can lead to unexpected results.
Parameters:
**b**bool
set\_clip\_path(*path*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L743-L803)
Set the artist's clip path.
Parameters:
**path**[`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") or [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") or [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") or None
The clip path. If given a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), *transform* must be provided as well. If *None*, a previously set clip path is removed.
**transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
Only used if *path* is a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), in which case the given [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") is converted to a [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") using *transform*.
#### Notes
For efficiency, if *path* is a [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") this method will set the clipping box to the corresponding rectangle and set the clipping path to `None`.
For technical reasons (support of [`set`](_as_gen/matplotlib.artist.artist.set#matplotlib.artist.Artist.set "matplotlib.artist.Artist.set")), a tuple (*path*, *transform*) is also accepted as a single positional parameter.
set\_cmap(*cmap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L562-L574)
Set the colormap for luminance data.
Parameters:
**cmap**[`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None
set\_color(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L713-L727)
Set both the edgecolor and the facecolor.
Parameters:
**c**color or list of rgba tuples
See also
[`Collection.set_facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor"), [`Collection.set_edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor")
For setting the edge or face color individually.
set\_dashes(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.RegularPolyCollection.set_linestyle "matplotlib.collections.RegularPolyCollection.set_linestyle").
set\_ec(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.RegularPolyCollection.set_edgecolor "matplotlib.collections.RegularPolyCollection.set_edgecolor").
set\_edgecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Set the edgecolor(s) of the collection.
Parameters:
**c**color or list of colors or 'face'
The collection edgecolor(s). If a sequence, the patches cycle through it. If 'face', match the facecolor.
set\_edgecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.RegularPolyCollection.set_edgecolor "matplotlib.collections.RegularPolyCollection.set_edgecolor").
set\_facecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Set the facecolor(s) of the collection. *c* can be a color (all patches have same color), or a sequence of colors; if it is a sequence the patches will cycle through the sequence.
If *c* is 'none', the patch will not be filled.
Parameters:
**c**color or list of colors
set\_facecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.RegularPolyCollection.set_facecolor "matplotlib.collections.RegularPolyCollection.set_facecolor").
set\_fc(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.RegularPolyCollection.set_facecolor "matplotlib.collections.RegularPolyCollection.set_facecolor").
set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L707-L729)
Set the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
set\_gid(*gid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L592-L600)
Set the (group) id for the artist.
Parameters:
**gid**str
set\_hatch(*hatch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L497-L532)
Set the hatching pattern
*hatch* can be one of:
```
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
```
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
Parameters:
**hatch**{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'}
set\_in\_layout(*in\_layout*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1043-L1054)
Set if artist is to be included in layout calculations, E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
Parameters:
**in\_layout**bool
set\_joinstyle(*js*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L644-L653)
Set the [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") for the collection (for all its elements).
Parameters:
**js**[`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'}
set\_label(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1060-L1074)
Set a label that will be displayed in the legend.
Parameters:
**s**object
*s* will be converted to a string by calling [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)").
set\_linestyle(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Set the linestyle(s) for the collection.
| linestyle | description |
| --- | --- |
| `'-'` or `'solid'` | solid line |
| `'--'` or `'dashed'` | dashed line |
| `'-.'` or `'dashdot'` | dash-dotted line |
| `':'` or `'dotted'` | dotted line |
Alternatively a dash tuple of the following form can be provided:
```
(offset, onoffseq),
```
where `onoffseq` is an even length tuple of on and off ink in points.
Parameters:
**ls**str or tuple or list thereof
Valid values for individual linestyles include {'-', '--', '-.', ':', '', (offset, on-off-seq)}. See [`Line2D.set_linestyle`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") for a complete description.
set\_linestyles(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.RegularPolyCollection.set_linestyle "matplotlib.collections.RegularPolyCollection.set_linestyle").
set\_linewidth(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Set the linewidth(s) for the collection. *lw* can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence
Parameters:
**lw**float or list of floats
set\_linewidths(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.RegularPolyCollection.set_linewidth "matplotlib.collections.RegularPolyCollection.set_linewidth").
set\_ls(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.RegularPolyCollection.set_linestyle "matplotlib.collections.RegularPolyCollection.set_linestyle").
set\_lw(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.RegularPolyCollection.set_linewidth "matplotlib.collections.RegularPolyCollection.set_linewidth").
set\_mouseover(*mouseover*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1345-L1366)
Set whether this artist is queried for custom context information when the mouse cursor moves over it.
Parameters:
**mouseover**bool
See also
[`get_cursor_data`](#matplotlib.collections.RegularPolyCollection.get_cursor_data "matplotlib.collections.RegularPolyCollection.get_cursor_data")
[`ToolCursorPosition`](backend_tools_api#matplotlib.backend_tools.ToolCursorPosition "matplotlib.backend_tools.ToolCursorPosition")
[`NavigationToolbar2`](backend_bases_api#matplotlib.backend_bases.NavigationToolbar2 "matplotlib.backend_bases.NavigationToolbar2")
set\_norm(*norm*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L609-L623)
Set the normalization instance.
Parameters:
**norm**[`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None
#### Notes
If there are any colorbars using the mappable for this norm, setting the norm of the mappable will reset the norm, locator, and formatters on the colorbar to default.
set\_offset\_transform(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Set the artist offset transform.
Parameters:
**offset\_transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_offsets(*offsets*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L538-L552)
Set the offsets for the collection.
Parameters:
**offsets**(N, 2) or (2,) array-like
set\_path\_effects(*path\_effects*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L689-L698)
Set the path effects.
Parameters:
**path\_effects**[`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
set\_paths(*paths*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L208-L209)
set\_picker(*picker*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L527-L560)
Define the picking behavior of the artist.
Parameters:
**picker**None or bool or float or callable
This can be one of the following:
* *None*: Picking is disabled for this artist (default).
* A boolean: If *True* then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist.
* A float: If picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if its data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event
* A function: If picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event:
```
hit, props = picker(artist, mouseevent)
```
to determine the hit test. if the mouse event is over the artist, return *hit=True* and props is a dictionary of properties you want added to the PickEvent attributes.
set\_pickradius(*pickradius*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L422-L432)
Set the pick radius used for containment tests.
Parameters:
**pickradius**float
Pick radius, in points.
set\_rasterized(*rasterized*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L908-L927)
Force rasterized (bitmap) drawing for vector graphics output.
Rasterized drawing is not supported by all artists. If you try to enable this on an artist that does not support it, the command has no effect and a warning will be issued.
This setting is ignored for pixel-based output.
See also [Rasterization for vector graphics](https://matplotlib.org/stable/gallery/misc/rasterization_demo.html).
Parameters:
**rasterized**bool
set\_sizes(*sizes*, *dpi=72.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L949-L971)
Set the sizes of each member of the collection.
Parameters:
**sizes**ndarray or None
The size to set for each element of the collection. The value is the 'area' of the element.
**dpi**float, default: 72
The dpi of the canvas.
set\_sketch\_params(*scale=None*, *length=None*, *randomness=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L661-L687)
Set the sketch parameters.
Parameters:
**scale**float, optional
The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), or not provided, no sketch filter will be provided.
**length**float, optional
The length of the wiggle along the line, in pixels (default 128.0)
**randomness**float, optional
The scale factor by which the length is shrunken or expanded (default 16.0)
The PGF backend uses this argument as an RNG seed and not as described above. Using the same seed yields the same random shape.
set\_snap(*snap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L613-L639)
Set the snapping behavior.
Snapping aligns positions with the pixel grid, which results in clearer images. For example, if a black line of 1px width was defined at a position in between two pixels, the resulting image would contain the interpolated value of that line in the pixel grid, which would be a grey value on both adjacent pixel positions. In contrast, snapping will move the line to the nearest integer pixel value, so that the resulting image will really contain a 1px wide black line.
Snapping is currently only supported by the Agg and MacOSX backends.
Parameters:
**snap**bool or None
Possible values:
* *True*: Snap vertices to the nearest pixel center.
* *False*: Do not modify vertex positions.
* *None*: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center.
set\_transOffset(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Alias for [`set_offset_transform`](#matplotlib.collections.RegularPolyCollection.set_offset_transform "matplotlib.collections.RegularPolyCollection.set_offset_transform").
set\_transform(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L408-L419)
Set the artist transform.
Parameters:
**t**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_url(*url*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L578-L586)
Set the url for the artist.
Parameters:
**url**str
set\_urls(*urls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L474-L486)
Parameters:
**urls**list of str or None
#### Notes
URLs are currently only implemented by the SVG backend. They are ignored by all other backends.
set\_visible(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1011-L1021)
Set the artist's visibility.
Parameters:
**b**bool
set\_zorder(*level*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1080-L1093)
Set the zorder for the artist. Artists with lower zorder values are drawn first.
Parameters:
**level**float
*property*stale
Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist.
*property*sticky\_edges
`x` and `y` sticky edge lists for autoscaling.
When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added--the view limit "sticks" to the edge. A typical use case is histograms, where one usually expects no margin on the bottom edge (0) of the histogram.
Moreover, margin expansion "bumps" against sticky edges and cannot cross them. For example, if the upper data limit is 1.0, the upper view limit computed by simple margin application is 1.2, but there is a sticky edge at 1.1, then the actual upper view limit will be 1.1.
This attribute cannot be assigned to; however, the `x` and `y` lists can be modified in place as needed.
#### Examples
```
>>> artist.sticky_edges.x[:] = (xmin, xmax)
>>> artist.sticky_edges.y[:] = (ymin, ymax)
```
to\_rgba(*x*, *alpha=None*, *bytes=False*, *norm=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L414-L482)
Return a normalized rgba array corresponding to *x*.
In the normal case, *x* is a 1D or 2D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If *x* is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the *alpha* kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the *alpha* kwarg is ignored; it does not replace the preexisting alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if *bytes* is *False* (default), the rgba array will be floats in the 0-1 range; if it is *True*, the returned rgba array will be uint8 in the 0 to 255 range.
If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1).
update(*props*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1168-L1177)
Update this artist's properties from the dict *props*.
Parameters:
**props**dict
update\_from(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L907-L929)
Copy properties from other to self.
update\_scalarmappable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L865-L901)
Update colors from the scalar mappable array, if any.
Assign colors to edges and faces based on the array and/or colors that were directly set, as appropriate.
zorder*=0*
*class*matplotlib.collections.StarPolygonCollection(*numsides*, *\**, *rotation=0*, *sizes=(1,)*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1342-L1344)
Bases: [`RegularPolyCollection`](#matplotlib.collections.RegularPolyCollection "matplotlib.collections.RegularPolyCollection")
Draw a collection of regular stars with *numsides* points.
Parameters:
**numsides**int
The number of sides of the polygon.
**rotation**float
The rotation of the polygon in radians.
**sizes**tuple of float
The area of the circle circumscribing the polygon in points^2.
**\*\*kwargs**
Forwarded to [`Collection`](#matplotlib.collections.Collection "matplotlib.collections.Collection").
#### Examples
See [Lasso Demo](https://matplotlib.org/stable/gallery/event_handling/lasso_demo.html) for a complete example:
```
offsets = np.random.rand(20, 2)
facecolors = [cm.jet(x) for x in np.random.rand(20)]
collection = RegularPolyCollection(
numsides=5, # a pentagon
rotation=0, sizes=(50,),
facecolors=facecolors,
edgecolors=("black",),
linewidths=(1,),
offsets=offsets,
offset_transform=ax.transData,
)
```
add\_callback(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L348-L375)
Add a callback function that will be called whenever one of the [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")'s properties changes.
Parameters:
**func**callable
The callback function. It must have the signature:
```
def func(artist: Artist) -> Any
```
where *artist* is the calling [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"). Return values may exist but are ignored.
Returns:
int
The observer id associated with the callback. This id can be used for removing the callback with [`remove_callback`](#matplotlib.collections.StarPolygonCollection.remove_callback "matplotlib.collections.StarPolygonCollection.remove_callback") later.
See also
[`remove_callback`](#matplotlib.collections.StarPolygonCollection.remove_callback "matplotlib.collections.StarPolygonCollection.remove_callback")
autoscale()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L625-L634)
Autoscale the scalar limits on the norm instance using the current array
autoscale\_None()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L636-L645)
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
*property*axes
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance the artist resides in, or *None*.
*property*callbacksSM[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
changed()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L647-L653)
Call this whenever the mappable is changed to notify all the callbackSM listeners to the 'changed' signal.
colorbar
The last colorbar associated with this ScalarMappable. May be None.
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L437-L472)
Test whether the mouse event occurred in the collection.
Returns `bool, dict(ind=itemlist)`, where every item in itemlist contains the event.
convert\_xunits(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L241-L251)
Convert *x* using the unit type of the xaxis.
If the artist is not contained in an Axes or if the xaxis does not have units, *x* itself is returned.
convert\_yunits(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L253-L263)
Convert *y* using the unit type of the yaxis.
If the artist is not contained in an Axes or if the yaxis does not have units, *y* itself is returned.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1330-L1339)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
findobj(*match=None*, *include\_self=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1208-L1249)
Find artist objects.
Recursively find all [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") instances contained in the artist.
Parameters:
**match**
A filter criterion for the matches. This can be
* *None*: Return all objects contained in artist.
* A function with signature `def match(artist: Artist) -> bool`. The result will only contain artists for which the function returns *True*.
* A class instance: e.g., [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"). The result will only contain artists of this class or its subclasses (`isinstance` check).
**include\_self**bool
Include *self* in the list to be checked for a match.
Returns:
list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
format\_cursor\_data(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1282-L1336)
Return a string representation of *data*.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
The default implementation converts ints and floats and arrays of ints and floats into a comma-separated string enclosed in square brackets, unless the artist has an associated colorbar, in which case scalar values are formatted using the colorbar's formatter.
See also
[`get_cursor_data`](#matplotlib.collections.StarPolygonCollection.get_cursor_data "matplotlib.collections.StarPolygonCollection.get_cursor_data")
get\_agg\_filter()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L929-L931)
Return filter function to be used for agg filter.
get\_alpha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L805-L810)
Return the alpha value used for blending - not supported on all backends.
get\_animated()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L816-L818)
Return whether the artist is animated.
get\_array()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L507-L514)
Return the array of values, that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the array.
get\_capstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L641-L642)
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L430-L432)
Return a list of the child [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s of this [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist").
get\_clim()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L520-L524)
Return the values (min, max) that are mapped to the colormap limits.
get\_clip\_box()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L859-L861)
Return the clipbox.
get\_clip\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L855-L857)
Return whether the artist uses clipping.
get\_clip\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L863-L865)
Return the clip path.
get\_cmap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L516-L518)
Return the [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") instance.
get\_cursor\_data(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1251-L1280)
Return the cursor data for a given event.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
Cursor data can be used by Artists to provide additional context information for a given event. The default implementation just returns *None*.
Subclasses can override the method and return arbitrary data. However, when doing so, they must ensure that [`format_cursor_data`](#matplotlib.collections.StarPolygonCollection.format_cursor_data "matplotlib.collections.StarPolygonCollection.format_cursor_data") can convert the data to a string representation.
The only current use case is displaying the z-value of an [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") in the status bar of a plot window, while moving the mouse.
Parameters:
**event**[`matplotlib.backend_bases.MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
See also
[`format_cursor_data`](#matplotlib.collections.StarPolygonCollection.format_cursor_data "matplotlib.collections.StarPolygonCollection.format_cursor_data")
get\_dashes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.StarPolygonCollection.get_linestyle "matplotlib.collections.StarPolygonCollection.get_linestyle").
get\_datalim(*transData*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L235-L301)
get\_ec()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.StarPolygonCollection.get_edgecolor "matplotlib.collections.StarPolygonCollection.get_edgecolor").
get\_edgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
get\_edgecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.StarPolygonCollection.get_edgecolor "matplotlib.collections.StarPolygonCollection.get_edgecolor").
get\_facecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
get\_facecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.StarPolygonCollection.get_facecolor "matplotlib.collections.StarPolygonCollection.get_facecolor").
get\_fc()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.StarPolygonCollection.get_facecolor "matplotlib.collections.StarPolygonCollection.get_facecolor").
get\_figure()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L703-L705)
Return the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
get\_fill()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L903-L905)
Return whether face is colored.
get\_gid()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L588-L590)
Return the group id.
get\_hatch()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L534-L536)
Return the current hatching pattern.
get\_in\_layout()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L820-L829)
Return boolean flag, `True` if artist is included in layout calculations.
E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
get\_joinstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L655-L656)
get\_label()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1056-L1058)
Return the label used for this artist in the legend.
get\_linestyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
get\_linestyles()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.StarPolygonCollection.get_linestyle "matplotlib.collections.StarPolygonCollection.get_linestyle").
get\_linewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
get\_linewidths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.StarPolygonCollection.get_linewidth "matplotlib.collections.StarPolygonCollection.get_linewidth").
get\_ls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.StarPolygonCollection.get_linestyle "matplotlib.collections.StarPolygonCollection.get_linestyle").
get\_lw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.StarPolygonCollection.get_linewidth "matplotlib.collections.StarPolygonCollection.get_linewidth").
get\_mouseover()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1338-L1343)
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
get\_numsides()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1324-L1325)
get\_offset\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist offset.
get\_offsets()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L554-L557)
Return the offsets for the collection.
get\_path\_effects()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L700-L701)
get\_paths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L205-L206)
get\_picker()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L562-L572)
Return the picking behavior of the artist.
The possible values are described in [`set_picker`](#matplotlib.collections.StarPolygonCollection.set_picker "matplotlib.collections.StarPolygonCollection.set_picker").
See also
[`set_picker`](#matplotlib.collections.StarPolygonCollection.set_picker "matplotlib.collections.StarPolygonCollection.set_picker"), [`pickable`](#matplotlib.collections.StarPolygonCollection.pickable "matplotlib.collections.StarPolygonCollection.pickable"), [`pick`](#matplotlib.collections.StarPolygonCollection.pick "matplotlib.collections.StarPolygonCollection.pick")
get\_pickradius()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L434-L435)
get\_rasterized()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L904-L906)
Return whether the artist is to be rasterized.
get\_rotation()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1327-L1328)
get\_sizes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L938-L947)
Return the sizes ('areas') of the elements in the collection.
Returns:
array
The 'area' of each element.
get\_sketch\_params()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L641-L659)
Return the sketch parameters for the artist.
Returns:
tuple or None
A 3-tuple with the following elements:
* *scale*: The amplitude of the wiggle perpendicular to the source line.
* *length*: The length of the wiggle along the line.
* *randomness*: The scale factor by which the length is shrunken or expanded.
Returns *None* if no sketch parameters were set.
get\_snap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L602-L611)
Return the snap setting.
See [`set_snap`](#matplotlib.collections.StarPolygonCollection.set_snap "matplotlib.collections.StarPolygonCollection.set_snap") for details.
get\_tightbbox(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L322-L346)
Like [`Artist.get_window_extent`](_as_gen/matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent"), but includes any clipping.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
Returns:
[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The enclosing bounding box (in figure pixel coordinates).
get\_transOffset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Alias for [`get_offset_transform`](#matplotlib.collections.StarPolygonCollection.get_offset_transform "matplotlib.collections.StarPolygonCollection.get_offset_transform").
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L421-L428)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist.
get\_transformed\_clip\_path\_and\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L867-L875)
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
get\_transforms()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L211-L212)
get\_url()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L574-L576)
Return the url.
get\_urls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L488-L495)
Return a list of URLs, one for each element of the collection.
The list contains *None* for elements without a URL. See [Hyperlinks](https://matplotlib.org/stable/gallery/misc/hyperlinks_sgskip.html) for an example.
get\_visible()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L812-L814)
Return the visibility.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L303-L306)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
get\_zorder()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1076-L1078)
Return the artist's zorder.
have\_units()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L236-L239)
Return whether units are set on any axis.
is\_transform\_set()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L400-L406)
Return whether the Artist has an explicitly set transform.
This is *True* after [`set_transform`](#matplotlib.collections.StarPolygonCollection.set_transform "matplotlib.collections.StarPolygonCollection.set_transform") has been called.
*property*mouseover
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
*property*norm
pchanged()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L387-L398)
Call all of the registered callbacks.
This function is triggered internally when a property is changed.
See also
[`add_callback`](#matplotlib.collections.StarPolygonCollection.add_callback "matplotlib.collections.StarPolygonCollection.add_callback")
[`remove_callback`](#matplotlib.collections.StarPolygonCollection.remove_callback "matplotlib.collections.StarPolygonCollection.remove_callback")
pick(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L490-L525)
Process a pick event.
Each child artist will fire a pick event if *mouseevent* is over the artist and the artist has picker set.
See also
[`set_picker`](#matplotlib.collections.StarPolygonCollection.set_picker "matplotlib.collections.StarPolygonCollection.set_picker"), [`get_picker`](#matplotlib.collections.StarPolygonCollection.get_picker "matplotlib.collections.StarPolygonCollection.get_picker"), [`pickable`](#matplotlib.collections.StarPolygonCollection.pickable "matplotlib.collections.StarPolygonCollection.pickable")
pickable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L480-L488)
Return whether the artist is pickable.
See also
[`set_picker`](#matplotlib.collections.StarPolygonCollection.set_picker "matplotlib.collections.StarPolygonCollection.set_picker"), [`get_picker`](#matplotlib.collections.StarPolygonCollection.get_picker "matplotlib.collections.StarPolygonCollection.get_picker"), [`pick`](#matplotlib.collections.StarPolygonCollection.pick "matplotlib.collections.StarPolygonCollection.pick")
properties()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1139-L1141)
Return a dictionary of all the properties of the artist.
remove()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L193-L234)
Remove the artist from the figure if possible.
The effect will not be visible until the figure is redrawn, e.g., with [`FigureCanvasBase.draw_idle`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase.draw_idle "matplotlib.backend_bases.FigureCanvasBase.draw_idle"). Call [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") to update the axes limits if desired.
Note: [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") will not see collections even if the collection was added to the axes with *autolim* = True.
Note: there is no support for removing the artist's legend entry.
remove\_callback(*oid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L377-L385)
Remove a callback based on its observer id.
See also
[`add_callback`](#matplotlib.collections.StarPolygonCollection.add_callback "matplotlib.collections.StarPolygonCollection.add_callback")
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *array=<UNSET>*, *capstyle=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *offset\_transform=<UNSET>*, *offsets=<UNSET>*, *path\_effects=<UNSET>*, *paths=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *sizes=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *urls=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`paths`](#matplotlib.collections.Collection.set_paths "matplotlib.collections.Collection.set_paths") | unknown |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `sizes` | ndarray or None |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_aa(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.StarPolygonCollection.set_antialiased "matplotlib.collections.StarPolygonCollection.set_antialiased").
set\_agg\_filter(*filter\_func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L933-L949)
Set the agg filter.
Parameters:
**filter\_func**callable
A filter function, which takes a (m, n, depth) float array and a dpi value, and returns a (m, n, depth) array and two offsets from the bottom left corner of the image
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L807-L821)
Set the alpha value used for blending - not supported on all backends.
Parameters:
**alpha**array-like or scalar or None
All values must be within the 0-1 range, inclusive. Masked values and nans are not supported.
set\_animated(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1023-L1041)
Set whether the artist is intended to be used in an animation.
If True, the artist is excluded from regular drawing of the figure. You have to call [`Figure.draw_artist`](figure_api#matplotlib.figure.Figure.draw_artist "matplotlib.figure.Figure.draw_artist") / [`Axes.draw_artist`](_as_gen/matplotlib.axes.axes.draw_artist#matplotlib.axes.Axes.draw_artist "matplotlib.axes.Axes.draw_artist") explicitly on the artist. This approach is used to speed up animations using blitting.
See also [`matplotlib.animation`](animation_api#module-matplotlib.animation "matplotlib.animation") and [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html).
Parameters:
**b**bool
set\_antialiased(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Set the antialiasing state for rendering.
Parameters:
**aa**bool or list of bools
set\_antialiaseds(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.StarPolygonCollection.set_antialiased "matplotlib.collections.StarPolygonCollection.set_antialiased").
set\_array(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L484-L505)
Set the value array from array-like *A*.
Parameters:
**A**array-like or None
The values that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the value array *A*.
set\_capstyle(*cs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L630-L639)
Set the [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") for the collection (for all its elements).
Parameters:
**cs**[`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'}
set\_clim(*vmin=None*, *vmax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L526-L550)
Set the norm limits for image scaling.
Parameters:
**vmin, vmax**float
The limits.
The limits may also be passed as a tuple (*vmin*, *vmax*) as a single positional argument.
set\_clip\_box(*clipbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L731-L741)
Set the artist's clip [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
Parameters:
**clipbox**[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
set\_clip\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L877-L892)
Set whether the artist uses clipping.
When False artists will be visible outside of the Axes which can lead to unexpected results.
Parameters:
**b**bool
set\_clip\_path(*path*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L743-L803)
Set the artist's clip path.
Parameters:
**path**[`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") or [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") or [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") or None
The clip path. If given a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), *transform* must be provided as well. If *None*, a previously set clip path is removed.
**transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
Only used if *path* is a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), in which case the given [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") is converted to a [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") using *transform*.
#### Notes
For efficiency, if *path* is a [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") this method will set the clipping box to the corresponding rectangle and set the clipping path to `None`.
For technical reasons (support of [`set`](_as_gen/matplotlib.artist.artist.set#matplotlib.artist.Artist.set "matplotlib.artist.Artist.set")), a tuple (*path*, *transform*) is also accepted as a single positional parameter.
set\_cmap(*cmap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L562-L574)
Set the colormap for luminance data.
Parameters:
**cmap**[`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None
set\_color(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L713-L727)
Set both the edgecolor and the facecolor.
Parameters:
**c**color or list of rgba tuples
See also
[`Collection.set_facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor"), [`Collection.set_edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor")
For setting the edge or face color individually.
set\_dashes(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.StarPolygonCollection.set_linestyle "matplotlib.collections.StarPolygonCollection.set_linestyle").
set\_ec(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.StarPolygonCollection.set_edgecolor "matplotlib.collections.StarPolygonCollection.set_edgecolor").
set\_edgecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Set the edgecolor(s) of the collection.
Parameters:
**c**color or list of colors or 'face'
The collection edgecolor(s). If a sequence, the patches cycle through it. If 'face', match the facecolor.
set\_edgecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.StarPolygonCollection.set_edgecolor "matplotlib.collections.StarPolygonCollection.set_edgecolor").
set\_facecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Set the facecolor(s) of the collection. *c* can be a color (all patches have same color), or a sequence of colors; if it is a sequence the patches will cycle through the sequence.
If *c* is 'none', the patch will not be filled.
Parameters:
**c**color or list of colors
set\_facecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.StarPolygonCollection.set_facecolor "matplotlib.collections.StarPolygonCollection.set_facecolor").
set\_fc(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.StarPolygonCollection.set_facecolor "matplotlib.collections.StarPolygonCollection.set_facecolor").
set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L707-L729)
Set the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
set\_gid(*gid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L592-L600)
Set the (group) id for the artist.
Parameters:
**gid**str
set\_hatch(*hatch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L497-L532)
Set the hatching pattern
*hatch* can be one of:
```
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
```
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
Parameters:
**hatch**{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'}
set\_in\_layout(*in\_layout*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1043-L1054)
Set if artist is to be included in layout calculations, E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
Parameters:
**in\_layout**bool
set\_joinstyle(*js*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L644-L653)
Set the [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") for the collection (for all its elements).
Parameters:
**js**[`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'}
set\_label(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1060-L1074)
Set a label that will be displayed in the legend.
Parameters:
**s**object
*s* will be converted to a string by calling [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)").
set\_linestyle(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Set the linestyle(s) for the collection.
| linestyle | description |
| --- | --- |
| `'-'` or `'solid'` | solid line |
| `'--'` or `'dashed'` | dashed line |
| `'-.'` or `'dashdot'` | dash-dotted line |
| `':'` or `'dotted'` | dotted line |
Alternatively a dash tuple of the following form can be provided:
```
(offset, onoffseq),
```
where `onoffseq` is an even length tuple of on and off ink in points.
Parameters:
**ls**str or tuple or list thereof
Valid values for individual linestyles include {'-', '--', '-.', ':', '', (offset, on-off-seq)}. See [`Line2D.set_linestyle`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") for a complete description.
set\_linestyles(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.StarPolygonCollection.set_linestyle "matplotlib.collections.StarPolygonCollection.set_linestyle").
set\_linewidth(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Set the linewidth(s) for the collection. *lw* can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence
Parameters:
**lw**float or list of floats
set\_linewidths(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.StarPolygonCollection.set_linewidth "matplotlib.collections.StarPolygonCollection.set_linewidth").
set\_ls(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.StarPolygonCollection.set_linestyle "matplotlib.collections.StarPolygonCollection.set_linestyle").
set\_lw(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.StarPolygonCollection.set_linewidth "matplotlib.collections.StarPolygonCollection.set_linewidth").
set\_mouseover(*mouseover*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1345-L1366)
Set whether this artist is queried for custom context information when the mouse cursor moves over it.
Parameters:
**mouseover**bool
See also
[`get_cursor_data`](#matplotlib.collections.StarPolygonCollection.get_cursor_data "matplotlib.collections.StarPolygonCollection.get_cursor_data")
[`ToolCursorPosition`](backend_tools_api#matplotlib.backend_tools.ToolCursorPosition "matplotlib.backend_tools.ToolCursorPosition")
[`NavigationToolbar2`](backend_bases_api#matplotlib.backend_bases.NavigationToolbar2 "matplotlib.backend_bases.NavigationToolbar2")
set\_norm(*norm*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L609-L623)
Set the normalization instance.
Parameters:
**norm**[`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None
#### Notes
If there are any colorbars using the mappable for this norm, setting the norm of the mappable will reset the norm, locator, and formatters on the colorbar to default.
set\_offset\_transform(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Set the artist offset transform.
Parameters:
**offset\_transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_offsets(*offsets*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L538-L552)
Set the offsets for the collection.
Parameters:
**offsets**(N, 2) or (2,) array-like
set\_path\_effects(*path\_effects*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L689-L698)
Set the path effects.
Parameters:
**path\_effects**[`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
set\_paths(*paths*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L208-L209)
set\_picker(*picker*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L527-L560)
Define the picking behavior of the artist.
Parameters:
**picker**None or bool or float or callable
This can be one of the following:
* *None*: Picking is disabled for this artist (default).
* A boolean: If *True* then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist.
* A float: If picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if its data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event
* A function: If picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event:
```
hit, props = picker(artist, mouseevent)
```
to determine the hit test. if the mouse event is over the artist, return *hit=True* and props is a dictionary of properties you want added to the PickEvent attributes.
set\_pickradius(*pickradius*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L422-L432)
Set the pick radius used for containment tests.
Parameters:
**pickradius**float
Pick radius, in points.
set\_rasterized(*rasterized*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L908-L927)
Force rasterized (bitmap) drawing for vector graphics output.
Rasterized drawing is not supported by all artists. If you try to enable this on an artist that does not support it, the command has no effect and a warning will be issued.
This setting is ignored for pixel-based output.
See also [Rasterization for vector graphics](https://matplotlib.org/stable/gallery/misc/rasterization_demo.html).
Parameters:
**rasterized**bool
set\_sizes(*sizes*, *dpi=72.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L949-L971)
Set the sizes of each member of the collection.
Parameters:
**sizes**ndarray or None
The size to set for each element of the collection. The value is the 'area' of the element.
**dpi**float, default: 72
The dpi of the canvas.
set\_sketch\_params(*scale=None*, *length=None*, *randomness=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L661-L687)
Set the sketch parameters.
Parameters:
**scale**float, optional
The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), or not provided, no sketch filter will be provided.
**length**float, optional
The length of the wiggle along the line, in pixels (default 128.0)
**randomness**float, optional
The scale factor by which the length is shrunken or expanded (default 16.0)
The PGF backend uses this argument as an RNG seed and not as described above. Using the same seed yields the same random shape.
set\_snap(*snap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L613-L639)
Set the snapping behavior.
Snapping aligns positions with the pixel grid, which results in clearer images. For example, if a black line of 1px width was defined at a position in between two pixels, the resulting image would contain the interpolated value of that line in the pixel grid, which would be a grey value on both adjacent pixel positions. In contrast, snapping will move the line to the nearest integer pixel value, so that the resulting image will really contain a 1px wide black line.
Snapping is currently only supported by the Agg and MacOSX backends.
Parameters:
**snap**bool or None
Possible values:
* *True*: Snap vertices to the nearest pixel center.
* *False*: Do not modify vertex positions.
* *None*: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center.
set\_transOffset(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Alias for [`set_offset_transform`](#matplotlib.collections.StarPolygonCollection.set_offset_transform "matplotlib.collections.StarPolygonCollection.set_offset_transform").
set\_transform(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L408-L419)
Set the artist transform.
Parameters:
**t**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_url(*url*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L578-L586)
Set the url for the artist.
Parameters:
**url**str
set\_urls(*urls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L474-L486)
Parameters:
**urls**list of str or None
#### Notes
URLs are currently only implemented by the SVG backend. They are ignored by all other backends.
set\_visible(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1011-L1021)
Set the artist's visibility.
Parameters:
**b**bool
set\_zorder(*level*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1080-L1093)
Set the zorder for the artist. Artists with lower zorder values are drawn first.
Parameters:
**level**float
*property*stale
Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist.
*property*sticky\_edges
`x` and `y` sticky edge lists for autoscaling.
When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added--the view limit "sticks" to the edge. A typical use case is histograms, where one usually expects no margin on the bottom edge (0) of the histogram.
Moreover, margin expansion "bumps" against sticky edges and cannot cross them. For example, if the upper data limit is 1.0, the upper view limit computed by simple margin application is 1.2, but there is a sticky edge at 1.1, then the actual upper view limit will be 1.1.
This attribute cannot be assigned to; however, the `x` and `y` lists can be modified in place as needed.
#### Examples
```
>>> artist.sticky_edges.x[:] = (xmin, xmax)
>>> artist.sticky_edges.y[:] = (ymin, ymax)
```
to\_rgba(*x*, *alpha=None*, *bytes=False*, *norm=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L414-L482)
Return a normalized rgba array corresponding to *x*.
In the normal case, *x* is a 1D or 2D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If *x* is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the *alpha* kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the *alpha* kwarg is ignored; it does not replace the preexisting alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if *bytes* is *False* (default), the rgba array will be floats in the 0-1 range; if it is *True*, the returned rgba array will be uint8 in the 0 to 255 range.
If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1).
update(*props*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1168-L1177)
Update this artist's properties from the dict *props*.
Parameters:
**props**dict
update\_from(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L907-L929)
Copy properties from other to self.
update\_scalarmappable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L865-L901)
Update colors from the scalar mappable array, if any.
Assign colors to edges and faces based on the array and/or colors that were directly set, as appropriate.
zorder*=0*
*class*matplotlib.collections.TriMesh(*triangulation*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1831-L1891)
Bases: [`Collection`](#matplotlib.collections.Collection "matplotlib.collections.Collection")
Class for the efficient drawing of a triangular mesh using Gouraud shading.
A triangular mesh is a [`Triangulation`](tri_api#matplotlib.tri.Triangulation "matplotlib.tri.Triangulation") object.
Parameters:
**edgecolors**color or list of colors, default: `[rcParams["patch.edgecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.edgecolor#matplotlibrc-sample)` (default: `'black'`)
Edge color for each patch making up the collection. The special value 'face' can be passed to make the edgecolor match the facecolor.
**facecolors**color or list of colors, default: `[rcParams["patch.facecolor"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.facecolor#matplotlibrc-sample)` (default: `'C0'`)
Face color for each patch making up the collection.
**linewidths**float or list of floats, default: `[rcParams["patch.linewidth"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.linewidth#matplotlibrc-sample)` (default: `1.0`)
Line width for each patch making up the collection.
**linestyles**str or tuple or list thereof, default: 'solid'
Valid strings are ['solid', 'dashed', 'dashdot', 'dotted', '-', '--', '-.', ':']. Dash tuples should be of the form:
```
(offset, onoffseq),
```
where *onoffseq* is an even length tuple of on and off ink lengths in points. For examples, see [Linestyles](https://matplotlib.org/stable/gallery/lines_bars_and_markers/linestyles.html).
**capstyle**[`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle")-like, default: `[rcParams["patch.capstyle"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.capstyle#matplotlibrc-sample)`
Style to use for capping lines for all paths in the collection. Allowed values are {'butt', 'projecting', 'round'}.
**joinstyle**[`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle")-like, default: `[rcParams["patch.joinstyle"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.joinstyle#matplotlibrc-sample)`
Style to use for joining lines for all paths in the collection. Allowed values are {'miter', 'round', 'bevel'}.
**antialiaseds**bool or list of bool, default: `[rcParams["patch.antialiased"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=patch.antialiased#matplotlibrc-sample)` (default: `True`)
Whether each patch in the collection should be drawn with antialiasing.
**offsets**(float, float) or list thereof, default: (0, 0)
A vector by which to translate each patch after rendering (default is no translation). The translation is performed in screen (pixel) coordinates (i.e. after the Artist's transform is applied).
**offset\_transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), default: [`IdentityTransform`](transformations#matplotlib.transforms.IdentityTransform "matplotlib.transforms.IdentityTransform")
A single transform which will be applied to each *offsets* vector before it is used.
**cmap, norm**
Data normalization and colormapping parameters. See [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") for a detailed description.
**hatch**str, optional
Hatching pattern to use in filled paths, if any. Valid strings are ['/', '', '|', '-', '+', 'x', 'o', 'O', '.', '\*']. See [Hatch style reference](https://matplotlib.org/stable/gallery/shapes_and_collections/hatch_style_reference.html) for the meaning of each hatch type.
**pickradius**float, default: 5.0
If `pickradius <= 0`, then [`Collection.contains`](#matplotlib.collections.Collection.contains "matplotlib.collections.Collection.contains") will return `True` whenever the test point is inside of one of the polygons formed by the control points of a Path in the Collection. On the other hand, if it is greater than 0, then we instead check if the test point is contained in a stroke of width `2*pickradius` following any of the Paths in the Collection.
**urls**list of str, default: None
A URL for each patch to link to once drawn. Currently only works for the SVG backend. See [Hyperlinks](https://matplotlib.org/stable/gallery/misc/hyperlinks_sgskip.html) for examples.
**zorder**float, default: 1
The drawing order, shared by all Patches in the Collection. See [Zorder Demo](https://matplotlib.org/stable/gallery/misc/zorder_demo.html) for all defaults and examples.
add\_callback(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L348-L375)
Add a callback function that will be called whenever one of the [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")'s properties changes.
Parameters:
**func**callable
The callback function. It must have the signature:
```
def func(artist: Artist) -> Any
```
where *artist* is the calling [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"). Return values may exist but are ignored.
Returns:
int
The observer id associated with the callback. This id can be used for removing the callback with [`remove_callback`](#matplotlib.collections.TriMesh.remove_callback "matplotlib.collections.TriMesh.remove_callback") later.
See also
[`remove_callback`](#matplotlib.collections.TriMesh.remove_callback "matplotlib.collections.TriMesh.remove_callback")
autoscale()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L625-L634)
Autoscale the scalar limits on the norm instance using the current array
autoscale\_None()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L636-L645)
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
*property*axes
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance the artist resides in, or *None*.
*property*callbacksSM[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
changed()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L647-L653)
Call this whenever the mappable is changed to notify all the callbackSM listeners to the 'changed' signal.
colorbar
The last colorbar associated with this ScalarMappable. May be None.
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L437-L472)
Test whether the mouse event occurred in the collection.
Returns `bool, dict(ind=itemlist)`, where every item in itemlist contains the event.
*static*convert\_mesh\_to\_paths(*tri*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1858-L1868)
Convert a given mesh into a sequence of [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") objects.
This function is primarily of use to implementers of backends that do not directly support meshes.
convert\_xunits(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L241-L251)
Convert *x* using the unit type of the xaxis.
If the artist is not contained in an Axes or if the xaxis does not have units, *x* itself is returned.
convert\_yunits(*y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L253-L263)
Convert *y* using the unit type of the yaxis.
If the artist is not contained in an Axes or if the yaxis does not have units, *y* itself is returned.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1870-L1891)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
findobj(*match=None*, *include\_self=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1208-L1249)
Find artist objects.
Recursively find all [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") instances contained in the artist.
Parameters:
**match**
A filter criterion for the matches. This can be
* *None*: Return all objects contained in artist.
* A function with signature `def match(artist: Artist) -> bool`. The result will only contain artists for which the function returns *True*.
* A class instance: e.g., [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"). The result will only contain artists of this class or its subclasses (`isinstance` check).
**include\_self**bool
Include *self* in the list to be checked for a match.
Returns:
list of [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
format\_cursor\_data(*data*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1282-L1336)
Return a string representation of *data*.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
The default implementation converts ints and floats and arrays of ints and floats into a comma-separated string enclosed in square brackets, unless the artist has an associated colorbar, in which case scalar values are formatted using the colorbar's formatter.
See also
[`get_cursor_data`](#matplotlib.collections.TriMesh.get_cursor_data "matplotlib.collections.TriMesh.get_cursor_data")
get\_agg\_filter()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L929-L931)
Return filter function to be used for agg filter.
get\_alpha()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L805-L810)
Return the alpha value used for blending - not supported on all backends.
get\_animated()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L816-L818)
Return whether the artist is animated.
get\_array()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L507-L514)
Return the array of values, that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the array.
get\_capstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L641-L642)
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L430-L432)
Return a list of the child [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s of this [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist").
get\_clim()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L520-L524)
Return the values (min, max) that are mapped to the colormap limits.
get\_clip\_box()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L859-L861)
Return the clipbox.
get\_clip\_on()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L855-L857)
Return whether the artist uses clipping.
get\_clip\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L863-L865)
Return the clip path.
get\_cmap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L516-L518)
Return the [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") instance.
get\_cursor\_data(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1251-L1280)
Return the cursor data for a given event.
Note
This method is intended to be overridden by artist subclasses. As an end-user of Matplotlib you will most likely not call this method yourself.
Cursor data can be used by Artists to provide additional context information for a given event. The default implementation just returns *None*.
Subclasses can override the method and return arbitrary data. However, when doing so, they must ensure that [`format_cursor_data`](#matplotlib.collections.TriMesh.format_cursor_data "matplotlib.collections.TriMesh.format_cursor_data") can convert the data to a string representation.
The only current use case is displaying the z-value of an [`AxesImage`](image_api#matplotlib.image.AxesImage "matplotlib.image.AxesImage") in the status bar of a plot window, while moving the mouse.
Parameters:
**event**[`matplotlib.backend_bases.MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
See also
[`format_cursor_data`](#matplotlib.collections.TriMesh.format_cursor_data "matplotlib.collections.TriMesh.format_cursor_data")
get\_dashes()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.TriMesh.get_linestyle "matplotlib.collections.TriMesh.get_linestyle").
get\_datalim(*transData*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L235-L301)
get\_ec()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.TriMesh.get_edgecolor "matplotlib.collections.TriMesh.get_edgecolor").
get\_edgecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
get\_edgecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L760-L764)
Alias for [`get_edgecolor`](#matplotlib.collections.TriMesh.get_edgecolor "matplotlib.collections.TriMesh.get_edgecolor").
get\_facecolor()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
get\_facecolors()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.TriMesh.get_facecolor "matplotlib.collections.TriMesh.get_facecolor").
get\_fc()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L757-L758)
Alias for [`get_facecolor`](#matplotlib.collections.TriMesh.get_facecolor "matplotlib.collections.TriMesh.get_facecolor").
get\_figure()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L703-L705)
Return the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
get\_fill()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L903-L905)
Return whether face is colored.
get\_gid()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L588-L590)
Return the group id.
get\_hatch()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L534-L536)
Return the current hatching pattern.
get\_in\_layout()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L820-L829)
Return boolean flag, `True` if artist is included in layout calculations.
E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
get\_joinstyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L655-L656)
get\_label()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1056-L1058)
Return the label used for this artist in the legend.
get\_linestyle()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
get\_linestyles()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.TriMesh.get_linestyle "matplotlib.collections.TriMesh.get_linestyle").
get\_linewidth()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
get\_linewidths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.TriMesh.get_linewidth "matplotlib.collections.TriMesh.get_linewidth").
get\_ls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L828-L829)
Alias for [`get_linestyle`](#matplotlib.collections.TriMesh.get_linestyle "matplotlib.collections.TriMesh.get_linestyle").
get\_lw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L825-L826)
Alias for [`get_linewidth`](#matplotlib.collections.TriMesh.get_linewidth "matplotlib.collections.TriMesh.get_linewidth").
get\_mouseover()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1338-L1343)
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
get\_offset\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist offset.
get\_offsets()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L554-L557)
Return the offsets for the collection.
get\_path\_effects()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L700-L701)
get\_paths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1850-L1853)
get\_picker()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L562-L572)
Return the picking behavior of the artist.
The possible values are described in [`set_picker`](#matplotlib.collections.TriMesh.set_picker "matplotlib.collections.TriMesh.set_picker").
See also
[`set_picker`](#matplotlib.collections.TriMesh.set_picker "matplotlib.collections.TriMesh.set_picker"), [`pickable`](#matplotlib.collections.TriMesh.pickable "matplotlib.collections.TriMesh.pickable"), [`pick`](#matplotlib.collections.TriMesh.pick "matplotlib.collections.TriMesh.pick")
get\_pickradius()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L434-L435)
get\_rasterized()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L904-L906)
Return whether the artist is to be rasterized.
get\_sketch\_params()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L641-L659)
Return the sketch parameters for the artist.
Returns:
tuple or None
A 3-tuple with the following elements:
* *scale*: The amplitude of the wiggle perpendicular to the source line.
* *length*: The length of the wiggle along the line.
* *randomness*: The scale factor by which the length is shrunken or expanded.
Returns *None* if no sketch parameters were set.
get\_snap()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L602-L611)
Return the snap setting.
See [`set_snap`](#matplotlib.collections.TriMesh.set_snap "matplotlib.collections.TriMesh.set_snap") for details.
get\_tightbbox(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L322-L346)
Like [`Artist.get_window_extent`](_as_gen/matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent"), but includes any clipping.
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass
renderer that will be used to draw the figures (i.e. `fig.canvas.get_renderer()`)
Returns:
[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
The enclosing bounding box (in figure pixel coordinates).
get\_transOffset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L214-L222)
Alias for [`get_offset_transform`](#matplotlib.collections.TriMesh.get_offset_transform "matplotlib.collections.TriMesh.get_offset_transform").
get\_transform()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L421-L428)
Return the [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") instance used by this artist.
get\_transformed\_clip\_path\_and\_affine()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L867-L875)
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
get\_transforms()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L211-L212)
get\_url()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L574-L576)
Return the url.
get\_urls()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L488-L495)
Return a list of URLs, one for each element of the collection.
The list contains *None* for elements without a URL. See [Hyperlinks](https://matplotlib.org/stable/gallery/misc/hyperlinks_sgskip.html) for an example.
get\_visible()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L812-L814)
Return the visibility.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L303-L306)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
get\_zorder()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1076-L1078)
Return the artist's zorder.
have\_units()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L236-L239)
Return whether units are set on any axis.
is\_transform\_set()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L400-L406)
Return whether the Artist has an explicitly set transform.
This is *True* after [`set_transform`](#matplotlib.collections.TriMesh.set_transform "matplotlib.collections.TriMesh.set_transform") has been called.
*property*mouseover
Return whether this artist is queried for custom context information when the mouse cursor moves over it.
*property*norm
pchanged()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L387-L398)
Call all of the registered callbacks.
This function is triggered internally when a property is changed.
See also
[`add_callback`](#matplotlib.collections.TriMesh.add_callback "matplotlib.collections.TriMesh.add_callback")
[`remove_callback`](#matplotlib.collections.TriMesh.remove_callback "matplotlib.collections.TriMesh.remove_callback")
pick(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L490-L525)
Process a pick event.
Each child artist will fire a pick event if *mouseevent* is over the artist and the artist has picker set.
See also
[`set_picker`](#matplotlib.collections.TriMesh.set_picker "matplotlib.collections.TriMesh.set_picker"), [`get_picker`](#matplotlib.collections.TriMesh.get_picker "matplotlib.collections.TriMesh.get_picker"), [`pickable`](#matplotlib.collections.TriMesh.pickable "matplotlib.collections.TriMesh.pickable")
pickable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L480-L488)
Return whether the artist is pickable.
See also
[`set_picker`](#matplotlib.collections.TriMesh.set_picker "matplotlib.collections.TriMesh.set_picker"), [`get_picker`](#matplotlib.collections.TriMesh.get_picker "matplotlib.collections.TriMesh.get_picker"), [`pick`](#matplotlib.collections.TriMesh.pick "matplotlib.collections.TriMesh.pick")
properties()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1139-L1141)
Return a dictionary of all the properties of the artist.
remove()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L193-L234)
Remove the artist from the figure if possible.
The effect will not be visible until the figure is redrawn, e.g., with [`FigureCanvasBase.draw_idle`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase.draw_idle "matplotlib.backend_bases.FigureCanvasBase.draw_idle"). Call [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") to update the axes limits if desired.
Note: [`relim`](_as_gen/matplotlib.axes.axes.relim#matplotlib.axes.Axes.relim "matplotlib.axes.Axes.relim") will not see collections even if the collection was added to the axes with *autolim* = True.
Note: there is no support for removing the artist's legend entry.
remove\_callback(*oid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L377-L385)
Remove a callback based on its observer id.
See also
[`add_callback`](#matplotlib.collections.TriMesh.add_callback "matplotlib.collections.TriMesh.add_callback")
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *array=<UNSET>*, *capstyle=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *offset\_transform=<UNSET>*, *offsets=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *pickradius=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *urls=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](#matplotlib.collections.Collection.set_alpha "matplotlib.collections.Collection.set_alpha") | array-like or scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](#matplotlib.collections.Collection.set_antialiased "matplotlib.collections.Collection.set_antialiased") or aa or antialiaseds | bool or list of bools |
| [`array`](cm_api#matplotlib.cm.ScalarMappable.set_array "matplotlib.cm.ScalarMappable.set_array") | array-like or None |
| [`capstyle`](#matplotlib.collections.Collection.set_capstyle "matplotlib.collections.Collection.set_capstyle") | [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clim`](cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`color`](#matplotlib.collections.Collection.set_color "matplotlib.collections.Collection.set_color") | color or list of rgba tuples |
| [`edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor") or ec or edgecolors | color or list of colors or 'face' |
| [`facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor") or facecolors or fc | color or list of colors |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](#matplotlib.collections.Collection.set_hatch "matplotlib.collections.Collection.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](#matplotlib.collections.Collection.set_joinstyle "matplotlib.collections.Collection.set_joinstyle") | [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](#matplotlib.collections.Collection.set_linestyle "matplotlib.collections.Collection.set_linestyle") or dashes or linestyles or ls | str or tuple or list thereof |
| [`linewidth`](#matplotlib.collections.Collection.set_linewidth "matplotlib.collections.Collection.set_linewidth") or linewidths or lw | float or list of floats |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`offset_transform`](#matplotlib.collections.Collection.set_offset_transform "matplotlib.collections.Collection.set_offset_transform") or transOffset | unknown |
| [`offsets`](#matplotlib.collections.Collection.set_offsets "matplotlib.collections.Collection.set_offsets") | (N, 2) or (2,) array-like |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`pickradius`](#matplotlib.collections.Collection.set_pickradius "matplotlib.collections.Collection.set_pickradius") | unknown |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`urls`](#matplotlib.collections.Collection.set_urls "matplotlib.collections.Collection.set_urls") | list of str or None |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_aa(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.TriMesh.set_antialiased "matplotlib.collections.TriMesh.set_antialiased").
set\_agg\_filter(*filter\_func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L933-L949)
Set the agg filter.
Parameters:
**filter\_func**callable
A filter function, which takes a (m, n, depth) float array and a dpi value, and returns a (m, n, depth) array and two offsets from the bottom left corner of the image
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L807-L821)
Set the alpha value used for blending - not supported on all backends.
Parameters:
**alpha**array-like or scalar or None
All values must be within the 0-1 range, inclusive. Masked values and nans are not supported.
set\_animated(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1023-L1041)
Set whether the artist is intended to be used in an animation.
If True, the artist is excluded from regular drawing of the figure. You have to call [`Figure.draw_artist`](figure_api#matplotlib.figure.Figure.draw_artist "matplotlib.figure.Figure.draw_artist") / [`Axes.draw_artist`](_as_gen/matplotlib.axes.axes.draw_artist#matplotlib.axes.Axes.draw_artist "matplotlib.axes.Axes.draw_artist") explicitly on the artist. This approach is used to speed up animations using blitting.
See also [`matplotlib.animation`](animation_api#module-matplotlib.animation "matplotlib.animation") and [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html).
Parameters:
**b**bool
set\_antialiased(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Set the antialiasing state for rendering.
Parameters:
**aa**bool or list of bools
set\_antialiaseds(*aa*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L696-L707)
Alias for [`set_antialiased`](#matplotlib.collections.TriMesh.set_antialiased "matplotlib.collections.TriMesh.set_antialiased").
set\_array(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L484-L505)
Set the value array from array-like *A*.
Parameters:
**A**array-like or None
The values that are mapped to colors.
The base class [`ScalarMappable`](cm_api#matplotlib.cm.ScalarMappable "matplotlib.cm.ScalarMappable") does not make any assumptions on the dimensionality and shape of the value array *A*.
set\_capstyle(*cs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L630-L639)
Set the [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") for the collection (for all its elements).
Parameters:
**cs**[`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'}
set\_clim(*vmin=None*, *vmax=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L526-L550)
Set the norm limits for image scaling.
Parameters:
**vmin, vmax**float
The limits.
The limits may also be passed as a tuple (*vmin*, *vmax*) as a single positional argument.
set\_clip\_box(*clipbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L731-L741)
Set the artist's clip [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox").
Parameters:
**clipbox**[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox")
set\_clip\_on(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L877-L892)
Set whether the artist uses clipping.
When False artists will be visible outside of the Axes which can lead to unexpected results.
Parameters:
**b**bool
set\_clip\_path(*path*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L743-L803)
Set the artist's clip path.
Parameters:
**path**[`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") or [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") or [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") or None
The clip path. If given a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), *transform* must be provided as well. If *None*, a previously set clip path is removed.
**transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform"), optional
Only used if *path* is a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path"), in which case the given [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") is converted to a [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") using *transform*.
#### Notes
For efficiency, if *path* is a [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") this method will set the clipping box to the corresponding rectangle and set the clipping path to `None`.
For technical reasons (support of [`set`](_as_gen/matplotlib.artist.artist.set#matplotlib.artist.Artist.set "matplotlib.artist.Artist.set")), a tuple (*path*, *transform*) is also accepted as a single positional parameter.
set\_cmap(*cmap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L562-L574)
Set the colormap for luminance data.
Parameters:
**cmap**[`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None
set\_color(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L713-L727)
Set both the edgecolor and the facecolor.
Parameters:
**c**color or list of rgba tuples
See also
[`Collection.set_facecolor`](#matplotlib.collections.Collection.set_facecolor "matplotlib.collections.Collection.set_facecolor"), [`Collection.set_edgecolor`](#matplotlib.collections.Collection.set_edgecolor "matplotlib.collections.Collection.set_edgecolor")
For setting the edge or face color individually.
set\_dashes(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.TriMesh.set_linestyle "matplotlib.collections.TriMesh.set_linestyle").
set\_ec(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.TriMesh.set_edgecolor "matplotlib.collections.TriMesh.set_edgecolor").
set\_edgecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Set the edgecolor(s) of the collection.
Parameters:
**c**color or list of colors or 'face'
The collection edgecolor(s). If a sequence, the patches cycle through it. If 'face', match the facecolor.
set\_edgecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L789-L805)
Alias for [`set_edgecolor`](#matplotlib.collections.TriMesh.set_edgecolor "matplotlib.collections.TriMesh.set_edgecolor").
set\_facecolor(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Set the facecolor(s) of the collection. *c* can be a color (all patches have same color), or a sequence of colors; if it is a sequence the patches will cycle through the sequence.
If *c* is 'none', the patch will not be filled.
Parameters:
**c**color or list of colors
set\_facecolors(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.TriMesh.set_facecolor "matplotlib.collections.TriMesh.set_facecolor").
set\_fc(*c*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L740-L755)
Alias for [`set_facecolor`](#matplotlib.collections.TriMesh.set_facecolor "matplotlib.collections.TriMesh.set_facecolor").
set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L707-L729)
Set the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
set\_gid(*gid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L592-L600)
Set the (group) id for the artist.
Parameters:
**gid**str
set\_hatch(*hatch*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L497-L532)
Set the hatching pattern
*hatch* can be one of:
```
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
```
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
Parameters:
**hatch**{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'}
set\_in\_layout(*in\_layout*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1043-L1054)
Set if artist is to be included in layout calculations, E.g. [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html), [`Figure.tight_layout()`](figure_api#matplotlib.figure.Figure.tight_layout "matplotlib.figure.Figure.tight_layout"), and `fig.savefig(fname, bbox_inches='tight')`.
Parameters:
**in\_layout**bool
set\_joinstyle(*js*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L644-L653)
Set the [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") for the collection (for all its elements).
Parameters:
**js**[`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'}
set\_label(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1060-L1074)
Set a label that will be displayed in the legend.
Parameters:
**s**object
*s* will be converted to a string by calling [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)").
set\_linestyle(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Set the linestyle(s) for the collection.
| linestyle | description |
| --- | --- |
| `'-'` or `'solid'` | solid line |
| `'--'` or `'dashed'` | dashed line |
| `'-.'` or `'dashdot'` | dash-dotted line |
| `':'` or `'dotted'` | dotted line |
Alternatively a dash tuple of the following form can be provided:
```
(offset, onoffseq),
```
where `onoffseq` is an even length tuple of on and off ink in points.
Parameters:
**ls**str or tuple or list thereof
Valid values for individual linestyles include {'-', '--', '-.', ':', '', (offset, on-off-seq)}. See [`Line2D.set_linestyle`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D.set_linestyle "matplotlib.lines.Line2D.set_linestyle") for a complete description.
set\_linestyles(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.TriMesh.set_linestyle "matplotlib.collections.TriMesh.set_linestyle").
set\_linewidth(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Set the linewidth(s) for the collection. *lw* can be a scalar or a sequence; if it is a sequence the patches will cycle through the sequence
Parameters:
**lw**float or list of floats
set\_linewidths(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.TriMesh.set_linewidth "matplotlib.collections.TriMesh.set_linewidth").
set\_ls(*ls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L583-L628)
Alias for [`set_linestyle`](#matplotlib.collections.TriMesh.set_linestyle "matplotlib.collections.TriMesh.set_linestyle").
set\_lw(*lw*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L563-L581)
Alias for [`set_linewidth`](#matplotlib.collections.TriMesh.set_linewidth "matplotlib.collections.TriMesh.set_linewidth").
set\_mouseover(*mouseover*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1345-L1366)
Set whether this artist is queried for custom context information when the mouse cursor moves over it.
Parameters:
**mouseover**bool
See also
[`get_cursor_data`](#matplotlib.collections.TriMesh.get_cursor_data "matplotlib.collections.TriMesh.get_cursor_data")
[`ToolCursorPosition`](backend_tools_api#matplotlib.backend_tools.ToolCursorPosition "matplotlib.backend_tools.ToolCursorPosition")
[`NavigationToolbar2`](backend_bases_api#matplotlib.backend_bases.NavigationToolbar2 "matplotlib.backend_bases.NavigationToolbar2")
set\_norm(*norm*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L609-L623)
Set the normalization instance.
Parameters:
**norm**[`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None
#### Notes
If there are any colorbars using the mappable for this norm, setting the norm of the mappable will reset the norm, locator, and formatters on the colorbar to default.
set\_offset\_transform(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Set the artist offset transform.
Parameters:
**offset\_transform**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_offsets(*offsets*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L538-L552)
Set the offsets for the collection.
Parameters:
**offsets**(N, 2) or (2,) array-like
set\_path\_effects(*path\_effects*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L689-L698)
Set the path effects.
Parameters:
**path\_effects**[`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect")
set\_paths()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L1855-L1856)
set\_picker(*picker*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L527-L560)
Define the picking behavior of the artist.
Parameters:
**picker**None or bool or float or callable
This can be one of the following:
* *None*: Picking is disabled for this artist (default).
* A boolean: If *True* then picking will be enabled and the artist will fire a pick event if the mouse event is over the artist.
* A float: If picker is a number it is interpreted as an epsilon tolerance in points and the artist will fire off an event if its data is within epsilon of the mouse event. For some artists like lines and patch collections, the artist may provide additional data to the pick event that is generated, e.g., the indices of the data within epsilon of the pick event
* A function: If picker is callable, it is a user supplied function which determines whether the artist is hit by the mouse event:
```
hit, props = picker(artist, mouseevent)
```
to determine the hit test. if the mouse event is over the artist, return *hit=True* and props is a dictionary of properties you want added to the PickEvent attributes.
set\_pickradius(*pickradius*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L422-L432)
Set the pick radius used for containment tests.
Parameters:
**pickradius**float
Pick radius, in points.
set\_rasterized(*rasterized*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L908-L927)
Force rasterized (bitmap) drawing for vector graphics output.
Rasterized drawing is not supported by all artists. If you try to enable this on an artist that does not support it, the command has no effect and a warning will be issued.
This setting is ignored for pixel-based output.
See also [Rasterization for vector graphics](https://matplotlib.org/stable/gallery/misc/rasterization_demo.html).
Parameters:
**rasterized**bool
set\_sketch\_params(*scale=None*, *length=None*, *randomness=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L661-L687)
Set the sketch parameters.
Parameters:
**scale**float, optional
The amplitude of the wiggle perpendicular to the source line, in pixels. If scale is [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)"), or not provided, no sketch filter will be provided.
**length**float, optional
The length of the wiggle along the line, in pixels (default 128.0)
**randomness**float, optional
The scale factor by which the length is shrunken or expanded (default 16.0)
The PGF backend uses this argument as an RNG seed and not as described above. Using the same seed yields the same random shape.
set\_snap(*snap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L613-L639)
Set the snapping behavior.
Snapping aligns positions with the pixel grid, which results in clearer images. For example, if a black line of 1px width was defined at a position in between two pixels, the resulting image would contain the interpolated value of that line in the pixel grid, which would be a grey value on both adjacent pixel positions. In contrast, snapping will move the line to the nearest integer pixel value, so that the resulting image will really contain a 1px wide black line.
Snapping is currently only supported by the Agg and MacOSX backends.
Parameters:
**snap**bool or None
Possible values:
* *True*: Snap vertices to the nearest pixel center.
* *False*: Do not modify vertex positions.
* *None*: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center.
set\_transOffset(*offset\_transform*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L224-L233)
Alias for [`set_offset_transform`](#matplotlib.collections.TriMesh.set_offset_transform "matplotlib.collections.TriMesh.set_offset_transform").
set\_transform(*t*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L408-L419)
Set the artist transform.
Parameters:
**t**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
set\_url(*url*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L578-L586)
Set the url for the artist.
Parameters:
**url**str
set\_urls(*urls*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L474-L486)
Parameters:
**urls**list of str or None
#### Notes
URLs are currently only implemented by the SVG backend. They are ignored by all other backends.
set\_visible(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1011-L1021)
Set the artist's visibility.
Parameters:
**b**bool
set\_zorder(*level*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1080-L1093)
Set the zorder for the artist. Artists with lower zorder values are drawn first.
Parameters:
**level**float
*property*stale
Whether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist.
*property*sticky\_edges
`x` and `y` sticky edge lists for autoscaling.
When performing autoscaling, if a data limit coincides with a value in the corresponding sticky\_edges list, then no margin will be added--the view limit "sticks" to the edge. A typical use case is histograms, where one usually expects no margin on the bottom edge (0) of the histogram.
Moreover, margin expansion "bumps" against sticky edges and cannot cross them. For example, if the upper data limit is 1.0, the upper view limit computed by simple margin application is 1.2, but there is a sticky edge at 1.1, then the actual upper view limit will be 1.1.
This attribute cannot be assigned to; however, the `x` and `y` lists can be modified in place as needed.
#### Examples
```
>>> artist.sticky_edges.x[:] = (xmin, xmax)
>>> artist.sticky_edges.y[:] = (ymin, ymax)
```
to\_rgba(*x*, *alpha=None*, *bytes=False*, *norm=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/cm.py#L414-L482)
Return a normalized rgba array corresponding to *x*.
In the normal case, *x* is a 1D or 2D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If *x* is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. The array can be uint8, or it can be floating point with values in the 0-1 range; otherwise a ValueError will be raised. If it is a masked array, the mask will be ignored. If the last dimension is 3, the *alpha* kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the *alpha* kwarg is ignored; it does not replace the preexisting alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if *bytes* is *False* (default), the rgba array will be floats in the 0-1 range; if it is *True*, the returned rgba array will be uint8 in the 0 to 255 range.
If norm is False, no normalization of the input data is performed, and it is assumed to be in the range (0-1).
update(*props*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1168-L1177)
Update this artist's properties from the dict *props*.
Parameters:
**props**dict
update\_from(*other*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L907-L929)
Copy properties from other to self.
update\_scalarmappable()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/collections.py#L865-L901)
Update colors from the scalar mappable array, if any.
Assign colors to edges and faces based on the array and/or colors that were directly set, as appropriate.
zorder*=0*
| programming_docs |
matplotlib matplotlib.hatch matplotlib.hatch
================
Contains classes for generating hatch patterns.
*class*matplotlib.hatch.Circles(*hatch*, *density*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/hatch.py#L124-L129)
Bases: [`Shapes`](#matplotlib.hatch.Shapes "matplotlib.hatch.Shapes")
*class*matplotlib.hatch.HatchPatternBase[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/hatch.py#L9-L11)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
The base class for a hatch pattern.
*class*matplotlib.hatch.HorizontalHatch(*hatch*, *density*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/hatch.py#L14-L28)
Bases: [`HatchPatternBase`](#matplotlib.hatch.HatchPatternBase "matplotlib.hatch.HatchPatternBase")
set\_vertices\_and\_codes(*vertices*, *codes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/hatch.py#L19-L28)
*class*matplotlib.hatch.LargeCircles(*hatch*, *density*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/hatch.py#L140-L145)
Bases: [`Circles`](#matplotlib.hatch.Circles "matplotlib.hatch.Circles")
size*=0.35*
*class*matplotlib.hatch.NorthEastHatch(*hatch*, *density*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/hatch.py#L48-L64)
Bases: [`HatchPatternBase`](#matplotlib.hatch.HatchPatternBase "matplotlib.hatch.HatchPatternBase")
set\_vertices\_and\_codes(*vertices*, *codes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/hatch.py#L57-L64)
*class*matplotlib.hatch.Shapes(*hatch*, *density*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/hatch.py#L87-L121)
Bases: [`HatchPatternBase`](#matplotlib.hatch.HatchPatternBase "matplotlib.hatch.HatchPatternBase")
filled*=False*
set\_vertices\_and\_codes(*vertices*, *codes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/hatch.py#L101-L121)
*class*matplotlib.hatch.SmallCircles(*hatch*, *density*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/hatch.py#L132-L137)
Bases: [`Circles`](#matplotlib.hatch.Circles "matplotlib.hatch.Circles")
size*=0.2*
*class*matplotlib.hatch.SmallFilledCircles(*hatch*, *density*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/hatch.py#L148-L154)
Bases: [`Circles`](#matplotlib.hatch.Circles "matplotlib.hatch.Circles")
filled*=True*
size*=0.1*
*class*matplotlib.hatch.SouthEastHatch(*hatch*, *density*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/hatch.py#L67-L84)
Bases: [`HatchPatternBase`](#matplotlib.hatch.HatchPatternBase "matplotlib.hatch.HatchPatternBase")
set\_vertices\_and\_codes(*vertices*, *codes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/hatch.py#L77-L84)
*class*matplotlib.hatch.Stars(*hatch*, *density*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/hatch.py#L157-L168)
Bases: [`Shapes`](#matplotlib.hatch.Shapes "matplotlib.hatch.Shapes")
filled*=True*
size*=0.3333333333333333*
*class*matplotlib.hatch.VerticalHatch(*hatch*, *density*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/hatch.py#L31-L45)
Bases: [`HatchPatternBase`](#matplotlib.hatch.HatchPatternBase "matplotlib.hatch.HatchPatternBase")
set\_vertices\_and\_codes(*vertices*, *codes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/hatch.py#L36-L45)
matplotlib.hatch.get\_path(*hatchpattern*, *density=6*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/hatch.py#L199-L225)
Given a hatch specifier, *hatchpattern*, generates Path to render the hatch in a unit square. *density* is the number of lines per unit square.
matplotlib matplotlib.container matplotlib.container
====================
*class*matplotlib.container.BarContainer(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/container.py#L43-L75)
Bases: [`Container`](#matplotlib.container.Container "matplotlib.container.Container")
Container for the artists of bar plots (e.g. created by [`Axes.bar`](_as_gen/matplotlib.axes.axes.bar#matplotlib.axes.Axes.bar "matplotlib.axes.Axes.bar")).
The container can be treated as a tuple of the *patches* themselves. Additionally, you can access these and further parameters by the attributes.
Attributes:
**patches**list of [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle")
The artists of the bars.
**errorbar**None or [`ErrorbarContainer`](#matplotlib.container.ErrorbarContainer "matplotlib.container.ErrorbarContainer")
A container for the error bar artists if error bars are present. *None* otherwise.
**datavalues**None or array-like
The underlying data values corresponding to the bars.
**orientation**{'vertical', 'horizontal'}, default: None
If 'vertical', the bars are assumed to be vertical. If 'horizontal', the bars are assumed to be horizontal.
*class*matplotlib.container.Container(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/container.py#L5-L40)
Bases: [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.10)")
Base class for containers.
Containers are classes that collect semantically related Artists such as the bars of a bar plot.
add\_callback(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L348-L375)
Add a callback function that will be called whenever one of the [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")'s properties changes.
Parameters:
**func**callable
The callback function. It must have the signature:
```
def func(artist: Artist) -> Any
```
where *artist* is the calling [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist"). Return values may exist but are ignored.
Returns:
int
The observer id associated with the callback. This id can be used for removing the callback with [`remove_callback`](#matplotlib.container.Container.remove_callback "matplotlib.container.Container.remove_callback") later.
See also
[`remove_callback`](#matplotlib.container.Container.remove_callback "matplotlib.container.Container.remove_callback")
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/container.py#L33-L34)
get\_label()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1056-L1058)
Return the label used for this artist in the legend.
pchanged()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L387-L398)
Call all of the registered callbacks.
This function is triggered internally when a property is changed.
See also
[`add_callback`](#matplotlib.container.Container.add_callback "matplotlib.container.Container.add_callback")
[`remove_callback`](#matplotlib.container.Container.remove_callback "matplotlib.container.Container.remove_callback")
remove()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/container.py#L25-L31)
remove\_callback(*oid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L377-L385)
Remove a callback based on its observer id.
See also
[`add_callback`](#matplotlib.container.Container.add_callback "matplotlib.container.Container.add_callback")
set\_label(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L1060-L1074)
Set a label that will be displayed in the legend.
Parameters:
**s**object
*s* will be converted to a string by calling [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)").
*class*matplotlib.container.ErrorbarContainer(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/container.py#L78-L107)
Bases: [`Container`](#matplotlib.container.Container "matplotlib.container.Container")
Container for the artists of error bars (e.g. created by [`Axes.errorbar`](_as_gen/matplotlib.axes.axes.errorbar#matplotlib.axes.Axes.errorbar "matplotlib.axes.Axes.errorbar")).
The container can be treated as the *lines* tuple itself. Additionally, you can access these and further parameters by the attributes.
Attributes:
**lines**tuple
Tuple of `(data_line, caplines, barlinecols)`.
* data\_line : [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") instance of x, y plot markers and/or line.
* caplines : tuple of [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") instances of the error bar caps.
* barlinecols : list of [`LineCollection`](collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") with the horizontal and vertical error ranges.
**has\_xerr, has\_yerr**bool
`True` if the errorbar has x/y errors.
*class*matplotlib.container.StemContainer(*\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/container.py#L110-L142)
Bases: [`Container`](#matplotlib.container.Container "matplotlib.container.Container")
Container for the artists created in a [`Axes.stem()`](_as_gen/matplotlib.axes.axes.stem#matplotlib.axes.Axes.stem "matplotlib.axes.Axes.stem") plot.
The container can be treated like a namedtuple `(markerline, stemlines,
baseline)`.
Attributes:
**markerline**[`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
The artist of the markers at the stem heads.
**stemlines**list of [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
The artists of the vertical lines for all stems.
**baseline**[`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")
The artist of the horizontal baseline.
Parameters:
**markerline\_stemlines\_baseline**tuple
Tuple of `(markerline, stemlines, baseline)`. `markerline` contains the [`LineCollection`](collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") of the markers, `stemlines` is a [`LineCollection`](collections_api#matplotlib.collections.LineCollection "matplotlib.collections.LineCollection") of the main lines, `baseline` is the [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") of the baseline.
matplotlib matplotlib.widgets matplotlib.widgets
==================
GUI neutral widgets
-------------------
Widgets that are designed to work for any of the GUI backends. All of these widgets require you to predefine a [`matplotlib.axes.Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance and pass that as the first parameter. Matplotlib doesn't try to be too smart with respect to layout -- you will have to figure out how wide and tall you want your Axes to be to accommodate your widget.
*class*matplotlib.widgets.AxesWidget(*ax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L92-L132)
Bases: [`Widget`](#matplotlib.widgets.Widget "matplotlib.widgets.Widget")
Widget connected to a single [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes").
To guarantee that the widget remains responsive and not garbage-collected, a reference to the object should be maintained by the user.
This is necessary because the callback registry maintains only weak-refs to the functions, which are member functions of the widget. If there are no references to the widget object it may be garbage collected which will disconnect the callbacks.
Attributes:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The parent Axes for the widget.
**canvas**[`FigureCanvasBase`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase "matplotlib.backend_bases.FigureCanvasBase")
The parent figure canvas for the widget.
`active`bool
Is the widget active?
connect\_event(*event*, *callback*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L119-L127)
Connect a callback function with an event.
This should be used in lieu of `figure.canvas.mpl_connect` since this function stores callback ids for later clean up.
disconnect\_events()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L129-L132)
Disconnect all events created by this widget.
*class*matplotlib.widgets.Button(*ax*, *label*, *image=None*, *color='0.85'*, *hovercolor='0.95'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L135-L224)
Bases: [`AxesWidget`](#matplotlib.widgets.AxesWidget "matplotlib.widgets.AxesWidget")
A GUI neutral button.
For the button to remain responsive you must keep a reference to it. Call [`on_clicked`](#matplotlib.widgets.Button.on_clicked "matplotlib.widgets.Button.on_clicked") to connect to the button.
Attributes:
**ax**
The [`matplotlib.axes.Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") the button renders into.
**label**
A [`matplotlib.text.Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") instance.
**color**
The color of the button when not hovering.
**hovercolor**
The color of the button when hovering.
Parameters:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance the button will be placed into.
**label**str
The button text.
**image**array-like or PIL Image
The image to place in the button, if not *None*. The parameter is directly forwarded to [`imshow`](_as_gen/matplotlib.axes.axes.imshow#matplotlib.axes.Axes.imshow "matplotlib.axes.Axes.imshow").
**color**color
The color of the button when not activated.
**hovercolor**color
The color of the button when the mouse is over it.
disconnect(*cid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L222-L224)
Remove the callback function with connection id *cid*.
on\_clicked(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L214-L220)
Connect the callback function *func* to button click events.
Returns a connection id, which can be used to disconnect the callback.
*class*matplotlib.widgets.CheckButtons(*ax*, *labels*, *actives=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L958-L1101)
Bases: [`AxesWidget`](#matplotlib.widgets.AxesWidget "matplotlib.widgets.AxesWidget")
A GUI neutral set of check buttons.
For the check buttons to remain responsive you must keep a reference to this object.
Connect to the CheckButtons with the [`on_clicked`](#matplotlib.widgets.CheckButtons.on_clicked "matplotlib.widgets.CheckButtons.on_clicked") method.
Attributes:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The parent Axes for the widget.
**labels**list of [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")
**rectangles**list of [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle")
**lines**list of ([`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D"), [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D")) pairs
List of lines for the x's in the check boxes. These lines exist for each box, but have `set_visible(False)` when its box is not checked.
Add check buttons to [`matplotlib.axes.Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance *ax*.
Parameters:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The parent Axes for the widget.
**labels**list of str
The labels of the check buttons.
**actives**list of bool, optional
The initial check states of the buttons. The list must have the same length as *labels*. If not given, all buttons are unchecked.
disconnect(*cid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1099-L1101)
Remove the observer with connection id *cid*.
get\_status()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1085-L1089)
Return a tuple of the status (True/False) of all of the check buttons.
on\_clicked(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1091-L1097)
Connect the callback function *func* to button click events.
Returns a connection id, which can be used to disconnect the callback.
set\_active(*index*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1056-L1083)
Toggle (activate or deactivate) a check button by index.
Callbacks will be triggered if `eventson` is True.
Parameters:
**index**int
Index of the check button to toggle.
Raises:
ValueError
If *index* is invalid.
*class*matplotlib.widgets.Cursor(*ax*, *horizOn=True*, *vertOn=True*, *useblit=False*, *\*\*lineprops*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1579-L1671)
Bases: [`AxesWidget`](#matplotlib.widgets.AxesWidget "matplotlib.widgets.AxesWidget")
A crosshair cursor that spans the Axes and moves with mouse cursor.
For the cursor to remain responsive you must keep a reference to it.
Parameters:
**ax**[`matplotlib.axes.Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") to attach the cursor to.
**horizOn**bool, default: True
Whether to draw the horizontal line.
**vertOn**bool, default: True
Whether to draw the vertical line.
**useblit**bool, default: False
Use blitting for faster drawing if supported by the backend. See the tutorial [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html) for details.
Other Parameters:
**\*\*lineprops**
[`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties that control the appearance of the lines. See also [`axhline`](_as_gen/matplotlib.axes.axes.axhline#matplotlib.axes.Axes.axhline "matplotlib.axes.Axes.axhline").
#### Examples
See [Cursor](https://matplotlib.org/stable/gallery/widgets/cursor.html).
clear(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1628-L1635)
Internal event handler to clear the cursor.
onmove(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1637-L1660)
Internal event handler to draw the cursor when the mouse moves.
*class*matplotlib.widgets.EllipseSelector(*ax*, *onselect*, *drawtype=<deprecated parameter>*, *minspanx=0*, *minspany=0*, *useblit=False*, *lineprops=<deprecated parameter>*, *props=None*, *spancoords='data'*, *button=None*, *grab\_range=10*, *handle\_props=None*, *interactive=False*, *state\_modifier\_keys=None*, *drag\_from\_anywhere=False*, *ignore\_event\_outside=False*, *use\_data\_coordinates=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L3453-L3507)
Bases: [`RectangleSelector`](#matplotlib.widgets.RectangleSelector "matplotlib.widgets.RectangleSelector")
Select an elliptical region of an Axes.
For the cursor to remain responsive you must keep a reference to it.
Press and release events triggered at the same coordinates outside the selection will clear the selector, except when `ignore_event_outside=True`.
Parameters:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The parent axes for the widget.
**onselect**function
A callback function that is called after a release event and the selection is created, changed or removed. It must have the signature:
```
def onselect(eclick: MouseEvent, erelease: MouseEvent)
```
where *eclick* and *erelease* are the mouse click and release [`MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")s that start and complete the selection.
**minspanx**float, default: 0
Selections with an x-span less than or equal to *minspanx* are removed (when already existing) or cancelled.
**minspany**float, default: 0
Selections with an y-span less than or equal to *minspanx* are removed (when already existing) or cancelled.
**useblit**bool, default: False
Whether to use blitting for faster drawing (if supported by the backend). See the tutorial [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html) for details.
**props**dict, optional
Properties with which the ellipse is drawn. See [`matplotlib.patches.Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") for valid properties. Default:
`dict(facecolor='red', edgecolor='black', alpha=0.2, fill=True)`
**spancoords**{"data", "pixels"}, default: "data"
Whether to interpret *minspanx* and *minspany* in data or in pixel coordinates.
**button**[`MouseButton`](backend_bases_api#matplotlib.backend_bases.MouseButton "matplotlib.backend_bases.MouseButton"), list of [`MouseButton`](backend_bases_api#matplotlib.backend_bases.MouseButton "matplotlib.backend_bases.MouseButton"), default: all buttons
Button(s) that trigger rectangle selection.
**grab\_range**float, default: 10
Distance in pixels within which the interactive tool handles can be activated.
**handle\_props**dict, optional
Properties with which the interactive handles (marker artists) are drawn. See the marker arguments in [`matplotlib.lines.Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") for valid properties. Default values are defined in `mpl.rcParams` except for the default value of `markeredgecolor` which will be the same as the `edgecolor` property in *props*.
**interactive**bool, default: False
Whether to draw a set of handles that allow interaction with the widget after it is drawn.
**state\_modifier\_keys**dict, optional
Keyboard modifiers which affect the widget's behavior. Values amend the defaults, which are:
* "move": Move the existing shape, default: no modifier.
* "clear": Clear the current shape, default: "escape".
* "square": Make the shape square, default: "shift".
* "center": change the shape around its center, default: "ctrl".
* "rotate": Rotate the shape around its center between -45° and 45°, default: "r".
"square" and "center" can be combined. The square shape can be defined in data or display coordinates as determined by the `use_data_coordinates` argument specified when creating the selector.
**drag\_from\_anywhere**bool, default: False
If [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)"), the widget can be moved by clicking anywhere within its bounds.
**ignore\_event\_outside**bool, default: False
If [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)"), the event triggered outside the span selector will be ignored.
**use\_data\_coordinates**bool, default: False
If [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)"), the "square" shape of the selector is defined in data coordinates instead of display coordinates.
#### Examples
[Rectangle and ellipse selectors](https://matplotlib.org/stable/gallery/widgets/rectangle_selector.html)
*property*draw\_shape[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*class*matplotlib.widgets.Lasso(*ax*, *xy*, *callback=None*, *useblit=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L3965-L4034)
Bases: [`AxesWidget`](#matplotlib.widgets.AxesWidget "matplotlib.widgets.AxesWidget")
Selection curve of an arbitrary shape.
The selected path can be used in conjunction with [`contains_point`](path_api#matplotlib.path.Path.contains_point "matplotlib.path.Path.contains_point") to select data points from an image.
Unlike [`LassoSelector`](#matplotlib.widgets.LassoSelector "matplotlib.widgets.LassoSelector"), this must be initialized with a starting point *xy*, and the [`Lasso`](#matplotlib.widgets.Lasso "matplotlib.widgets.Lasso") events are destroyed upon release.
Parameters:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The parent Axes for the widget.
**xy**(float, float)
Coordinates of the start of the lasso.
**useblit**bool, default: True
Whether to use blitting for faster drawing (if supported by the backend). See the tutorial [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html) for details.
**callback**callable
Whenever the lasso is released, the *callback* function is called and passed the vertices of the selected path.
onmove(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L4016-L4034)
onrelease(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L4005-L4014)
*class*matplotlib.widgets.LassoSelector(*ax*, *onselect=None*, *useblit=True*, *props=None*, *button=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L3510-L3590)
Bases: `_SelectorWidget`
Selection curve of an arbitrary shape.
For the selector to remain responsive you must keep a reference to it.
The selected path can be used in conjunction with [`contains_point`](path_api#matplotlib.path.Path.contains_point "matplotlib.path.Path.contains_point") to select data points from an image.
In contrast to [`Lasso`](#matplotlib.widgets.Lasso "matplotlib.widgets.Lasso"), [`LassoSelector`](#matplotlib.widgets.LassoSelector "matplotlib.widgets.LassoSelector") is written with an interface similar to [`RectangleSelector`](#matplotlib.widgets.RectangleSelector "matplotlib.widgets.RectangleSelector") and [`SpanSelector`](#matplotlib.widgets.SpanSelector "matplotlib.widgets.SpanSelector"), and will continue to interact with the Axes until disconnected.
Example usage:
```
ax = plt.subplot()
ax.plot(x, y)
def onselect(verts):
print(verts)
lasso = LassoSelector(ax, onselect)
```
Parameters:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The parent Axes for the widget.
**onselect**function
Whenever the lasso is released, the *onselect* function is called and passed the vertices of the selected path.
**useblit**bool, default: True
Whether to use blitting for faster drawing (if supported by the backend). See the tutorial [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html) for details.
**props**dict, optional
Properties with which the line is drawn, see [`matplotlib.lines.Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") for valid properties. Default values are defined in `mpl.rcParams`.
**button**[`MouseButton`](backend_bases_api#matplotlib.backend_bases.MouseButton "matplotlib.backend_bases.MouseButton") or list of [`MouseButton`](backend_bases_api#matplotlib.backend_bases.MouseButton "matplotlib.backend_bases.MouseButton"), optional
The mouse buttons used for rectangle selection. Default is `None`, which corresponds to all buttons.
onpress(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L3564-L3566)
[*Deprecated*]
#### Notes
Deprecated since version 3.5: Use press instead.
onrelease(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L3572-L3574)
[*Deprecated*]
#### Notes
Deprecated since version 3.5: Use release instead.
*class*matplotlib.widgets.LockDraw[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L26-L61)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Some widgets, like the cursor, draw onto the canvas, and this is not desirable under all circumstances, like when the toolbar is in zoom-to-rect mode and drawing a rectangle. To avoid this, a widget can acquire a canvas' lock with `canvas.widgetlock(widget)` before drawing on the canvas; this will prevent other widgets from doing so at the same time (if they also try to acquire the lock first).
available(*o*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L51-L53)
Return whether drawing is available to *o*.
isowner(*o*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L55-L57)
Return whether *o* owns this lock.
locked()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L59-L61)
Return whether the lock is currently held by an owner.
release(*o*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L45-L49)
Release the lock from *o*.
*class*matplotlib.widgets.MultiCursor(*canvas*, *axes*, *\**, *useblit=True*, *horizOn=False*, *vertOn=True*, *\*\*lineprops*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1674-L1815)
Bases: [`Widget`](#matplotlib.widgets.Widget "matplotlib.widgets.Widget")
Provide a vertical (default) and/or horizontal line cursor shared between multiple Axes.
For the cursor to remain responsive you must keep a reference to it.
Parameters:
**canvas**object
This parameter is entirely unused and only kept for back-compatibility.
**axes**list of [`matplotlib.axes.Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") to attach the cursor to.
**useblit**bool, default: True
Use blitting for faster drawing if supported by the backend. See the tutorial [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html) for details.
**horizOn**bool, default: False
Whether to draw the horizontal line.
**vertOn**bool, default: True
Whether to draw the vertical line.
Other Parameters:
**\*\*lineprops**
[`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") properties that control the appearance of the lines. See also [`axhline`](_as_gen/matplotlib.axes.axes.axhline#matplotlib.axes.Axes.axhline "matplotlib.axes.Axes.axhline").
#### Examples
See [Multicursor](https://matplotlib.org/stable/gallery/widgets/multicursor.html).
background()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1754-L1755)
[*Deprecated*]
#### Notes
Deprecated since version 3.6:
*property*canvas[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
clear(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1772-L1780)
Clear the cursor.
connect()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1757-L1763)
Connect events.
disconnect()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1765-L1770)
Disconnect events.
onmove(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1782-L1798)
*class*matplotlib.widgets.PolygonSelector(*ax*, *onselect*, *useblit=False*, *props=None*, *handle\_props=None*, *grab\_range=10*, *\**, *draw\_bounding\_box=False*, *box\_handle\_props=None*, *box\_props=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L3593-L3962)
Bases: `_SelectorWidget`
Select a polygon region of an Axes.
Place vertices with each mouse click, and make the selection by completing the polygon (clicking on the first vertex). Once drawn individual vertices can be moved by clicking and dragging with the left mouse button, or removed by clicking the right mouse button.
In addition, the following modifier keys can be used:
* Hold *ctrl* and click and drag a vertex to reposition it before the polygon has been completed.
* Hold the *shift* key and click and drag anywhere in the Axes to move all vertices.
* Press the *esc* key to start a new polygon.
For the selector to remain responsive you must keep a reference to it.
Parameters:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The parent Axes for the widget.
**onselect**function
When a polygon is completed or modified after completion, the *onselect* function is called and passed a list of the vertices as `(xdata, ydata)` tuples.
**useblit**bool, default: False
Whether to use blitting for faster drawing (if supported by the backend). See the tutorial [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html) for details.
**props**dict, optional
Properties with which the line is drawn, see [`matplotlib.lines.Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") for valid properties. Default:
`dict(color='k', linestyle='-', linewidth=2, alpha=0.5)`
**handle\_props**dict, optional
Artist properties for the markers drawn at the vertices of the polygon. See the marker arguments in [`matplotlib.lines.Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") for valid properties. Default values are defined in `mpl.rcParams` except for the default value of `markeredgecolor` which will be the same as the `color` property in *props*.
**grab\_range**float, default: 10
A vertex is selected (to complete the polygon or to move a vertex) if the mouse click is within *grab\_range* pixels of the vertex.
**draw\_bounding\_box**bool, optional
If [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)"), a bounding box will be drawn around the polygon selector once it is complete. This box can be used to move and resize the selector.
**box\_handle\_props**dict, optional
Properties to set for the box handles. See the documentation for the *handle\_props* argument to [`RectangleSelector`](#matplotlib.widgets.RectangleSelector "matplotlib.widgets.RectangleSelector") for more info.
**box\_props**dict, optional
Properties to set for the box. See the documentation for the *props* argument to [`RectangleSelector`](#matplotlib.widgets.RectangleSelector "matplotlib.widgets.RectangleSelector") for more info.
#### Notes
If only one point remains after removing points, the selector reverts to an incomplete state and you can start drawing a new polygon from the existing point.
#### Examples
[Polygon Selector](https://matplotlib.org/stable/gallery/widgets/polygon_selector_simple.html) [Select indices from a collection using polygon selector](https://matplotlib.org/stable/gallery/widgets/polygon_selector_demo.html)
*property*line[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
onmove(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L3850-L3860)
Cursor move event handler and validator.
*property*vertex\_select\_radius[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*property*verts
The polygon vertices, as a list of `(x, y)` pairs.
*class*matplotlib.widgets.RadioButtons(*ax*, *labels*, *active=0*, *activecolor='blue'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1377-L1504)
Bases: [`AxesWidget`](#matplotlib.widgets.AxesWidget "matplotlib.widgets.AxesWidget")
A GUI neutral radio button.
For the buttons to remain responsive you must keep a reference to this object.
Connect to the RadioButtons with the [`on_clicked`](#matplotlib.widgets.RadioButtons.on_clicked "matplotlib.widgets.RadioButtons.on_clicked") method.
Attributes:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The parent Axes for the widget.
**activecolor**color
The color of the selected button.
**labels**list of [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")
The button labels.
**circles**list of [`Circle`](_as_gen/matplotlib.patches.circle#matplotlib.patches.Circle "matplotlib.patches.Circle")
The buttons.
**value\_selected**str
The label text of the currently selected button.
Add radio buttons to an [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes").
Parameters:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The Axes to add the buttons to.
**labels**list of str
The button labels.
**active**int
The index of the initially selected button.
**activecolor**color
The color of the selected button.
disconnect(*cid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1502-L1504)
Remove the observer with connection id *cid*.
on\_clicked(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1494-L1500)
Connect the callback function *func* to button click events.
Returns a connection id, which can be used to disconnect the callback.
set\_active(*index*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1470-L1492)
Select button with number *index*.
Callbacks will be triggered if `eventson` is True.
*class*matplotlib.widgets.RangeSlider(*ax*, *label*, *valmin*, *valmax*, *valinit=None*, *valfmt=None*, *closedmin=True*, *closedmax=True*, *dragging=True*, *valstep=None*, *orientation='horizontal'*, *track\_color='lightgrey'*, *handle\_style=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L576-L955)
Bases: [`SliderBase`](#matplotlib.widgets.SliderBase "matplotlib.widgets.SliderBase")
A slider representing a range of floating point values. Defines the min and max of the range via the *val* attribute as a tuple of (min, max).
Create a slider that defines a range contained within [*valmin*, *valmax*] in Axes *ax*. For the slider to remain responsive you must maintain a reference to it. Call [`on_changed()`](#matplotlib.widgets.RangeSlider.on_changed "matplotlib.widgets.RangeSlider.on_changed") to connect to the slider event.
Attributes:
**val**tuple of float
Slider value.
Parameters:
**ax**Axes
The Axes to put the slider in.
**label**str
Slider label.
**valmin**float
The minimum value of the slider.
**valmax**float
The maximum value of the slider.
**valinit**tuple of float or None, default: None
The initial positions of the slider. If None the initial positions will be at the 25th and 75th percentiles of the range.
**valfmt**str, default: None
%-format string used to format the slider values. If None, a [`ScalarFormatter`](ticker_api#matplotlib.ticker.ScalarFormatter "matplotlib.ticker.ScalarFormatter") is used instead.
**closedmin**bool, default: True
Whether the slider interval is closed on the bottom.
**closedmax**bool, default: True
Whether the slider interval is closed on the top.
**dragging**bool, default: True
If True the slider can be dragged by the mouse.
**valstep**float, default: None
If given, the slider will snap to multiples of *valstep*.
**orientation**{'horizontal', 'vertical'}, default: 'horizontal'
The orientation of the slider.
**track\_color**color, default: 'lightgrey'
The color of the background track. The track is accessible for further styling via the *track* attribute.
**handle\_style**dict
Properties of the slider handles. Default values are
| Key | Value | Default | Description |
| --- | --- | --- | --- |
| facecolor | color | 'white' | The facecolor of the slider handles. |
| edgecolor | color | '.75' | The edgecolor of the slider handles. |
| size | int | 10 | The size of the slider handles in points. |
Other values will be transformed as marker{foo} and passed to the [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") constructor. e.g. `handle_style = {'style'='x'}` will result in `markerstyle = 'x'`.
#### Notes
Additional kwargs are passed on to `self.poly` which is the [`Polygon`](_as_gen/matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon") that draws the slider knob. See the [`Polygon`](_as_gen/matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon") documentation for valid property names (`facecolor`, `edgecolor`, `alpha`, etc.).
on\_changed(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L940-L955)
Connect *func* as callback function to changes of the slider value.
Parameters:
**func**callable
Function to call when slider is changed. The function must accept a numpy array with shape (2,) as its argument.
Returns:
int
Connection id (which can be used to disconnect *func*).
set\_max(*max*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L901-L909)
Set the lower value of the slider to *max*.
Parameters:
**max**float
set\_min(*min*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L891-L899)
Set the lower value of the slider to *min*.
Parameters:
**min**float
set\_val(*val*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L911-L938)
Set slider value to *val*.
Parameters:
**val**tuple or array-like of float
*class*matplotlib.widgets.RectangleSelector(*ax*, *onselect*, *drawtype=<deprecated parameter>*, *minspanx=0*, *minspany=0*, *useblit=False*, *lineprops=<deprecated parameter>*, *props=None*, *spancoords='data'*, *button=None*, *grab\_range=10*, *handle\_props=None*, *interactive=False*, *state\_modifier\_keys=None*, *drag\_from\_anywhere=False*, *ignore\_event\_outside=False*, *use\_data\_coordinates=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L2896-L3450)
Bases: `_SelectorWidget`
Select a rectangular region of an Axes.
For the cursor to remain responsive you must keep a reference to it.
Press and release events triggered at the same coordinates outside the selection will clear the selector, except when `ignore_event_outside=True`.
Parameters:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The parent axes for the widget.
**onselect**function
A callback function that is called after a release event and the selection is created, changed or removed. It must have the signature:
```
def onselect(eclick: MouseEvent, erelease: MouseEvent)
```
where *eclick* and *erelease* are the mouse click and release [`MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")s that start and complete the selection.
**minspanx**float, default: 0
Selections with an x-span less than or equal to *minspanx* are removed (when already existing) or cancelled.
**minspany**float, default: 0
Selections with an y-span less than or equal to *minspanx* are removed (when already existing) or cancelled.
**useblit**bool, default: False
Whether to use blitting for faster drawing (if supported by the backend). See the tutorial [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html) for details.
**props**dict, optional
Properties with which the rectangle is drawn. See [`matplotlib.patches.Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") for valid properties. Default:
`dict(facecolor='red', edgecolor='black', alpha=0.2, fill=True)`
**spancoords**{"data", "pixels"}, default: "data"
Whether to interpret *minspanx* and *minspany* in data or in pixel coordinates.
**button**[`MouseButton`](backend_bases_api#matplotlib.backend_bases.MouseButton "matplotlib.backend_bases.MouseButton"), list of [`MouseButton`](backend_bases_api#matplotlib.backend_bases.MouseButton "matplotlib.backend_bases.MouseButton"), default: all buttons
Button(s) that trigger rectangle selection.
**grab\_range**float, default: 10
Distance in pixels within which the interactive tool handles can be activated.
**handle\_props**dict, optional
Properties with which the interactive handles (marker artists) are drawn. See the marker arguments in [`matplotlib.lines.Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") for valid properties. Default values are defined in `mpl.rcParams` except for the default value of `markeredgecolor` which will be the same as the `edgecolor` property in *props*.
**interactive**bool, default: False
Whether to draw a set of handles that allow interaction with the widget after it is drawn.
**state\_modifier\_keys**dict, optional
Keyboard modifiers which affect the widget's behavior. Values amend the defaults, which are:
* "move": Move the existing shape, default: no modifier.
* "clear": Clear the current shape, default: "escape".
* "square": Make the shape square, default: "shift".
* "center": change the shape around its center, default: "ctrl".
* "rotate": Rotate the shape around its center between -45° and 45°, default: "r".
"square" and "center" can be combined. The square shape can be defined in data or display coordinates as determined by the `use_data_coordinates` argument specified when creating the selector.
**drag\_from\_anywhere**bool, default: False
If [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)"), the widget can be moved by clicking anywhere within its bounds.
**ignore\_event\_outside**bool, default: False
If [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)"), the event triggered outside the span selector will be ignored.
**use\_data\_coordinates**bool, default: False
If [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)"), the "square" shape of the selector is defined in data coordinates instead of display coordinates.
#### Examples
```
>>> import matplotlib.pyplot as plt
>>> import matplotlib.widgets as mwidgets
>>> fig, ax = plt.subplots()
>>> ax.plot([1, 2, 3], [10, 50, 100])
>>> def onselect(eclick, erelease):
... print(eclick.xdata, eclick.ydata)
... print(erelease.xdata, erelease.ydata)
>>> props = dict(facecolor='blue', alpha=0.5)
>>> rect = mwidgets.RectangleSelector(ax, onselect, interactive=True,
props=props)
>>> fig.show()
```
```
>>> selector.add_state('square')
```
See also: [Rectangle and ellipse selectors](https://matplotlib.org/stable/gallery/widgets/rectangle_selector.html)
*property*active\_handle[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*property*center
Center of rectangle in data coordinates.
*property*corners
Corners of rectangle in data coordinates from lower left, moving clockwise.
*property*draw\_shape[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*property*drawtype[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*property*edge\_centers
Midpoint of rectangle edges in data coordinates from left, moving anti-clockwise.
*property*extents
Return (xmin, xmax, ymin, ymax) in data coordinates as defined by the bounding box before rotation.
*property*geometry
Return an array of shape (2, 5) containing the x (`RectangleSelector.geometry[1, :]`) and y (`RectangleSelector.geometry[0, :]`) data coordinates of the four corners of the rectangle starting and ending in the top left corner.
*property*interactive[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*property*maxdist[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*property*rotation
Rotation in degree in interval [-45°, 45°]. The rotation is limited in range to keep the implementation simple.
*property*to\_draw[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*class*matplotlib.widgets.Slider(*ax*, *label*, *valmin*, *valmax*, *valinit=0.5*, *valfmt=None*, *closedmin=True*, *closedmax=True*, *slidermin=None*, *slidermax=None*, *dragging=True*, *valstep=None*, *orientation='horizontal'*, *\**, *initcolor='r'*, *track\_color='lightgrey'*, *handle\_style=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L305-L573)
Bases: [`SliderBase`](#matplotlib.widgets.SliderBase "matplotlib.widgets.SliderBase")
A slider representing a floating point range.
Create a slider from *valmin* to *valmax* in Axes *ax*. For the slider to remain responsive you must maintain a reference to it. Call [`on_changed()`](#matplotlib.widgets.Slider.on_changed "matplotlib.widgets.Slider.on_changed") to connect to the slider event.
Attributes:
**val**float
Slider value.
Parameters:
**ax**Axes
The Axes to put the slider in.
**label**str
Slider label.
**valmin**float
The minimum value of the slider.
**valmax**float
The maximum value of the slider.
**valinit**float, default: 0.5
The slider initial position.
**valfmt**str, default: None
%-format string used to format the slider value. If None, a [`ScalarFormatter`](ticker_api#matplotlib.ticker.ScalarFormatter "matplotlib.ticker.ScalarFormatter") is used instead.
**closedmin**bool, default: True
Whether the slider interval is closed on the bottom.
**closedmax**bool, default: True
Whether the slider interval is closed on the top.
**slidermin**Slider, default: None
Do not allow the current slider to have a value less than the value of the Slider *slidermin*.
**slidermax**Slider, default: None
Do not allow the current slider to have a value greater than the value of the Slider *slidermax*.
**dragging**bool, default: True
If True the slider can be dragged by the mouse.
**valstep**float or array-like, default: None
If a float, the slider will snap to multiples of *valstep*. If an array the slider will snap to the values in the array.
**orientation**{'horizontal', 'vertical'}, default: 'horizontal'
The orientation of the slider.
**initcolor**color, default: 'r'
The color of the line at the *valinit* position. Set to `'none'` for no line.
**track\_color**color, default: 'lightgrey'
The color of the background track. The track is accessible for further styling via the *track* attribute.
**handle\_style**dict
Properties of the slider handle. Default values are
| Key | Value | Default | Description |
| --- | --- | --- | --- |
| facecolor | color | 'white' | The facecolor of the slider handle. |
| edgecolor | color | '.75' | The edgecolor of the slider handle. |
| size | int | 10 | The size of the slider handle in points. |
Other values will be transformed as marker{foo} and passed to the [`Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") constructor. e.g. `handle_style = {'style'='x'}` will result in `markerstyle = 'x'`.
#### Notes
Additional kwargs are passed on to `self.poly` which is the [`Polygon`](_as_gen/matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon") that draws the slider knob. See the [`Polygon`](_as_gen/matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon") documentation for valid property names (`facecolor`, `edgecolor`, `alpha`, etc.).
on\_changed(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L558-L573)
Connect *func* as callback function to changes of the slider value.
Parameters:
**func**callable
Function to call when slider is changed. The function must accept a single float as its arguments.
Returns:
int
Connection id (which can be used to disconnect *func*).
set\_val(*val*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L533-L556)
Set slider value to *val*.
Parameters:
**val**float
*class*matplotlib.widgets.SliderBase(*ax*, *orientation*, *closedmin*, *closedmax*, *valmin*, *valmax*, *valfmt*, *dragging*, *valstep*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L227-L302)
Bases: [`AxesWidget`](#matplotlib.widgets.AxesWidget "matplotlib.widgets.AxesWidget")
The base class for constructing Slider widgets. Not intended for direct usage.
For the slider to remain responsive you must maintain a reference to it.
disconnect(*cid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L288-L297)
Remove the observer with connection id *cid*.
Parameters:
**cid**int
Connection id of the observer to be removed.
reset()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L299-L302)
Reset the slider to the initial value.
*class*matplotlib.widgets.SpanSelector(*ax*, *onselect*, *direction*, *minspan=0*, *useblit=False*, *props=None*, *onmove\_callback=None*, *interactive=False*, *button=None*, *handle\_props=None*, *grab\_range=10*, *state\_modifier\_keys=None*, *drag\_from\_anywhere=False*, *ignore\_event\_outside=False*, *snap\_values=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L2181-L2632)
Bases: `_SelectorWidget`
Visually select a min/max range on a single axis and call a function with those values.
To guarantee that the selector remains responsive, keep a reference to it.
In order to turn off the SpanSelector, set `span_selector.active` to False. To turn it back on, set it to True.
Press and release events triggered at the same coordinates outside the selection will clear the selector, except when `ignore_event_outside=True`.
Parameters:
**ax**[`matplotlib.axes.Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
**onselect**callable
A callback function that is called after a release event and the selection is created, changed or removed. It must have the signature:
```
def on_select(min: float, max: float) -> Any
```
**direction**{"horizontal", "vertical"}
The direction along which to draw the span selector.
**minspan**float, default: 0
If selection is less than or equal to *minspan*, the selection is removed (when already existing) or cancelled.
**useblit**bool, default: False
If True, use the backend-dependent blitting features for faster canvas updates. See the tutorial [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html) for details.
**props**dict, optional
Dictionary of [`matplotlib.patches.Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch") properties. Default:
`dict(facecolor='red', alpha=0.5)`
**onmove\_callback**func(min, max), min/max are floats, default: None
Called on mouse move while the span is being selected.
**span\_stays**bool, default: False
If True, the span stays visible after the mouse is released. Deprecated, use *interactive* instead.
**interactive**bool, default: False
Whether to draw a set of handles that allow interaction with the widget after it is drawn.
**button**[`MouseButton`](backend_bases_api#matplotlib.backend_bases.MouseButton "matplotlib.backend_bases.MouseButton") or list of [`MouseButton`](backend_bases_api#matplotlib.backend_bases.MouseButton "matplotlib.backend_bases.MouseButton"), default: all buttons
The mouse buttons which activate the span selector.
**handle\_props**dict, default: None
Properties of the handle lines at the edges of the span. Only used when *interactive* is True. See [`matplotlib.lines.Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D") for valid properties.
**grab\_range**float, default: 10
Distance in pixels within which the interactive tool handles can be activated.
**state\_modifier\_keys**dict, optional
Keyboard modifiers which affect the widget's behavior. Values amend the defaults, which are:
* "clear": Clear the current shape, default: "escape".
**drag\_from\_anywhere**bool, default: False
If [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)"), the widget can be moved by clicking anywhere within its bounds.
**ignore\_event\_outside**bool, default: False
If [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)"), the event triggered outside the span selector will be ignored.
**snap\_values**1D array-like, optional
Snap the selector edges to the given values.
#### Examples
```
>>> import matplotlib.pyplot as plt
>>> import matplotlib.widgets as mwidgets
>>> fig, ax = plt.subplots()
>>> ax.plot([1, 2, 3], [10, 50, 100])
>>> def onselect(vmin, vmax):
... print(vmin, vmax)
>>> span = mwidgets.SpanSelector(ax, onselect, 'horizontal',
... props=dict(facecolor='blue', alpha=0.5))
>>> fig.show()
```
See also: [Span Selector](https://matplotlib.org/stable/gallery/widgets/span_selector.html)
*property*active\_handle[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
connect\_default\_events()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L2410-L2414)
Connect the major canvas events to methods.
*property*direction
Direction of the span selector: 'vertical' or 'horizontal'.
*property*extents
Return extents of the span selector.
new\_axes(*ax*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L2354-L2379)
Set SpanSelector to operate on a new Axes.
*property*pressv[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*property*prev[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*property*rect[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*property*rectprops[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*property*span\_stays[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*class*matplotlib.widgets.SubplotTool(*targetfig*, *toolfig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1507-L1576)
Bases: [`Widget`](#matplotlib.widgets.Widget "matplotlib.widgets.Widget")
A tool to adjust the subplot params of a [`matplotlib.figure.Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure").
Parameters:
**targetfig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The figure instance to adjust.
**toolfig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The figure instance to embed the subplot tool into.
*class*matplotlib.widgets.TextBox(*ax*, *label*, *initial=''*, *color='.95'*, *hovercolor='1'*, *label\_pad=0.01*, *textalignment='left'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1104-L1374)
Bases: [`AxesWidget`](#matplotlib.widgets.AxesWidget "matplotlib.widgets.AxesWidget")
A GUI neutral text input box.
For the text box to remain responsive you must keep a reference to it.
Call [`on_text_change`](#matplotlib.widgets.TextBox.on_text_change "matplotlib.widgets.TextBox.on_text_change") to be updated whenever the text changes.
Call [`on_submit`](#matplotlib.widgets.TextBox.on_submit "matplotlib.widgets.TextBox.on_submit") to be updated whenever the user hits enter or leaves the text entry field.
Attributes:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The parent Axes for the widget.
**label**[`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")
**color**color
The color of the text box when not hovering.
**hovercolor**color
The color of the text box when hovering.
Parameters:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") instance the button will be placed into.
**label**str
Label for this text box.
**initial**str
Initial value in the text box.
**color**color
The color of the box.
**hovercolor**color
The color of the box when the mouse is over it.
**label\_pad**float
The distance between the label and the right side of the textbox.
**textalignment**{'left', 'center', 'right'}
The horizontal location of the text.
*property*DIST\_FROM\_LEFT[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
begin\_typing(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1282-L1301)
disconnect(*cid*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1372-L1374)
Remove the observer with connection id *cid*.
on\_submit(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1363-L1370)
When the user hits enter or leaves the submission box, call this *func* with event.
A connection id is returned which can be used to disconnect.
on\_text\_change(*func*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1355-L1361)
When the text changes, call this *func* with event.
A connection id is returned which can be used to disconnect.
position\_cursor(*x*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1318-L1327)
set\_val(*val*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1272-L1280)
stop\_typing()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L1303-L1316)
*property*text
*class*matplotlib.widgets.ToolHandles(*ax*, *x*, *y*, *marker='o'*, *marker\_props=None*, *useblit=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L2743-L2805)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Control handles for canvas tools.
Parameters:
**ax**[`matplotlib.axes.Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
Matplotlib Axes where tool handles are displayed.
**x, y**1D arrays
Coordinates of control handles.
**marker**str, default: 'o'
Shape of marker used to display handle. See [`matplotlib.pyplot.plot`](_as_gen/matplotlib.pyplot.plot#matplotlib.pyplot.plot "matplotlib.pyplot.plot").
**marker\_props**dict, optional
Additional marker properties. See [`matplotlib.lines.Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D").
**useblit**bool, default: True
Whether to use blitting for faster drawing (if supported by the backend). See the tutorial [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html) for details.
*property*artists
closest(*x*, *y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L2797-L2805)
Return index and pixel distance to closest index.
set\_animated(*val*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L2794-L2795)
set\_data(*pts*, *y=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L2784-L2789)
Set x and y positions of handles.
set\_visible(*val*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L2791-L2792)
*property*x
*property*y
*class*matplotlib.widgets.ToolLineHandles(*ax*, *positions*, *direction*, *line\_props=None*, *useblit=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L2635-L2740)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Control handles for canvas tools.
Parameters:
**ax**[`matplotlib.axes.Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
Matplotlib Axes where tool handles are displayed.
**positions**1D array
Positions of handles in data coordinates.
**direction**{"horizontal", "vertical"}
Direction of handles, either 'vertical' or 'horizontal'
**line\_props**dict, optional
Additional line properties. See [`matplotlib.lines.Line2D`](_as_gen/matplotlib.lines.line2d#matplotlib.lines.Line2D "matplotlib.lines.Line2D").
**useblit**bool, default: True
Whether to use blitting for faster drawing (if supported by the backend). See the tutorial [Faster rendering by using blitting](https://matplotlib.org/stable/tutorials/advanced/blitting.html) for details.
*property*artists
closest(*x*, *y*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L2714-L2740)
Return index and pixel distance to closest handle.
Parameters:
**x, y**float
x, y position from which the distance will be calculated to determinate the closest handle
Returns:
**index, distance**index of the handle and its distance from
position x, y
*property*direction
Direction of the handle: 'vertical' or 'horizontal'.
*property*positions
Positions of the handle in data coordinates.
remove()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L2709-L2712)
Remove the handles artist from the figure.
set\_animated(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L2704-L2707)
Set the animated state of the handles artist.
set\_data(*positions*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L2685-L2697)
Set x or y positions of handles, depending if the lines are vertical of horizontal.
Parameters:
**positions**tuple of length 2
Set the positions of the handle in data coordinates
set\_visible(*value*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L2699-L2702)
Set the visibility state of the handles artist.
*class*matplotlib.widgets.Widget[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L64-L89)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
Abstract base class for GUI neutral widgets.
*property*active
Is the widget active?
drawon*=True*
eventson*=True*
get\_active()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L76-L78)
Get whether the widget is active.
ignore(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L83-L89)
Return whether *event* should be ignored.
This method should be called at the beginning of any event callback.
set\_active(*active*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/widgets.py#L72-L74)
Set whether the widget is active.
| programming_docs |
matplotlib matplotlib.patches matplotlib.patches
==================
Patches are [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")s with a face color and an edge color.
Classes
-------
| | |
| --- | --- |
| [`Annulus`](_as_gen/matplotlib.patches.annulus#matplotlib.patches.Annulus "matplotlib.patches.Annulus")(xy, r, width[, angle]) | An elliptical annulus. |
| [`Arc`](_as_gen/matplotlib.patches.arc#matplotlib.patches.Arc "matplotlib.patches.Arc")(xy, width, height, \*[, angle, theta1, ...]) | An elliptical arc, i.e. a segment of an ellipse. |
| [`Arrow`](_as_gen/matplotlib.patches.arrow#matplotlib.patches.Arrow "matplotlib.patches.Arrow")(x, y, dx, dy, \*[, width]) | An arrow patch. |
| [`ArrowStyle`](_as_gen/matplotlib.patches.arrowstyle#matplotlib.patches.ArrowStyle "matplotlib.patches.ArrowStyle")(stylename, \*\*kwargs) | [`ArrowStyle`](_as_gen/matplotlib.patches.arrowstyle#matplotlib.patches.ArrowStyle "matplotlib.patches.ArrowStyle") is a container class which defines several arrowstyle classes, which is used to create an arrow path along a given path. |
| [`BoxStyle`](_as_gen/matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle "matplotlib.patches.BoxStyle")(stylename, \*\*kwargs) | [`BoxStyle`](_as_gen/matplotlib.patches.boxstyle#matplotlib.patches.BoxStyle "matplotlib.patches.BoxStyle") is a container class which defines several boxstyle classes, which are used for [`FancyBboxPatch`](_as_gen/matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch"). |
| [`Circle`](_as_gen/matplotlib.patches.circle#matplotlib.patches.Circle "matplotlib.patches.Circle")(xy[, radius]) | A circle patch. |
| [`CirclePolygon`](_as_gen/matplotlib.patches.circlepolygon#matplotlib.patches.CirclePolygon "matplotlib.patches.CirclePolygon")(xy[, radius, resolution]) | A polygon-approximation of a circle patch. |
| [`ConnectionPatch`](_as_gen/matplotlib.patches.connectionpatch#matplotlib.patches.ConnectionPatch "matplotlib.patches.ConnectionPatch")(xyA, xyB, coordsA[, ...]) | A patch that connects two points (possibly in different axes). |
| [`ConnectionStyle`](_as_gen/matplotlib.patches.connectionstyle#matplotlib.patches.ConnectionStyle "matplotlib.patches.ConnectionStyle")(stylename, \*\*kwargs) | [`ConnectionStyle`](_as_gen/matplotlib.patches.connectionstyle#matplotlib.patches.ConnectionStyle "matplotlib.patches.ConnectionStyle") is a container class which defines several connectionstyle classes, which is used to create a path between two points. |
| [`Ellipse`](_as_gen/matplotlib.patches.ellipse#matplotlib.patches.Ellipse "matplotlib.patches.Ellipse")(xy, width, height, \*[, angle]) | A scale-free ellipse. |
| [`FancyArrow`](_as_gen/matplotlib.patches.fancyarrow#matplotlib.patches.FancyArrow "matplotlib.patches.FancyArrow")(x, y, dx, dy, \*[, width, ...]) | Like Arrow, but lets you set head width and head height independently. |
| [`FancyArrowPatch`](_as_gen/matplotlib.patches.fancyarrowpatch#matplotlib.patches.FancyArrowPatch "matplotlib.patches.FancyArrowPatch")([posA, posB, path, ...]) | A fancy arrow patch. |
| [`FancyBboxPatch`](_as_gen/matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch")(xy, width, height[, ...]) | A fancy box around a rectangle with lower left at *xy* = (*x*, *y*) with specified width and height. |
| [`Patch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch "matplotlib.patches.Patch")(\*[, edgecolor, facecolor, color, ...]) | A patch is a 2D artist with a face color and an edge color. |
| [`PathPatch`](_as_gen/matplotlib.patches.pathpatch#matplotlib.patches.PathPatch "matplotlib.patches.PathPatch")(path, \*\*kwargs) | A general polycurve path patch. |
| [`StepPatch`](_as_gen/matplotlib.patches.steppatch#matplotlib.patches.StepPatch "matplotlib.patches.StepPatch")(values, edges, \*[, orientation, ...]) | A path patch describing a stepwise constant function. |
| [`Polygon`](_as_gen/matplotlib.patches.polygon#matplotlib.patches.Polygon "matplotlib.patches.Polygon")(xy, \*[, closed]) | A general polygon patch. |
| [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle")(xy, width, height, \*[, angle, ...]) | A rectangle defined via an anchor point *xy* and its *width* and *height*. |
| [`RegularPolygon`](_as_gen/matplotlib.patches.regularpolygon#matplotlib.patches.RegularPolygon "matplotlib.patches.RegularPolygon")(xy, numVertices, \*[, radius, ...]) | A regular polygon patch. |
| [`Shadow`](_as_gen/matplotlib.patches.shadow#matplotlib.patches.Shadow "matplotlib.patches.Shadow")(patch, ox, oy, \*\*kwargs) | Create a shadow of the given *patch*. |
| [`Wedge`](_as_gen/matplotlib.patches.wedge#matplotlib.patches.Wedge "matplotlib.patches.Wedge")(center, r, theta1, theta2, \*[, width]) | Wedge shaped patch. |
Functions
---------
| | |
| --- | --- |
| [`bbox_artist`](_as_gen/matplotlib.patches.bbox_artist#matplotlib.patches.bbox_artist "matplotlib.patches.bbox_artist")(artist, renderer[, props, fill]) | A debug function to draw a rectangle around the bounding box returned by an artist's [`Artist.get_window_extent`](_as_gen/matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent") to test whether the artist is returning the correct bbox. |
| [`draw_bbox`](_as_gen/matplotlib.patches.draw_bbox#matplotlib.patches.draw_bbox "matplotlib.patches.draw_bbox")(bbox, renderer[, color, trans]) | A debug function to draw a rectangle around the bounding box returned by an artist's [`Artist.get_window_extent`](_as_gen/matplotlib.artist.artist.get_window_extent#matplotlib.artist.Artist.get_window_extent "matplotlib.artist.Artist.get_window_extent") to test whether the artist is returning the correct bbox. |
matplotlib matplotlib.layout_engine matplotlib.layout\_engine
=========================
Classes to layout elements in a [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure").
Figures have a `layout_engine` property that holds a subclass of [`LayoutEngine`](#matplotlib.layout_engine.LayoutEngine "matplotlib.layout_engine.LayoutEngine") defined here (or *None* for no layout). At draw time `figure.get_layout_engine().execute()` is called, the goal of which is usually to rearrange Axes on the figure to produce a pleasing layout. This is like a `draw` callback, however when printing we disable the layout engine for the final draw and it is useful to know the layout engine while the figure is being created, in particular to deal with colorbars.
Matplotlib supplies two layout engines, [`TightLayoutEngine`](#matplotlib.layout_engine.TightLayoutEngine "matplotlib.layout_engine.TightLayoutEngine") and [`ConstrainedLayoutEngine`](#matplotlib.layout_engine.ConstrainedLayoutEngine "matplotlib.layout_engine.ConstrainedLayoutEngine"). Third parties can create their own layout engine by subclassing [`LayoutEngine`](#matplotlib.layout_engine.LayoutEngine "matplotlib.layout_engine.LayoutEngine").
*class*matplotlib.layout\_engine.ConstrainedLayoutEngine(*\**, *h\_pad=None*, *w\_pad=None*, *hspace=None*, *wspace=None*, *rect=(0, 0, 1, 1)*, *compress=False*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/layout_engine.py#L193-L286)
Implements the `constrained_layout` geometry management. See [Constrained Layout Guide](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html) for details.
Initialize `constrained_layout` settings.
Parameters:
**h\_pad, w\_pad**float
Padding around the axes elements in figure-normalized units. Default to `[rcParams["figure.constrained\_layout.h\_pad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.constrained_layout.h_pad#matplotlibrc-sample)` (default: `0.04167`) and `[rcParams["figure.constrained\_layout.w\_pad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.constrained_layout.w_pad#matplotlibrc-sample)` (default: `0.04167`).
**hspace, wspace**float
Fraction of the figure to dedicate to space between the axes. These are evenly spread between the gaps between the axes. A value of 0.2 for a three-column layout would have a space of 0.1 of the figure width between each column. If h/wspace < h/w\_pad, then the pads are used instead. Default to `[rcParams["figure.constrained\_layout.hspace"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.constrained_layout.hspace#matplotlibrc-sample)` (default: `0.02`) and `[rcParams["figure.constrained\_layout.wspace"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.constrained_layout.wspace#matplotlibrc-sample)` (default: `0.02`).
**rect**tuple of 4 floats
Rectangle in figure coordinates to perform constrained layout in (left, bottom, width, height), each from 0-1.
**compress**bool
Whether to shift Axes so that white space in between them is removed. This is useful for simple grids of fixed-aspect Axes (e.g. a grid of images). See [Grids of fixed aspect-ratio Axes: "compressed" layout](https://matplotlib.org/stable/tutorials/intermediate/constrainedlayout_guide.html#compressed-layout).
*property*adjust\_compatible
Return a boolean if the layout engine is compatible with [`subplots_adjust`](figure_api#matplotlib.figure.Figure.subplots_adjust "matplotlib.figure.Figure.subplots_adjust").
*property*colorbar\_gridspec
Return a boolean if the layout engine creates colorbars using a gridspec.
execute(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/layout_engine.py#L242-L259)
Perform constrained\_layout and move and resize axes accordingly.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") to perform layout on.
get()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/layout_engine.py#L89-L93)
Return copy of the parameters for the layout engine.
set(*\**, *h\_pad=None*, *w\_pad=None*, *hspace=None*, *wspace=None*, *rect=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/layout_engine.py#L261-L286)
Set the pads for constrained\_layout.
Parameters:
**h\_pad, w\_pad**float
Padding around the axes elements in figure-normalized units. Default to `[rcParams["figure.constrained\_layout.h\_pad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.constrained_layout.h_pad#matplotlibrc-sample)` (default: `0.04167`) and `[rcParams["figure.constrained\_layout.w\_pad"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.constrained_layout.w_pad#matplotlibrc-sample)` (default: `0.04167`).
**hspace, wspace**float
Fraction of the figure to dedicate to space between the axes. These are evenly spread between the gaps between the axes. A value of 0.2 for a three-column layout would have a space of 0.1 of the figure width between each column. If h/wspace < h/w\_pad, then the pads are used instead. Default to `[rcParams["figure.constrained\_layout.hspace"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.constrained_layout.hspace#matplotlibrc-sample)` (default: `0.02`) and `[rcParams["figure.constrained\_layout.wspace"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=figure.constrained_layout.wspace#matplotlibrc-sample)` (default: `0.02`).
**rect**tuple of 4 floats
Rectangle in figure coordinates to perform constrained layout in (left, bottom, width, height), each from 0-1.
*class*matplotlib.layout\_engine.LayoutEngine(*\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/layout_engine.py#L27-L100)
Base class for Matplotlib layout engines.
A layout engine can be passed to a figure at instantiation or at any time with [`set_layout_engine`](figure_api#matplotlib.figure.Figure.set_layout_engine "matplotlib.figure.Figure.set_layout_engine"). Once attached to a figure, the layout engine `execute` function is called at draw time by [`draw`](figure_api#matplotlib.figure.Figure.draw "matplotlib.figure.Figure.draw"), providing a special draw-time hook.
Note
However, note that layout engines affect the creation of colorbars, so [`set_layout_engine`](figure_api#matplotlib.figure.Figure.set_layout_engine "matplotlib.figure.Figure.set_layout_engine") should be called before any colorbars are created.
Currently, there are two properties of [`LayoutEngine`](#matplotlib.layout_engine.LayoutEngine "matplotlib.layout_engine.LayoutEngine") classes that are consulted while manipulating the figure:
* `engine.colorbar_gridspec` tells [`Figure.colorbar`](figure_api#matplotlib.figure.Figure.colorbar "matplotlib.figure.Figure.colorbar") whether to make the
axes using the gridspec method (see [`colorbar.make_axes_gridspec`](colorbar_api#matplotlib.colorbar.make_axes_gridspec "matplotlib.colorbar.make_axes_gridspec")) or not (see [`colorbar.make_axes`](colorbar_api#matplotlib.colorbar.make_axes "matplotlib.colorbar.make_axes"));
* `engine.adjust_compatible` stops [`Figure.subplots_adjust`](figure_api#matplotlib.figure.Figure.subplots_adjust "matplotlib.figure.Figure.subplots_adjust") from being
run if it is not compatible with the layout engine.
To implement a custom [`LayoutEngine`](#matplotlib.layout_engine.LayoutEngine "matplotlib.layout_engine.LayoutEngine"):
1. override `_adjust_compatible` and `_colorbar_gridspec`
2. override [`LayoutEngine.set`](#matplotlib.layout_engine.LayoutEngine.set "matplotlib.layout_engine.LayoutEngine.set") to update *self.\_params*
3. override [`LayoutEngine.execute`](#matplotlib.layout_engine.LayoutEngine.execute "matplotlib.layout_engine.LayoutEngine.execute") with your implementation
*property*adjust\_compatible
Return a boolean if the layout engine is compatible with [`subplots_adjust`](figure_api#matplotlib.figure.Figure.subplots_adjust "matplotlib.figure.Figure.subplots_adjust").
*property*colorbar\_gridspec
Return a boolean if the layout engine creates colorbars using a gridspec.
execute(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/layout_engine.py#L95-L100)
Execute the layout on the figure given by *fig*.
get()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/layout_engine.py#L89-L93)
Return copy of the parameters for the layout engine.
set(*\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/layout_engine.py#L66-L67)
*class*matplotlib.layout\_engine.PlaceHolderLayoutEngine(*adjust\_compatible*, *colorbar\_gridspec*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/layout_engine.py#L103-L124)
This layout engine does not adjust the figure layout at all.
The purpose of this [`LayoutEngine`](#matplotlib.layout_engine.LayoutEngine "matplotlib.layout_engine.LayoutEngine") is to act as a place holder when the user removes a layout engine to ensure an incompatible [`LayoutEngine`](#matplotlib.layout_engine.LayoutEngine "matplotlib.layout_engine.LayoutEngine") can not be set later.
Parameters:
**adjust\_compatible, colorbar\_gridspec**bool
Allow the PlaceHolderLayoutEngine to mirror the behavior of whatever layout engine it is replacing.
*property*adjust\_compatible
Return a boolean if the layout engine is compatible with [`subplots_adjust`](figure_api#matplotlib.figure.Figure.subplots_adjust "matplotlib.figure.Figure.subplots_adjust").
*property*colorbar\_gridspec
Return a boolean if the layout engine creates colorbars using a gridspec.
execute(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/layout_engine.py#L123-L124)
Execute the layout on the figure given by *fig*.
get()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/layout_engine.py#L89-L93)
Return copy of the parameters for the layout engine.
set(*\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/layout_engine.py#L66-L67)
*class*matplotlib.layout\_engine.TightLayoutEngine(*\**, *pad=1.08*, *h\_pad=None*, *w\_pad=None*, *rect=(0, 0, 1, 1)*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/layout_engine.py#L127-L190)
Implements the `tight_layout` geometry management. See [Tight Layout guide](https://matplotlib.org/stable/tutorials/intermediate/tight_layout_guide.html) for details.
Initialize tight\_layout engine.
Parameters:
**pad**float, 1.08
Padding between the figure edge and the edges of subplots, as a fraction of the font size.
**h\_pad, w\_pad**float
Padding (height/width) between edges of adjacent subplots. Defaults to *pad*.
**rect**tuple (left, bottom, right, top), default: (0, 0, 1, 1).
rectangle in normalized figure coordinates that the subplots (including labels) will fit into.
*property*adjust\_compatible
Return a boolean if the layout engine is compatible with [`subplots_adjust`](figure_api#matplotlib.figure.Figure.subplots_adjust "matplotlib.figure.Figure.subplots_adjust").
*property*colorbar\_gridspec
Return a boolean if the layout engine creates colorbars using a gridspec.
execute(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/layout_engine.py#L158-L185)
Execute tight\_layout.
This decides the subplot parameters given the padding that will allow the axes labels to not be covered by other labels and axes.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") to perform layout on.
**See also: `.figure.Figure.tight\_layout` and `.pyplot.tight\_layout`.**
get()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/layout_engine.py#L89-L93)
Return copy of the parameters for the layout engine.
set(*\**, *pad=None*, *w\_pad=None*, *h\_pad=None*, *rect=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/layout_engine.py#L187-L190)
matplotlib backend_cairo backend\_cairo
==============
A Cairo backend for Matplotlib
------------------------------
Author:
Steve Chaplin and others
This backend depends on cairocffi or pycairo.
matplotlib.backends.backend\_cairo.FigureCanvas[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L413-L533)
alias of [`FigureCanvasCairo`](#matplotlib.backends.backend_cairo.FigureCanvasCairo "matplotlib.backends.backend_cairo.FigureCanvasCairo")
*class*matplotlib.backends.backend\_cairo.FigureCanvasCairo(*figure=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L413-L533)
Bases: [`FigureCanvasBase`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase "matplotlib.backend_bases.FigureCanvasBase")
copy\_from\_bbox(*bbox*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L427-L444)
get\_renderer()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L424-L425)
print\_pdf(*fobj*, *\**, *orientation='portrait'*)
print\_png(*fobj*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L460-L461)
print\_ps(*fobj*, *\**, *orientation='portrait'*)
print\_raw(*fobj*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L463-L467)
print\_rgba(*fobj*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L463-L467)
print\_svg(*fobj*, *\**, *orientation='portrait'*)
print\_svgz(*fobj*, *\**, *orientation='portrait'*)
restore\_region(*region*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L446-L458)
*class*matplotlib.backends.backend\_cairo.GraphicsContextCairo(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L322-L404)
Bases: [`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
get\_rgb()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L395-L396)
Return a tuple of three or four floats from 0-1.
restore()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L339-L340)
Restore the graphics context from the stack - needed only for backends that save graphics contexts on a stack.
set\_alpha(*alpha*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L342-L349)
Set the alpha value used for blending - not supported on all backends.
If `alpha=None` (the default), the alpha components of the foreground and fill colors will be used to set their respective transparencies (where applicable); otherwise, `alpha` will override them.
set\_antialiased(*b*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L351-L353)
Set whether object should be drawn with antialiased rendering.
set\_capstyle(*cs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L355-L357)
Set how to draw endpoints of lines.
Parameters:
**cs**[`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'}
set\_clip\_path(*path*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L368-L377)
Set the clip path to a [`TransformedPath`](transformations#matplotlib.transforms.TransformedPath "matplotlib.transforms.TransformedPath") or None.
set\_clip\_rectangle(*rectangle*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L359-L366)
Set the clip rectangle to a [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") or None.
set\_dashes(*offset*, *dashes*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L379-L386)
Set the dash style for the gc.
Parameters:
**dash\_offset**float
Distance, in points, into the dash pattern at which to start the pattern. It is usually set to 0.
**dash\_list**array-like or None
The on-off sequence as points. None specifies a solid line. All values must otherwise be non-negative (\(\ge 0\)).
#### Notes
See p. 666 of the PostScript [Language Reference](https://www.adobe.com/jp/print/postscript/pdfs/PLRM.pdf) for more info.
set\_foreground(*fg*, *isRGBA=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L388-L393)
Set the foreground color.
Parameters:
**fg**color
**isRGBA**bool
If *fg* is known to be an `(r, g, b, a)` tuple, *isRGBA* can be set to True to improve performance.
set\_joinstyle(*js*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L398-L400)
Set how to draw connections between line segments.
Parameters:
**js**[`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'}
set\_linewidth(*w*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L402-L404)
Set the linewidth in points.
*class*matplotlib.backends.backend\_cairo.RendererCairo(*dpi*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L107-L319)
Bases: [`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase")
draw\_image(*gc*, *x*, *y*, *im*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L217-L228)
Draw an RGBA image.
Parameters:
**gc**[`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
A graphics context with clipping information.
**x**scalar
The distance in physical units (i.e., dots or pixels) from the left hand side of the canvas.
**y**scalar
The distance in physical units (i.e., dots or pixels) from the bottom side of the canvas.
**im**(N, M, 4) array-like of np.uint8
An array of RGBA pixels.
**transform**[`matplotlib.transforms.Affine2DBase`](transformations#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")
If and only if the concrete backend is written such that `option_scale_image` returns `True`, an affine transformation (i.e., an [`Affine2DBase`](transformations#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")) *may* be passed to [`draw_image`](#matplotlib.backends.backend_cairo.RendererCairo.draw_image "matplotlib.backends.backend_cairo.RendererCairo.draw_image"). The translation vector of the transformation is given in physical units (i.e., dots or pixels). Note that the transformation does not override *x* and *y*, and has to be applied *before* translating the result by *x* and *y* (this can be accomplished by adding *x* and *y* to the translation vector defined by *transform*).
draw\_markers(*gc*, *marker\_path*, *marker\_trans*, *path*, *transform*, *rgbFace=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L169-L215)
Draw a marker at each of *path*'s vertices (excluding control points).
The base (fallback) implementation makes multiple calls to [`draw_path`](#matplotlib.backends.backend_cairo.RendererCairo.draw_path "matplotlib.backends.backend_cairo.RendererCairo.draw_path"). Backends may want to override this method in order to draw the marker only once and reuse it multiple times.
Parameters:
**gc**[`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
The graphics context.
**marker\_trans**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
An affine transform applied to the marker.
**trans**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
An affine transform applied to the path.
draw\_path(*gc*, *path*, *transform*, *rgbFace=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L155-L167)
Draw a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") instance using the given affine transform.
draw\_text(*gc*, *x*, *y*, *s*, *prop*, *angle*, *ismath=False*, *mtext=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L230-L254)
Draw a text instance.
Parameters:
**gc**[`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
The graphics context.
**x**float
The x location of the text in display coords.
**y**float
The y location of the text baseline in display coords.
**s**str
The text string.
**prop**[`matplotlib.font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties")
The font properties.
**angle**float
The rotation angle in degrees anti-clockwise.
**mtext**[`matplotlib.text.Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")
The original text object to be rendered.
#### Notes
**Note for backend implementers:**
When you are trying to determine if you have gotten your bounding box right (which is what enables the text layout/alignment to work properly), it helps to change the line in text.py:
```
if 0: bbox_artist(self, renderer)
```
to if 1, and then the actual bounding box will be plotted along with your text.
get\_canvas\_width\_height()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L282-L284)
Return the canvas width and height in display coords.
get\_text\_width\_height\_descent(*s*, *prop*, *ismath*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L286-L308)
Get the width, height, and descent (offset from the bottom to the baseline), in display coords, of the string *s* with [`FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") *prop*.
new\_gc()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L310-L315)
Return an instance of a [`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase").
points\_to\_pixels(*points*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L317-L319)
Convert points to display units.
You need to override this function (unless your backend doesn't have a dpi, e.g., postscript or svg). Some imaging systems assume some value for pixels per inch:
```
points to pixels = points * pixels_per_inch/72 * dpi/72
```
Parameters:
**points**float or array-like
a float or a numpy array of float
Returns:
Points converted to pixels
set\_context(*ctx*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L117-L133)
set\_ctx\_from\_surface(*surface*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L135-L137)
[*Deprecated*]
#### Notes
Deprecated since version 3.6: Use set\_context instead.
set\_width\_height(*width*, *height*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_cairo.py#L139-L142)
[*Deprecated*]
#### Notes
Deprecated since version 3.6:
| programming_docs |
matplotlib backend_pgf backend\_pgf
============
matplotlib.backends.backend\_pgf.FigureCanvas[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L772-L897)
alias of [`FigureCanvasPgf`](#matplotlib.backends.backend_pgf.FigureCanvasPgf "matplotlib.backends.backend_pgf.FigureCanvasPgf")
*class*matplotlib.backends.backend\_pgf.FigureCanvasPgf(*figure=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L772-L897)
Bases: [`FigureCanvasBase`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase "matplotlib.backend_bases.FigureCanvasBase")
draw()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L895-L897)
Render the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure").
This method must walk the artist tree, even if no output is produced, because it triggers deferred work that users may want to access before saving output to disk. For example computing limits, auto-limits, and tick values.
filetypes*={'pdf': 'LaTeX compiled PGF picture', 'pgf': 'LaTeX PGF picture', 'png': 'Portable Network Graphics'}*
get\_default\_filetype()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L777-L778)
Return the default savefig file format as specified in `[rcParams["savefig.format"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=savefig.format#matplotlibrc-sample)` (default: `'png'`).
The returned string does not include a period. This method is overridden in backends that only support a single file type.
get\_renderer()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L892-L893)
print\_pdf(*fname\_or\_fh*, *\**, *metadata=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L846-L877)
Use LaTeX to compile a pgf generated figure to pdf.
print\_pgf(*fname\_or\_fh*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L836-L844)
Output pgf macros for drawing the figure so it can be included and rendered in latex documents.
print\_png(*fname\_or\_fh*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L879-L890)
Use LaTeX to compile a pgf figure to pdf and convert it to png.
*exception*matplotlib.backends.backend\_pgf.LatexError(*message*, *latex\_output=''*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L211-L220)
Bases: [`Exception`](https://docs.python.org/3/library/exceptions.html#Exception "(in Python v3.10)")
*class*matplotlib.backends.backend\_pgf.LatexManager[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L223-L371)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
The LatexManager opens an instance of the LaTeX application for determining the metrics of text elements. The LaTeX environment can be modified by setting fonts and/or a custom preamble in [`rcParams`](matplotlib_configuration_api#matplotlib.rcParams "matplotlib.rcParams").
get\_width\_height\_descent(*text*, *prop*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L339-L344)
Get the width, total height, and descent (in TeX points) for a text typeset by the current LaTeX environment.
*property*latex\_header[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*property*str\_cache[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*property*texcommand[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/_api/deprecation.py)
*class*matplotlib.backends.backend\_pgf.PdfPages(*filename*, *\**, *keep\_empty=True*, *metadata=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L908-L1057)
Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.10)")
A multi-page PDF file using the pgf backend
#### Examples
```
>>> import matplotlib.pyplot as plt
>>> # Initialize:
>>> with PdfPages('foo.pdf') as pdf:
... # As many times as you like, create a figure fig and save it:
... fig = plt.figure()
... pdf.savefig(fig)
... # When no figure is specified the current figure is saved
... pdf.savefig()
```
Create a new PdfPages object.
Parameters:
**filename**str or path-like
Plots using [`PdfPages.savefig`](#matplotlib.backends.backend_pgf.PdfPages.savefig "matplotlib.backends.backend_pgf.PdfPages.savefig") will be written to a file at this location. Any older file with the same name is overwritten.
**keep\_empty**bool, default: True
If set to False, then empty pdf files will be deleted automatically when closed.
**metadata**dict, optional
Information dictionary object (see PDF reference section 10.2.1 'Document Information Dictionary'), e.g.: `{'Creator': 'My software', 'Author': 'Me', 'Title': 'Awesome'}`.
The standard keys are 'Title', 'Author', 'Subject', 'Keywords', 'Creator', 'Producer', 'CreationDate', 'ModDate', and 'Trapped'. Values have been predefined for 'Creator', 'Producer' and 'CreationDate'. They can be removed by setting them to [`None`](https://docs.python.org/3/library/constants.html#None "(in Python v3.10)").
Note that some versions of LaTeX engines may ignore the 'Producer' key and set it to themselves.
close()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L987-L997)
Finalize this object, running LaTeX in a temporary directory and moving the final pdf file to *filename*.
get\_pagecount()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L1055-L1057)
Return the current number of pages in the multipage pdf file.
keep\_empty
savefig(*figure=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L1010-L1053)
Save a [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") to this file as a new page.
Any other keyword arguments are passed to [`savefig`](figure_api#matplotlib.figure.Figure.savefig "matplotlib.figure.Figure.savefig").
Parameters:
**figure**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") or int, default: the active figure
The figure, or index of the figure, that is saved to the file.
*class*matplotlib.backends.backend\_pgf.RendererPgf(*figure*, *fh*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L390-L769)
Bases: [`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase")
Create a new PGF renderer that translates any drawing instruction into text commands to be interpreted in a latex pgfpicture environment.
Attributes:
**figure**[`matplotlib.figure.Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
Matplotlib figure to initialize height, width and dpi from.
**fh**file-like
File handle for the output of the drawing commands.
draw\_image(*gc*, *x*, *y*, *im*, *transform=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L655-L694)
Draw an RGBA image.
Parameters:
**gc**[`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
A graphics context with clipping information.
**x**scalar
The distance in physical units (i.e., dots or pixels) from the left hand side of the canvas.
**y**scalar
The distance in physical units (i.e., dots or pixels) from the bottom side of the canvas.
**im**(N, M, 4) array-like of np.uint8
An array of RGBA pixels.
**transform**[`matplotlib.transforms.Affine2DBase`](transformations#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")
If and only if the concrete backend is written such that [`option_scale_image`](#matplotlib.backends.backend_pgf.RendererPgf.option_scale_image "matplotlib.backends.backend_pgf.RendererPgf.option_scale_image") returns `True`, an affine transformation (i.e., an [`Affine2DBase`](transformations#matplotlib.transforms.Affine2DBase "matplotlib.transforms.Affine2DBase")) *may* be passed to [`draw_image`](#matplotlib.backends.backend_pgf.RendererPgf.draw_image "matplotlib.backends.backend_pgf.RendererPgf.draw_image"). The translation vector of the transformation is given in physical units (i.e., dots or pixels). Note that the transformation does not override *x* and *y*, and has to be applied *before* translating the result by *x* and *y* (this can be accomplished by adding *x* and *y* to the translation vector defined by *transform*).
draw\_markers(*gc*, *marker\_path*, *marker\_trans*, *path*, *trans*, *rgbFace=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L411-L447)
Draw a marker at each of *path*'s vertices (excluding control points).
The base (fallback) implementation makes multiple calls to [`draw_path`](#matplotlib.backends.backend_pgf.RendererPgf.draw_path "matplotlib.backends.backend_pgf.RendererPgf.draw_path"). Backends may want to override this method in order to draw the marker only once and reuse it multiple times.
Parameters:
**gc**[`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
The graphics context.
**marker\_trans**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
An affine transform applied to the marker.
**trans**[`matplotlib.transforms.Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
An affine transform applied to the path.
draw\_path(*gc*, *path*, *transform*, *rgbFace=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L449-L500)
Draw a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") instance using the given affine transform.
draw\_tex(*gc*, *x*, *y*, *s*, *prop*, *angle*, *ismath='TeX'*, *mtext=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L696-L698)
draw\_text(*gc*, *x*, *y*, *s*, *prop*, *angle*, *ismath=False*, *mtext=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L700-L745)
Draw a text instance.
Parameters:
**gc**[`GraphicsContextBase`](backend_bases_api#matplotlib.backend_bases.GraphicsContextBase "matplotlib.backend_bases.GraphicsContextBase")
The graphics context.
**x**float
The x location of the text in display coords.
**y**float
The y location of the text baseline in display coords.
**s**str
The text string.
**prop**[`matplotlib.font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties")
The font properties.
**angle**float
The rotation angle in degrees anti-clockwise.
**mtext**[`matplotlib.text.Text`](text_api#matplotlib.text.Text "matplotlib.text.Text")
The original text object to be rendered.
#### Notes
**Note for backend implementers:**
When you are trying to determine if you have gotten your bounding box right (which is what enables the text layout/alignment to work properly), it helps to change the line in text.py:
```
if 0: bbox_artist(self, renderer)
```
to if 1, and then the actual bounding box will be plotted along with your text.
flipy()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L758-L760)
Return whether y values increase from top to bottom.
Note that this only affects drawing of texts.
get\_canvas\_width\_height()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L762-L765)
Return the canvas width and height in display coords.
get\_text\_width\_height\_descent(*s*, *prop*, *ismath*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L747-L756)
Get the width, height, and descent (offset from the bottom to the baseline), in display coords, of the string *s* with [`FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") *prop*.
option\_image\_nocomposite()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L651-L653)
Return whether image composition by Matplotlib should be skipped.
Raster backends should usually return False (letting the C-level rasterizer take care of image composition); vector backends should usually return `not rcParams["image.composite_image"]`.
option\_scale\_image()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L647-L649)
Return whether arbitrary affine transformations in [`draw_image`](#matplotlib.backends.backend_pgf.RendererPgf.draw_image "matplotlib.backends.backend_pgf.RendererPgf.draw_image") are supported (True for most vector backends).
points\_to\_pixels(*points*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L767-L769)
Convert points to display units.
You need to override this function (unless your backend doesn't have a dpi, e.g., postscript or svg). Some imaging systems assume some value for pixels per inch:
```
points to pixels = points * pixels_per_inch/72 * dpi/72
```
Parameters:
**points**float or array-like
a float or a numpy array of float
Returns:
Points converted to pixels
matplotlib.backends.backend\_pgf.common\_texification(*text*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L95-L97)
[*Deprecated*]
#### Notes
Deprecated since version 3.6:
matplotlib.backends.backend\_pgf.get\_fontspec()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L45-L49)
[*Deprecated*] Build fontspec preamble from rc.
#### Notes
Deprecated since version 3.6.
matplotlib.backends.backend\_pgf.get\_preamble()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L52-L55)
[*Deprecated*] Get LaTeX preamble from rc.
#### Notes
Deprecated since version 3.6.
matplotlib.backends.backend\_pgf.make\_pdf\_to\_png\_converter()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L184-L208)
Return a function that converts a pdf file to a png file.
matplotlib.backends.backend\_pgf.writeln(*fh*, *line*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/backends/backend_pgf.py#L128-L130)
[*Deprecated*]
#### Notes
Deprecated since version 3.6:
matplotlib matplotlib.image matplotlib.image
================
The image module supports basic image loading, rescaling and display operations.
*class*matplotlib.image.AxesImage(*ax*, *\**, *cmap=None*, *norm=None*, *interpolation=None*, *origin=None*, *extent=None*, *filternorm=True*, *filterrad=4.0*, *resample=False*, *interpolation\_stage=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L857-L1021)
Bases: `_ImageBase`
An image attached to an Axes.
Parameters:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The axes the image will belong to.
**cmap**str or [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"), default: `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
The Colormap instance or registered colormap name used to map scalar data to colors.
**norm**str or [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize")
Maps luminance to 0-1.
**interpolation**str, default: `[rcParams["image.interpolation"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.interpolation#matplotlibrc-sample)` (default: `'antialiased'`)
Supported values are 'none', 'antialiased', 'nearest', 'bilinear', 'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', 'hermite', 'kaiser', 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos', 'blackman'.
**interpolation\_stage**{'data', 'rgba'}, default: 'data'
If 'data', interpolation is carried out on the data provided by the user. If 'rgba', the interpolation is carried out after the colormapping has been applied (visual interpolation).
**origin**{'upper', 'lower'}, default: `[rcParams["image.origin"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.origin#matplotlibrc-sample)` (default: `'upper'`)
Place the [0, 0] index of the array in the upper left or lower left corner of the axes. The convention 'upper' is typically used for matrices and images.
**extent**tuple, optional
The data axes (left, right, bottom, top) for making image plots registered with data plots. Default is to label the pixel centers with the zero-based row and column indices.
**filternorm**bool, default: True
A parameter for the antigrain image resize filter (see the antigrain documentation). If filternorm is set, the filter normalizes integer values and corrects the rounding errors. It doesn't do anything with the source floating point values, it corrects only integers according to the rule of 1.0 which means that any sum of pixel weights must be equal to 1.0. So, the filter function must produce a graph of the proper shape.
**filterrad**float > 0, default: 4
The filter radius for filters that have a radius parameter, i.e. when interpolation is one of: 'sinc', 'lanczos' or 'blackman'.
**resample**bool, default: False
When True, use a full resampling method. When False, only resample when the output image is larger than the input image.
**\*\*kwargs**[`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") properties
Parameters:
**norm**[`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") (or subclass thereof) or str or None
The normalizing object which scales data, typically into the interval `[0, 1]`. If a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)"), a [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") subclass is dynamically generated based on the scale with the corresponding name. If *None*, *norm* defaults to a *colors.Normalize* object which initializes its scaling based on the first data processed.
**cmap**str or [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap")
The colormap used to map normalized data values to RGBA colors.
get\_cursor\_data(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L996-L1021)
Return the image value at the event position or *None* if the event is outside the image.
See also
[`matplotlib.artist.Artist.get_cursor_data`](_as_gen/matplotlib.artist.artist.get_cursor_data#matplotlib.artist.Artist.get_cursor_data "matplotlib.artist.Artist.get_cursor_data")
get\_extent()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L984-L994)
Return the image extent as tuple (left, right, bottom, top).
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L935-L938)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
make\_image(*renderer*, *magnification=1.0*, *unsampled=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L940-L950)
Normalize, rescale, and colormap this image's data for rendering using *renderer*, with the given *magnification*.
If *unsampled* is True, the image will not be scaled, but an appropriate affine transformation will be returned instead.
Returns:
**image**(M, N, 4) uint8 array
The RGBA image, resampled unless *unsampled* is True.
**x, y**float
The upper left corner where the image should be drawn, in pixel space.
**trans**Affine2D
The affine transformation from image to pixel space.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *array=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *data=<UNSET>*, *extent=<UNSET>*, *filternorm=<UNSET>*, *filterrad=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *interpolation=<UNSET>*, *interpolation\_stage=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *resample=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| `alpha` | float or 2D array-like or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| `array` | array-like |
| [`clim`](cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| `data` | array-like or [`PIL.Image.Image`](https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image "(in Pillow (PIL Fork) v9.2.0)") |
| [`extent`](#matplotlib.image.AxesImage.set_extent "matplotlib.image.AxesImage.set_extent") | 4-tuple of float |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| `filternorm` | bool |
| `filterrad` | positive float |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| `interpolation` | {'antialiased', 'nearest', 'bilinear', 'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', 'hermite', 'kaiser', 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos', 'none'} or None |
| `interpolation_stage` | {'data', 'rgba'} or None |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `resample` | bool or None |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_extent(*extent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L956-L982)
Set the image extent.
Parameters:
**extent**4-tuple of float
The position and size of the image as tuple `(left, right, bottom, top)` in data coordinates.
#### Notes
This updates `ax.dataLim`, and, if autoscaling, sets `ax.viewLim` to tightly fit the image, regardless of `dataLim`. Autoscaling state is not changed, so following this with `ax.autoscale_view()` will redo the autoscaling in accord with `dataLim`.
*class*matplotlib.image.BboxImage(*bbox*, *\**, *cmap=None*, *norm=None*, *interpolation=None*, *origin=None*, *filternorm=True*, *filterrad=4.0*, *resample=False*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1398-L1466)
Bases: `_ImageBase`
The Image class whose size is determined by the given bbox.
cmap is a colors.Colormap instance norm is a colors.Normalize instance to map luminance to 0-1
kwargs are an optional list of Artist keyword args
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1442-L1454)
Test whether the mouse event occurred within the image.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1431-L1440)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
make\_image(*renderer*, *magnification=1.0*, *unsampled=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1456-L1466)
Normalize, rescale, and colormap this image's data for rendering using *renderer*, with the given *magnification*.
If *unsampled* is True, the image will not be scaled, but an appropriate affine transformation will be returned instead.
Returns:
**image**(M, N, 4) uint8 array
The RGBA image, resampled unless *unsampled* is True.
**x, y**float
The upper left corner where the image should be drawn, in pixel space.
**trans**Affine2D
The affine transformation from image to pixel space.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *array=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *data=<UNSET>*, *filternorm=<UNSET>*, *filterrad=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *interpolation=<UNSET>*, *interpolation\_stage=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *resample=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| `alpha` | float or 2D array-like or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| `array` | array-like |
| [`clim`](cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| `data` | array-like or [`PIL.Image.Image`](https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image "(in Pillow (PIL Fork) v9.2.0)") |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| `filternorm` | bool |
| `filterrad` | positive float |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| `interpolation` | {'antialiased', 'nearest', 'bilinear', 'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', 'hermite', 'kaiser', 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos', 'none'} or None |
| `interpolation_stage` | {'data', 'rgba'} or None |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `resample` | bool or None |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
*class*matplotlib.image.FigureImage(*fig*, *\**, *cmap=None*, *norm=None*, *offsetx=0*, *offsety=0*, *origin=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1335-L1395)
Bases: `_ImageBase`
An image attached to a figure.
cmap is a colors.Colormap instance norm is a colors.Normalize instance to map luminance to 0-1
kwargs are an optional list of Artist keyword args
get\_extent()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1369-L1373)
Return the image extent as tuple (left, right, bottom, top).
make\_image(*renderer*, *magnification=1.0*, *unsampled=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1375-L1390)
Normalize, rescale, and colormap this image's data for rendering using *renderer*, with the given *magnification*.
If *unsampled* is True, the image will not be scaled, but an appropriate affine transformation will be returned instead.
Returns:
**image**(M, N, 4) uint8 array
The RGBA image, resampled unless *unsampled* is True.
**x, y**float
The upper left corner where the image should be drawn, in pixel space.
**trans**Affine2D
The affine transformation from image to pixel space.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *array=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *data=<UNSET>*, *filternorm=<UNSET>*, *filterrad=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *interpolation=<UNSET>*, *interpolation\_stage=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *resample=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| `alpha` | float or 2D array-like or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| `array` | array-like |
| [`clim`](cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`data`](#matplotlib.image.FigureImage.set_data "matplotlib.image.FigureImage.set_data") | unknown |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| `filternorm` | bool |
| `filterrad` | positive float |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| `interpolation` | {'antialiased', 'nearest', 'bilinear', 'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', 'hermite', 'kaiser', 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos', 'none'} or None |
| `interpolation_stage` | {'data', 'rgba'} or None |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `resample` | bool or None |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_data(*A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1392-L1395)
Set the image array.
zorder*=0*
*class*matplotlib.image.NonUniformImage(*ax*, *\**, *interpolation='nearest'*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1024-L1179)
Bases: [`AxesImage`](#matplotlib.image.AxesImage "matplotlib.image.AxesImage")
Parameters:
**interpolation**{'nearest', 'bilinear'}, default: 'nearest'
**\*\*kwargs**
All other keyword arguments are identical to those of [`AxesImage`](#matplotlib.image.AxesImage "matplotlib.image.AxesImage").
get\_extent()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1160-L1163)
Return the image extent as tuple (left, right, bottom, top).
make\_image(*renderer*, *magnification=1.0*, *unsampled=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1043-L1111)
Normalize, rescale, and colormap this image's data for rendering using *renderer*, with the given *magnification*.
If *unsampled* is True, the image will not be scaled, but an appropriate affine transformation will be returned instead.
Returns:
**image**(M, N, 4) uint8 array
The RGBA image, resampled unless *unsampled* is True.
**x, y**float
The upper left corner where the image should be drawn, in pixel space.
**trans**Affine2D
The affine transformation from image to pixel space.
mouseover*=False*
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *array=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *data=<UNSET>*, *extent=<UNSET>*, *filternorm=<UNSET>*, *filterrad=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *interpolation=<UNSET>*, *interpolation\_stage=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *resample=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| `alpha` | float or 2D array-like or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| `array` | unknown |
| [`clim`](cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | unknown |
| [`data`](#matplotlib.image.NonUniformImage.set_data "matplotlib.image.NonUniformImage.set_data") | unknown |
| [`extent`](#matplotlib.image.AxesImage.set_extent "matplotlib.image.AxesImage.set_extent") | 4-tuple of float |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| `filternorm` | unknown |
| `filterrad` | unknown |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`interpolation`](#matplotlib.image.NonUniformImage.set_interpolation "matplotlib.image.NonUniformImage.set_interpolation") | {'nearest', 'bilinear'} or None |
| `interpolation_stage` | {'data', 'rgba'} or None |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | unknown |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `resample` | bool or None |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_array(*\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1145-L1146)
Retained for backwards compatibility - use set\_data instead.
Parameters:
**A**array-like
set\_cmap(*cmap*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1176-L1179)
Set the colormap for luminance data.
Parameters:
**cmap**[`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None
set\_data(*x*, *y*, *A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1113-L1143)
Set the grid for the pixel centers, and the pixel values.
Parameters:
**x, y**1D array-like
Monotonic arrays of shapes (N,) and (M,), respectively, specifying pixel centers.
**A**array-like
(M, N) ndarray or masked array of values to be colormapped, or (M, N, 3) RGB array, or (M, N, 4) RGBA array.
set\_filternorm(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1165-L1166)
Set whether the resize filter normalizes the weights.
See help for [`imshow`](_as_gen/matplotlib.axes.axes.imshow#matplotlib.axes.Axes.imshow "matplotlib.axes.Axes.imshow").
Parameters:
**filternorm**bool
set\_filterrad(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1168-L1169)
Set the resize filter radius only applicable to some interpolation schemes -- see help for imshow
Parameters:
**filterrad**positive float
set\_interpolation(*s*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1148-L1158)
Parameters:
**s**{'nearest', 'bilinear'} or None
If None, use `[rcParams["image.interpolation"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.interpolation#matplotlibrc-sample)` (default: `'antialiased'`).
set\_norm(*norm*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1171-L1174)
Set the normalization instance.
Parameters:
**norm**[`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None
#### Notes
If there are any colorbars using the mappable for this norm, setting the norm of the mappable will reset the norm, locator, and formatters on the colorbar to default.
*class*matplotlib.image.PcolorImage(*ax*, *x=None*, *y=None*, *A=None*, *\**, *cmap=None*, *norm=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1182-L1332)
Bases: [`AxesImage`](#matplotlib.image.AxesImage "matplotlib.image.AxesImage")
Make a pcolor-style plot with an irregular rectangular grid.
This uses a variation of the original irregular image code, and it is used by pcolorfast for the corresponding grid type.
Parameters:
**ax**[`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The axes the image will belong to.
**x, y**1D array-like, optional
Monotonic arrays of length N+1 and M+1, respectively, specifying rectangle boundaries. If not given, will default to `range(N + 1)` and `range(M + 1)`, respectively.
**A**array-like
The data to be color-coded. The interpretation depends on the shape:
* (M, N) ndarray or masked array: values to be colormapped
* (M, N, 3): RGB array
* (M, N, 4): RGBA array
**cmap**str or [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"), default: `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
The Colormap instance or registered colormap name used to map scalar data to colors.
**norm**str or [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize")
Maps luminance to 0-1.
**\*\*kwargs**[`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") properties
get\_cursor\_data(*event*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1321-L1332)
Return the image value at the event position or *None* if the event is outside the image.
See also
[`matplotlib.artist.Artist.get_cursor_data`](_as_gen/matplotlib.artist.artist.get_cursor_data#matplotlib.artist.Artist.get_cursor_data "matplotlib.artist.Artist.get_cursor_data")
make\_image(*renderer*, *magnification=1.0*, *unsampled=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1228-L1259)
Normalize, rescale, and colormap this image's data for rendering using *renderer*, with the given *magnification*.
If *unsampled* is True, the image will not be scaled, but an appropriate affine transformation will be returned instead.
Returns:
**image**(M, N, 4) uint8 array
The RGBA image, resampled unless *unsampled* is True.
**x, y**float
The upper left corner where the image should be drawn, in pixel space.
**trans**Affine2D
The affine transformation from image to pixel space.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *array=<UNSET>*, *clim=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *cmap=<UNSET>*, *data=<UNSET>*, *extent=<UNSET>*, *filternorm=<UNSET>*, *filterrad=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *interpolation=<UNSET>*, *interpolation\_stage=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *norm=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *resample=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| `alpha` | float or 2D array-like or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| `array` | unknown |
| [`clim`](cm_api#matplotlib.cm.ScalarMappable.set_clim "matplotlib.cm.ScalarMappable.set_clim") | (vmin: float, vmax: float) |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`cmap`](cm_api#matplotlib.cm.ScalarMappable.set_cmap "matplotlib.cm.ScalarMappable.set_cmap") | [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap") or str or None |
| [`data`](#matplotlib.image.PcolorImage.set_data "matplotlib.image.PcolorImage.set_data") | unknown |
| [`extent`](#matplotlib.image.AxesImage.set_extent "matplotlib.image.AxesImage.set_extent") | 4-tuple of float |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| `filternorm` | bool |
| `filterrad` | positive float |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| `interpolation` | {'antialiased', 'nearest', 'bilinear', 'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', 'hermite', 'kaiser', 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos', 'none'} or None |
| `interpolation_stage` | {'data', 'rgba'} or None |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`norm`](cm_api#matplotlib.cm.ScalarMappable.set_norm "matplotlib.cm.ScalarMappable.set_norm") | [`Normalize`](_as_gen/matplotlib.colors.normalize#matplotlib.colors.Normalize "matplotlib.colors.Normalize") or str or None |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| `resample` | bool or None |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_array(*\*args*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1318-L1319)
Retained for backwards compatibility - use set\_data instead.
Parameters:
**A**array-like
set\_data(*x*, *y*, *A*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1264-L1316)
Set the grid for the rectangle boundaries, and the data values.
Parameters:
**x, y**1D array-like, optional
Monotonic arrays of length N+1 and M+1, respectively, specifying rectangle boundaries. If not given, will default to `range(N + 1)` and `range(M + 1)`, respectively.
**A**array-like
The data to be color-coded. The interpretation depends on the shape:
* (M, N) ndarray or masked array: values to be colormapped
* (M, N, 3): RGB array
* (M, N, 4): RGBA array
matplotlib.image.composite\_images(*images*, *renderer*, *magnification=1.0*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L57-L110)
Composite a number of RGBA images into one. The images are composited in the order in which they appear in the *images* list.
Parameters:
**images**list of Images
Each must have a `make_image` method. For each image, `can_composite` should return [`True`](https://docs.python.org/3/library/constants.html#True "(in Python v3.10)"), though this is not enforced by this function. Each image must have a purely affine transformation with no shear.
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase")
**magnification**float, default: 1
The additional magnification to apply for the renderer in use.
Returns:
**image**uint8 array (M, N, 4)
The composited RGBA image.
**offset\_x, offset\_y**float
The (left, bottom) offset where the composited image should be placed in the output figure.
matplotlib.image.imread(*fname*, *format=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1469-L1544)
Read an image from a file into an array.
Note
This function exists for historical reasons. It is recommended to use [`PIL.Image.open`](https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.open "(in Pillow (PIL Fork) v9.2.0)") instead for loading images.
Parameters:
**fname**str or file-like
The image file to read: a filename, a URL or a file-like object opened in read-binary mode.
Passing a URL is deprecated. Please open the URL for reading and pass the result to Pillow, e.g. with `np.array(PIL.Image.open(urllib.request.urlopen(url)))`.
**format**str, optional
The image file format assumed for reading the data. The image is loaded as a PNG file if *format* is set to "png", if *fname* is a path or opened file with a ".png" extension, or if it is an URL. In all other cases, *format* is ignored and the format is auto-detected by [`PIL.Image.open`](https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.open "(in Pillow (PIL Fork) v9.2.0)").
Returns:
[`numpy.array`](https://numpy.org/doc/stable/reference/generated/numpy.array.html#numpy.array "(in NumPy v1.23)")
The image data. The returned array has shape
* (M, N) for grayscale images.
* (M, N, 3) for RGB images.
* (M, N, 4) for RGBA images.
PNG images are returned as float arrays (0-1). All other formats are returned as int arrays, with a bit depth determined by the file's contents.
matplotlib.image.imsave(*fname*, *arr*, *vmin=None*, *vmax=None*, *cmap=None*, *format=None*, *origin=None*, *dpi=100*, *\**, *metadata=None*, *pil\_kwargs=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1547-L1656)
Save an array as an image file.
Parameters:
**fname**str or path-like or file-like
A path or a file-like object to store the image in. If *format* is not set, then the output format is inferred from the extension of *fname*, if any, and from `[rcParams["savefig.format"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=savefig.format#matplotlibrc-sample)` (default: `'png'`) otherwise. If *format* is set, it determines the output format.
**arr**array-like
The image data. The shape can be one of MxN (luminance), MxNx3 (RGB) or MxNx4 (RGBA).
**vmin, vmax**float, optional
*vmin* and *vmax* set the color scaling for the image by fixing the values that map to the colormap color limits. If either *vmin* or *vmax* is None, that limit is determined from the *arr* min/max value.
**cmap**str or [`Colormap`](_as_gen/matplotlib.colors.colormap#matplotlib.colors.Colormap "matplotlib.colors.Colormap"), default: `[rcParams["image.cmap"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.cmap#matplotlibrc-sample)` (default: `'viridis'`)
A Colormap instance or registered colormap name. The colormap maps scalar data to colors. It is ignored for RGB(A) data.
**format**str, optional
The file format, e.g. 'png', 'pdf', 'svg', ... The behavior when this is unset is documented under *fname*.
**origin**{'upper', 'lower'}, default: `[rcParams["image.origin"]](https://matplotlib.org/stable/tutorials/introductory/customizing.html?highlight=image.origin#matplotlibrc-sample)` (default: `'upper'`)
Indicates whether the `(0, 0)` index of the array is in the upper left or lower left corner of the axes.
**dpi**float
The DPI to store in the metadata of the file. This does not affect the resolution of the output image. Depending on file format, this may be rounded to the nearest integer.
**metadata**dict, optional
Metadata in the image file. The supported keys depend on the output format, see the documentation of the respective backends for more information.
**pil\_kwargs**dict, optional
Keyword arguments passed to [`PIL.Image.Image.save`](https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.save "(in Pillow (PIL Fork) v9.2.0)"). If the 'pnginfo' key is present, it completely overrides *metadata*, including the default 'Software' key.
matplotlib.image.pil\_to\_array(*pilImage*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1659-L1691)
Load a [PIL image](https://pillow.readthedocs.io/en/latest/reference/Image.html) and return it as a numpy int array.
Returns:
numpy.array
The array shape depends on the image type:
* (M, N) for grayscale images.
* (M, N, 3) for RGB images.
* (M, N, 4) for RGBA images.
matplotlib.image.thumbnail(*infile*, *thumbfile*, *scale=0.1*, *interpolation='bilinear'*, *preview=False*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/image.py#L1724-L1785)
Make a thumbnail of image in *infile* with output filename *thumbfile*.
See [Image Thumbnail](https://matplotlib.org/stable/gallery/misc/image_thumbnail_sgskip.html).
Parameters:
**infile**str or file-like
The image file. Matplotlib relies on [Pillow](https://python-pillow.org/) for image reading, and thus supports a wide range of file formats, including PNG, JPG, TIFF and others.
**thumbfile**str or file-like
The thumbnail filename.
**scale**float, default: 0.1
The scale factor for the thumbnail.
**interpolation**str, default: 'bilinear'
The interpolation scheme used in the resampling. See the *interpolation* parameter of [`imshow`](_as_gen/matplotlib.axes.axes.imshow#matplotlib.axes.Axes.imshow "matplotlib.axes.Axes.imshow") for possible values.
**preview**bool, default: False
If True, the default backend (presumably a user interface backend) will be used which will cause a figure to be raised if [`show`](_as_gen/matplotlib.pyplot.show#matplotlib.pyplot.show "matplotlib.pyplot.show") is called. If it is False, the figure is created using [`FigureCanvasBase`](backend_bases_api#matplotlib.backend_bases.FigureCanvasBase "matplotlib.backend_bases.FigureCanvasBase") and the drawing backend is selected as [`Figure.savefig`](figure_api#matplotlib.figure.Figure.savefig "matplotlib.figure.Figure.savefig") would normally do.
Returns:
[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
The figure instance containing the thumbnail.
| programming_docs |
matplotlib matplotlib.table matplotlib.table
================
Tables drawing.
Note
The table implementation in Matplotlib is lightly maintained. For a more featureful table implementation, you may wish to try [blume](https://github.com/swfiua/blume).
Use the factory function [`table`](#matplotlib.table.table "matplotlib.table.table") to create a ready-made table from texts. If you need more control, use the [`Table`](#matplotlib.table.Table "matplotlib.table.Table") class and its methods.
The table consists of a grid of cells, which are indexed by (row, column). The cell (0, 0) is positioned at the top left.
Thanks to John Gill for providing the class and table.
*class*matplotlib.table.Cell(*xy*, *width*, *height*, *\**, *edgecolor='k'*, *facecolor='w'*, *fill=True*, *text=''*, *loc=None*, *fontproperties=None*, *visible\_edges='closed'*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L35-L232)
Bases: [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle")
A cell is a [`Rectangle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle "matplotlib.patches.Rectangle") with some associated [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text").
As a user, you'll most likely not creates cells yourself. Instead, you should use either the [`table`](#matplotlib.table.table "matplotlib.table.table") factory function or [`Table.add_cell`](#matplotlib.table.Table.add_cell "matplotlib.table.Table.add_cell").
Parameters:
**xy**2-tuple
The position of the bottom left corner of the cell.
**width**float
The cell width.
**height**float
The cell height.
**edgecolor**color
The color of the cell border.
**facecolor**color
The cell facecolor.
**fill**bool
Whether the cell background is filled.
**text**str
The cell text.
**loc**{'left', 'center', 'right'}, default: 'right'
The alignment of the text within the cell.
**fontproperties**dict
A dict defining the font properties of the text. Supported keys and values are the keyword arguments accepted by [`FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties").
**visible\_edges**str, default: 'closed'
The cell edges to be drawn with a line: a substring of 'BRTL' (bottom, right, top, left), or one of 'open' (no edges drawn), 'closed' (all edges drawn), 'horizontal' (bottom and top), 'vertical' (right and left).
PAD*=0.1*
Padding between text and rectangle.
auto\_set\_font\_size(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L129-L138)
Shrink font size until the text fits into the cell width.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L140-L149)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
get\_fontsize()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L125-L127)
Return the cell fontsize.
get\_path()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L220-L232)
Return a [`Path`](path_api#matplotlib.path.Path "matplotlib.path.Path") for the [`visible_edges`](#matplotlib.table.Cell.visible_edges "matplotlib.table.Cell.visible_edges").
get\_required\_width(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L174-L177)
Return the minimal required width for the cell.
get\_text()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L116-L118)
Return the cell [`Text`](text_api#matplotlib.text.Text "matplotlib.text.Text") instance.
get\_text\_bounds(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L166-L172)
Return the text bounds as *(x, y, width, height)* in table coordinates.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *angle=<UNSET>*, *animated=<UNSET>*, *antialiased=<UNSET>*, *bounds=<UNSET>*, *capstyle=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *color=<UNSET>*, *edgecolor=<UNSET>*, *facecolor=<UNSET>*, *fill=<UNSET>*, *fontsize=<UNSET>*, *gid=<UNSET>*, *hatch=<UNSET>*, *height=<UNSET>*, *in\_layout=<UNSET>*, *joinstyle=<UNSET>*, *label=<UNSET>*, *linestyle=<UNSET>*, *linewidth=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *text\_props=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *width=<UNSET>*, *x=<UNSET>*, *xy=<UNSET>*, *y=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`angle`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle.set_angle "matplotlib.patches.Rectangle.set_angle") | unknown |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`antialiased`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_antialiased "matplotlib.patches.Patch.set_antialiased") or aa | bool or None |
| [`bounds`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle.set_bounds "matplotlib.patches.Rectangle.set_bounds") | (left, bottom, width, height) |
| [`capstyle`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_capstyle "matplotlib.patches.Patch.set_capstyle") | [`CapStyle`](_enums_api#matplotlib._enums.CapStyle "matplotlib._enums.CapStyle") or {'butt', 'projecting', 'round'} |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`color`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_color "matplotlib.patches.Patch.set_color") | color |
| [`edgecolor`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_edgecolor "matplotlib.patches.Patch.set_edgecolor") or ec | color or None |
| [`facecolor`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_facecolor "matplotlib.patches.Patch.set_facecolor") or fc | color or None |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | unknown |
| [`fill`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_fill "matplotlib.patches.Patch.set_fill") | bool |
| [`fontsize`](#matplotlib.table.Cell.set_fontsize "matplotlib.table.Cell.set_fontsize") | unknown |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`hatch`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_hatch "matplotlib.patches.Patch.set_hatch") | {'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '\*'} |
| [`height`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle.set_height "matplotlib.patches.Rectangle.set_height") | unknown |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`joinstyle`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_joinstyle "matplotlib.patches.Patch.set_joinstyle") | [`JoinStyle`](_enums_api#matplotlib._enums.JoinStyle "matplotlib._enums.JoinStyle") or {'miter', 'round', 'bevel'} |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linestyle`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_linestyle "matplotlib.patches.Patch.set_linestyle") or ls | {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| [`linewidth`](_as_gen/matplotlib.patches.patch#matplotlib.patches.Patch.set_linewidth "matplotlib.patches.Patch.set_linewidth") or lw | float or None |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`text_props`](#matplotlib.table.Cell.set_text_props "matplotlib.table.Cell.set_text_props") | unknown |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | unknown |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`width`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle.set_width "matplotlib.patches.Rectangle.set_width") | unknown |
| [`x`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle.set_x "matplotlib.patches.Rectangle.set_x") | unknown |
| [`xy`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle.set_xy "matplotlib.patches.Rectangle.set_xy") | (float, float) |
| [`y`](_as_gen/matplotlib.patches.rectangle#matplotlib.patches.Rectangle.set_y "matplotlib.patches.Rectangle.set_y") | unknown |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_figure(*fig*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L112-L114)
Set the [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") instance the artist belongs to.
Parameters:
**fig**[`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure")
set\_fontsize(*size*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L120-L123)
Set the text fontsize.
set\_text\_props(*\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L179-L189)
Update the text properties.
Valid keyword arguments are:
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`backgroundcolor`](text_api#matplotlib.text.Text.set_backgroundcolor "matplotlib.text.Text.set_backgroundcolor") | color |
| [`bbox`](text_api#matplotlib.text.Text.set_bbox "matplotlib.text.Text.set_bbox") | dict with properties for [`patches.FancyBboxPatch`](_as_gen/matplotlib.patches.fancybboxpatch#matplotlib.patches.FancyBboxPatch "matplotlib.patches.FancyBboxPatch") |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | unknown |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | unknown |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | unknown |
| [`color`](text_api#matplotlib.text.Text.set_color "matplotlib.text.Text.set_color") or c | color |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fontfamily`](text_api#matplotlib.text.Text.set_fontfamily "matplotlib.text.Text.set_fontfamily") or family | {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'} |
| [`fontproperties`](text_api#matplotlib.text.Text.set_fontproperties "matplotlib.text.Text.set_fontproperties") or font or font\_properties | [`font_manager.FontProperties`](font_manager_api#matplotlib.font_manager.FontProperties "matplotlib.font_manager.FontProperties") or [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.10)") or [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.10)") |
| [`fontsize`](text_api#matplotlib.text.Text.set_fontsize "matplotlib.text.Text.set_fontsize") or size | float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'} |
| [`fontstretch`](text_api#matplotlib.text.Text.set_fontstretch "matplotlib.text.Text.set_fontstretch") or stretch | {a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'} |
| [`fontstyle`](text_api#matplotlib.text.Text.set_fontstyle "matplotlib.text.Text.set_fontstyle") or style | {'normal', 'italic', 'oblique'} |
| [`fontvariant`](text_api#matplotlib.text.Text.set_fontvariant "matplotlib.text.Text.set_fontvariant") or variant | {'normal', 'small-caps'} |
| [`fontweight`](text_api#matplotlib.text.Text.set_fontweight "matplotlib.text.Text.set_fontweight") or weight | {a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'} |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`horizontalalignment`](text_api#matplotlib.text.Text.set_horizontalalignment "matplotlib.text.Text.set_horizontalalignment") or ha | {'left', 'center', 'right'} |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`linespacing`](text_api#matplotlib.text.Text.set_linespacing "matplotlib.text.Text.set_linespacing") | float (multiple of font size) |
| [`math_fontfamily`](text_api#matplotlib.text.Text.set_math_fontfamily "matplotlib.text.Text.set_math_fontfamily") | str |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`multialignment`](text_api#matplotlib.text.Text.set_multialignment "matplotlib.text.Text.set_multialignment") or ma | {'left', 'right', 'center'} |
| [`parse_math`](text_api#matplotlib.text.Text.set_parse_math "matplotlib.text.Text.set_parse_math") | bool |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`position`](text_api#matplotlib.text.Text.set_position "matplotlib.text.Text.set_position") | (float, float) |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`rotation`](text_api#matplotlib.text.Text.set_rotation "matplotlib.text.Text.set_rotation") | float or {'vertical', 'horizontal'} |
| [`rotation_mode`](text_api#matplotlib.text.Text.set_rotation_mode "matplotlib.text.Text.set_rotation_mode") | {None, 'default', 'anchor'} |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`text`](text_api#matplotlib.text.Text.set_text "matplotlib.text.Text.set_text") | object |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`transform_rotates_text`](text_api#matplotlib.text.Text.set_transform_rotates_text "matplotlib.text.Text.set_transform_rotates_text") | bool |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`usetex`](text_api#matplotlib.text.Text.set_usetex "matplotlib.text.Text.set_usetex") | bool or None |
| [`verticalalignment`](text_api#matplotlib.text.Text.set_verticalalignment "matplotlib.text.Text.set_verticalalignment") or va | {'bottom', 'baseline', 'center', 'center\_baseline', 'top'} |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`wrap`](text_api#matplotlib.text.Text.set_wrap "matplotlib.text.Text.set_wrap") | bool |
| [`x`](text_api#matplotlib.text.Text.set_x "matplotlib.text.Text.set_x") | float |
| [`y`](text_api#matplotlib.text.Text.set_y "matplotlib.text.Text.set_y") | float |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_transform(*trans*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L107-L110)
Set the artist transform.
Parameters:
**t**[`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform")
*property*visible\_edges
The cell edges to be drawn with a line.
Reading this property returns a substring of 'BRTL' (bottom, right, top, left').
When setting this property, you can use a substring of 'BRTL' or one of {'open', 'closed', 'horizontal', 'vertical'}.
matplotlib.table.CustomCell[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L35-L232)
alias of [`Cell`](#matplotlib.table.Cell "matplotlib.table.Cell")
*class*matplotlib.table.Table(*ax*, *loc=None*, *bbox=None*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L238-L647)
Bases: [`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist")
A table of cells.
The table consists of a grid of cells, which are indexed by (row, column).
For a simple table, you'll have a full grid of cells with indices from (0, 0) to (num\_rows-1, num\_cols-1), in which the cell (0, 0) is positioned at the top left. However, you can also add cells with negative indices. You don't have to add a cell to every grid position, so you can create tables that have holes.
*Note*: You'll usually not create an empty table from scratch. Instead use [`table`](#matplotlib.table.table "matplotlib.table.table") to create a table from data.
Parameters:
**ax**[`matplotlib.axes.Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes")
The [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes") to plot the table into.
**loc**str
The position of the cell with respect to *ax*. This must be one of the [`codes`](#matplotlib.table.Table.codes "matplotlib.table.Table.codes").
**bbox**[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") or None
A bounding box to draw the table into. If this is not *None*, this overrides *loc*.
Other Parameters:
**\*\*kwargs**
[`Artist`](artist_api#matplotlib.artist.Artist "matplotlib.artist.Artist") properties.
AXESPAD*=0.02*
The border between the Axes and the table edge in Axes units.
FONTSIZE*=10*
add\_cell(*row*, *col*, *\*args*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L323-L345)
Create a cell and add it to the table.
Parameters:
**row**int
Row index.
**col**int
Column index.
**\*args, \*\*kwargs**
All other parameters are passed on to [`Cell`](#matplotlib.table.Cell "matplotlib.table.Cell").
Returns:
[`Cell`](#matplotlib.table.Cell "matplotlib.table.Cell")
The created cell.
auto\_set\_column\_width(*col*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L490-L508)
Automatically set the widths of given columns to optimal sizes.
Parameters:
**col**int or sequence of ints
The indices of the columns to auto-scale.
auto\_set\_font\_size(*value=True*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L518-L521)
Automatically set font size.
codes*={'best': 0, 'bottom': 17, 'bottom left': 12, 'bottom right': 13, 'center': 9, 'center left': 5, 'center right': 6, 'left': 15, 'lower center': 7, 'lower left': 3, 'lower right': 4, 'right': 14, 'top': 16, 'top left': 11, 'top right': 10, 'upper center': 8, 'upper left': 2, 'upper right': 1}*
Possible values where to place the table relative to the Axes.
contains(*mouseevent*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L429-L444)
Test whether the artist contains the mouse event.
Parameters:
**mouseevent**[`matplotlib.backend_bases.MouseEvent`](backend_bases_api#matplotlib.backend_bases.MouseEvent "matplotlib.backend_bases.MouseEvent")
Returns:
**contains**bool
Whether any values are within the radius.
**details**dict
An artist-specific dictionary of details of the event context, such as which points are contained in the pick radius. See the individual Artist subclasses for details.
draw(*renderer*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L395-L415)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible ([`Artist.get_visible`](_as_gen/matplotlib.artist.artist.get_visible#matplotlib.artist.Artist.get_visible "matplotlib.artist.Artist.get_visible") returns False).
Parameters:
**renderer**[`RendererBase`](backend_bases_api#matplotlib.backend_bases.RendererBase "matplotlib.backend_bases.RendererBase") subclass.
#### Notes
This method is overridden in the Artist subclasses.
*property*edges
The default value of [`visible_edges`](#matplotlib.table.Cell.visible_edges "matplotlib.table.Cell.visible_edges") for newly added cells using [`add_cell`](#matplotlib.table.Table.add_cell "matplotlib.table.Table.add_cell").
#### Notes
This setting does currently only affect newly created cells using [`add_cell`](#matplotlib.table.Table.add_cell "matplotlib.table.Table.add_cell").
To change existing cells, you have to set their edges explicitly:
```
for c in tab.get_celld().values():
c.visible_edges = 'horizontal'
```
get\_celld()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L634-L647)
Return a dict of cells in the table mapping *(row, column)* to [`Cell`](#matplotlib.table.Cell "matplotlib.table.Cell")s.
#### Notes
You can also directly index into the Table object to access individual cells:
```
cell = table[row, col]
```
get\_children()[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L446-L448)
Return the Artists contained by the table.
get\_window\_extent(*renderer=None*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L450-L457)
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
scale(*xscale*, *yscale*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L541-L545)
Scale column widths by *xscale* and row heights by *yscale*.
set(*\**, *agg\_filter=<UNSET>*, *alpha=<UNSET>*, *animated=<UNSET>*, *clip\_box=<UNSET>*, *clip\_on=<UNSET>*, *clip\_path=<UNSET>*, *fontsize=<UNSET>*, *gid=<UNSET>*, *in\_layout=<UNSET>*, *label=<UNSET>*, *mouseover=<UNSET>*, *path\_effects=<UNSET>*, *picker=<UNSET>*, *rasterized=<UNSET>*, *sketch\_params=<UNSET>*, *snap=<UNSET>*, *transform=<UNSET>*, *url=<UNSET>*, *visible=<UNSET>*, *zorder=<UNSET>*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/artist.py#L117-L117)
Set multiple properties at once.
Supported properties are
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fontsize`](#matplotlib.table.Table.set_fontsize "matplotlib.table.Table.set_fontsize") | float |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
set\_fontsize(*size*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L547-L570)
Set the font size, in points, of the cell text.
Parameters:
**size**float
#### Notes
As long as auto font size has not been disabled, the value will be clipped such that the text fits horizontally into the cell.
You can disable this behavior using [`auto_set_font_size`](#matplotlib.table.Table.auto_set_font_size "matplotlib.table.Table.auto_set_font_size").
```
>>> the_table.auto_set_font_size(False)
>>> the_table.set_fontsize(20)
```
However, there is no automatic scaling of the row height so that the text may exceed the cell boundary.
matplotlib.table.table(*ax*, *cellText=None*, *cellColours=None*, *cellLoc='right'*, *colWidths=None*, *rowLabels=None*, *rowColours=None*, *rowLoc='left'*, *colLabels=None*, *colColours=None*, *colLoc='center'*, *loc='bottom'*, *bbox=None*, *edges='closed'*, *\*\*kwargs*)[[source]](https://github.com/matplotlib/matplotlib/blob/v3.6.0/lib/matplotlib/table.py#L650-L827)
Add a table to an [`Axes`](axes_api#matplotlib.axes.Axes "matplotlib.axes.Axes").
At least one of *cellText* or *cellColours* must be specified. These parameters must be 2D lists, in which the outer lists define the rows and the inner list define the column values per row. Each row must have the same number of elements.
The table can optionally have row and column headers, which are configured using *rowLabels*, *rowColours*, *rowLoc* and *colLabels*, *colColours*, *colLoc* respectively.
For finer grained control over tables, use the [`Table`](#matplotlib.table.Table "matplotlib.table.Table") class and add it to the axes with [`Axes.add_table`](_as_gen/matplotlib.axes.axes.add_table#matplotlib.axes.Axes.add_table "matplotlib.axes.Axes.add_table").
Parameters:
**cellText**2D list of str, optional
The texts to place into the table cells.
*Note*: Line breaks in the strings are currently not accounted for and will result in the text exceeding the cell boundaries.
**cellColours**2D list of colors, optional
The background colors of the cells.
**cellLoc**{'left', 'center', 'right'}, default: 'right'
The alignment of the text within the cells.
**colWidths**list of float, optional
The column widths in units of the axes. If not given, all columns will have a width of *1 / ncols*.
**rowLabels**list of str, optional
The text of the row header cells.
**rowColours**list of colors, optional
The colors of the row header cells.
**rowLoc**{'left', 'center', 'right'}, default: 'left'
The text alignment of the row header cells.
**colLabels**list of str, optional
The text of the column header cells.
**colColours**list of colors, optional
The colors of the column header cells.
**colLoc**{'left', 'center', 'right'}, default: 'left'
The text alignment of the column header cells.
**loc**str, optional
The position of the cell with respect to *ax*. This must be one of the [`codes`](#matplotlib.table.Table.codes "matplotlib.table.Table.codes").
**bbox**[`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox"), optional
A bounding box to draw the table into. If this is not *None*, this overrides *loc*.
**edges**substring of 'BRTL' or {'open', 'closed', 'horizontal', 'vertical'}
The cell edges to be drawn with a line. See also [`visible_edges`](#matplotlib.table.Cell.visible_edges "matplotlib.table.Cell.visible_edges").
Returns:
[`Table`](#matplotlib.table.Table "matplotlib.table.Table")
The created table.
Other Parameters:
**\*\*kwargs**
[`Table`](#matplotlib.table.Table "matplotlib.table.Table") properties.
| Property | Description |
| --- | --- |
| [`agg_filter`](_as_gen/matplotlib.artist.artist.set_agg_filter#matplotlib.artist.Artist.set_agg_filter "matplotlib.artist.Artist.set_agg_filter") | a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image |
| [`alpha`](_as_gen/matplotlib.artist.artist.set_alpha#matplotlib.artist.Artist.set_alpha "matplotlib.artist.Artist.set_alpha") | scalar or None |
| [`animated`](_as_gen/matplotlib.artist.artist.set_animated#matplotlib.artist.Artist.set_animated "matplotlib.artist.Artist.set_animated") | bool |
| [`clip_box`](_as_gen/matplotlib.artist.artist.set_clip_box#matplotlib.artist.Artist.set_clip_box "matplotlib.artist.Artist.set_clip_box") | [`Bbox`](transformations#matplotlib.transforms.Bbox "matplotlib.transforms.Bbox") |
| [`clip_on`](_as_gen/matplotlib.artist.artist.set_clip_on#matplotlib.artist.Artist.set_clip_on "matplotlib.artist.Artist.set_clip_on") | bool |
| [`clip_path`](_as_gen/matplotlib.artist.artist.set_clip_path#matplotlib.artist.Artist.set_clip_path "matplotlib.artist.Artist.set_clip_path") | Patch or (Path, Transform) or None |
| [`figure`](_as_gen/matplotlib.artist.artist.set_figure#matplotlib.artist.Artist.set_figure "matplotlib.artist.Artist.set_figure") | [`Figure`](figure_api#matplotlib.figure.Figure "matplotlib.figure.Figure") |
| [`fontsize`](#matplotlib.table.Table.set_fontsize "matplotlib.table.Table.set_fontsize") | float |
| [`gid`](_as_gen/matplotlib.artist.artist.set_gid#matplotlib.artist.Artist.set_gid "matplotlib.artist.Artist.set_gid") | str |
| [`in_layout`](_as_gen/matplotlib.artist.artist.set_in_layout#matplotlib.artist.Artist.set_in_layout "matplotlib.artist.Artist.set_in_layout") | bool |
| [`label`](_as_gen/matplotlib.artist.artist.set_label#matplotlib.artist.Artist.set_label "matplotlib.artist.Artist.set_label") | object |
| [`mouseover`](_as_gen/matplotlib.artist.artist.set_mouseover#matplotlib.artist.Artist.set_mouseover "matplotlib.artist.Artist.set_mouseover") | bool |
| [`path_effects`](_as_gen/matplotlib.artist.artist.set_path_effects#matplotlib.artist.Artist.set_path_effects "matplotlib.artist.Artist.set_path_effects") | [`AbstractPathEffect`](patheffects_api#matplotlib.patheffects.AbstractPathEffect "matplotlib.patheffects.AbstractPathEffect") |
| [`picker`](_as_gen/matplotlib.artist.artist.set_picker#matplotlib.artist.Artist.set_picker "matplotlib.artist.Artist.set_picker") | None or bool or float or callable |
| [`rasterized`](_as_gen/matplotlib.artist.artist.set_rasterized#matplotlib.artist.Artist.set_rasterized "matplotlib.artist.Artist.set_rasterized") | bool |
| [`sketch_params`](_as_gen/matplotlib.artist.artist.set_sketch_params#matplotlib.artist.Artist.set_sketch_params "matplotlib.artist.Artist.set_sketch_params") | (scale: float, length: float, randomness: float) |
| [`snap`](_as_gen/matplotlib.artist.artist.set_snap#matplotlib.artist.Artist.set_snap "matplotlib.artist.Artist.set_snap") | bool or None |
| [`transform`](_as_gen/matplotlib.artist.artist.set_transform#matplotlib.artist.Artist.set_transform "matplotlib.artist.Artist.set_transform") | [`Transform`](transformations#matplotlib.transforms.Transform "matplotlib.transforms.Transform") |
| [`url`](_as_gen/matplotlib.artist.artist.set_url#matplotlib.artist.Artist.set_url "matplotlib.artist.Artist.set_url") | str |
| [`visible`](_as_gen/matplotlib.artist.artist.set_visible#matplotlib.artist.Artist.set_visible "matplotlib.artist.Artist.set_visible") | bool |
| [`zorder`](_as_gen/matplotlib.artist.artist.set_zorder#matplotlib.artist.Artist.set_zorder "matplotlib.artist.Artist.set_zorder") | float |
| programming_docs |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.