public class JErrorClass extends AbstractJClass
AbstractJClass that represents an error class.
Error-types represents holes or placeholders that can't be filled.
JErrorClass differs from JDirectClass class in that it should
never be used in generated code. References to error-classes can be used in
hidden class-models. Such classes should never be actually written but can be
somehow used during code generation. Use
JCodeModel#buildsErrorTypeRefs method to test if your generated
Java-sources contains references to error-types.
You should probably always check generated code with
JCodeModel#buildsErrorTypeRefs method if you use any error-types.
Most of JErrorClass methods throws JErrorClassUsedException
unchecked exceptions. Be careful and use AbstractJType#isError method to check for error-types before actually using
it's methods.
JCodeModel.buildsErrorTypeRefs(),
JCodeModel.errorClass(String)EMPTY_ARRAY| Modifier | Constructor and Description |
|---|---|
protected |
JErrorClass(JCodeModel _owner,
String sMessage) |
| Modifier and Type | Method and Description |
|---|---|
AbstractJClass |
_extends()
Gets the super class of this class.
|
Iterator<AbstractJClass> |
_implements()
Iterates all super interfaces directly implemented by this class/interface.
|
JPackage |
_package()
Gets the package to which this class belongs.
|
String |
fullName()
Gets the full name of the type.
|
String |
getMessage() |
boolean |
isAbstract() |
boolean |
isError()
Tells whether or not this is an error-type.
|
boolean |
isInterface() |
String |
name()
Gets the name of this class.
|
protected AbstractJClass |
substituteParams(JTypeVar[] variables,
List<? extends AbstractJClass> bindings)
Substitutes the type variables with their actual arguments.
|
array, boxify, dotclass, erasure, generate, getBaseClass, getBaseClass, getPrimitiveType, getTypeParameters, isParameterized, narrow, narrow, narrow, narrow, narrow, narrow, outer, owner, staticInvoke, staticInvoke, staticRef, staticRef, toString, typeParams, unboxify, wildcard, wildcard, wildcardSuperbinaryName, elementType, isArray, isAssignableFrom, isAssignableFrom, isPrimitive, isReference, parseprotected JErrorClass(@Nonnull JCodeModel _owner, @Nonnull String sMessage)
@Nonnull public String name()
AbstractJClassname in class AbstractJClassjava.lang.String.@Nonnull public String fullName()
AbstractJTypefullName in class AbstractJTypenull for unnamed classes.@Nonnull public JPackage _package()
AbstractJClass_package in class AbstractJClassJPackage this class belongs to. Is usually not
null except for the JTypeVar and the
JTypeWildcard implementation.@Nonnull public AbstractJClass _extends()
AbstractJClass_extends in class AbstractJClassAbstractJClass representing the superclass of
the entity (class or interface) represented by this
AbstractJClass. Even if no super class is given explicitly
or this AbstractJClass is not a class, this method still
returns AbstractJClass for Object. If this
AbstractJClass represents Object, return null.@Nonnull public Iterator<AbstractJClass> _implements()
AbstractJClass_implements in class AbstractJClassAbstractJClass
objects that represents those interfaces implemented by this
object.public boolean isInterface()
isInterface in class AbstractJClasstrue if this object represents an interface.public boolean isAbstract()
isAbstract in class AbstractJClasstrue if this class is an abstract class.public boolean isError()
AbstractJTypeError types are not actual Java types and shouldn't be used in actually generated code.
isError in class AbstractJTypetrue if this is an error classJErrorClass@Nonnull protected AbstractJClass substituteParams(JTypeVar[] variables, List<? extends AbstractJClass> bindings)
AbstractJClassAbstractJClass
for Map<String,Map<Integer>>. substituteParams in class AbstractJClassvariables - Type variablesbindings - Bindingsnull.Copyright © 2013–2015 Philip Helger. All rights reserved.