Class ObjectType
java.lang.Object
com.graphql_java_generator.plugin.language.impl.AbstractType
com.graphql_java_generator.plugin.language.impl.ObjectType
- All Implemented Interfaces:
Type
- Direct Known Subclasses:
InterfaceType
,UnionType
This class describes one object type, as found in a graphql schema. It aims to be simple enough, so that the Velocity
template can easily generated the fields from it.
An ObjectType would for instance describe:
An ObjectType would for instance describe:
type Character { name: String! appearsIn: [Episode!]! }
- Author:
- etienne-sf
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.graphql_java_generator.plugin.language.Type
Type.GraphQlType, Type.TargetFileType
-
Constructor Summary
ModifierConstructorDescriptionObjectType
(String name, CommonConfiguration configuration, DocumentParser documentParser) protected
ObjectType
(String name, Type.GraphQlType type, CommonConfiguration configuration, DocumentParser documentParser) This constructor is especially intended for subclasses, likeInterfaceType
-
Method Summary
Modifier and TypeMethodDescriptionReturns the identifier for this type.Returns the list ofType
s that this object implements.Returns the package's name where the GraphQL objects from the GraphQL schema must be generated.protected String
protected String
boolean
Returns true if this type is a GraphQL Custom Scalar, false otherwiseboolean
isScalar()
Returns true if this type is a GraphQL Scalar (custom or not), false otherwisetoString()
Methods inherited from class com.graphql_java_generator.plugin.language.impl.AbstractType
addAnnotation, addAnnotation, addImport, addImportForUtilityClasses, getAnnotation, getCamelCaseName, getClassSimpleName, getGraphQlType, getJavaName, setAnnotation, setComments
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.Type
getAppliedDirectives, getClassFullName, getComments, getDataFetcher, getDescription, getField, getFields, getImports, getImportsForUtilityClasses, getName, getRequestType, getTargetFileName, isEnum, isInputType
-
Constructor Details
-
ObjectType
- Parameters:
name
- The name of this object typeconfiguration
- The current plugin configuration, which is accessible through an interface that extendsCommonConfiguration
documentParser
- TheDocumentParser
that has parsed the schema, and so that contains the whole schema definition
-
ObjectType
protected ObjectType(String name, Type.GraphQlType type, CommonConfiguration configuration, DocumentParser documentParser) This constructor is especially intended for subclasses, likeInterfaceType
- Parameters:
name
- the name for this typetype
- the kind of objectconfiguration
- The current plugin configuration, which is accessible through an interface that extendsCommonConfiguration
documentParser
- TheDocumentParser
that has parsed the schema, and so that contains the whole schema definition
-
-
Method Details
-
getPackageName
Description copied from interface:Type
Returns the package's name where the GraphQL objects from the GraphQL schema must be generated.- Returns:
-
getIdentifier
Description copied from interface:Type
Returns the identifier for this type. Typically : the field which has an ID as a type.- Returns:
- The identifier for this type, or null of this type has no identifier or multiplier identifers (that is: multiple identifiers or identifier based on several fields are not currently managed)
-
isCustomScalar
public boolean isCustomScalar()Description copied from interface:Type
Returns true if this type is a GraphQL Custom Scalar, false otherwise -
isScalar
public boolean isScalar()Description copied from interface:Type
Returns true if this type is a GraphQL Scalar (custom or not), false otherwise -
getRequestTypePascalCase
-
getPrefix
- Overrides:
getPrefix
in classAbstractType
-
getSuffix
- Overrides:
getSuffix
in classAbstractType
-
toString
- Overrides:
toString
in classAbstractType
-
getImplementedTypes
Returns the list ofType
s that this object implements. These types may interfaces or unions.- Returns:
-