本文整理汇总了Java中org.eclipse.emf.ecore.EParameter类的典型用法代码示例。如果您正苦于以下问题:Java EParameter类的具体用法?Java EParameter怎么用?Java EParameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EParameter类属于org.eclipse.emf.ecore包,在下文中一共展示了EParameter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: convertAction
import org.eclipse.emf.ecore.EParameter; //导入依赖的package包/类
/**
* Convert an OCCI action to an Ecore operation.
*
* @param action
* the OCCI action to convert.
* @return the resulting Ecore operation.
*/
protected EOperation convertAction(Action action) {
// Create the Ecore operation.
EOperation eOperation = EcoreFactory.eINSTANCE.createEOperation();
// Set the name of the Ecore operation.
eOperation.setName(ConverterUtils.formatName(action.getTerm()));
// Convert all attributes of the OCCI action.
for (Attribute attribute : action.getAttributes()) {
// Each OCCI attribute of the OCCI action is converted to an Ecore
// parameter of the Ecore operation.
EParameter convertParameter = convertParameter(attribute);
if (convertParameter != null) {
// Add the Ecore parameter to the Ecore operation.
eOperation.getEParameters().add(convertParameter);
}
}
attachInfo(eOperation, action.getTitle());
return eOperation;
}
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:27,代码来源:OCCIExtension2Ecore.java
示例2: convertParameter
import org.eclipse.emf.ecore.EParameter; //导入依赖的package包/类
/**
* Convert an OCCI action's attribute to an Ecore operation parameter.
*
* @param attribute
* the OCCI attribute to convert.
* @return the resulting Ecore operation parameter.
*/
protected EParameter convertParameter(Attribute attribute) {
// Create an Ecore parameter.
EParameter eParam = EcoreFactory.eINSTANCE.createEParameter();
// Set the name of the Ecore parameter.
eParam.setName(Occi2Ecore.convertOcciAttributeName2EcoreAttributeName(attribute.getName()));
// Set the type of the Ecore parameter.
eParam.setEType(getMappedType(attribute.getType()));
// If the OCCI attribute is required then the Ecore parameter is also
// required.
if (attribute.isRequired()) {
eParam.setLowerBound(1);
}
attachInfo(eParam, attribute.getDescription());
return eParam;
}
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:26,代码来源:OCCIExtension2Ecore.java
示例3: visitVariableExp
import org.eclipse.emf.ecore.EParameter; //导入依赖的package包/类
@Override
public String visitVariableExp(VariableExp<EClassifier, EParameter> v) {
++counter;
oclTranslation.append("% Lookup for variable " + v.getName() + "\n");
String predName = "nVariable" + counter + constraintName;
oclTranslation.append(predName);
oclTranslation.append("(_, Vars, Result):-");
oclTranslation.append("\n\t");
oclTranslation.append("ocl_variable(Vars,");
int index = varStack.search(v.getName());
if (index < 0) {
logger.writeErrorMessage(this.getClass().toString(), "Internal error: Variable " + v.getName() + " not found");
}
oclTranslation.append(index);
oclTranslation.append(",Result).\n");
return predName;
}
开发者ID:SOM-Research,项目名称:EMFtoCSP,代码行数:18,代码来源:OclToEcl.java
示例4: isOverrideOf
import org.eclipse.emf.ecore.EParameter; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
public boolean isOverrideOf(EOperation someOperation)
{
if (someOperation.getEContainingClass().isSuperTypeOf(getEContainingClass()) && someOperation.getName().equals(getName()))
{
EList<EParameter> parameters = getEParameters();
EList<EParameter> otherParameters = someOperation.getEParameters();
if (parameters.size() == otherParameters.size())
{
for (Iterator<EParameter> i = parameters.iterator(), j = otherParameters.iterator(); i.hasNext(); )
{
EParameter parameter = i.next();
EParameter otherParameter = j.next();
if (!parameter.getEType().getInstanceTypeName().equals(otherParameter.getEType().getInstanceTypeName()))
{
return false;
}
}
return true;
}
}
return false;
}
开发者ID:LangleyStudios,项目名称:eclipse-avro,代码行数:28,代码来源:EOperationImpl.java
示例5: text
import org.eclipse.emf.ecore.EParameter; //导入依赖的package包/类
/**
* Text for EOperation.
*
* @param eOperation
* the EOperation
* @return the name and types of all EParameters
*/
protected String text(final EOperation eOperation) {
return eOperation.getName() + "(" + Joiner.on(", ").join(Iterables.transform(eOperation.getEParameters(), new Function<EParameter, String>() {
public String apply(final EParameter input) {
return getText(input.getEType());
}
})) + ") : " + (eOperation.getEType() == null ? "Void" : getText(eOperation.getEType()));
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:15,代码来源:XtextSpyLabelProvider.java
示例6: extendWith
import org.eclipse.emf.ecore.EParameter; //导入依赖的package包/类
private void extendWith(EClass c, EOperation op) {
if ( op.getEType() == null ) {
// Operations without return type cannot be invoked in ATL
return;
}
ContextHelper helper = ATLFactory.eINSTANCE.createContextHelper();
helper.getCommentsBefore().add(EOPERATION_TAG);
OclFeatureDefinition fd = OCLFactory.eINSTANCE.createOclFeatureDefinition();
OclContextDefinition ctx = OCLFactory.eINSTANCE.createOclContextDefinition();
Operation oclOp = OCLFactory.eINSTANCE.createOperation();
ctx.setContext_(createType(c, false));
fd.setContext_(ctx);
fd.setFeature(oclOp);
oclOp.setName(op.getName());
oclOp.setReturnType(createType(op.getEType(), op.isMany()));
oclOp.setBody( OCLFactory.eINSTANCE.createJavaBody() );
for(EParameter p : op.getEParameters()) {
Parameter pnew = OCLFactory.eINSTANCE.createParameter();
pnew.setVarName(p.getName());
pnew.setType(createType(p.getEType(), p.isMany()));
oclOp.getParameters().add(pnew);
}
helper.setDefinition(fd);
if ( unit instanceof Module ) {
((Module) unit).getElements().add(helper);
} else if ( unit instanceof Library ) {
((Library) unit).getHelpers().add(helper);
} else {
// Ignore
}
}
开发者ID:anatlyzer,项目名称:anatlyzer,代码行数:41,代码来源:ExtendTransformation.java
示例7: getEParameters
import org.eclipse.emf.ecore.EParameter; //导入依赖的package包/类
@Override
public EList<EParameter> getEParameters() {
List<Parameter> paramList = origOperation.getOwnedParameters();
EList<EParameter> result = new BasicEList<EParameter>();
if (! paramList.isEmpty()){
for (Parameter param : paramList)
if (param.getDirection() != ParameterDirectionKind.RETURN_LITERAL)
result.add(((EResourceUMLAdapter)owningResource).getParamIfNotExists(new EParameterUMLAdapter(param,owningResource)));
}
return result;
}
开发者ID:SOM-Research,项目名称:EMFtoCSP,代码行数:12,代码来源:EOperationUMLAdapter.java
示例8: getParamIfNotExists
import org.eclipse.emf.ecore.EParameter; //导入依赖的package包/类
public EParameter getParamIfNotExists(EParameter param){
Assert.isNotNull(param);
for (EParameter par : loadedParameters)
if (par.equals(param))
return par;
loadedParameters.add(param);
return param;
}
开发者ID:SOM-Research,项目名称:EMFtoCSP,代码行数:9,代码来源:EResourceUMLAdapter.java
示例9: visitExpressionInOCL
import org.eclipse.emf.ecore.EParameter; //导入依赖的package包/类
@Override
public String visitExpressionInOCL(ExpressionInOCL<EClassifier, EParameter> expression) {
constraintName = ((Constraint)expression.eContainer()).getName();
oclTranslation = new StringBuilder();
oclTranslation.append("% OCL constraint " + expression.getBodyExpression().toString() + "\n" );
varStack = new Stack<String>();
firstPredicate = "";
counter = 0;
return super.visitExpressionInOCL(expression);
}
开发者ID:SOM-Research,项目名称:EMFtoCSP,代码行数:13,代码来源:OclToEcl.java
示例10: visitIteratorExp
import org.eclipse.emf.ecore.EParameter; //导入依赖的package包/类
@Override
public String visitIteratorExp(IteratorExp<EClassifier, EParameter> callExp) {
List<String> variableResults;
EList<Variable<EClassifier, EParameter>> variables = callExp.getIterator();
if (variables.isEmpty()) {
variableResults = Collections.emptyList();
}
else {
variableResults = new java.util.ArrayList<String>(variables.size());
}
Iterator<Variable<EClassifier, EParameter>> it = variables.iterator();
return processIterators(callExp, it, variableResults);
}
开发者ID:SOM-Research,项目名称:EMFtoCSP,代码行数:16,代码来源:OclToEcl.java
示例11: handleIteratorExp
import org.eclipse.emf.ecore.EParameter; //导入依赖的package包/类
@Override
protected String handleIteratorExp(IteratorExp<EClassifier, EParameter> callExp, String sourceResult, List<String> variableResults, String bodyResult) {
String itName = callExp.getName();
//String type = itName.equalsIgnoreCase("forAll") ? "Boolean" : getType(callExp);
++counter;
String predName = "n" + itName + counter + constraintName;
oclTranslation.append(predName);
oclTranslation.append("(Instances, Vars, Result):-");
oclTranslation.append("\n\t");
oclTranslation.append(sourceResult);
oclTranslation.append("(Instances, Vars, Value1),");
oclTranslation.append("\n\t");
oclTranslation.append("ocl_");
if (itName.equals("collect") || itName.equals("select") || itName.equals("reject") || itName.equals("collectNested") || itName.equals("sortedBy")) {
//FIXME: this is a dirty bug fix
oclTranslation.append("bag");
oclTranslation.append("_");
}
else
oclTranslation.append("col_");
oclTranslation.append(itName);
oclTranslation.append("(Instances, Vars, Value1, ");
oclTranslation.append(bodyResult);
oclTranslation.append(", Result).\n");
return predName;
}
开发者ID:SOM-Research,项目名称:EMFtoCSP,代码行数:28,代码来源:OclToEcl.java
示例12: handleExpressionInOCL
import org.eclipse.emf.ecore.EParameter; //导入依赖的package包/类
@Override
protected String handleExpressionInOCL(ExpressionInOCL<EClassifier, EParameter> callExp, String contextResult, String resultResult, List<String> parameterResults, String bodyResult) {
String predName = constraintName.substring(0,1).toLowerCase().concat(constraintName.substring(1, constraintName.length()));
setConstraintFirstPredicate(bodyResult);
oclTranslation.append(predName);
oclTranslation.append("(Instances):-");
oclTranslation.append("\n\t");
oclTranslation.append(bodyResult);
oclTranslation.append("(Instances, [], Result),");
oclTranslation.append("\n\t");
oclTranslation.append("Result #=1.\n");
return oclTranslation.toString();
}
开发者ID:SOM-Research,项目名称:EMFtoCSP,代码行数:14,代码来源:OclToEcl.java
示例13: visitVariableExp
import org.eclipse.emf.ecore.EParameter; //导入依赖的package包/类
public Variable<EClassifier, EParameter> visitVariableExp(VariableExp<EClassifier, EParameter> v) {
Variable<EClassifier, EParameter> referredVar = v.getReferredVariable();
if ("self".equals(referredVar.getName())) {
result = referredVar;
}
return result;
}
开发者ID:SOM-Research,项目名称:EMFtoCSP,代码行数:8,代码来源:LookupSelfVariableVisitor.java
示例14: insertQuantificationForSelf
import org.eclipse.emf.ecore.EParameter; //导入依赖的package包/类
/**
* Add quantification for self variable if required.
* @param helper
* @param contextCls The context of this expression (i.e., the type of "self")
* @param oclExpression The OCL expression to be extended
* @throws ParserException
*/
@SuppressWarnings("rawtypes")
private void insertQuantificationForSelf(OCLHelper<EClassifier, EOperation, EStructuralFeature, Constraint> helper,
EClass contextCls, ExpressionInOCL oclExpression) throws ParserException {
/* TODO: This method inserts the quantification for "self" only if this variable
* occurs. This is working and practical.
* However, the precise semantics of OCL would require that self is always quantified.
* In the long term, a switch for EMFtoCSP should be added.
*/
OCLExpression bodyExp = oclExpression.getBodyExpression();
LookupSelfVariableVisitor lookupVisitor = new LookupSelfVariableVisitor();
bodyExp.accept(lookupVisitor);
Variable<EClassifier, EParameter> selfDecl = lookupVisitor.getResult();
if (selfDecl != null) {
System.err.println("Adding required self variable quantification");
EcorePackage oclPackage = (EcorePackage) oclExpression.eClass().getEPackage();
EcoreFactory oclFactory = (EcoreFactory) oclPackage.getEFactoryInstance();
IteratorExp forAllExp = oclFactory.createIteratorExp();
forAllExp.setName("forAll");
forAllExp.setType((EClassifier) bodyExp.getType());
selfDecl.setName("self");
selfDecl.setType(contextCls);
forAllExp.getIterator().add(selfDecl);
forAllExp.setBody(bodyExp);
helper.setContext(contextCls);
OCLExpression<EClassifier> allInstancesExp = helper.createQuery(contextCls.getName() + ".allInstances()");
forAllExp.setSource(allInstancesExp);
oclExpression.setBodyExpression(forAllExp);
}
}
开发者ID:SOM-Research,项目名称:EMFtoCSP,代码行数:38,代码来源:EmfToEclCodeGenerator.java
示例15: getEParameters
import org.eclipse.emf.ecore.EParameter; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<EParameter> getEParameters()
{
if (eParameters == null)
{
eParameters = new EObjectContainmentWithInverseEList<EParameter>(EParameter.class, this, EcorePackage.EOPERATION__EPARAMETERS, EcorePackage.EPARAMETER__EOPERATION);
}
return eParameters;
}
开发者ID:LangleyStudios,项目名称:eclipse-avro,代码行数:14,代码来源:EOperationImpl.java
示例16: internalAddEParameter
import org.eclipse.emf.ecore.EParameter; //导入依赖的package包/类
private EParameter internalAddEParameter(EOperation owner, EClassifier type, String name)
{
EParameter p = ecoreFactory.createEParameter();
p.setEType(type);
p.setName(name);
owner.getEParameters().add(p);
return p;
}
开发者ID:LangleyStudios,项目名称:eclipse-avro,代码行数:9,代码来源:EPackageImpl.java
示例17: addEParameter
import org.eclipse.emf.ecore.EParameter; //导入依赖的package包/类
protected EParameter addEParameter(EOperation owner, EClassifier type, String name, int lowerBound, int upperBound, boolean isUnique, boolean isOrdered)
{
EParameter p = internalAddEParameter(owner, type, name);
p.setLowerBound(lowerBound);
p.setUpperBound(upperBound);
p.setUnique(isUnique);
p.setOrdered(isOrdered);
return p;
}
开发者ID:LangleyStudios,项目名称:eclipse-avro,代码行数:10,代码来源:EPackageImpl.java
示例18: getBody
import org.eclipse.emf.ecore.EParameter; //导入依赖的package包/类
private String getBody(final EOperation op) {
final StringBuffer buff = new StringBuffer();
if (op.getEType() != null) {
buff.append("return ");
}
buff.append(getExtensionClassName(op)).append(".");
buff.append(op.getName());
buff.append("(");
final List<EParameter> params = op.getEParameters();
for (final Iterator<EParameter> iter = params.iterator(); iter.hasNext();) {
final EParameter element = iter.next();
buff.append(element.getName());
}
return buff.append("this);").toString();
}
开发者ID:markus1978,项目名称:clickwatch,代码行数:16,代码来源:AddAnnotationsAction.java
示例19: findEParameterById
import org.eclipse.emf.ecore.EParameter; //导入依赖的package包/类
public static org.eclipse.emf.ecore.EParameter findEParameterById(java.util.List<org.eclipse.emf.ecore.EParameter> list, String id){
for (EParameter obji : list) {
if (getEParameterId(obji).equals(id))
return obji;
}
return null;
}
开发者ID:SOM-Research,项目名称:emf-rest,代码行数:8,代码来源:IdentificationResolver.java
示例20: initCustomEnv
import org.eclipse.emf.ecore.EParameter; //导入依赖的package包/类
/**
* @generated
*/
private static void initCustomEnv(
Environment<?, EClassifier, ?, ?, ?, EParameter, ?, ?, ?, ?, ?, ?> ecoreEnv,
Map<String, EClassifier> environment) {
// Use EObject as implicit root class for any object, to allow eContainer() and other EObject operations from OCL expressions
ParsingOptions
.setOption(ecoreEnv, ParsingOptions.implicitRootClass(ecoreEnv), EcorePackage.eINSTANCE.getEObject());
for (String varName : environment.keySet()) {
EClassifier varType = environment.get(varName);
ecoreEnv.addElement(varName, createVar(ecoreEnv, varName, varType), false);
}
}
开发者ID:adisandro,项目名称:MMINT,代码行数:15,代码来源:MIDOCLFactory.java
注:本文中的org.eclipse.emf.ecore.EParameter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论