public final class RecordType extends NamedClassType
core::Duration
.Constructor and Description |
---|
RecordType(String moduleName,
String name)
Constructor
|
RecordType(String moduleName,
String name,
RecordType superType)
Constructor
|
RecordType(String moduleName,
String name,
RecordType superType,
Collection<InterfaceType> interfaces,
Map<String,String> metadata,
RecordXmlMapping xmlMapping,
Collection<RecordFlag> flags)
Creates a record type.
|
RecordType(String moduleName,
String name,
RecordType superType,
Map<String,String> metadata)
Constructor
|
Modifier and Type | Method and Description |
---|---|
<T,E extends Throwable> |
accept(TypeVisitor<T,E> visitor)
Accepts type visitor.
|
Collection<RecordType> |
getAllSupertypes()
Returns collection of all supertypes.
|
RecordAssociation |
getAssociation(String propertyName) |
Collection<RecordAssociation> |
getAssociations()
Returns associations.
|
Class<?> |
getCompiled()
Returns class of the compiled record.
|
Constructor<?> |
getCompiledConstructor(Class<?>... params)
Returns the Java constructor of a compiled class.
|
List<FunctionSignature> |
getConstructors()
Returns the unmodifiable list of record constructors.
|
List<FunctionSignature> |
getConstructors(Visibility visibility)
Returns the unmodifiable list of record constructors
having at least the given visibility.
|
String |
getEntityJavaClassName()
Returns class name of the corresponding java implementation.
|
JavaMapping |
getEntityJavaMapping()
Returns java name of the pojo entity.
|
<T extends RecordTypeExtension> |
getExtension(Class<T> cls)
Returns extension casted to required type.
|
RecordField |
getField(String fieldName)
Returns field representation.
|
Collection<String> |
getFieldNames()
Returns collection with field names (both local and inherited).
|
Collection<RecordField> |
getFields()
Returns fields.
|
Set<RecordFlag> |
getFlags()
Deprecated.
Use getter for each flag
|
Collection<RecordAssociation> |
getLocalAssociations()
Returns local associations.
|
Map<String,RecordField> |
getLocalFields() |
Map<String,RecordProperty> |
getLocalProperties()
Returns local properties.
|
Collection<FunctionSignature> |
getLocalStaticMethods()
Returns locally defined static methods (methods defined in this type, not inherited).
|
Collection<RecordProperty> |
getProperties()
Returns properties (both local and inherited properties).
|
List<String> |
getPropertiesForEquals()
Returns a list of property names used for equals.
|
RecordProperty |
getProperty(String name)
Returns property.
|
RecordType |
getPropertyDeclarationRecord(String propertyName)
Returns a record type where the given property is declared.
|
Collection<String> |
getPropertyNames()
Returns collection with property names (both local and inherited).
|
String[] |
getPropertyNamesAsArray()
Returns the array with property names (both local and inherited).
|
String |
getProviderJavaClassName()
Returns provider java class name.
|
Collection<FunctionSignature> |
getStaticMethods()
Returns all static methods (including inherited).
|
Collection<FunctionSignature> |
getStaticMethodsForName(String name,
Visibility visibility)
Returns collection of static methods with a given name.
|
RecordXmlMapping |
getXmlMapping() |
boolean |
hasDeclaredConstructorInHierarchy()
Returns
true if this record type or its ancestor (supertype)
has a declared constructor (defined by user). |
boolean |
hasPojoEntity()
Returns true if record type has pojo entity.
|
boolean |
isAbstract()
Returns
true if the record type is abstract. |
boolean |
isCompiled()
Indicates whether this type is compiled
|
boolean |
isFinal()
Returns
true if the record type is final. |
boolean |
isPreserveOnClear()
Returns
true if the record type is preserved on evaluation level clear. |
boolean |
isReadOnly()
Returns true if the record is read only.
|
boolean |
isShared()
Returns true if the record is shared.
|
boolean |
isSystem()
Returns
true if the record type is system. |
void |
setAssociations(Collection<RecordAssociation> associations)
sets the associations of the record.
|
void |
setCompiled(Class<?> compiled)
Sets class of the compiled record.
|
void |
setDeclaredConstructors(Collection<FunctionSignature> constructors)
Sets the record constructors (declared by user).
|
void |
setExtension(RecordTypeExtension extension)
Sets extension.
|
void |
setFields(Collection<RecordField> fields)
sets the fields of the record.
|
void |
setFields(RecordField... fields)
Sets fields.
|
void |
setStaticMethods(Collection<FunctionSignature> methods)
Sets static methods.
|
equals, getData, getFullName, getLocalMethods, getMetadata, getMetadata, getModuleName, getName, getNamespaceModel, hashCode, hasIntersectionType, hasMetadata, isPrivate, setData, setMethods, toString
assignableTo, findCommonSubtype, findCommonSupertype, getAllInterfaces, getInterfaces, getJavaClass, getMethodBySignature, getMethods, getMethodsForName, getMethodsForName, getOverriddenMethodsBySignature, getRecordSupertype, getSupertype
getFreeTypes, hasFreeTypes, isCollection, matchesSubtype, matchesSupertype, performConversion, substituteFreeTypes
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
assignableTo, findCommonSubtype, findCommonSupertype, getFreeTypes, getJavaClass, getSupertype, hasFreeTypes, isCollection, matchesSubtype, matchesSupertype, performConversion, substituteFreeTypes
public RecordType(String moduleName, String name)
moduleName
- name
- of recordpublic RecordType(String moduleName, String name, RecordType superType)
moduleName
- name
- of recordsuperType
- it will inherit its fieldspublic RecordType(String moduleName, String name, RecordType superType, Map<String,String> metadata)
moduleName
- name
- of recordsuperType
- it will inherit its fieldsmetadata
- public RecordType(String moduleName, String name, RecordType superType, Collection<InterfaceType> interfaces, Map<String,String> metadata, RecordXmlMapping xmlMapping, Collection<RecordFlag> flags)
moduleName
- name
- of recordsuperType
- a record supertypeinterfaces
- a set of interfaces the record implementsmetadata
- xmlMapping
- flags
- @Deprecated public Set<RecordFlag> getFlags()
public <T extends RecordTypeExtension> T getExtension(Class<T> cls)
T
- cls
- public void setExtension(RecordTypeExtension extension)
extension
- public void setFields(Collection<RecordField> fields)
fields
- IllegalStateException
- if the fields have been already setpublic void setFields(RecordField... fields)
fields
- public Map<String,RecordField> getLocalFields()
public Collection<RecordField> getFields()
public Collection<String> getFieldNames()
public void setAssociations(Collection<RecordAssociation> associations)
associations
- IllegalStateException
- if the associations have been already setpublic Collection<RecordAssociation> getLocalAssociations()
public Collection<RecordAssociation> getAssociations()
public RecordAssociation getAssociation(String propertyName)
propertyName
- public Map<String,RecordProperty> getLocalProperties()
public Collection<RecordProperty> getProperties()
public Collection<String> getPropertyNames()
public String[] getPropertyNamesAsArray()
Used by debugger via Java Debug Interface, do not change the method signature.
public RecordProperty getProperty(String name)
name
- public RecordField getField(String fieldName)
fieldName
- the name of the field, not null.public RecordType getPropertyDeclarationRecord(String propertyName)
propertyName
- null
if the property is not foundpublic Collection<RecordType> getAllSupertypes()
public <T,E extends Throwable> T accept(TypeVisitor<T,E> visitor) throws E extends Throwable
Type
T
- visitor return typevisitor
- visitor to visitE
E extends Throwable
public boolean hasPojoEntity()
public JavaMapping getEntityJavaMapping()
public String getEntityJavaClassName()
public String getProviderJavaClassName()
public boolean isShared()
public boolean isReadOnly()
public RecordXmlMapping getXmlMapping()
public boolean isAbstract()
true
if the record type is abstract.isAbstract
in class ClassType
true
if the record type is abstractpublic boolean isSystem()
true
if the record type is system.true
if the record type is systempublic boolean isFinal()
true
if the record type is final.true
if the record type is finalpublic boolean isPreserveOnClear()
true
if the record type is preserved on evaluation level clear.true
if the record type is preserved on evaluation level clearpublic List<String> getPropertiesForEquals()
public Class<?> getCompiled()
public void setCompiled(Class<?> compiled)
compiled
- public boolean isCompiled()
ClassType
isCompiled
in class NamedClassType
true
if this type is compiledpublic Constructor<?> getCompiledConstructor(Class<?>... params)
params
- public void setDeclaredConstructors(Collection<FunctionSignature> constructors)
constructors
- public boolean hasDeclaredConstructorInHierarchy()
true
if this record type or its ancestor (supertype)
has a declared constructor (defined by user).true
if this record type or its ancestor has a declared constructorpublic List<FunctionSignature> getConstructors(Visibility visibility)
visibility
- public List<FunctionSignature> getConstructors()
public void setStaticMethods(Collection<FunctionSignature> methods)
methods
- public Collection<FunctionSignature> getLocalStaticMethods()
ClassType
getLocalStaticMethods
in class ClassType
public Collection<FunctionSignature> getStaticMethods()
ClassType
getStaticMethods
in class ClassType
public Collection<FunctionSignature> getStaticMethodsForName(String name, Visibility visibility)
ClassType
getStaticMethodsForName
in class ClassType
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.