Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Modifiers | Name | Description |
---|---|---|
class |
MetaClassRegistry.MetaClassCreationHandle |
Class used as base for the creation of MetaClass implementations. |
Type | Name and description |
---|---|
void |
addMetaClassRegistryChangeEventListener(MetaClassRegistryChangeEventListener listener) Adds a meta class change listener for constant meta classes |
void |
addNonRemovableMetaClassRegistryChangeEventListener(MetaClassRegistryChangeEventListener listener) Adds a meta class change listener for constant meta classes. |
MetaClass |
getMetaClass(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 |
MetaClassRegistry.MetaClassCreationHandle |
getMetaClassCreationHandler() Retrieves the MetaClassCreationHandle that is responsible for constructing MetaClass instances |
MetaClassRegistryChangeEventListener[] |
getMetaClassRegistryChangeEventListeners() Returns all registered class change listener for constant meta classes. |
Iterator |
iterator() Gets a snapshot of the current constant meta classes and returns it as Iterator. |
void |
removeMetaClass(Class theClass) Removes a cached MetaClass from the registry |
void |
removeMetaClassRegistryChangeEventListener(MetaClassRegistryChangeEventListener listener) Removes a meta class change listener for constant meta classes |
void |
setMetaClass(Class theClass, MetaClass theMetaClass) Adds a metaclass to the registery for the given class |
void |
setMetaClassCreationHandle(MetaClassRegistry.MetaClassCreationHandle handle) Sets the MetaClassCreationHandle instance that is responsible for constructing instances |
Adds a meta class change listener for constant meta classes
listener
- - the update listenerAdds a meta class change listener for constant meta classes. This listener cannot be removed!
listener
- - the update listenerThe main function of the registry If a meta class exists then return it otherwise create one, put it in the registry and return it
Retrieves the MetaClassCreationHandle that is responsible for constructing MetaClass instances
Returns all registered class change listener for constant meta classes.
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.
Removes a cached MetaClass from the registry
theClass
- The Java class of the MetaClass to removeRemoves a meta class change listener for constant meta classes
listener
- - the update listenerAdds a metaclass to the registery for the given class
theClass
- The classtheMetaClass
- The MetaClass for theClassSets the MetaClassCreationHandle instance that is responsible for constructing instances
handle
- The handle instance