org.apache.fop.datatypes

## Class ValidationPercentBaseContext

- java.lang.Object
- - org.apache.fop.datatypes.ValidationPercentBaseContext

- All Implemented Interfaces:
    PercentBaseContext

      public final class ValidationPercentBaseContext
      extends Object
      implements PercentBaseContext

  This base context is used during validation when the actual base values are still unknown but should still already be checked. The actual value returned is not so important in this case. But it's important that zero and non-zero values can be distinguished.

  Example: A table with collapsing border model has no padding. The Table FO should be able to check if non-zero values (even percentages) have been specified.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getBaseLength(int lengthBase, FObj fobj)` Returns the value for the given lengthBase.
    `static PercentBaseContext` | `getPseudoContext()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getBaseLength

          public int getBaseLength(int lengthBase,
                                   FObj fobj)

      Returns the value for the given lengthBase. Returns the base length for the given length base. Length base should be one of the constants defined in `LengthBase`.
      Specified by:
        `getBaseLength` in interface `PercentBaseContext`
      Parameters:
        `lengthBase` - Indicates which type of the base length value is to be returned
        `fobj` - The FO object against which the percentage should be evaluated
      Returns:
        The base length value of the given kind

    - #### getPseudoContext

          public static PercentBaseContext getPseudoContext()

      Returns:
        a base context for validation purposes. See class description.

Copyright © 2023 Apache Software Foundation. All rights reserved.