public class ModelValidator extends Object
Constructor and Description |
---|
ModelValidator(Model model,
String className,
ClassLoader classLoader,
ResourceBundle bundle)
Create a new model validator object.
|
ModelValidator(Model model,
String className,
ResourceBundle bundle) |
Modifier and Type | Method and Description |
---|---|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createClassExistenceComponent(String className)
Create a validation component which can check whether the class exists.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createClassExistenceComponent(String className,
PersistenceFieldElement relatedField)
Create a validation component which can check whether the class exists.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createClassMappingComponent(PersistenceClassElement persistenceClass)
Create a validation component which can check whether the class is
unmapped.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createClassPersistenceComponent(String className)
Create a validation component which can check the class persistence.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createClassPersistenceComponent(String className,
PersistenceFieldElement relatedField)
Create a validation component which can check the class persistence.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createCollectionClassComponent(RelationshipElement field)
Create a validation component which can check whether the collection
class is valid given the relationship field type.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createColumnExistenceComponent(String columnName)
Create a validation component which can check whether the given column
exists.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createColumnExistenceComponent(String columnName,
MappingFieldElement relatedField)
Create a validation component which can check whether the given
column or column pair exists.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createColumnOverlapComponent(MappingFieldElement field)
Create a validation component which can check whether the field is
one of a set mapped to overlapping columns
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createElementClassComponent(RelationshipElement field)
Create a validation component which can check whether the
relationship is mapped to columns even though the element class is null.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createFieldBlobMappingComponent(PersistenceFieldElement field)
Create a validation component which can check whether the field is
mapped to a blob type and if so, whether it is a key field or belongs
to the default fetch group.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createFieldCardinalityComponent(PersistenceFieldElement field)
Create a validation component which can check whether the cardinality
bounds are semantically valid given the relationship field type.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createFieldConsistencyComponent(MappingFieldElement field)
Create a validation component which can check whether the field is
consistent (if in mapping model but not jdo, it is a problem).
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createFieldConsistencyComponent(PersistenceFieldElement field)
Create a validation component which can check whether the field is
consistent (field in both models or relationship in both).
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createFieldDefaultFetchGroupComponent(MappingFieldElement field)
Create a validation component which can check whether the field is
part of a managed (multiple fields to same column) group and in an
illegal fetch group.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createFieldExistenceComponent(Object field)
Create a validation component which can check whether the field exists.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createFieldExistenceComponent(String fieldName)
Create a validation component which can check whether the field exists.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createFieldMappingComponent(PersistenceFieldElement field)
Create a validation component which can check whether the field is
unmapped.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createFieldPersistenceComponent(PersistenceFieldElement field)
Create a validation component which can check whether the field is
persistent.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createFieldPersistenceTypeComponent(PersistenceFieldElement field)
Create a validation component which can check the persistence type
of the field (whether it is a relationship or not).
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createInverseFieldComponent(RelationshipElement field)
Create a validation component which can check whether the inverse of
the inverse of the relationship is the relationship itself.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createInverseMappingComponent(RelationshipElement field)
Create a validation component which can check whether the mapping of
the relationship and the mapping of its inverse are inverses of each
other.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createKeyClassComponent(String className)
Create a validation component which can check whether the key class
of the persistence capable class is valid.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createKeyColumnMappingComponent(PersistenceClassElement persistenceClass)
Create a validation component which can check whether the class
contains field mappings for all primary key columns.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createPrimaryTableComponent(MappingTableElement primaryTable)
Create a validation component which can check whether the
class is mapped to tables even though the schema is null or the
class is mapped to a primary table without a primary key.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createRelatedClassMatchesComponent(RelationshipElement field)
Create a validation component which can check whether the inverse of
the relationship belongs to the related class (type or element class
depending on cardinality).
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createRelatedSchemaMatchesComponent(String relatedClass,
PersistenceFieldElement relatedField)
Create a validation component which can check whether the schema of
the related class matches that of the class we are checking.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createRelatedTableMatchesComponent(String relatedClass,
PersistenceFieldElement relatedField,
List tableNames,
String pairName)
Create a validation component which can check whether any of
the supplied tables of the related class (which includes primary
and secondary tables) contains the table of the column stored in
the relationship definition.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createSchemaExistenceComponent(String className)
Create a validation component which can check whether the schema of
the given class exists.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createSchemaExistenceComponent(String className,
PersistenceFieldElement relatedField)
Create a validation component which can check whether the schema of
the given class exists.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createSerializableClassComponent(String className)
Create a validation component which can check that the persistence
capable class implement methods readObject and writeObject, if the class
implements the intreface java.io.Serializable
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createTableExistenceComponent(String tableName)
Create a validation component which can check whether the given table
exists.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createTableExistenceComponent(String tableName,
PersistenceFieldElement relatedField)
Create a validation component which can check whether the given table
exists.
|
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent |
createVersionConsistencyComponent(MappingClassElement mappingClass)
Create a validation component which checks whether the rules for
version consistency are followed.
|
Collection |
fullValidationCheck()
Main method used for validating the combination of java (or class)
information and mapping/jdo information by running through the full
validation check and returning a collection of
ModelValidationExceptions containing any errors or warnings encountered.
|
Collection |
getBasicValidationList()
Computes and returns a collection of ValidationComponents
representing the tests to be performed during parse.
|
ClassLoader |
getClassLoader()
Get the class loader used to load the class being validated.
|
String |
getClassName()
Get the name of the class being validated.
|
Collection |
getFullValidationList()
Computes and returns a collection of ValidationComponents
representing the tests to be performed during validation.
|
protected ResourceBundle |
getMessages() |
Model |
getModel()
Get the model object used for validation.
|
boolean |
parseCheck()
Main method used for parsing the combination of java (or class)
information and mapping/jdo information by running through a subset
of the full validation check and aborting (and returning
false at the first error or warning. |
public ModelValidator(Model model, String className, ResourceBundle bundle)
public ModelValidator(Model model, String className, ClassLoader classLoader, ResourceBundle bundle)
model
- model object used for validationclassName
- the name of the class being validatedpublic Model getModel()
public String getClassName()
public ClassLoader getClassLoader()
protected ResourceBundle getMessages()
public boolean parseCheck()
false
at the first error or warning.true
if no errors or warnings occur,
false
otherwise.getBasicValidationList()
public Collection fullValidationCheck()
null
.getFullValidationList()
public Collection getBasicValidationList()
getDatabaseValidationList()
,
getFieldsValidationList()
,
getFullValidationList()
public Collection getFullValidationList()
getRelatedClassValidationList(com.sun.jdo.api.persistence.model.jdo.PersistenceFieldElement)
,
getBasicValidationList()
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createClassExistenceComponent(String className, PersistenceFieldElement relatedField)
className
- the class whose existence is being checkedrelatedField
- the relationship field whose class is being checked,
may be null
in which case we are probably checking the
same class as the validator is checking overallprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createClassExistenceComponent(String className)
className
- the class whose existence is being checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createClassPersistenceComponent(String className, PersistenceFieldElement relatedField)
className
- the class whose persistence is being checkedrelatedField
- the relationship field whose class is being checked,
may be null
in which case we are probably checking the
same class as the validator is checking overallprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createClassPersistenceComponent(String className)
className
- the class whose persistence is being checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createFieldExistenceComponent(String fieldName)
fieldName
- the field whose existence is being checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createFieldExistenceComponent(Object field)
field
- the field whose existence is being checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createFieldPersistenceComponent(PersistenceFieldElement field)
field
- the field whose persistence is being checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createFieldConsistencyComponent(PersistenceFieldElement field)
field
- the field whose consistency is being checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createFieldConsistencyComponent(MappingFieldElement field)
field
- the field whose consistency is being checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createFieldPersistenceTypeComponent(PersistenceFieldElement field)
field
- the field whose persistence type is being checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createFieldCardinalityComponent(PersistenceFieldElement field)
field
- the relationship whose cardinality bounds are being checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createFieldMappingComponent(PersistenceFieldElement field)
field
- the field whose mapping is being checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createFieldBlobMappingComponent(PersistenceFieldElement field)
field
- the field whose mapping/key field/fetch group consistency
is being checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createCollectionClassComponent(RelationshipElement field)
field
- the relationship whose collection class is being checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createElementClassComponent(RelationshipElement field)
field
- the relationship whose element class is being checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createVersionConsistencyComponent(MappingClassElement mappingClass)
mappingClass
- the mapping class element whose consistency is being
checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createInverseFieldComponent(RelationshipElement field)
field
- the relationship whose inverse relationship is being checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createRelatedClassMatchesComponent(RelationshipElement field)
field
- the relationship whose inverse relationship is being checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createInverseMappingComponent(RelationshipElement field)
field
- the relationship whose inverse relationship is being checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createFieldDefaultFetchGroupComponent(MappingFieldElement field)
field
- the field whose fetch group is being checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createRelatedSchemaMatchesComponent(String relatedClass, PersistenceFieldElement relatedField)
relatedClass
- the class whose schema is being checkedrelatedField
- the relationship field whose schema is being
comparedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createRelatedTableMatchesComponent(String relatedClass, PersistenceFieldElement relatedField, List tableNames, String pairName)
relatedClass
- the class whose table is being checkedrelatedField
- the relationship field whose table is being comparedtableNames
- the list of names of the tables we expect the
column to matchpairName
- the name of the pair whose reference column is to
be checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createSchemaExistenceComponent(String className)
className
- the class whose mapped schema's existence is
being checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createSchemaExistenceComponent(String className, PersistenceFieldElement relatedField)
className
- the class whose mapped schema's existence is
being checkedrelatedField
- the relationship field whose class'
mapped schema is being checked, may be null
in which
case we are probably checking the same class as the validator is
checking overallprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createPrimaryTableComponent(MappingTableElement primaryTable)
primaryTable
- the primary table for the classprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createTableExistenceComponent(String tableName)
tableName
- the table whose existence is being checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createTableExistenceComponent(String tableName, PersistenceFieldElement relatedField)
tableName
- the table whose existence is being checkedrelatedField
- the relationship field whose class'
table is being checked, may be null
in which
case we are probably checking the same class as the validator is
checking overallprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createColumnExistenceComponent(String columnName)
columnName
- the column whose existence is being checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createColumnExistenceComponent(String columnName, MappingFieldElement relatedField)
columnName
- the column or pair whose existence is being checkedrelatedField
- the field whose class' column is being checked,
may be null
in which case we are probably checking the
same secondary table setupprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createColumnOverlapComponent(MappingFieldElement field)
field
- the field whose column mapping is being checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createKeyClassComponent(String className)
protected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createSerializableClassComponent(String className)
className
- the class whose methods are checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createClassMappingComponent(PersistenceClassElement persistenceClass)
persistenceClass
- the class whose mapping is being checkedprotected com.sun.jdo.api.persistence.model.util.ModelValidator.ValidationComponent createKeyColumnMappingComponent(PersistenceClassElement persistenceClass)
persistenceClass
- the class whose mapping is being checkedCopyright © 2019. All rights reserved.