Class ObjectGenerator

    • Method Detail

      • needsContext

        public boolean needsContext()
        Returns true if this class requires that calls to generate a value be passed a GeneratorContext object, false otherwise.
        If it returns true, then only the generate(GeneratorContext) method may be called to generate values; the generate() method should never be called.
        If it returns false, then either method may be called.
      • isArray

        public static boolean isArray​(java.lang.Object value)
        Returns true if the given value is a non-null array object, false otherwise.
      • generate

        @Nullable
        public java.lang.Object generate​(GeneratorContext context)
                                  throws TransformationException
        Generates an Object value (which may be null), based on the given context.
        Parameters:
        context - Contains information about the context in which the value is being generated.
        Throws:
        TransformationException
      • generate

        @Nullable
        public java.lang.Object generate()
        Generates an Object value (which may be null).
        This method must only be called if this object's needsContext() method returns false, otherwise the generate(GeneratorContext) method must be called instead.
      • toString

        public abstract java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public abstract boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public abstract int hashCode()
        Overrides:
        hashCode in class java.lang.Object