public class RoleHandlerHelper extends Object
RoleHandler
implementation for the pair of CtElement
implementation and CtRole
The returned RoleHandler
can be then used to manipulate value of attribute represented by CtRole
on the CtElement
instanceModifier and Type | Method and Description |
---|---|
static void |
forEachRoleHandler(Consumer<RoleHandler> consumer) |
static RoleHandler |
getOptionalRoleHandler(Class<? extends CtElement> targetClass,
CtRole role) |
static RoleHandler |
getRoleHandler(Class<? extends CtElement> targetClass,
CtRole role) |
static List<RoleHandler> |
getRoleHandlers(Class<? extends CtElement> targetClass) |
static RoleHandler |
getRoleHandlerWrtParent(CtElement element) |
public static RoleHandler getRoleHandler(Class<? extends CtElement> targetClass, CtRole role)
targetClass
- the class of the to be manipulated noderole
- defines the to be manipulated attributeRoleHandler
implementation which knows how to manipulate the attribute of CtRole
on `targetClass`
or throws exception if such role doesn't exist on the `targetClass`public static RoleHandler getOptionalRoleHandler(Class<? extends CtElement> targetClass, CtRole role)
targetClass
- the Class of the to be manipulated noderole
- defines the to be manipulated attributeRoleHandler
implementation, which knows how to manipulate the attribute of CtRole
on `targetClass`
or returns null if such role doesn't exist on the `targetClass`public static List<RoleHandler> getRoleHandlers(Class<? extends CtElement> targetClass)
targetClass
- a Class whose handlers we are looking forRoleHandler
s available for the `targetClass`public static void forEachRoleHandler(Consumer<RoleHandler> consumer)
consumer
- is called for each RoleHandler
of SpoonModelpublic static RoleHandler getRoleHandlerWrtParent(CtElement element)
element
- the CtElement
whose relation from `element.getParent()` to `element` is needed.RoleHandler
handling relation from `element.getParent()` to `element`Copyright © 2007–2019 Inria. All rights reserved.