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


Java JvmGenericType.isInterface方法代码示例

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


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

示例1: completeJvmGenericType

import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
protected void completeJvmGenericType(JvmGenericType element) {
	// if no super type add Object
	ensureSuperTypeObject(element);
	addAnnotations(element);
	if (!element.isInterface()) {
		// if no constructors have been added, add a default constructor
		if (isEmpty(element.getDeclaredConstructors())) {
			JvmConstructor constructor = TypesFactory.eINSTANCE.createJvmConstructor();
			constructor.setSimpleName(element.getSimpleName());
			constructor.setVisibility(JvmVisibility.PUBLIC);
			typeExtensions.setSynthetic(constructor, true);
			EObject primarySourceElement = associations.getPrimarySourceElement(element);
			if (primarySourceElement != null) {
				associator.associate(primarySourceElement, constructor);
			}
			element.getMembers().add(constructor);
		}
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:20,代码来源:JvmModelCompleter.java

示例2: addFeatureDescriptions

import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
protected void addFeatureDescriptions(IEObjectDescription typeDescription, List<IEObjectDescription> result) {
	EObject proxy = getResolvedProxy(typeDescription);
	if (!proxy.eIsProxy() && proxy instanceof JvmGenericType) {
		JvmGenericType type = (JvmGenericType) proxy;
		if (!type.isInterface()) {
			for(JvmConstructor constructor: type.getDeclaredConstructors()) {
				boolean visible = visibilityHelper.isVisible(constructor);
				ConstructorDescription constructorDescription = createConstructorDescription(typeDescription, constructor, visible);
				result.add(constructorDescription);
			}
		} else if (!strict) {
			result.add(new SimpleIdentifiableElementDescription(typeDescription));
		}
	} else if (proxy instanceof JvmType) {
		if (!strict)
			result.add(new SimpleIdentifiableElementDescription(typeDescription));
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:19,代码来源:ConstructorTypeScopeWrapper.java

示例3: getElements

import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
@Override
public Iterable<IEObjectDescription> getElements(final QualifiedName name) {
	IEObjectDescription typeDescription = typeScope.getSingleElement(name);
	if (typeDescription == null)
		return emptySet();
	JvmType type = (JvmType) typeDescription.getEObjectOrProxy();
	if (type.eIsProxy() || !(type instanceof JvmGenericType)) {
		return emptySet();
	}
	final JvmGenericType castedType = (JvmGenericType) type;
	if (castedType.isInterface()) {
		return emptySet();
	}
	Iterable<JvmConstructor> constructors = new Iterable<JvmConstructor>() {
		@Override
		public Iterator<JvmConstructor> iterator() {
			return castedType.getDeclaredConstructors().iterator();
		}
	};
	return transform(constructors, new Function<JvmConstructor,IEObjectDescription>(){
		@Override
		public IEObjectDescription apply(JvmConstructor from) {
			return EObjectDescription.create(name, from);
		}
	});
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:27,代码来源:AbstractConstructorScope.java

示例4: createUserData

import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
protected void createUserData(EObject eObject, ImmutableMap.Builder<String, String> userData) {
	if (eObject instanceof JvmDeclaredType) {
		userData.put(SIGNATURE_HASH_KEY, hashProvider.getHash((JvmDeclaredType) eObject));
		if (eObject.eContainer() != null) {
			userData.put(IS_NESTED_TYPE, Boolean.TRUE.toString());
		}
	}
	if (eObject instanceof JvmGenericType) {
		JvmGenericType genericType = (JvmGenericType) eObject;
		if (genericType.isInterface())
			userData.put(IS_INTERFACE, Boolean.TRUE.toString());
		if (!genericType.getTypeParameters().isEmpty()) {
			String result = "<";
			for (Iterator<JvmTypeParameter> iterator = genericType.getTypeParameters().iterator(); iterator.hasNext();) {
				JvmTypeParameter type = iterator.next();
				result += type.getSimpleName();
				if (iterator.hasNext()) {
					result += ",";
				}
			}
			result +=">";
			userData.put(TYPE_PARAMETERS, result);
		}
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:26,代码来源:JvmTypesResourceDescriptionStrategy.java

示例5: _generateBody

import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
protected ITreeAppendable _generateBody(final JvmGenericType it, final ITreeAppendable appendable, final GeneratorConfig config) {
  ITreeAppendable _xblockexpression = null;
  {
    this.generateJavaDoc(it, appendable, config);
    final ITreeAppendable childAppendable = appendable.trace(it);
    this.generateAnnotations(it.getAnnotations(), childAppendable, true, config);
    this.generateModifier(it, childAppendable, config);
    boolean _isInterface = it.isInterface();
    if (_isInterface) {
      childAppendable.append("interface ");
    } else {
      childAppendable.append("class ");
    }
    this._treeAppendableUtil.traceSignificant(childAppendable, it).append(this.makeJavaIdentifier(it.getSimpleName()));
    this.generateTypeParameterDeclaration(it, childAppendable, config);
    boolean _isEmpty = it.getTypeParameters().isEmpty();
    if (_isEmpty) {
      childAppendable.append(" ");
    }
    this.generateExtendsClause(it, childAppendable, config);
    this.generateMembersInBody(it, childAppendable, config);
    ITreeAppendable _xifexpression = null;
    if (((!it.isAnonymous()) && (!(it.eContainer() instanceof JvmType)))) {
      _xifexpression = appendable.newLine();
    }
    _xblockexpression = _xifexpression;
  }
  return _xblockexpression;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:30,代码来源:JvmModelGenerator.java

示例6: _generateModifier

import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
protected ITreeAppendable _generateModifier(final JvmGenericType it, final ITreeAppendable appendable, final GeneratorConfig config) {
  ITreeAppendable _xblockexpression = null;
  {
    this.generateVisibilityModifier(it, appendable);
    boolean _isInterface = it.isInterface();
    boolean _not = (!_isInterface);
    if (_not) {
      boolean _isStatic = it.isStatic();
      if (_isStatic) {
        appendable.append("static ");
      }
      boolean _isAbstract = it.isAbstract();
      if (_isAbstract) {
        appendable.append("abstract ");
      }
    }
    boolean _isFinal = it.isFinal();
    if (_isFinal) {
      appendable.append("final ");
    }
    ITreeAppendable _xifexpression = null;
    boolean _isStrictFloatingPoint = it.isStrictFloatingPoint();
    if (_isStrictFloatingPoint) {
      _xifexpression = appendable.append("strictfp ");
    }
    _xblockexpression = _xifexpression;
  }
  return _xblockexpression;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:30,代码来源:JvmModelGenerator.java

示例7: getStyle

import org.eclipse.xtext.common.types.JvmGenericType; //导入方法依赖的package包/类
protected String getStyle(JvmGenericType type) {
	if (type.isInterface()) {
		return INTERFACE;
	} else if (type.isAbstract()) {
		return ABSTRACT_CLASS;
	} else {
		return CLASS;
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:10,代码来源:XbaseHighlightingCalculator.java


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