public final class RecordType extends NamedClassType
core::Duration
.Constructor and Description |
---|
RecordType(java.lang.String moduleName,
java.lang.String name)
Constructor
|
RecordType(java.lang.String moduleName,
java.lang.String name,
RecordType superType)
Constructor
|
RecordType(java.lang.String moduleName,
java.lang.String name,
RecordType superType,
java.util.Collection<InterfaceType> interfaces,
java.util.Map<java.lang.String,java.lang.String> metadata,
RecordXmlMapping xmlMapping,
java.util.Collection<RecordFlag> flags)
Creates a record type.
|
RecordType(java.lang.String moduleName,
java.lang.String name,
RecordType superType,
java.util.Map<java.lang.String,java.lang.String> metadata)
Constructor
|
Modifier and Type | Method and Description |
---|---|
<T,E extends java.lang.Throwable> |
accept(TypeVisitor<T,E> visitor)
Accepts type visitor.
|
java.util.Collection<RecordType> |
getAllSupertypes()
Returns collection of all supertypes.
|
RecordAssociation |
getAssociation(java.lang.String propertyName) |
java.util.Collection<RecordAssociation> |
getAssociations()
Returns associations.
|
java.lang.Class<?> |
getCompiled()
Returns class of the compiled record.
|
java.lang.reflect.Constructor<?> |
getCompiledConstructor(java.lang.Class<?>... params)
Returns the Java constructor of a compiled class.
|
java.util.List<FunctionSignature> |
getConstructors()
Returns the unmodifiable list of record constructors.
|
java.util.List<FunctionSignature> |
getConstructors(Visibility visibility)
Returns the unmodifiable list of record constructors
having at least the given visibility.
|
java.lang.String |
getEntityJavaClassName()
Returns class name of the corresponding java implementation.
|
JavaMapping |
getEntityJavaMapping()
Returns java name of the pojo entity.
|
<T extends RecordTypeExtension> |
getExtension(java.lang.Class<T> cls)
Returns extension casted to required type.
|
RecordField |
getField(java.lang.String fieldName)
Returns field representation.
|
java.util.Collection<java.lang.String> |
getFieldNames()
Returns collection with field names (both local and inherited).
|
java.util.Collection<RecordField> |
getFields()
Returns fields.
|
java.util.Set<RecordFlag> |
getFlags()
Deprecated.
Use getter for each flag
|
java.util.Collection<RecordAssociation> |
getLocalAssociations()
Returns local associations.
|
java.util.Map<java.lang.String,RecordField> |
getLocalFields() |
java.util.Map<java.lang.String,RecordProperty> |
getLocalProperties()
Returns local properties.
|
java.util.Collection<FunctionSignature> |
getLocalStaticMethods()
Returns locally defined static methods (methods defined in this type, not inherited).
|
java.util.Collection<RecordProperty> |
getProperties()
Returns properties (both local and inherited properties).
|
java.util.List<java.lang.String> |
getPropertiesForEquals()
Returns a list of property names used for equals.
|
RecordProperty |
getProperty(java.lang.String name)
Returns property.
|
RecordType |
getPropertyDeclarationRecord(java.lang.String propertyName)
Returns a record type where the given property is declared.
|
java.util.Collection<java.lang.String> |
getPropertyNames()
Returns collection with property names (both local and inherited).
|
java.lang.String[] |
getPropertyNamesAsArray()
Returns the array with property names (both local and inherited).
|
java.lang.String |
getProviderJavaClassName()
Returns provider java class name.
|
java.util.Collection<FunctionSignature> |
getStaticMethods()
Returns all static methods (including inherited).
|
java.util.Collection<FunctionSignature> |
getStaticMethodsForName(java.lang.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(java.util.Collection<RecordAssociation> associations)
sets the associations of the record.
|
void |
setCompiled(java.lang.Class<?> compiled)
Sets class of the compiled record.
|
void |
setDeclaredConstructors(java.util.Collection<FunctionSignature> constructors)
Sets the record constructors (declared by user).
|
void |
setExtension(RecordTypeExtension extension)
Sets extension.
|
void |
setFields(java.util.Collection<RecordField> fields)
sets the fields of the record.
|
void |
setFields(RecordField... fields)
Sets fields.
|
void |
setStaticMethods(java.util.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(java.lang.String moduleName, java.lang.String name)
moduleName
- name
- of recordpublic RecordType(java.lang.String moduleName, java.lang.String name, RecordType superType)
moduleName
- name
- of recordsuperType
- it will inherit its fieldspublic RecordType(java.lang.String moduleName, java.lang.String name, RecordType superType, java.util.Map<java.lang.String,java.lang.String> metadata)
moduleName
- name
- of recordsuperType
- it will inherit its fieldsmetadata
- public RecordType(java.lang.String moduleName, java.lang.String name, RecordType superType, java.util.Collection<InterfaceType> interfaces, java.util.Map<java.lang.String,java.lang.String> metadata, RecordXmlMapping xmlMapping, java.util.Collection<RecordFlag> flags)
moduleName
- name
- of recordsuperType
- a record supertypeinterfaces
- a set of interfaces the record implementsmetadata
- xmlMapping
- flags
- @Deprecated public java.util.Set<RecordFlag> getFlags()
public <T extends RecordTypeExtension> T getExtension(java.lang.Class<T> cls)
T
- cls
- public void setExtension(RecordTypeExtension extension)
extension
- public void setFields(java.util.Collection<RecordField> fields)
fields
- java.lang.IllegalStateException
- if the fields have been already setpublic void setFields(RecordField... fields)
fields
- public java.util.Map<java.lang.String,RecordField> getLocalFields()
public java.util.Collection<RecordField> getFields()
public java.util.Collection<java.lang.String> getFieldNames()
public void setAssociations(java.util.Collection<RecordAssociation> associations)
associations
- java.lang.IllegalStateException
- if the associations have been already setpublic java.util.Collection<RecordAssociation> getLocalAssociations()
public java.util.Collection<RecordAssociation> getAssociations()
public RecordAssociation getAssociation(java.lang.String propertyName)
propertyName
- public java.util.Map<java.lang.String,RecordProperty> getLocalProperties()
public java.util.Collection<RecordProperty> getProperties()
public java.util.Collection<java.lang.String> getPropertyNames()
public java.lang.String[] getPropertyNamesAsArray()
Used by debugger via Java Debug Interface, do not change the method signature.
public RecordProperty getProperty(java.lang.String name)
name
- public RecordField getField(java.lang.String fieldName)
fieldName
- the name of the field, not null.public RecordType getPropertyDeclarationRecord(java.lang.String propertyName)
propertyName
- null
if the property is not foundpublic java.util.Collection<RecordType> getAllSupertypes()
public <T,E extends java.lang.Throwable> T accept(TypeVisitor<T,E> visitor) throws E extends java.lang.Throwable
Type
T
- visitor return typevisitor
- visitor to visitE
E extends java.lang.Throwable
public boolean hasPojoEntity()
public JavaMapping getEntityJavaMapping()
public java.lang.String getEntityJavaClassName()
public java.lang.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 java.util.List<java.lang.String> getPropertiesForEquals()
public java.lang.Class<?> getCompiled()
public void setCompiled(java.lang.Class<?> compiled)
compiled
- public boolean isCompiled()
ClassType
isCompiled
in class NamedClassType
true
if this type is compiledpublic java.lang.reflect.Constructor<?> getCompiledConstructor(java.lang.Class<?>... params)
params
- public void setDeclaredConstructors(java.util.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 java.util.List<FunctionSignature> getConstructors(Visibility visibility)
visibility
- public java.util.List<FunctionSignature> getConstructors()
public void setStaticMethods(java.util.Collection<FunctionSignature> methods)
methods
- public java.util.Collection<FunctionSignature> getLocalStaticMethods()
ClassType
getLocalStaticMethods
in class ClassType
public java.util.Collection<FunctionSignature> getStaticMethods()
ClassType
getStaticMethods
in class ClassType
public java.util.Collection<FunctionSignature> getStaticMethodsForName(java.lang.String name, Visibility visibility)
ClassType
getStaticMethodsForName
in class ClassType
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.