All Downloads are FREE. Search and download functionalities are using the official Maven repository.

generated.docs.javadoc.org.eclipse.dawnsci.nexus.validation.AbstractNexusValidator.html Maven / Gradle / Ivy






AbstractNexusValidator (h5jan API)












org.eclipse.dawnsci.nexus.validation

Class AbstractNexusValidator

  • java.lang.Object
    • org.eclipse.dawnsci.nexus.validation.AbstractNexusValidator
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      protected void clearLocalGroupDimensionPlaceholderValues()
      Clears the map of values of dimension placeholders, as these are local only to the current group.
      protected void failValidation(java.lang.String message)
      Throw an NexusValidationException with the given message.
      protected void validate(java.lang.String message, boolean condition)
      Validates that the given condition holds, throwing an NexusValidationException with the given message otherwise
      protected void validateAttributeEnumeration(java.lang.String attributeName, Attribute attribute, java.lang.String... permittedValues)
      Validates that an enumeration attribute has one of the given permitted values.
      protected void validateAttributeNotNull(java.lang.String attributeName, Attribute attribute)
      Validates that the given attribute node is not null.
      protected void validateAttributeType(java.lang.String fieldName, Attribute attribute, NexusDataType type)
      Validates that the type of the given attribute is that given.
      protected void validateFieldDimensions(java.lang.String fieldName, IDataset dataset, java.lang.String groupName, java.lang.Object... dimensions)
      Validate the dimensions of the given field.
      protected void validateFieldEnumeration(java.lang.String fieldName, IDataset dataset, java.lang.String... permittedValues)
      Validates that an enumeration field has one of the given permitted values.
      protected void validateFieldNotNull(java.lang.String fieldName, IDataset dataset)
      Validates that the given field value is not null.
      protected void validateFieldRank(java.lang.String fieldName, IDataset dataset, int rank)
      Validates that the given field has the expected rank.
      protected void validateFieldType(java.lang.String fieldName, IDataset dataset, NexusDataType type)
      Validates that the type of the given field is that given.
      protected void validateFieldUnits(java.lang.String fieldName, IDataset dataset, NexusUnitCategory unitCategory)
      Validates that the given field has units consistent with the given unit category.
      protected void validateGroupNotNull(java.lang.String groupName, java.lang.Class<? extends NXobject> type, GroupNode groupNode)
      Validates that the given group is not null.
      protected void validateNotNull(java.lang.String message, java.lang.Object object)
      Validates that the given object is not null.
      protected void validateTransformations(java.util.Map<java.lang.String,NXtransformations> transformations, java.lang.String dependsOnStr)
      Validate the given transformations.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractNexusValidator

        public AbstractNexusValidator()
    • Method Detail

      • validateNotNull

        protected void validateNotNull(java.lang.String message,
                                       java.lang.Object object)
                                throws NexusValidationException
        Validates that the given object is not null.
        Parameters:
        message - message
        object - object to check for null
        Throws:
        NexusValidationException - if the given object is null
      • validateGroupNotNull

        protected void validateGroupNotNull(java.lang.String groupName,
                                            java.lang.Class<? extends NXobject> type,
                                            GroupNode groupNode)
                                     throws NexusValidationException
        Validates that the given group is not null.
        Parameters:
        groupName - name of group
        type - type of group
        groupNode - group node
        Throws:
        NexusValidationException
      • validateFieldNotNull

        protected void validateFieldNotNull(java.lang.String fieldName,
                                            IDataset dataset)
                                     throws NexusValidationException
        Validates that the given field value is not null.
        Parameters:
        fieldName - name of field
        dataset - the field value, an IDataset
        Throws:
        NexusValidationException - if the field is null
      • validateAttributeNotNull

        protected void validateAttributeNotNull(java.lang.String attributeName,
                                                Attribute attribute)
                                         throws NexusValidationException
        Validates that the given attribute node is not null.
        Parameters:
        attributeName - name of attribute
        attribute - attribute
        Throws:
        NexusValidationException - if the attribute is null
      • validateFieldEnumeration

        protected void validateFieldEnumeration(java.lang.String fieldName,
                                                IDataset dataset,
                                                java.lang.String... permittedValues)
                                         throws NexusValidationException
        Validates that an enumeration field has one of the given permitted values.
        Parameters:
        fieldName - name of the field
        dataset - the field value, a Dataset
        permittedValues - the permitted values
        Throws:
        NexusValidationException - if the value of the field is not one of the permitted values
      • validateFieldType

        protected void validateFieldType(java.lang.String fieldName,
                                         IDataset dataset,
                                         NexusDataType type)
                                  throws NexusValidationException
        Validates that the type of the given field is that given.
        Parameters:
        fieldName - field name
        dataset - field value, an IDataset
        type - expected type
        Throws:
        NexusValidationException - if the type of the field is not that given
      • validateFieldUnits

        protected void validateFieldUnits(java.lang.String fieldName,
                                          IDataset dataset,
                                          NexusUnitCategory unitCategory)
                                   throws NexusValidationException
        Validates that the given field has units consistent with the given unit category.
        Parameters:
        fieldName - field name
        dataset - field value, an IDataset
        unitCategory - expected unit category
        Throws:
        java.lang.Exception - if an unexpected exception occurs
        NexusValidationException - if the field's units are not consistent with the given unit category
      • validateFieldRank

        protected void validateFieldRank(java.lang.String fieldName,
                                         IDataset dataset,
                                         int rank)
                                  throws NexusValidationException
        Validates that the given field has the expected rank.
        Parameters:
        fieldName - field name
        dataset - field value, an IDataset
        rank - expected rank
        Throws:
        NexusValidationException - if the field does not have the expected rank
      • validateFieldDimensions

        protected void validateFieldDimensions(java.lang.String fieldName,
                                               IDataset dataset,
                                               java.lang.String groupName,
                                               java.lang.Object... dimensions)
                                        throws NexusValidationException
        Validate the dimensions of the given field.
        Parameters:
        fieldName - field name
        dataset - dataset to validate
        groupName - the name of the group
        dimensions - the dimensions, each value must be either an integer, interpreted as the expected size of that dimension, or a placeholder string, in which case the size of this dimension will be validated against any previous dimension with the same placeholder string
        Throws:
        NexusValidationException - if a dimension did not have the expected size
      • validateAttributeType

        protected void validateAttributeType(java.lang.String fieldName,
                                             Attribute attribute,
                                             NexusDataType type)
                                      throws NexusValidationException
        Validates that the type of the given attribute is that given.
        Parameters:
        fieldName - field name
        dataset - field value, an IDataset
        type - expected type
        Throws:
        NexusValidationException - if the type of the field is not that given
      • validateAttributeEnumeration

        protected void validateAttributeEnumeration(java.lang.String attributeName,
                                                    Attribute attribute,
                                                    java.lang.String... permittedValues)
                                             throws NexusValidationException
        Validates that an enumeration attribute has one of the given permitted values.
        Parameters:
        attributeName - name of the attribute
        attribute - the attribute
        permittedValues - the permitted values
        Throws:
        NexusValidationException - if the value of the field is not one of the permitted values
      • validateTransformations

        protected void validateTransformations(java.util.Map<java.lang.String,NXtransformations> transformations,
                                               java.lang.String dependsOnStr)
                                        throws NexusValidationException
        Validate the given transformations. Transformations have an order, whereby the initial dependsOnStr identifies the first transformation, and thereafter each transformation is identified by the value of the depends_on attribute of the previous transformation. The final transformation is identified by having "." as the value of its depends_on attribute.
        Parameters:
        transformations - transformations
        dependsOnStr - the name of the first transformation
        Throws:
        NexusValidationException - if an expected transformation does not exist
      • clearLocalGroupDimensionPlaceholderValues

        protected void clearLocalGroupDimensionPlaceholderValues()
        Clears the map of values of dimension placeholders, as these are local only to the current group.




© 2015 - 2024 Weber Informatics LLC | Privacy Policy