Class JavaFileAccess
- java.lang.Object
-
- org.eclipse.xtext.xtext.generator.model.TextFileAccess
-
- org.eclipse.xtext.xtext.generator.model.JavaFileAccess
-
- Direct Known Subclasses:
GeneratedJavaFileAccess
,XtendFileAccess
public class JavaFileAccess extends TextFileAccess
A utility class for generating Java files.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
JavaFileAccess.JavaTypeAwareStringConcatenation
-
Field Summary
Fields Modifier and Type Field Description protected CodeConfig
codeConfig
static int
DONT_IMPORT_NESTED_TYPES
Set this value for the 'importNestedTypeThreshold' property to disable importing of nested typesprotected java.util.Map<java.lang.String,java.lang.String>
imports
static java.util.Set<java.lang.String>
JAVA_KEYWORDS
A list of keywords in the Java language.protected TypeReference
javaType
-
Fields inherited from class org.eclipse.xtext.xtext.generator.model.TextFileAccess
internalContents
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
JavaFileAccess(TypeReference typeRef, CodeConfig codeConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
appendSemicolons()
java.lang.CharSequence
getContent()
protected java.lang.String
getFileExtension()
int
getImportNestedTypeThreshold()
protected java.lang.CharSequence
getInternalContent()
java.lang.String
importType(TypeReference typeRef)
boolean
isMarkedAsGenerated()
void
setContent(org.eclipse.xtend2.lib.StringConcatenationClient javaContent)
void
setImportNestedTypeThreshold(int importNestedTypeThreshold)
void
setMarkedAsGenerated(boolean markedAsGenerated)
void
setResourceSet(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
-
Methods inherited from class org.eclipse.xtext.xtext.generator.model.TextFileAccess
getContentString, getPath, setPath, writeTo
-
-
-
-
Field Detail
-
JAVA_KEYWORDS
public static final java.util.Set<java.lang.String> JAVA_KEYWORDS
A list of keywords in the Java language. Use this to avoid illegal variable names.
-
DONT_IMPORT_NESTED_TYPES
public static final int DONT_IMPORT_NESTED_TYPES
Set this value for the 'importNestedTypeThreshold' property to disable importing of nested types- See Also:
- Constant Field Values
-
imports
protected final java.util.Map<java.lang.String,java.lang.String> imports
-
javaType
protected final TypeReference javaType
-
codeConfig
protected final CodeConfig codeConfig
-
-
Constructor Detail
-
JavaFileAccess
protected JavaFileAccess(TypeReference typeRef, CodeConfig codeConfig)
-
-
Method Detail
-
getFileExtension
protected java.lang.String getFileExtension()
-
importType
public java.lang.String importType(TypeReference typeRef)
-
setContent
public void setContent(org.eclipse.xtend2.lib.StringConcatenationClient javaContent)
- Overrides:
setContent
in classTextFileAccess
-
appendSemicolons
protected boolean appendSemicolons()
-
getContent
public java.lang.CharSequence getContent()
- Overrides:
getContent
in classTextFileAccess
-
getInternalContent
protected java.lang.CharSequence getInternalContent()
-
getImportNestedTypeThreshold
@Pure public int getImportNestedTypeThreshold()
-
setImportNestedTypeThreshold
public void setImportNestedTypeThreshold(int importNestedTypeThreshold)
-
isMarkedAsGenerated
@Pure public boolean isMarkedAsGenerated()
-
setMarkedAsGenerated
public void setMarkedAsGenerated(boolean markedAsGenerated)
-
setResourceSet
public void setResourceSet(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
-
-