当前位置: 首页>>代码示例>>Java>>正文


Java IdResolver.getProperty方法代码示例

本文整理汇总了Java中org.eclipse.ocl.pivot.ids.IdResolver.getProperty方法的典型用法代码示例。如果您正苦于以下问题:Java IdResolver.getProperty方法的具体用法?Java IdResolver.getProperty怎么用?Java IdResolver.getProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.ocl.pivot.ids.IdResolver的用法示例。


在下文中一共展示了IdResolver.getProperty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: basicEvaluate

import org.eclipse.ocl.pivot.ids.IdResolver; //导入方法依赖的package包/类
@Override
public @Nullable Object basicEvaluate(@NonNull Executor executor, @NonNull TypedElement caller, @Nullable Object @NonNull [] sourceAndArgumentValues) {
	@SuppressWarnings("null") final /*@NonInvalid*/ @NonNull CompilationUnit self_16 = (/*@NonInvalid*/ @NonNull CompilationUnit)sourceAndArgumentValues[0];
	final /*@NonInvalid*/ @Nullable Visitable child = (/*@NonInvalid*/ @Nullable Visitable)sourceAndArgumentValues[1];
	final /*@NonInvalid*/ @NonNull IdResolver idResolver = executor.getIdResolver();
	final /*@NonInvalid*/ [email protected] Class TYP_astm_c_c_FunctionDefinition_0 = idResolver.getClass(CLSSid_FunctionDefinition, null);
	final /*@Thrown*/ @NonNull LookupEnvironment self_27 = INSTANCE_Visitable_parentEnv_FunctionDefinition.evaluate(self_16);
	final /*@NonInvalid*/ @NonNull Property CTORid_parentEnv = idResolver.getProperty(PROPid_parentEnv);
	final /*@NonInvalid*/ [email protected] Class TYP_lookup_c_c_LookupEnvironment_0 = idResolver.getClass(CLSSid_LookupEnvironment, null);
	final /*@Thrown*/ @NonNull LookupEnvironment symbol_0 = (LookupEnvironment)TYP_lookup_c_c_LookupEnvironment_0.createInstance();
	CTORid_parentEnv.initValue(symbol_0, self_27);
	@SuppressWarnings("null")
	final /*@Thrown*/ @NonNull List<DefinitionObject> fragments = self_16.getFragments();
	final /*@Thrown*/ @NonNull OrderedSetValue BOXED_fragments = idResolver.createOrderedSetOfAll(ORD_CLSSid_DefinitionObject, fragments);
	final /*@Thrown*/ @NonNull OrderedSetValue selectByKind = (OrderedSetValue)CollectionSelectByKindOperation.INSTANCE.evaluate(executor, BOXED_fragments, TYP_astm_c_c_FunctionDefinition_0);
	final /*@Thrown*/ @NonNull List<FunctionDefinition> ECORE_selectByKind = ((IdResolver.IdResolverExtension)idResolver).ecoreValueOfAll(FunctionDefinition.class, selectByKind);
	@SuppressWarnings("null")
	final /*@Thrown*/ @NonNull LookupEnvironment addElements = symbol_0.addElements(ECORE_selectByKind);
	return addElements;
}
 
开发者ID:adolfosbh,项目名称:cs2as,代码行数:21,代码来源:Delphi_qvtp_qvtcas.java

示例2: basicEvaluate

import org.eclipse.ocl.pivot.ids.IdResolver; //导入方法依赖的package包/类
@Override
public @Nullable Object basicEvaluate(@NonNull Executor executor, @NonNull TypedElement caller, @Nullable Object @NonNull [] sourceAndArgumentValues) {
	@SuppressWarnings("null") final /*@NonInvalid*/ @NonNull Company self_2 = (/*@NonInvalid*/ @NonNull Company)sourceAndArgumentValues[0];
	final /*@NonInvalid*/ @Nullable Object child = (/*@NonInvalid*/ @Nullable Object)sourceAndArgumentValues[1];
	final /*@NonInvalid*/ @NonNull IdResolver idResolver = executor.getIdResolver();
	final /*@Thrown*/ @NonNull LookupEnvironment self_6 = INSTANCE_OclElement_parentEnv_Employee.evaluate(self_2);
	final /*@NonInvalid*/ @NonNull Property CTORid_parentEnv = idResolver.getProperty(PROPid_parentEnv);
	final /*@NonInvalid*/ [email protected] Class TYP_lookup_c_c_LookupEnvironment_0 = idResolver.getClass(CLSSid_LookupEnvironment, null);
	final /*@Thrown*/ @NonNull LookupEnvironment symbol_0 = (LookupEnvironment)TYP_lookup_c_c_LookupEnvironment_0.createInstance();
	CTORid_parentEnv.initValue(symbol_0, self_6);
	@SuppressWarnings("null")
	final /*@Thrown*/ @NonNull List<Department> depts = self_2.getDepts();
	final /*@Thrown*/ @NonNull SetValue BOXED_depts = idResolver.createSetOfAll(SET_CLSSid_Department, depts);
	/*@Thrown*/ [email protected] Accumulator accumulator = ValueUtil.createBagAccumulatorValue(BAG_CLSSid_Employee);
	@NonNull Iterator<Object> ITERATOR__1 = BOXED_depts.iterator();
	/*@Thrown*/ @NonNull BagValue collect;
	while (true) {
		if (!ITERATOR__1.hasNext()) {
			collect = accumulator;
			break;
		}
		@SuppressWarnings("null")
		/*@NonInvalid*/ @NonNull Department _1 = (Department)ITERATOR__1.next();
		/**
		 * ::_'null' : Set(company::Employee)
		 */
		final /*@Thrown*/ @NonNull SetValue getEmployees = INSTANCE_Department_getEmployees.evaluate(_1);
		//
		for (Object value : getEmployees.flatten().getElements()) {
			accumulator.add(value);
		}
	}
	final /*@Thrown*/ @NonNull SetValue asSet = CollectionAsSetOperation.INSTANCE.evaluate(collect);
	final /*@Thrown*/ @NonNull List<Employee> ECORE_asSet = ((IdResolver.IdResolverExtension)idResolver).ecoreValueOfAll(Employee.class, asSet);
	@SuppressWarnings("null")
	final /*@Thrown*/ @NonNull LookupEnvironment addElements = symbol_0.addElements(ECORE_asSet);
	return addElements;
}
 
开发者ID:adolfosbh,项目名称:cs2as,代码行数:39,代码来源:companies_qvtp_qvtcas.java

示例3: MAP_m_Visitable__ExpressionStatement_expression

import org.eclipse.ocl.pivot.ids.IdResolver; //导入方法依赖的package包/类
/**
 *
 * map m_Visitable__ExpressionStatement_expression in Delphi_qvtp_qvtcas {
 *
 *   guard:leftCS lAssignmentStmnt  : delphi::assignmentStmnt[1];
 * var Assign1 : astm::Assign[1] := astm::Assign{
 *   }
 *   ;
 * var ast : astm::Visitable[1] := lAssignmentStmnt.ast;
 * var designator1 : delphi::designator[?] := lAssignmentStmnt.designator;
 * var exp : delphi::expression[?] := lAssignmentStmnt.exp;
 * var aExpressionStatement : astm::ExpressionStatement[1] := ast.oclAsType(astm::ExpressionStatement)
 *   ;
 * var ast1 : astm::Visitable[?] := designator1.ast;
 * var ast2 : astm::Visitable[?] := exp.ast;
 * var aExpression : astm::Expression[1] := ast2.oclAsType(astm::Expression)
 *   ;
 * var aNameReference : astm::NameReference[1] := ast1.oclAsType(astm::NameReference)
 *   ;
 * var BinaryExpression1 : astm::BinaryExpression[1] := astm::BinaryExpression{leftOperand = aNameReference, operator = Assign1, rightOperand = aExpression
 *   };
 * set aExpressionStatement.expression := BinaryExpression1;
 *
 */
protected boolean MAP_m_Visitable__ExpressionStatement_expression(final /*@NonInvalid*/ @NonNull assignmentStmnt lAssignmentStmnt_0)  {
	try {
		final /*@NonInvalid*/ @NonNull IdResolver idResolver = executor.getIdResolver();
		final /*@NonInvalid*/ [email protected] Class TYP_astm_c_c_Assign_0 = idResolver.getClass(CLSSid_Assign, null);
		final /*@NonInvalid*/ @NonNull Assign symbol_0 = (Assign)TYP_astm_c_c_Assign_0.createInstance();
		final /*@Thrown*/ @Nullable Visitable ast = lAssignmentStmnt_0.getAst();
		final /*@Thrown*/ boolean symbol_1 = ast != null;
		/*@Thrown*/ @Nullable Boolean raw_ast;
		if (symbol_1) {
			if (ast == null) {
				throw throwNull(lAssignmentStmnt_0, "Null where non-null value required");
			}
			final /*@Thrown*/ @Nullable designator designator = lAssignmentStmnt_0.getDesignator();
			final /*@Thrown*/ @Nullable expression exp = lAssignmentStmnt_0.getExp();
			final /*@NonInvalid*/ [email protected] Class TYP_astm_c_c_ExpressionStatement_0 = idResolver.getClass(CLSSid_ExpressionStatement, null);
			final /*@Thrown*/ @NonNull ExpressionStatement oclAsType = ClassUtil.nonNullState((ExpressionStatement)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, ast, TYP_astm_c_c_ExpressionStatement_0));
			if (designator == null) {
				throw throwNull(lAssignmentStmnt_0, "Null source for \'\'http://www.xtext.org/example/delphi/Delphi\'::CSTrace::ast\'");
			}
			final /*@Thrown*/ @Nullable Visitable ast_0 = designator.getAst();
			if (exp == null) {
				throw throwNull(lAssignmentStmnt_0, "Null source for \'\'http://www.xtext.org/example/delphi/Delphi\'::CSTrace::ast\'");
			}
			final /*@Thrown*/ @Nullable Visitable ast_1 = exp.getAst();
			final /*@NonInvalid*/ [email protected] Class TYP_astm_c_c_Expression_0 = idResolver.getClass(CLSSid_Expression, null);
			final /*@Thrown*/ @NonNull Expression oclAsType_0 = ClassUtil.nonNullState((Expression)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, ast_1, TYP_astm_c_c_Expression_0));
			final /*@NonInvalid*/ [email protected] Class TYP_astm_c_c_NameReference_0 = idResolver.getClass(CLSSid_NameReference, null);
			final /*@Thrown*/ @NonNull NameReference oclAsType_1 = ClassUtil.nonNullState((NameReference)OclAnyOclAsTypeOperation.INSTANCE.evaluate(executor, ast_0, TYP_astm_c_c_NameReference_0));
			final /*@NonInvalid*/ @NonNull Property CTORid_leftOperand = idResolver.getProperty(PROPid_leftOperand);
			final /*@NonInvalid*/ @NonNull Property CTORid_operator = idResolver.getProperty(PROPid_operator);
			final /*@NonInvalid*/ @NonNull Property CTORid_rightOperand = idResolver.getProperty(PROPid_rightOperand);
			final /*@NonInvalid*/ [email protected] Class TYP_astm_c_c_BinaryExpression_0 = idResolver.getClass(CLSSid_BinaryExpression, null);
			final /*@Thrown*/ @NonNull BinaryExpression symbol_5 = (BinaryExpression)TYP_astm_c_c_BinaryExpression_0.createInstance();
			CTORid_leftOperand.initValue(symbol_5, oclAsType_1);
			CTORid_operator.initValue(symbol_5, symbol_0);
			CTORid_rightOperand.initValue(symbol_5, oclAsType_0);
			// mapping statements
			oclAsType.setExpression(symbol_5);
			final /*@Thrown*/ @Nullable Boolean m_Visitable__ExpressionStatement_expression = ValueUtil.TRUE_VALUE;
			raw_ast = m_Visitable__ExpressionStatement_expression;
		}
		else {
			raw_ast = ValueUtil.FALSE_VALUE;
		}
		return raw_ast;
	} catch (Throwable e) {
		return handleExecutionFailure("MAP_m_Visitable__ExpressionStatement_expression", e);
	}
}
 
开发者ID:adolfosbh,项目名称:cs2as,代码行数:74,代码来源:Delphi_qvtp_qvtcas.java


注:本文中的org.eclipse.ocl.pivot.ids.IdResolver.getProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。