Package org.rexxla.bsf.engines.rexx
Class RexxStrictArgument
java.lang.Object
org.rexxla.bsf.engines.rexx.RexxStrictArgument
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 Summary
ConstructorsConstructorDescriptionRexxStrictArgument(Class<?> type, Object value) This constructor allows for casting a Java object to the supplied class object which must be strictly matched.RexxStrictArgument(Object value) This constructor accepts any Java object which class object will be queried and stored. -
Method Summary
Modifier and TypeMethodDescriptionClass<?>Returns the class object which needs to be strictly matched.getValue()Returns the Java object to be used as the argument value.Return the value part in a form that is appropriate for ooRexx, ie.toString()Return String representation, showing values of fields.
-
Constructor Details
-
RexxStrictArgument
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
This constructor allows for casting a Java object to the supplied class object which must be strictly matched. If the value isnull, then theclz2CastToargument 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
Returns the class object which needs to be strictly matched.- Returns:
- the class oobject to match strictly
-
getValue
Returns the Java object to be used as the argument value.- Returns:
- the value to use as argument value
-
toString
Return String representation, showing values of fields. -
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
-