Class ModelDescriptor
java.lang.Object
nl.datasteel.crudcraft.codegen.descriptor.model.ModelDescriptor
Metadata for a model composed of distinct descriptor parts.
-
Constructor Summary
ConstructorsConstructorDescriptionModelDescriptor
(ModelIdentity identity, ModelFlags flags, EndpointOptions endpoints, ModelSecurity security) Constructs a ModelDescriptor with the provided identity, flags, endpoints, and security options. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the identity of the model, which includes its name, package, and fields.Returns the base package of the model, which is used for generating code.Class
<? extends CrudEndpointPolicy> Returns the custom endpoint policy, if defined.Returns the fields of the model, which are defined in the ModelIdentity.Returns the endpoints that should be included during controller generation.getName()
Returns the name of the model, which is used for generating code and identifying the model.Returns the endpoints that should be omitted during controller generation.Returns the package name of the model, which is used for organizing code and avoiding naming conflicts.Returns the class names that handle row-level security for this model.Class
<? extends CrudSecurityPolicy> Returns the class that implements the security policy for this model.Returns the template used for generating endpoints for this model.int
hashCode()
Computes a hash code for the ModelDescriptor based on its identity, flags, endpoints, and security options.boolean
Returns whether the model is a CrudCraft entity, meaning it is part of the CrudCraft framework.boolean
Returns the identity of the model, which includes its name, package, and fields.boolean
Returns whether the model is embeddable, meaning it can be used as a part of another entity.boolean
isSecure()
Returns whether the model is secure, meaning it has a defined security policy.toString()
Returns a string representation of the ModelDescriptor.
-
Constructor Details
-
ModelDescriptor
public ModelDescriptor(ModelIdentity identity, ModelFlags flags, EndpointOptions endpoints, ModelSecurity security) Constructs a ModelDescriptor with the provided identity, flags, endpoints, and security options.- Parameters:
identity
- the core identity of the modelflags
- the flags indicating properties of the modelendpoints
- the options for endpoints associated with the modelsecurity
- the security options for the model
-
-
Method Details
-
getName
Returns the name of the model, which is used for generating code and identifying the model.- Returns:
- the name of the model as a String
-
getPackageName
Returns the package name of the model, which is used for organizing code and avoiding naming conflicts. -
getBasePackage
Returns the base package of the model, which is used for generating code. This is typically the package where the model's classes are located.- Returns:
- the base package as a String
-
getFields
Returns the fields of the model, which are defined in the ModelIdentity.- Returns:
- a list of FieldDescriptor objects representing the fields of the model
-
isEditable
public boolean isEditable()Returns the identity of the model, which includes its name, package, and fields.- Returns:
- the ModelIdentity object representing the model's identity
-
isCrudCraftEntity
public boolean isCrudCraftEntity()Returns whether the model is a CrudCraft entity, meaning it is part of the CrudCraft framework.- Returns:
- true if the model is a CrudCraft entity, false otherwise
-
isEmbeddable
public boolean isEmbeddable()Returns whether the model is embeddable, meaning it can be used as a part of another entity.- Returns:
- true if the model is embeddable, false otherwise
-
getTemplate
Returns the template used for generating endpoints for this model.- Returns:
- the CrudTemplate object representing the template
-
getOmitEndpoints
Returns the endpoints that should be omitted during controller generation.- Returns:
- an array of omitted CrudEndpoint objects
-
getIncludeEndpoints
Returns the endpoints that should be included during controller generation.- Returns:
- an array of included CrudEndpoint objects
-
getEndpointPolicy
Returns the custom endpoint policy, if defined. -
isSecure
public boolean isSecure()Returns whether the model is secure, meaning it has a defined security policy.- Returns:
- true if the model is secure, false otherwise
-
getSecurityPolicy
Returns the class that implements the security policy for this model.- Returns:
- the class implementing CrudSecurityPolicy for this model
-
getRowSecurityHandlers
Returns the class names that handle row-level security for this model.- Returns:
- list of fully qualified row security handler class names
-
equals
Returns the identity of the model, which includes its name, package, and fields. -
hashCode
public int hashCode()Computes a hash code for the ModelDescriptor based on its identity, flags, endpoints, and security options. -
toString
Returns a string representation of the ModelDescriptor.
-