spoon.reflect.meta.impl.ModelRoleHandlers Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spoon-core Show documentation
Show all versions of spoon-core Show documentation
Spoon is a tool for meta-programming, analysis and transformation of Java programs.
/*
* SPDX-License-Identifier: (MIT OR CECILL-C)
*
* Copyright (C) 2006-2023 INRIA and contributors
*
* Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon.
*/
package spoon.reflect.meta.impl;
import java.lang.annotation.Annotation;
import spoon.reflect.code.BinaryOperatorKind;
import spoon.reflect.code.CaseKind;
import spoon.reflect.code.CtAbstractInvocation;
import spoon.reflect.code.CtAbstractSwitch;
import spoon.reflect.code.CtArrayAccess;
import spoon.reflect.code.CtAssert;
import spoon.reflect.code.CtAssignment;
import spoon.reflect.code.CtBinaryOperator;
import spoon.reflect.code.CtBlock;
import spoon.reflect.code.CtBodyHolder;
import spoon.reflect.code.CtCase;
import spoon.reflect.code.CtCasePattern;
import spoon.reflect.code.CtCatch;
import spoon.reflect.code.CtCatchVariable;
import spoon.reflect.code.CtComment;
import spoon.reflect.code.CtConditional;
import spoon.reflect.code.CtDo;
import spoon.reflect.code.CtExecutableReferenceExpression;
import spoon.reflect.code.CtExpression;
import spoon.reflect.code.CtFor;
import spoon.reflect.code.CtForEach;
import spoon.reflect.code.CtIf;
import spoon.reflect.code.CtJavaDoc;
import spoon.reflect.code.CtJavaDocTag;
import spoon.reflect.code.CtLabelledFlowBreak;
import spoon.reflect.code.CtLambda;
import spoon.reflect.code.CtLiteral;
import spoon.reflect.code.CtLocalVariable;
import spoon.reflect.code.CtNewArray;
import spoon.reflect.code.CtNewClass;
import spoon.reflect.code.CtOperatorAssignment;
import spoon.reflect.code.CtPattern;
import spoon.reflect.code.CtRHSReceiver;
import spoon.reflect.code.CtRecordPattern;
import spoon.reflect.code.CtResource;
import spoon.reflect.code.CtReturn;
import spoon.reflect.code.CtStatement;
import spoon.reflect.code.CtStatementList;
import spoon.reflect.code.CtSynchronized;
import spoon.reflect.code.CtTargetedExpression;
import spoon.reflect.code.CtTextBlock;
import spoon.reflect.code.CtThrow;
import spoon.reflect.code.CtTry;
import spoon.reflect.code.CtTryWithResource;
import spoon.reflect.code.CtTypeAccess;
import spoon.reflect.code.CtTypePattern;
import spoon.reflect.code.CtUnaryOperator;
import spoon.reflect.code.CtVariableAccess;
import spoon.reflect.code.CtWhile;
import spoon.reflect.code.CtYieldStatement;
import spoon.reflect.code.LiteralBase;
import spoon.reflect.code.UnaryOperatorKind;
import spoon.reflect.cu.SourcePosition;
import spoon.reflect.declaration.CtAnnotation;
import spoon.reflect.declaration.CtAnnotationMethod;
import spoon.reflect.declaration.CtAnonymousExecutable;
import spoon.reflect.declaration.CtClass;
import spoon.reflect.declaration.CtCodeSnippet;
import spoon.reflect.declaration.CtCompilationUnit;
import spoon.reflect.declaration.CtConstructor;
import spoon.reflect.declaration.CtElement;
import spoon.reflect.declaration.CtEnum;
import spoon.reflect.declaration.CtEnumValue;
import spoon.reflect.declaration.CtExecutable;
import spoon.reflect.declaration.CtField;
import spoon.reflect.declaration.CtFormalTypeDeclarer;
import spoon.reflect.declaration.CtImport;
import spoon.reflect.declaration.CtMethod;
import spoon.reflect.declaration.CtModifiable;
import spoon.reflect.declaration.CtModule;
import spoon.reflect.declaration.CtModuleDirective;
import spoon.reflect.declaration.CtModuleRequirement;
import spoon.reflect.declaration.CtMultiTypedElement;
import spoon.reflect.declaration.CtNamedElement;
import spoon.reflect.declaration.CtPackage;
import spoon.reflect.declaration.CtPackageDeclaration;
import spoon.reflect.declaration.CtPackageExport;
import spoon.reflect.declaration.CtParameter;
import spoon.reflect.declaration.CtProvidedService;
import spoon.reflect.declaration.CtReceiverParameter;
import spoon.reflect.declaration.CtRecord;
import spoon.reflect.declaration.CtRecordComponent;
import spoon.reflect.declaration.CtSealable;
import spoon.reflect.declaration.CtShadowable;
import spoon.reflect.declaration.CtType;
import spoon.reflect.declaration.CtTypeInformation;
import spoon.reflect.declaration.CtTypeMember;
import spoon.reflect.declaration.CtTypeParameter;
import spoon.reflect.declaration.CtTypedElement;
import spoon.reflect.declaration.CtUsedService;
import spoon.reflect.declaration.CtVariable;
import spoon.reflect.declaration.ModifierKind;
import spoon.reflect.meta.RoleHandler;
import spoon.reflect.path.CtRole;
import spoon.reflect.reference.CtActualTypeContainer;
import spoon.reflect.reference.CtArrayTypeReference;
import spoon.reflect.reference.CtExecutableReference;
import spoon.reflect.reference.CtFieldReference;
import spoon.reflect.reference.CtIntersectionTypeReference;
import spoon.reflect.reference.CtModuleReference;
import spoon.reflect.reference.CtPackageReference;
import spoon.reflect.reference.CtReference;
import spoon.reflect.reference.CtTypeMemberWildcardImportReference;
import spoon.reflect.reference.CtTypeReference;
import spoon.reflect.reference.CtVariableReference;
import spoon.reflect.reference.CtWildcardReference;
import spoon.support.reflect.CtExtendedModifier;
/**
* Contains implementations of {@link RoleHandler}s for all {@link CtRole}s of all model elements
*/
class ModelRoleHandlers {
static class CtVariableAccess_VARIABLE_RoleHandler extends SingleHandler> {
private CtVariableAccess_VARIABLE_RoleHandler() {
super(CtRole.VARIABLE, CtVariableAccess.class, CtVariableReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getVariable()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setVariable(castValue(value));
}
}
static class CtTypePattern_VARIABLE_RoleHandler extends SingleHandler> {
private CtTypePattern_VARIABLE_RoleHandler() {
super(CtRole.VARIABLE, CtTypePattern.class, CtLocalVariable.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getVariable()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setVariable(castValue(value));
}
}
static class CtTextBlock_VALUE_RoleHandler extends SingleHandler {
private CtTextBlock_VALUE_RoleHandler() {
super(CtRole.VALUE, CtTextBlock.class, String.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getValue()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setValue(castValue(value));
}
}
static class CtLiteral_VALUE_RoleHandler extends SingleHandler {
private CtLiteral_VALUE_RoleHandler() {
super(CtRole.VALUE, CtLiteral.class, Object.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getValue()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setValue(castValue(value));
}
}
static class CtEnum_VALUE_RoleHandler extends ListHandler> {
private CtEnum_VALUE_RoleHandler() {
super(CtRole.VALUE, CtEnum.class, CtEnumValue.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getEnumValues()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setEnumValues(castValue(value));
}
}
static class CtAnnotation_VALUE_RoleHandler extends MapHandler {
private CtAnnotation_VALUE_RoleHandler() {
super(CtRole.VALUE, CtAnnotation.class, CtExpression.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getValues()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setValues(castValue(value));
}
}
static class CtTypeMemberWildcardImportReference_TYPE_REF_RoleHandler extends SingleHandler> {
private CtTypeMemberWildcardImportReference_TYPE_REF_RoleHandler() {
super(CtRole.TYPE_REF, CtTypeMemberWildcardImportReference.class, CtTypeReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getTypeReference()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setTypeReference(castValue(value));
}
}
static class CtRecordPattern_TYPE_REF_RoleHandler extends SingleHandler> {
private CtRecordPattern_TYPE_REF_RoleHandler() {
super(CtRole.TYPE_REF, CtRecordPattern.class, CtTypeReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getRecordType()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setRecordType(castValue(value));
}
}
static class CtFormalTypeDeclarer_TYPE_PARAMETER_RoleHandler extends ListHandler {
private CtFormalTypeDeclarer_TYPE_PARAMETER_RoleHandler() {
super(CtRole.TYPE_PARAMETER, CtFormalTypeDeclarer.class, CtTypeParameter.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getFormalCtTypeParameters()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setFormalCtTypeParameters(castValue(value));
}
}
static class CtType_TYPE_MEMBER_RoleHandler extends ListHandler {
private CtType_TYPE_MEMBER_RoleHandler() {
super(CtRole.TYPE_MEMBER, CtType.class, CtTypeMember.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getTypeMembers()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setTypeMembers(castValue(value));
}
}
static class CtActualTypeContainer_TYPE_ARGUMENT_RoleHandler extends ListHandler> {
private CtActualTypeContainer_TYPE_ARGUMENT_RoleHandler() {
super(CtRole.TYPE_ARGUMENT, CtActualTypeContainer.class, CtTypeReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getActualTypeArguments()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setActualTypeArguments(castValue(value));
}
}
static class CtVariableReference_TYPE_RoleHandler extends SingleHandler {
private CtVariableReference_TYPE_RoleHandler() {
super(CtRole.TYPE, CtVariableReference.class, CtTypeReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getType()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setType(castValue(value));
}
}
static class CtTypedElement_TYPE_RoleHandler extends SingleHandler {
private CtTypedElement_TYPE_RoleHandler() {
super(CtRole.TYPE, CtTypedElement.class, CtTypeReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getType()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setType(castValue(value));
}
}
static class CtExecutableReference_TYPE_RoleHandler extends SingleHandler {
private CtExecutableReference_TYPE_RoleHandler() {
super(CtRole.TYPE, CtExecutableReference.class, CtTypeReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getType()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setType(castValue(value));
}
}
static class CtArrayTypeReference_TYPE_RoleHandler extends SingleHandler> {
private CtArrayTypeReference_TYPE_RoleHandler() {
super(CtRole.TYPE, CtArrayTypeReference.class, CtTypeReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getComponentType()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setComponentType(castValue(value));
}
}
static class CtTryWithResource_TRY_RESOURCE_RoleHandler extends ListHandler> {
private CtTryWithResource_TRY_RESOURCE_RoleHandler() {
super(CtRole.TRY_RESOURCE, CtTryWithResource.class, CtResource.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getResources()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setResources(castValue(value));
}
}
static class CtExecutable_THROWN_RoleHandler extends SetHandler> {
private CtExecutable_THROWN_RoleHandler() {
super(CtRole.THROWN, CtExecutable.class, CtTypeReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getThrownTypes()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setThrownTypes(castValue(value));
}
}
static class CtIf_THEN_RoleHandler extends SingleHandler {
private CtIf_THEN_RoleHandler() {
super(CtRole.THEN, CtIf.class, CtStatement.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getThenStatement()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setThenStatement(castValue(value));
}
}
static class CtConditional_THEN_RoleHandler extends SingleHandler> {
private CtConditional_THEN_RoleHandler() {
super(CtRole.THEN, CtConditional.class, CtExpression.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getThenExpression()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setThenExpression(castValue(value));
}
}
static class CtLabelledFlowBreak_TARGET_LABEL_RoleHandler extends SingleHandler {
private CtLabelledFlowBreak_TARGET_LABEL_RoleHandler() {
super(CtRole.TARGET_LABEL, CtLabelledFlowBreak.class, String.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getTargetLabel()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setTargetLabel(castValue(value));
}
}
static class CtTargetedExpression_TARGET_RoleHandler extends SingleHandler> {
private CtTargetedExpression_TARGET_RoleHandler() {
super(CtRole.TARGET, CtTargetedExpression.class, CtExpression.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getTarget()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setTarget(castValue(value));
}
}
static class CtTypeInformation_SUPER_TYPE_RoleHandler extends SingleHandler> {
private CtTypeInformation_SUPER_TYPE_RoleHandler() {
super(CtRole.SUPER_TYPE, CtTypeInformation.class, CtTypeReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getSuperclass()));
}
}
static class CtType_SUPER_TYPE_RoleHandler extends SingleHandler> {
private CtType_SUPER_TYPE_RoleHandler() {
super(CtRole.SUPER_TYPE, CtType.class, CtTypeReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getSuperclass()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setSuperclass(castValue(value));
}
}
static class CtPackage_SUB_PACKAGE_RoleHandler extends SetHandler {
private CtPackage_SUB_PACKAGE_RoleHandler() {
super(CtRole.SUB_PACKAGE, CtPackage.class, CtPackage.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getPackages()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setPackages(castValue(value));
}
}
static class CtModule_SUB_PACKAGE_RoleHandler extends SingleHandler {
private CtModule_SUB_PACKAGE_RoleHandler() {
super(CtRole.SUB_PACKAGE, CtModule.class, CtPackage.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getRootPackage()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setRootPackage(castValue(value));
}
}
static class CtStatementList_STATEMENT_RoleHandler extends ListHandler {
private CtStatementList_STATEMENT_RoleHandler() {
super(CtRole.STATEMENT, CtStatementList.class, CtStatement.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getStatements()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setStatements(castValue(value));
}
}
static class CtCodeSnippet_SNIPPET_RoleHandler extends SingleHandler {
private CtCodeSnippet_SNIPPET_RoleHandler() {
super(CtRole.SNIPPET, CtCodeSnippet.class, String.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getValue()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setValue(castValue(value));
}
}
static class CtUsedService_SERVICE_TYPE_RoleHandler extends SingleHandler {
private CtUsedService_SERVICE_TYPE_RoleHandler() {
super(CtRole.SERVICE_TYPE, CtUsedService.class, CtTypeReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getServiceType()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setServiceType(castValue(value));
}
}
static class CtProvidedService_SERVICE_TYPE_RoleHandler extends SingleHandler {
private CtProvidedService_SERVICE_TYPE_RoleHandler() {
super(CtRole.SERVICE_TYPE, CtProvidedService.class, CtTypeReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getServiceType()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setServiceType(castValue(value));
}
}
static class CtModule_SERVICE_TYPE_RoleHandler extends ListHandler {
private CtModule_SERVICE_TYPE_RoleHandler() {
super(CtRole.SERVICE_TYPE, CtModule.class, CtUsedService.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getUsedServices()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setUsedServices(castValue(value));
}
}
static class CtBinaryOperator_RIGHT_OPERAND_RoleHandler extends SingleHandler> {
private CtBinaryOperator_RIGHT_OPERAND_RoleHandler() {
super(CtRole.RIGHT_OPERAND, CtBinaryOperator.class, CtExpression.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getRightHandOperand()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setRightHandOperand(castValue(value));
}
}
static class CtModule_REQUIRED_MODULE_RoleHandler extends ListHandler {
private CtModule_REQUIRED_MODULE_RoleHandler() {
super(CtRole.REQUIRED_MODULE, CtModule.class, CtModuleRequirement.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getRequiredModules()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setRequiredModules(castValue(value));
}
}
static class CtRecord_RECORD_COMPONENT_RoleHandler extends SetHandler {
private CtRecord_RECORD_COMPONENT_RoleHandler() {
super(CtRole.RECORD_COMPONENT, CtRecord.class, CtRecordComponent.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getRecordComponents()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setRecordComponents(castValue(value));
}
}
static class CtExecutable_RECEIVER_PARAMETER_RoleHandler extends SingleHandler {
private CtExecutable_RECEIVER_PARAMETER_RoleHandler() {
super(CtRole.RECEIVER_PARAMETER, CtExecutable.class, CtReceiverParameter.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getReceiverParameter()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setReceiverParameter(castValue(value));
}
}
static class CtModule_PROVIDED_SERVICE_RoleHandler extends ListHandler {
private CtModule_PROVIDED_SERVICE_RoleHandler() {
super(CtRole.PROVIDED_SERVICE, CtModule.class, CtProvidedService.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getProvidedServices()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setProvidedServices(castValue(value));
}
}
static class CtElement_POSITION_RoleHandler extends SingleHandler {
private CtElement_POSITION_RoleHandler() {
super(CtRole.POSITION, CtElement.class, SourcePosition.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getPosition()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setPosition(castValue(value));
}
}
static class CtSealable_PERMITTED_TYPE_RoleHandler extends SetHandler> {
private CtSealable_PERMITTED_TYPE_RoleHandler() {
super(CtRole.PERMITTED_TYPE, CtSealable.class, CtTypeReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getPermittedTypes()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setPermittedTypes(castValue(value));
}
}
static class CtRecordPattern_PATTERN_RoleHandler extends ListHandler {
private CtRecordPattern_PATTERN_RoleHandler() {
super(CtRole.PATTERN, CtRecordPattern.class, CtPattern.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getPatternList()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setPatternList(castValue(value));
}
}
static class CtCasePattern_PATTERN_RoleHandler extends SingleHandler {
private CtCasePattern_PATTERN_RoleHandler() {
super(CtRole.PATTERN, CtCasePattern.class, CtPattern.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getPattern()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setPattern(castValue(value));
}
}
static class CtExecutable_PARAMETER_RoleHandler extends ListHandler> {
private CtExecutable_PARAMETER_RoleHandler() {
super(CtRole.PARAMETER, CtExecutable.class, CtParameter.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getParameters()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setParameters(castValue(value));
}
}
static class CtCatch_PARAMETER_RoleHandler extends SingleHandler> {
private CtCatch_PARAMETER_RoleHandler() {
super(CtRole.PARAMETER, CtCatch.class, CtCatchVariable.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getParameter()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setParameter(castValue(value));
}
}
static class CtTypeReference_PACKAGE_REF_RoleHandler extends SingleHandler {
private CtTypeReference_PACKAGE_REF_RoleHandler() {
super(CtRole.PACKAGE_REF, CtTypeReference.class, CtPackageReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getPackage()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setPackage(castValue(value));
}
}
static class CtPackageExport_PACKAGE_REF_RoleHandler extends SingleHandler {
private CtPackageExport_PACKAGE_REF_RoleHandler() {
super(CtRole.PACKAGE_REF, CtPackageExport.class, CtPackageReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getPackageReference()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setPackageReference(castValue(value));
}
}
static class CtPackageDeclaration_PACKAGE_REF_RoleHandler extends SingleHandler {
private CtPackageDeclaration_PACKAGE_REF_RoleHandler() {
super(CtRole.PACKAGE_REF, CtPackageDeclaration.class, CtPackageReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getReference()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setReference(castValue(value));
}
}
static class CtCompilationUnit_PACKAGE_DECLARATION_RoleHandler extends SingleHandler {
private CtCompilationUnit_PACKAGE_DECLARATION_RoleHandler() {
super(CtRole.PACKAGE_DECLARATION, CtCompilationUnit.class, CtPackageDeclaration.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getPackageDeclaration()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setPackageDeclaration(castValue(value));
}
}
static class CtUnaryOperator_OPERATOR_KIND_RoleHandler extends SingleHandler {
private CtUnaryOperator_OPERATOR_KIND_RoleHandler() {
super(CtRole.OPERATOR_KIND, CtUnaryOperator.class, UnaryOperatorKind.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getKind()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setKind(castValue(value));
}
}
static class CtOperatorAssignment_OPERATOR_KIND_RoleHandler extends SingleHandler {
private CtOperatorAssignment_OPERATOR_KIND_RoleHandler() {
super(CtRole.OPERATOR_KIND, CtOperatorAssignment.class, BinaryOperatorKind.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getKind()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setKind(castValue(value));
}
}
static class CtBinaryOperator_OPERATOR_KIND_RoleHandler extends SingleHandler {
private CtBinaryOperator_OPERATOR_KIND_RoleHandler() {
super(CtRole.OPERATOR_KIND, CtBinaryOperator.class, BinaryOperatorKind.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getKind()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setKind(castValue(value));
}
}
static class CtPackageExport_OPENED_PACKAGE_RoleHandler extends SingleHandler {
private CtPackageExport_OPENED_PACKAGE_RoleHandler() {
super(CtRole.OPENED_PACKAGE, CtPackageExport.class, Boolean.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).isOpenedPackage()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setOpenedPackage(castValue(value));
}
}
static class CtModule_OPENED_PACKAGE_RoleHandler extends ListHandler {
private CtModule_OPENED_PACKAGE_RoleHandler() {
super(CtRole.OPENED_PACKAGE, CtModule.class, CtPackageExport.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getOpenedPackages()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setOpenedPackages(castValue(value));
}
}
static class CtType_NESTED_TYPE_RoleHandler extends SetHandler> {
private CtType_NESTED_TYPE_RoleHandler() {
super(CtRole.NESTED_TYPE, CtType.class, CtType.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getNestedTypes()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setNestedTypes(castValue(value));
}
}
static class CtNewClass_NESTED_TYPE_RoleHandler extends SingleHandler> {
private CtNewClass_NESTED_TYPE_RoleHandler() {
super(CtRole.NESTED_TYPE, CtNewClass.class, CtClass.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getAnonymousClass()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setAnonymousClass(castValue(value));
}
}
static class CtReference_NAME_RoleHandler extends SingleHandler {
private CtReference_NAME_RoleHandler() {
super(CtRole.NAME, CtReference.class, String.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getSimpleName()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setSimpleName(castValue(value));
}
}
static class CtNamedElement_NAME_RoleHandler extends SingleHandler {
private CtNamedElement_NAME_RoleHandler() {
super(CtRole.NAME, CtNamedElement.class, String.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getSimpleName()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setSimpleName(castValue(value));
}
}
static class CtMultiTypedElement_MULTI_TYPE_RoleHandler extends ListHandler> {
private CtMultiTypedElement_MULTI_TYPE_RoleHandler() {
super(CtRole.MULTI_TYPE, CtMultiTypedElement.class, CtTypeReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getMultiTypes()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setMultiTypes(castValue(value));
}
}
static class CtPackageExport_MODULE_REF_RoleHandler extends ListHandler {
private CtPackageExport_MODULE_REF_RoleHandler() {
super(CtRole.MODULE_REF, CtPackageExport.class, CtModuleReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getTargetExport()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setTargetExport(castValue(value));
}
}
static class CtModuleRequirement_MODULE_REF_RoleHandler extends SingleHandler {
private CtModuleRequirement_MODULE_REF_RoleHandler() {
super(CtRole.MODULE_REF, CtModuleRequirement.class, CtModuleReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getModuleReference()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setModuleReference(castValue(value));
}
}
static class CtModule_MODULE_DIRECTIVE_RoleHandler extends ListHandler {
private CtModule_MODULE_DIRECTIVE_RoleHandler() {
super(CtRole.MODULE_DIRECTIVE, CtModule.class, CtModuleDirective.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getModuleDirectives()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setModuleDirectives(castValue(value));
}
}
static class CtTypeInformation_MODIFIER_RoleHandler extends SetHandler {
private CtTypeInformation_MODIFIER_RoleHandler() {
super(CtRole.MODIFIER, CtTypeInformation.class, ModifierKind.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getModifiers()));
}
}
static class CtModuleRequirement_MODIFIER_RoleHandler extends SetHandler {
private CtModuleRequirement_MODIFIER_RoleHandler() {
super(CtRole.MODIFIER, CtModuleRequirement.class, CtModuleRequirement.RequiresModifier.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getRequiresModifiers()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setRequiresModifiers(castValue(value));
}
}
static class CtModule_MODIFIER_RoleHandler extends SingleHandler {
private CtModule_MODIFIER_RoleHandler() {
super(CtRole.MODIFIER, CtModule.class, Boolean.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).isOpenModule()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setIsOpenModule(castValue(value));
}
}
static class CtModifiable_MODIFIER_RoleHandler extends SetHandler {
private CtModifiable_MODIFIER_RoleHandler() {
super(CtRole.MODIFIER, CtModifiable.class, ModifierKind.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getModifiers()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setModifiers(castValue(value));
}
}
static class CtType_METHOD_RoleHandler extends SetHandler> {
private CtType_METHOD_RoleHandler() {
super(CtRole.METHOD, CtType.class, CtMethod.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getMethods()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setMethods(castValue(value));
}
}
static class CtLiteral_LITERAL_BASE_RoleHandler extends SingleHandler {
private CtLiteral_LITERAL_BASE_RoleHandler() {
super(CtRole.LITERAL_BASE, CtLiteral.class, LiteralBase.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getBase()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setBase(castValue(value));
}
}
static class CtBinaryOperator_LEFT_OPERAND_RoleHandler extends SingleHandler> {
private CtBinaryOperator_LEFT_OPERAND_RoleHandler() {
super(CtRole.LEFT_OPERAND, CtBinaryOperator.class, CtExpression.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getLeftHandOperand()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setLeftHandOperand(castValue(value));
}
}
static class CtStatement_LABEL_RoleHandler extends SingleHandler {
private CtStatement_LABEL_RoleHandler() {
super(CtRole.LABEL, CtStatement.class, String.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getLabel()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setLabel(castValue(value));
}
}
static class CtJavaDocTag_JAVADOC_TAG_VALUE_RoleHandler extends SingleHandler {
private CtJavaDocTag_JAVADOC_TAG_VALUE_RoleHandler() {
super(CtRole.JAVADOC_TAG_VALUE, CtJavaDocTag.class, String.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getParam()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setParam(castValue(value));
}
}
static class CtParameter_IS_VARARGS_RoleHandler extends SingleHandler {
private CtParameter_IS_VARARGS_RoleHandler() {
super(CtRole.IS_VARARGS, CtParameter.class, Boolean.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).isVarArgs()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setVarArgs(castValue(value));
}
}
static class CtWildcardReference_IS_UPPER_RoleHandler extends SingleHandler {
private CtWildcardReference_IS_UPPER_RoleHandler() {
super(CtRole.IS_UPPER, CtWildcardReference.class, Boolean.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).isUpper()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setUpper(castValue(value));
}
}
static class CtFieldReference_IS_STATIC_RoleHandler extends SingleHandler {
private CtFieldReference_IS_STATIC_RoleHandler() {
super(CtRole.IS_STATIC, CtFieldReference.class, Boolean.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).isStatic()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setStatic(castValue(value));
}
}
static class CtExecutableReference_IS_STATIC_RoleHandler extends SingleHandler {
private CtExecutableReference_IS_STATIC_RoleHandler() {
super(CtRole.IS_STATIC, CtExecutableReference.class, Boolean.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).isStatic()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setStatic(castValue(value));
}
}
static class CtShadowable_IS_SHADOW_RoleHandler extends SingleHandler {
private CtShadowable_IS_SHADOW_RoleHandler() {
super(CtRole.IS_SHADOW, CtShadowable.class, Boolean.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).isShadow()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setShadow(castValue(value));
}
}
static class CtParameter_IS_INFERRED_RoleHandler extends SingleHandler {
private CtParameter_IS_INFERRED_RoleHandler() {
super(CtRole.IS_INFERRED, CtParameter.class, Boolean.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).isInferred()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setInferred(castValue(value));
}
}
static class CtLocalVariable_IS_INFERRED_RoleHandler extends SingleHandler {
private CtLocalVariable_IS_INFERRED_RoleHandler() {
super(CtRole.IS_INFERRED, CtLocalVariable.class, Boolean.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).isInferred()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setInferred(castValue(value));
}
}
static class CtElement_IS_IMPLICIT_RoleHandler extends SingleHandler {
private CtElement_IS_IMPLICIT_RoleHandler() {
super(CtRole.IS_IMPLICIT, CtElement.class, Boolean.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).isImplicit()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setImplicit(castValue(value));
}
}
static class CtFieldReference_IS_FINAL_RoleHandler extends SingleHandler {
private CtFieldReference_IS_FINAL_RoleHandler() {
super(CtRole.IS_FINAL, CtFieldReference.class, Boolean.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).isFinal()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setFinal(castValue(value));
}
}
static class CtMethod_IS_DEFAULT_RoleHandler extends SingleHandler {
private CtMethod_IS_DEFAULT_RoleHandler() {
super(CtRole.IS_DEFAULT, CtMethod.class, Boolean.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).isDefaultMethod()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setDefaultMethod(castValue(value));
}
}
static class CtTypeInformation_INTERFACE_RoleHandler extends SetHandler> {
private CtTypeInformation_INTERFACE_RoleHandler() {
super(CtRole.INTERFACE, CtTypeInformation.class, CtTypeReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getSuperInterfaces()));
}
}
static class CtType_INTERFACE_RoleHandler extends SetHandler> {
private CtType_INTERFACE_RoleHandler() {
super(CtRole.INTERFACE, CtType.class, CtTypeReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getSuperInterfaces()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setSuperInterfaces(castValue(value));
}
}
static class CtImport_IMPORT_REFERENCE_RoleHandler extends SingleHandler {
private CtImport_IMPORT_REFERENCE_RoleHandler() {
super(CtRole.IMPORT_REFERENCE, CtImport.class, CtReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getReference()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setReference(castValue(value));
}
}
static class CtProvidedService_IMPLEMENTATION_TYPE_RoleHandler extends ListHandler {
private CtProvidedService_IMPLEMENTATION_TYPE_RoleHandler() {
super(CtRole.IMPLEMENTATION_TYPE, CtProvidedService.class, CtTypeReference.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getImplementationTypes()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setImplementationTypes(castValue(value));
}
}
static class CtFor_FOR_UPDATE_RoleHandler extends ListHandler {
private CtFor_FOR_UPDATE_RoleHandler() {
super(CtRole.FOR_UPDATE, CtFor.class, CtStatement.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getForUpdate()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setForUpdate(castValue(value));
}
}
static class CtFor_FOR_INIT_RoleHandler extends ListHandler {
private CtFor_FOR_INIT_RoleHandler() {
super(CtRole.FOR_INIT, CtFor.class, CtStatement.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getForInit()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setForInit(castValue(value));
}
}
static class CtForEach_FOREACH_VARIABLE_RoleHandler extends SingleHandler> {
private CtForEach_FOREACH_VARIABLE_RoleHandler() {
super(CtRole.FOREACH_VARIABLE, CtForEach.class, CtLocalVariable.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getVariable()));
}
@Override
public void setValue(T element, U value) {
castTarget(element).setVariable(castValue(value));
}
}
static class CtTry_FINALIZER_RoleHandler extends SingleHandler> {
private CtTry_FINALIZER_RoleHandler() {
super(CtRole.FINALIZER, CtTry.class, CtBlock.class);
}
@SuppressWarnings("unchecked")
@Override
public U getValue(T element) {
return ((U) (Object) (castTarget(element).getFinalizer()));
}
@Override
public