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


Java TypesPackage类代码示例

本文整理汇总了Java中org.eclipse.xtext.common.types.TypesPackage的典型用法代码示例。如果您正苦于以下问题:Java TypesPackage类的具体用法?Java TypesPackage怎么用?Java TypesPackage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TypesPackage类属于org.eclipse.xtext.common.types包,在下文中一共展示了TypesPackage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: eGet

import org.eclipse.xtext.common.types.TypesPackage; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
	switch (featureID)
	{
		case TypesPackage.JVM_GENERIC_TYPE__TYPE_PARAMETERS:
			return getTypeParameters();
		case TypesPackage.JVM_GENERIC_TYPE__INTERFACE:
			return isInterface();
		case TypesPackage.JVM_GENERIC_TYPE__STRICT_FLOATING_POINT:
			return isStrictFloatingPoint();
		case TypesPackage.JVM_GENERIC_TYPE__ANONYMOUS:
			return isAnonymous();
	}
	return super.eGet(featureID, resolve, coreType);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:22,代码来源:JvmGenericTypeImpl.java

示例2: eSet

import org.eclipse.xtext.common.types.TypesPackage; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void eSet(int featureID, Object newValue)
{
	switch (featureID)
	{
		case TypesPackage.JVM_MEMBER__DECLARING_TYPE:
			setDeclaringType((JvmDeclaredType)newValue);
			return;
		case TypesPackage.JVM_MEMBER__VISIBILITY:
			setVisibility((JvmVisibility)newValue);
			return;
		case TypesPackage.JVM_MEMBER__SIMPLE_NAME:
			setSimpleName((String)newValue);
			return;
		case TypesPackage.JVM_MEMBER__DEPRECATED:
			setDeprecated((Boolean)newValue);
			return;
	}
	super.eSet(featureID, newValue);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:26,代码来源:JvmMemberImpl.java

示例3: eIsSet

import org.eclipse.xtext.common.types.TypesPackage; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public boolean eIsSet(int featureID)
{
	switch (featureID)
	{
		case TypesPackage.JVM_MEMBER__DECLARING_TYPE:
			return getDeclaringType() != null;
		case TypesPackage.JVM_MEMBER__VISIBILITY:
			return visibility != VISIBILITY_EDEFAULT;
		case TypesPackage.JVM_MEMBER__SIMPLE_NAME:
			return SIMPLE_NAME_EDEFAULT == null ? simpleName != null : !SIMPLE_NAME_EDEFAULT.equals(simpleName);
		case TypesPackage.JVM_MEMBER__IDENTIFIER:
			return IDENTIFIER_EDEFAULT == null ? identifier != null : !IDENTIFIER_EDEFAULT.equals(identifier);
		case TypesPackage.JVM_MEMBER__DEPRECATED:
			return isSetDeprecated();
	}
	return super.eIsSet(featureID);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:24,代码来源:JvmMemberImpl.java

示例4: setDeclarator

import org.eclipse.xtext.common.types.TypesPackage; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setDeclarator(JvmTypeParameterDeclarator newDeclarator)
{
	if (newDeclarator != eInternalContainer() || (eContainerFeatureID() != TypesPackage.JVM_TYPE_PARAMETER__DECLARATOR && newDeclarator != null))
	{
		if (EcoreUtil.isAncestor(this, newDeclarator))
			throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
		NotificationChain msgs = null;
		if (eInternalContainer() != null)
			msgs = eBasicRemoveFromContainer(msgs);
		if (newDeclarator != null)
			msgs = ((InternalEObject)newDeclarator).eInverseAdd(this, TypesPackage.JVM_TYPE_PARAMETER_DECLARATOR__TYPE_PARAMETERS, JvmTypeParameterDeclarator.class, msgs);
		msgs = basicSetDeclarator(newDeclarator, msgs);
		if (msgs != null) msgs.dispatch();
	}
	else if (eNotificationRequired())
		eNotify(new ENotificationImpl(this, Notification.SET, TypesPackage.JVM_TYPE_PARAMETER__DECLARATOR, newDeclarator, newDeclarator));
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:23,代码来源:JvmTypeParameterImpl.java

示例5: eGet

import org.eclipse.xtext.common.types.TypesPackage; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
	switch (featureID)
	{
		case TypesPackage.JVM_DECLARED_TYPE__ARRAY_TYPE:
			return getArrayType();
		case TypesPackage.JVM_DECLARED_TYPE__SUPER_TYPES:
			return getSuperTypes();
		case TypesPackage.JVM_DECLARED_TYPE__MEMBERS:
			return getMembers();
		case TypesPackage.JVM_DECLARED_TYPE__ABSTRACT:
			return isAbstract();
		case TypesPackage.JVM_DECLARED_TYPE__STATIC:
			return isStatic();
		case TypesPackage.JVM_DECLARED_TYPE__FINAL:
			return isFinal();
		case TypesPackage.JVM_DECLARED_TYPE__PACKAGE_NAME:
			return getPackageName();
	}
	return super.eGet(featureID, resolve, coreType);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:28,代码来源:JvmDeclaredTypeImpl.java

示例6: doVisitFunctionTypeReference

import org.eclipse.xtext.common.types.TypesPackage; //导入依赖的package包/类
@Override
public LightweightTypeReference doVisitFunctionTypeReference(XFunctionTypeRef reference) {
	JvmTypeReference equivalent = reference.getEquivalent();
	if (equivalent == null) {
		return super.doVisitFunctionTypeReference(reference);
	}
	FunctionTypeReference result;
	// constructors used below to avoid subsequent checks for isInner which was supposed to be done by 
	// the computation of the equivalent
	if (equivalent.eClass() == TypesPackage.Literals.JVM_INNER_TYPE_REFERENCE) {
		JvmParameterizedTypeReference outer = ((JvmInnerTypeReference) equivalent).getOuter();
		LightweightTypeReference outerEquivalent = outer.accept(this);
		result = new InnerFunctionTypeReference(owner, outerEquivalent, reference.getType());
	} else {
		result = new FunctionTypeReference(owner, reference.getType());
	}
	if (equivalent instanceof JvmParameterizedTypeReference) {
		for(JvmTypeReference argument: ((JvmParameterizedTypeReference)equivalent).getArguments()) {
			result.addTypeArgument(visit(argument));
		}
	}
	for(JvmTypeReference parameter: reference.getParamTypes()) {
		result.addParameterType(visit(parameter));
	}
	if (reference.getReturnType() != null) {
		result.setReturnType(visit(reference.getReturnType()));
	}
	return result;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:30,代码来源:LightweightTypeReferenceFactory.java

示例7: getSuperType

import org.eclipse.xtext.common.types.TypesPackage; //导入依赖的package包/类
@Override
/* @Nullable */
public LightweightTypeReference getSuperType(JvmType rawType) {
	if (rawType.eClass() == TypesPackage.Literals.JVM_ARRAY_TYPE) {
		JvmComponentType rawComponentType = ((JvmArrayType) rawType).getComponentType();
		LightweightTypeReference result = component.getSuperType(rawComponentType);
		if (result == null) {
			return null;
		}
		if (result == component)
			return this;
		return getOwner().newArrayTypeReference(result);
	} else if (rawType.eClass() == TypesPackage.Literals.JVM_GENERIC_TYPE) {
		String identifier = rawType.getIdentifier();
		if (Object.class.getName().equals(identifier)
				|| Cloneable.class.getName().equals(identifier)
				|| Serializable.class.getName().equals(identifier)) {
			return getOwner().newParameterizedTypeReference(rawType);
		}
	}
	return null;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:23,代码来源:ArrayTypeReference.java

示例8: computeFor

import org.eclipse.xtext.common.types.TypesPackage; //导入依赖的package包/类
static String computeFor(JvmWildcardTypeReference typeReference, char innerClassDelimiter, NameType nameType) {
	if (typeReference.eIsSet(TypesPackage.Literals.JVM_CONSTRAINT_OWNER__CONSTRAINTS)) {
		if (typeReference.getConstraints().size() == 1) {
			JvmTypeConstraint onlyConstraint = typeReference.getConstraints().get(0);
			if (nameType != NameType.ID && nameType != NameType.TO_STRING) {
				JvmTypeReference reference = onlyConstraint.getTypeReference();
				if (reference == null || (onlyConstraint instanceof JvmUpperBound && 
						Object.class.getCanonicalName().equals(onlyConstraint.getTypeReference().getIdentifier()))) {
					return "?";
				}
			} else if (nameType == NameType.ID && onlyConstraint.getTypeReference() == null) {
				return "?";
			}
		}
		StringBuilder mutableResult = new StringBuilder(64);
		mutableResult.append("? ");
		appendConstraintsName(mutableResult, typeReference.getConstraints(), innerClassDelimiter, nameType);
		return mutableResult.toString();
	}
	return "?";
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:22,代码来源:NameConcatHelper.java

示例9: eBaseStructuralFeatureID

import org.eclipse.xtext.common.types.TypesPackage; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
{
	if (baseClass == JvmType.class)
	{
		switch (derivedFeatureID)
		{
			default: return -1;
		}
	}
	if (baseClass == JvmComponentType.class)
	{
		switch (derivedFeatureID)
		{
			case TypesPackage.JVM_DECLARED_TYPE__ARRAY_TYPE: return TypesPackage.JVM_COMPONENT_TYPE__ARRAY_TYPE;
			default: return -1;
		}
	}
	return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:26,代码来源:JvmDeclaredTypeImpl.java

示例10: testUnreachableCase_6

import org.eclipse.xtext.common.types.TypesPackage; //导入依赖的package包/类
@Test
public void testUnreachableCase_6() {
  try {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("switch new java.util.ArrayList<String> {");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("java.util.List<Integer>: \"list of integers\"");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("java.util.List<String>: \"list of strings\"");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("default: \"something else\"");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    this._validationTestHelper.assertError(this.expression(_builder), TypesPackage.Literals.JVM_PARAMETERIZED_TYPE_REFERENCE, IssueCodes.UNREACHABLE_CASE);
  } catch (Throwable _e) {
    throw Exceptions.sneakyThrow(_e);
  }
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:23,代码来源:XbaseValidationTest.java

示例11: eIsSet

import org.eclipse.xtext.common.types.TypesPackage; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public boolean eIsSet(int featureID)
{
	switch (featureID)
	{
		case TypesPackage.JVM_SHORT_ANNOTATION_VALUE__VALUES:
			return values != null && !values.isEmpty();
	}
	return super.eIsSet(featureID);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:16,代码来源:JvmShortAnnotationValueImpl.java

示例12: eBaseStructuralFeatureID

import org.eclipse.xtext.common.types.TypesPackage; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
{
	if (baseClass == JvmTypeParameterDeclarator.class)
	{
		switch (derivedFeatureID)
		{
			case TypesPackage.JVM_EXECUTABLE__TYPE_PARAMETERS: return TypesPackage.JVM_TYPE_PARAMETER_DECLARATOR__TYPE_PARAMETERS;
			default: return -1;
		}
	}
	return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:19,代码来源:JvmExecutableImpl.java

示例13: eInverseRemove

import org.eclipse.xtext.common.types.TypesPackage; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
	switch (featureID)
	{
		case TypesPackage.JVM_TYPE_CONSTRAINT__TYPE_REFERENCE:
			return basicSetTypeReference(null, msgs);
		case TypesPackage.JVM_TYPE_CONSTRAINT__OWNER:
			return basicSetOwner(null, msgs);
	}
	return super.eInverseRemove(otherEnd, featureID, msgs);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:18,代码来源:JvmTypeConstraintImpl.java

示例14: eUnset

import org.eclipse.xtext.common.types.TypesPackage; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void eUnset(int featureID)
{
	switch (featureID)
	{
		case TypesPackage.JVM_DECLARED_TYPE__ARRAY_TYPE:
			setArrayType((JvmArrayType)null);
			return;
		case TypesPackage.JVM_DECLARED_TYPE__SUPER_TYPES:
			getSuperTypes().clear();
			return;
		case TypesPackage.JVM_DECLARED_TYPE__MEMBERS:
			getMembers().clear();
			return;
		case TypesPackage.JVM_DECLARED_TYPE__ABSTRACT:
			setAbstract(ABSTRACT_EDEFAULT);
			return;
		case TypesPackage.JVM_DECLARED_TYPE__STATIC:
			setStatic(STATIC_EDEFAULT);
			return;
		case TypesPackage.JVM_DECLARED_TYPE__FINAL:
			setFinal(FINAL_EDEFAULT);
			return;
		case TypesPackage.JVM_DECLARED_TYPE__PACKAGE_NAME:
			setPackageName(PACKAGE_NAME_EDEFAULT);
			return;
	}
	super.eUnset(featureID);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:35,代码来源:JvmDeclaredTypeImpl.java

示例15: eSet

import org.eclipse.xtext.common.types.TypesPackage; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
	switch (featureID)
	{
		case TypesPackage.JVM_BYTE_ANNOTATION_VALUE__VALUES:
			getValues().clear();
			getValues().addAll((Collection<? extends Byte>)newValue);
			return;
	}
	super.eSet(featureID, newValue);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:19,代码来源:JvmByteAnnotationValueImpl.java


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