Class RexxStrictArgument

java.lang.Object
org.rexxla.bsf.engines.rexx.RexxStrictArgument

public class RexxStrictArgument extends Object
This class represents values which type must strictly match with the type in a signature.
------------------------ Apache Version 2.0 license -------------------------
    Copyright (C) 2018-2019 Rony G. Flatscher

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
 ----------------------------------------------------------------------------- 
Since:
BSF4ooRexx 600 (implementation started: 2018-01-05)
Version:
1.00, 2018-11-01, 2018-11-04, 2019-08-16
Author:
Rony G. Flatscher (WU-Wien/Wirtschaftsuniversität Wien, http://www.wu-wien.ac.at/english)
  • Constructor Details

    • RexxStrictArgument

      public RexxStrictArgument(Object value) throws org.apache.bsf.BSFException
      This constructor accepts any Java object which class object will be queried and stored.
      Parameters:
      value - the Java object which class will have to be strictly matched
      Throws:
      org.apache.bsf.BSFException - if value is null
    • RexxStrictArgument

      public RexxStrictArgument(Class<?> type, Object value) throws org.apache.bsf.BSFException
      This constructor allows for casting a Java object to the supplied class object which must be strictly matched. If the value is null, then the clz2CastTo argument may be of any Class.
      Parameters:
      type - the Class object to strictly match (can also be a class to cast to)
      value - the Java object to
      Throws:
      org.apache.bsf.BSFException - if arugment type and value do not match or the type is null
  • Method Details

    • getClassObject

      public Class<?> getClassObject()
      Returns the class object which needs to be strictly matched.
      Returns:
      the class oobject to match strictly
    • getValue

      public Object getValue()
      Returns the Java object to be used as the argument value.
      Returns:
      the value to use as argument value
    • toString

      public String toString()
      Return String representation, showing values of fields.
      Overrides:
      toString in class Object
    • getValue4Rexx

      public Object getValue4Rexx()
      Return the value part in a form that is appropriate for ooRexx, ie. Boolean values as "0" or "1", the primitive (and String object) with their String values, any other object unedited.
      Returns:
      the appropriate value for ooRexx