Class FieldImpl
java.lang.Object
com.graphql_java_generator.plugin.language.impl.FieldImpl
- All Implemented Interfaces:
Field
- Author:
- etienne-sf
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAnnotation
(String annotationToAdd) The annotation setter should be added.void
addAnnotation
(String annotationToAdd, boolean replace) The annotation setter should be added.Retrieves the annotation or annotations to add to this field, when in server mode, to serve the relation that this field holdsConvert the given name, which is supposed to be in camel case (for instance: thisIsCamelCase) to a pascal case string (for instance: ThisIsCamelCase).getType()
Retrieves theType
for this fieldboolean
isId()
Indicates whether this field is an id or not.void
setAnnotation
(String annotation) Deprecated.void
setComments
(List<graphql.language.Comment> comments) toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.graphql_java_generator.plugin.language.Field
getAppliedDirectives, getCamelCaseName, getComments, getDataFetcher, getDefaultValue, getDefaultValueAsText, getDescription, getFieldJavaFullClassnamesFromImplementedInterface, getFieldTypeAST, getGraphQLType, getGraphQLTypeSimpleName, getInputParameters, getJavaName, getJavaType, getJavaTypeFullClassname, getName, getOwningType, getRelation
-
Constructor Details
-
FieldImpl
public FieldImpl()
-
-
Method Details
-
getType
Description copied from interface:Field
Retrieves theType
for this field -
getAnnotation
Description copied from interface:Field
Retrieves the annotation or annotations to add to this field, when in server mode, to serve the relation that this field holds- Specified by:
getAnnotation
in interfaceField
- Returns:
- The relevant annotation(s) ready to add directly as-is in the Velocity template, or "" (an empty string) if there is no annotation to add. The return is never null.
-
isId
public boolean isId()Description copied from interface:Field
Indicates whether this field is an id or not. It's used in server mode to add the javax.persistence annotations for the id fields. Default value is false. This field is set to true for GraphQL fields which are of 'ID' type. -
setAnnotation
Deprecated.The annotation setter should be used. Please use the {@link #addAnnotation(String))} instead- Parameters:
annotation
- The annotation, that will replace the current one
-
addAnnotation
The annotation setter should be added. This method allows to properly manage indentation in the generated source code- Parameters:
annotationToAdd
- The annotation, that will be added to the current one
-
addAnnotation
The annotation setter should be added. This method allows to properly manage indentation in the generated source code- Parameters:
annotationToAdd
- The annotation, that will be added to the current onereplace
- if true, any existing annotation is first removed
-
getPascalCaseName
Description copied from interface:Field
Convert the given name, which is supposed to be in camel case (for instance: thisIsCamelCase) to a pascal case string (for instance: ThisIsCamelCase).- Specified by:
getPascalCaseName
in interfaceField
- Returns:
-
setComments
-
toString
-