Available Methods
- getType ( )
- isPrimitive ( )
- isPrimitiveVoid ( )
- isAssignableFrom ( )
- isSubtypeOf ( )
- isOwnedBy ( )
- accept ( )
- isType ( )
- isResolved ( )
- isAny ( )
- getSimpleName ( )
- isUnknown ( )
- isInterfaceType ( )
- getHumanReadableName ( )
- isArray ( )
- getWrapperTypeIfPrimitive ( )
- getRawTypeReference ( )
- copyInto ( )
- isFunctionType ( )
- isWildcard ( )
- tryConvertToArray ( )
- isWrapper ( )
- getSuperType ( )
- getMultiTypeComponents ( )
- getSuperTypes ( )
- getPrimitiveKind ( )
Related Classes
- java.util.Collections
- org.junit.Assert
- com.google.common.collect.Lists
- com.google.common.collect.Iterables
- com.google.common.collect.Multimap
- org.eclipse.emf.ecore.EObject
- org.eclipse.emf.ecore.util.EcoreUtil
- org.eclipse.xtext.resource.XtextResource
- org.eclipse.xtext.validation.Issue
- org.eclipse.xtext.resource.IEObjectDescription
- org.eclipse.xtext.scoping.IScope
- org.eclipse.xtext.naming.QualifiedName
- org.eclipse.xtext.xbase.lib.IterableExtensions
- org.eclipse.xtext.xbase.lib.Exceptions
- org.eclipse.xtext.validation.Check
- org.eclipse.xtext.xbase.lib.CollectionLiterals
- org.eclipse.xtext.xbase.lib.Functions.Function1
- org.eclipse.xtend2.lib.StringConcatenation
- org.eclipse.xtext.xbase.XExpression
- org.eclipse.xtext.xbase.lib.ListExtensions
- org.eclipse.xtext.common.types.JvmFormalParameter
- org.eclipse.xtext.xbase.XBlockExpression
- org.eclipse.xtext.common.types.JvmTypeReference
- org.eclipse.xtext.xbase.XVariableDeclaration
- org.eclipse.xtext.common.types.JvmTypeParameter
Java Code Examples for org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference#getPrimitiveKind()
The following examples show how to use
org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference#getPrimitiveKind() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractXbaseCompiler.java From xtext-extras with Eclipse Public License 2.0 | 5 votes |
protected void appendDefaultLiteral(ITreeAppendable b, /* @Nullable */ LightweightTypeReference type) { if (type != null && type.isPrimitive()) { Primitive primitiveKind = type.getPrimitiveKind(); switch (primitiveKind) { case Boolean: b.append("false"); break; default: b.append("0"); break; } } else { b.append("null"); } }
Example 2
Source File: AbstractXbaseCompiler.java From xtext-extras with Eclipse Public License 2.0 | 5 votes |
protected String getDefaultValueLiteral(XExpression expr) { LightweightTypeReference type = getTypeForVariableDeclaration(expr); if (type.isPrimitive()) { if (type.getPrimitiveKind() == Primitives.Primitive.Boolean) { return "false"; } else { return "(" + type.getSimpleName() + ") 0"; } } return "null"; }