本文整理汇总了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);
}
}
}
示例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));
}
}
示例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);
}
});
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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;
}
}