# ReflectionService

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [Instance](https://rapi.sleaze.dev/classes/Instance.md), [Object](https://rapi.sleaze.dev/classes/Object.md)
- Tags: Not creatable, Not replicated, Service
- Memory category: Instances
- HTML page: https://rapi.sleaze.dev/classes/ReflectionService/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/ReflectionService

A service that allows scripts to query the engine's API at runtime for information about classes, properties, methods, and events.

## Methods

### GetClass

```luau
ReflectionService:GetClass(className: string, filter: { [string]: any }? = nil): { [string]: any }?
```

- Tags: Custom Lua state

Returns information about a class when given its name, assuming that class is accessible.

Parameters:

- `className`: The name of the class for which you wish to retrieve information.
- `filter`: An optional filter to restrict or expand the set of classes that this method can return and change the method's behavior.

Returns: A `ReflectedClass` dictionary with reflection information if the class exists; otherwise, `nil`.

### GetClasses

```luau
ReflectionService:GetClasses(filter: { [string]: any }? = nil): { any }
```

- Tags: Custom Lua state

Returns a list of all classes accessible with filters applied.

Parameters:

- `filter`: An optional filter to restrict or expand the set of classes that this method can return and change the method's behavior.

Returns: A list of `ReflectedClass` dictionaries with reflection information for each class that matches the filter criteria.

### GetEventsOfClass

```luau
ReflectionService:GetEventsOfClass(className: string, filter: { [string]: any }? = nil): { any }
```

- Tags: Custom Lua state

Returns a list of events for a given class with filters applied.

Parameters:

- `className`: The name of the class for which you wish to retrieve events.
- `filter`: An optional filter to restrict or expand the set of events that this method can return and change the method's behavior.

Returns: A list of `ReflectedEvent` dictionaries with reflection information for each event of the class that matches the filter criteria.

### GetMethodsOfClass

```luau
ReflectionService:GetMethodsOfClass(className: string, filter: { [string]: any }? = nil): { any }
```

- Tags: Custom Lua state

Returns a list of methods for a given class with filters applied.

Parameters:

- `className`: The name of the class for which you wish to retrieve methods.
- `filter`: An optional filter to restrict or expand the set of methods that this method can return and change the method's behavior.

Returns: A list of `ReflectedMethod` dictionaries with reflection information for each method of the class that matches the filter criteria.

### GetPropertiesOfClass

```luau
ReflectionService:GetPropertiesOfClass(className: string, filter: { [string]: any }? = nil): { any }
```

- Tags: Custom Lua state

Returns a list of properties for a given class with filters applied.

Parameters:

- `className`: The name of the class for which you wish to retrieve properties.
- `filter`: An optional filter to restrict or expand the set of properties that this method can return and change the method's behavior.

Returns: A list of `ReflectedProperty` dictionaries with reflection information for each property of the class that matches the filter criteria.

### GetPropertyNames

```luau
ReflectionService:GetPropertyNames(name: string): { any }
```

- Tags: Custom Lua state, Roblox script security

### GetStyledPropertyNames

```luau
ReflectionService:GetStyledPropertyNames(name: string): { any }
```

- Tags: Custom Lua state, Roblox script security

## Inherited members

- From [Instance](https://rapi.sleaze.dev/classes/Instance.md): `Archivable`, `archivable`, `Attributes`, `AttributesReplicate`, `AttributesSerialize`, `HistoryId`, `Name`, `Parent`, `PredictionMode`, `PropertyStatusStudio`, `RobloxLocked`, `SerializedOverrides`, `SourceAssetId`, `Tags`, `UniqueId`, `numExpectedDirectChildren`, `DataCost`, `Capabilities`, `DefinesCapabilities`, `IsInSandbox`, `Sandboxed`, `AddTag`, `ClearAllChildren`, `Clone`, `Destroy`, `FindFirstAncestor`, `FindFirstAncestorOfClass`, `FindFirstAncestorWhichIsA`, `FindFirstChild`, `FindFirstChildOfClass`, `FindFirstChildWhichIsA`, `FindFirstDescendant`, `GetActor`, `GetAttribute`, `GetAttributeChangedSignal`, `GetAttributes`, `GetChildren`, `GetDebugId`, `GetDescendants`, `GetFullName`, `GetStyled`, `GetStyledPropertyChangedSignal`, `GetTags`, `HasTag`, `IsAncestorOf`, `IsDescendantOf`, `IsPropertyModified`, `QueryDescendants`, `RemoveTag`, `ResetPropertyToDefault`, `SetAttribute`, `WaitForChild`, `Remove`, `children`, `clone`, `destroy`, `findFirstChild`, `getChildren`, `isDescendantOf`, `remove`, `AncestryChanged`, `AttributeChanged`, `ChildAdded`, `ChildRemoved`, `DescendantAdded`, `DescendantRemoving`, `Destroying`, `StyledPropertiesChanged`, `childAdded`
- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
