Passing a textvalue as an int to a method

Good Afternoon!
When you have a method like cipher.init(int opmode, Key key) how do you pass the value for opmode since the values are ENCRYPT_MODE, DECRYPT_MODE, WRAP_MODE or UNWRAP_MODE?
Here is the java doc:
http://java.sun.com/j2se/1.4.2/docs/api/javax/crypto/Cipher.html#DECRYPT_MODE
Thanks,
Doug

cipher.init(DECRYPT_MODE, key)

Similar Messages

  • Passing Ref Cursor as parameter to object type method

    I am encountering a problem passing a parameter of type REF CURSOR to methods of a set of object types I am developing.
    Here is an example of what I am trying to do:
    create or replace package p1 as
    type c_Cursor is ref cursor;
    end p1;
    create or replace type t_Object as object
    not instantiable method m1(p_Cursor in p1.c_Cursor) return varchar2
    ) not instantiable not final;
    create or replace type t_Subtype under t_Object as
    overriding method m1(p_Cursor in p1.c_Cursor)
    return varchar2
    The problem is that the PL/SQL compiler gives the error message PLS-00201 "p1.c_Cursor" not defined.
    According to my PL/SQL book (SF's Oracle PL/SQL Programming) the only way to use a ref cursor as a parameter to functions/procedures is to wrap them in a package. Indeed I have developed a test procedure in a different package that uses p1.c_Cursor as a parameter and it works fine.
    Oracle's documemtation suggests that object security (roles etc) can cause this error but as all the objects are being created in the same schema I don't see how this should be a problem.
    If anyone can suggest how to get around this problem I will be very grateful.
    BTW, if there are any mistakes in my sample code it's because I am writing it from memory as I don't have Internet access at work.
    Thanks,
    Charles.

    Thanks for your reply. I am still baffled as to why it doesn't work but, as you correctly point out, SYS_REFCURSOR works just fine. I figured that out earlier today and now the problem is solved.
    Charles.

  • Passing an Internal Table as parameter to a method

    Hi,
       Can we pass an internal table as a parameter to a method.if so how can we do that?i am new to abap objects..

    Hi Matt,
            Here is the code that i am trying to execute.I am extracting the data in the method "Extract" and passing it to the method "Display" to produce a report output.When i execute this it is giving me an error saying that t_mara is not an internal table since i just refered it with x_mara in the class definition.So how can i modify this code to pass t_mara as an internal table from the method "Extract".Please help me.
    *& Report  ZOBJ_PRAC                                      *
    REPORT  zobj_prac                                                   .
          CLASS example DEFINITION
    CLASS example DEFINITION.
      PUBLIC SECTION.
            TYPES : BEGIN OF x_mara,
                  matnr TYPE matnr,
                  ersda TYPE ersda,
               END OF x_mara.
        METHODS : extract EXPORTING t_mara TYPE x_mara,
                          display IMPORTING it_mara TYPE x_mara.
    ENDCLASS.                    "example DEFINITION
    "example IMPLEMENTATION
          CLASS example IMPLEMENTATION
    CLASS example IMPLEMENTATION.
      METHOD extract.
        DATA :lt_mara TYPE STANDARD TABLE OF x_mara INITIAL SIZE 0,
                  lw_mara TYPE x_mara.
        SELECT matnr ersda FROM mara INTO TABLE lt_mara UP TO 10 ROWS.
        t_mara[]  =  lt_mara[].
      ENDMETHOD.                    "extract
      METHOD display.
        DATA :lt_mara TYPE STANDARD TABLE OF x_mara INITIAL SIZE 0,
              lw_mara TYPE x_mara.
        lt_mara[]  =  it_mara[].
        LOOP AT lt_mara INTO lw_mara.
          WRITE:/ lw_mara-matnr,
                20 lw_mara-ersda.
        ENDLOOP.
      ENDCLASS.                    "example IMPLEMENTATION
    START-OF-SELECTION.
      DATA :  b1 TYPE REF TO example.
    CREATE OBJECT b1 TYPE example.
      TYPES : BEGIN OF x_mara,
                  matnr TYPE matnr,
                  ersda TYPE ersda,
               END OF x_mara.
    data : t_mara type standard table of x_mara initial size 0,
           it_mara type standard table of  x_mara initial size 0.
      call method b1->extract
        importing
         t_mara = t_mara.
         it_mara[]  =  t_mara[].
      call method b1->display
        exporting
         it_mara = it_mara.
    Edited by: Sai Chaitanya on Dec 2, 2008 5:30 AM

  • How does one pass import parameters to a report within a method?

    Hello all,
    Well how does one  pass import parameters to a report which is within a method ...end method.
    for example :
    method 123
    SUBMIT reportname using selection '1000'
    endmethod .
    Here we need to pass values into the selection screen and run the report for those values.
    The values are say 'ABC'   (  tablename "DEF" and field name "HIJ" ).
    I hope the question is clear, awaiting your response 
    Thanks and Regards,
    Sandeep.

    Go to SE24
    Parameters: Give the Parameter name, Typing method is "Type" is the domain type that u are selecting, say for e.g :  Parameter is "P_CONT" , its associated type "CHAR32" etc
    For Select Options:  Parameter name say "S_CUST", Type"importing". For this you need to give an associated type which must be created as "TABLE TYPE " in SE11. That table type needs to have a "LINE TYPE" .
    LINE TYPE is a Structure created with components "SIGN, OPTION, LOW & HIGH" for select-Options.
    NOTE: for a Table type related to Customer data fields "say KUNNR", the line type created must have the Component Type and data Type corresponding to the Data Element associated with "KUNNR" ;i.e: "CHAR" etc.
    See if this is clear to you or revert back in case of any Confusion.

  • Passing parameter to report from form using RUN_REPORT_OBJECT method

    Will you please let me know how to do this. I tried using run_product but it is giving error as too many declarations. So I decided to use RUN_REPORT_OBJECT, but no help is provided how to pass paramters to this routine from FORMS to REPORTS.

    If you just want to change the heading of a column dynamically, you can go with any of the two options. For both the options, you need to remove the static text and replace it with any dummy field (ensure the reference of field w.r. to repeating frame)
    1. Use the Format Trigger and change the heading to either "school" or "college" based on your field value.
    Ex.
    If :<field_name> = 'S'
    then :dummy_field := 'School'
    Else
    :dummy_field := 'College'
    End If;
    Return (true)
    2. Another option is similar to this and uses a CF.
    (I would prefer CF).
    Warm Regards,
    Raja.

  • How to pass a Class as a parameter of a method?

    I have a method like below. Inside this method I need to create a variable that his type is the type of the class I have passed as a method's parameter.
    For example, if I call the method like this "Meth1(ClassPerson);" insed the method I need to declare a  variable of class "ClassPerson", but if I call like "Meth1(ClassCity);" I need the same variable to be declared as a ClassCity.
    public function Meth1( /*I dont know what to put here*/   ):void{
         /*I dont know what to put here to declare my variable*/
         /*here
         comes
         more
         code
         using
         the
         variable*/
    I tried as below but dont worked:
    public function Meth1( classtype:Class):void{
         var var1:classtype = new classtype();
    Can someone help me?

    evyatarBH, after declare the variable like you said an error occurs when I try to access some property of the variable. I receive a mesage telling that this property dont exists.
    public function Meth1( classtype:Class ):void{
         var var1:* = new ClassFactory(classe);
         //when I try to do something like the line below the error appear
         inputtext1.text = var1.fieldname;
    rashare, I can't do this because I can't declare the object before the method is called. I must inform to the method only which class I will use, but the object must be created only inside the method.

  • How to pass entire class as a parameter in a method of other class- OpenScr

    Hi Folks,
    Whenever we create a script in OpenScript, it can contain only one class. However I want to declare several variables in a class/script and pass this entire class B as a parameter in a methodA of classA.
    What I mean by mean that is , I create ClassB something like below
    public class MyParams.....
    variable1;
    variable2;
    variable3;
    variable4;
    variable5;
    public class Original.....
    public void methodA(MyParams params)
    params = new MyParams();
    field1 = params.variable1;
    field2 = params.variable2;
    field3 = params.variable3;
    field5= params.variable5;
    Edited by: OATS Explorer on Mar 8, 2012 1:53 AM

    Hi
    I have a stand alone program (can be used by all other users) which will accept request_id and To_Email as parameters. I am developing a new request set in which I want to incldue this stand alone program and want to pass Prog#1 request Id to the 2nd stand alone program as a parameter so that I can send the output of the Prog#1 to the users through E-mail.
    Do we have any options to pass Prog#1 requeset id in to Prog#2 as a parameter in the request set without modifying the stand alone concurrent program code.
    Please note that i dont want to change stand alone program code becuase this code/program was developed to work in general for all the users and I dont want to change this code for new requirement/purpose...
    Hope you understood my requirement...
    Thanks!!

  • Is it possible to pass a field symbol as parameter from any method of view?

    Hi
    Is it possible to pass a field symbol as an importing parameter to teh globally declared attribute??

    While it is true that you can pass field symbols, they must be fully typed at the time you pass them  and they will be passed by value, not by reference. If you want to pass generically typed variables use a data reference (TYPE REF TO) instead.

  • Pass Class Object To FMS Using NetConnection.call Method

    Hello All,
    I have a custom class that defines several methods on itself
    to retrieve its data. This class object is then sent to FMS via the
    NetConnection.call method. Once received by FMS, FMS calls the
    remote method to dispaly the class object on connected clients
    (minus the originator).
    Now, standard properties are displayed correctly, but when I
    call the class method to retrieve the class data, no data is
    retrieved.
    My question is, can FMS handle class objects as parameters in
    a NetConnection call. If not, is there a better practice of
    applying methods to retrieve the class data? Example below...
    class com.QuizItem
    var numOfAnswers;
    var getAnswer;
    function QuizItem(question)
    this.numOfAnswers = 0;//<-- Returns correct number of
    answers
    this.getAnswer = function(answerNumberToGet)//<-- Does
    not return any data when called by client side script
    return this.answers[answerNumberToGet];//Already populated
    array
    Regards,
    Shack

    First, I know JAVA does not working "pass by
    reference". It's only working pass by value. (or call
    by value)But obviously you don't fully understand what it means.
    Isn't main_a and method_a alias?
    if there is not alias, why? please explain to me.No. They're two independent references coincidentally pointing to the same object. In your swap method, you move method_a to point to something else. This does not affect main_a.
    and why main_a.hashcode() is main_a's value?why not? What else should it be?
    I think It's mean copy object. but main_a and
    method_a, they have same object id! @_@;;;It means "copy reference", same object.

  • Passing internal tables as parameters to a class method.

    Hai,
            I have a requirement to pass an internal table(not structure) as a parameter to a method of a class.Are there ways to do it?
            Plz reply.
    Thanks in advance.
    Hema

    HI
    GOOD
    GO THROUGH THIS LINK
    http://www.abapforum.com/forum/viewtopic.php?t=1962&language=english
    THANKS
    MRUTYUN

  • Problem passing a value to a loop through a method?

    I am simply trying to design a program that will offer a pop up menu and prompt the user to enter a digit 1-4. If the user enters a 1,2, or 3 I want the menu to pop up again. If the user enters a 4, I want the program to end.
    I have created stubs for a few of these methods. However, I want to have a working version of the menu method.
    When I run the program the program executes the start_program method stub and then the menu method executes and up pops the menu. However, when I type in a number, the menu disappears never to return...Unless I type in "4" and then the menu pops up again and upon typing "4" again, the program exits.
    I am not sure if I have a poorly constructed loop or if I am improperly returning the value of the variable "number" back to the main method. Here is my code...I appreciate any and all help. Thanks,Ed
    package YMCA;
    import javax.swing.JOptionPane;
    public class YMCA {
    * This is the first phase of our YMCA interface. This phase utilizes a menu and various methods.
    public static void main(String[] args) {
    int number;
    //call start_program method
    start_program();
    //call menu method
    number = menu();
    //while loop to process user number input
    while (number != 4);
    {if (number == 1)
    //call modify_member method
    modify_member();
    else if (number == 2)
    //call modify_registration method
    modify_registration();
    else if (number == 3)
    // call report method
    report();
    //in case of error
    else
    System.out.println("Enter a valid selection");
    //send control back to menu method
    menu();
    //call exit_program method
    exit_program();
    System.exit(0);
    //start_program method
    public static void start_program(){
    System.out.println ("The program has begun");
    //menu method
    public static int menu(){
    String menuOutput, snumber;
    int number;
    menuOutput = "Moon Area YMCA \n" +
    "\n" +
    "1. Add/Modify Member Information \n" +
    "2. Add/Modify Class Registrations \n" +
    "3. Report Section \n" +
    "4. Exit the System \n" +
    "\n" +
    "Please Make Your Selection> \n";
    snumber = JOptionPane.showInputDialog(null, menuOutput);
    //convert string to integer
    number = Integer.parseInt(snumber);
    return number;}
    //modify_member method
    public static void modify_member(){
    System.out.println("Member Information method has been executed.");
    //modify_registration method
    public static void modify_registration(){
    System.out.println("The class registrations method has been executed.");
    //report method
    public static void report(){
    System.out.println("The report method has been executed");
    //exit_program method
    public static void exit_program(){
    System.out.println("The exit program has been executed");
    }

    hi
    here is your working program
    import javax.swing.JOptionPane;
    public class YMCA {
    * This is the first phase of our YMCA interface. This phase utilizes a menu and various methods.
    public static void main(String[] args) {
    int number;
    //call start_program method
    start_program();
    //call menu method
    number = menu();
    //while loop to process user number input
    while (number != 4)
    {if (number == 1)
    //call modify_member method
    modify_member();
    else if (number == 2)
    //call modify_registration method
    modify_registration();
    else if (number == 3)
    // call report method
    report();
    //in case of error
    else
    System.out.println("Enter a valid selection");
    //send control back to menu method
    menu();
    //call exit_program method
    exit_program();
    System.exit(0);
    //start_program method
    public static void start_program(){
    System.out.println ("The program has begun");
    //menu method
    public static int menu(){
    String menuOutput, snumber;
    int number;
    menuOutput = "Moon Area YMCA \n" +
    "\n" +
    "1. Add/Modify Member Information \n" +
    "2. Add/Modify Class Registrations \n" +
    "3. Report Section \n" +
    "4. Exit the System \n" +
    "\n" +
    "Please Make Your Selection> \n";
    snumber = JOptionPane.showInputDialog(null, menuOutput);
    //convert string to integer
    number = Integer.parseInt(snumber);
    return number;}
    //modify_member method
    public static void modify_member(){
    System.out.println("Member Information method has been executed.");
    //modify_registration method
    public static void modify_registration(){
    System.out.println("The class registrations method has been executed.");
    //report method
    public static void report(){
    System.out.println("The report method has been executed");
    //exit_program method
    public static void exit_program(){
    System.out.println("The exit program has been executed");
    }

  • Create an object with the name passed in as a string argument to a method

    Hi,
    I am sorry if it's too trivial for this forum , but I am stuck with the following requirements.
    I have a method
    void abc(String object_name, String key, String value)
    method abc should first check if there exists in memory a hashmap object with the name passed in as argument object_name.
    If yes ..just put the key and value there.
    if not , then create the hashmap object called <object_name> and insert the key/value there.
    Can anybody help me in the first step i.e, how to check if an object exists with the name passed in and if not then create it.
    Will getInstance method be of any help?
    Thanks in advance for your response.
    -Sub-java

    Dear Cotton.m,
    Thanks for your suggesstion. I will remember that.
    But somehow I have a strong belief that you still need to consult dictionary for exact meaning of the words like "upset" , "frustration" etc. Not knowing something in a language , that too as a beginner, does not yield frustration, but increases curiosity. And people like petes1234 are there to diminish that appetite.
    To clarify above, let me compare jverd's reply to my doubt with petes1234's.
    jverd said it cannot be done and suggested a work around (It was perfect and worked for me) While petes1234 , having no work in hand probably, started analysis of newbies mistakes.
    jverd solved my problem by saying that it cannot be done. petes1234 acted as a worthless critic in my opinion and now joined cotton.m.
    Finally, this is a java forum and I do not want to discuss human characteristics here for sure.
    My apologies if I had a wrong concept or if I chose a wrong forum to ask, where people like petes1234 or Cotton.m show their geekdom by pointing out "shortfalls" rather than clearing that by perfect examples and words.
    Again take it easy and Cotton.m , please do not use this forum to figure out others' frustration but be a little more focussed on solving others "Java related" problems :)
    -Sub-java

  • Passing null in ArrayList as part of EJB Method gives NullPointerException

    Hi gurus,
    I have many EJBS in my application. All are working fine but when I pass null as element of ArrayList (serializable object) and pass ArrayList object to SessionBean it gives me NullPointerException. I think as part of EJB Specification it allows the Serialized object as part of method call but I think Oracle9iAS 903 has this as an error.
    e.g
         ArrayList mylist = new ArrayList();
         mylist.add("lar");
         mylist.add("%");
         mylist.add(new Long(0));
         mylist.add("%");
         mylist.add(new Long(0));
         mylist.add("");
         mylist.add("%");
         mylist.add("Y");
         mylist.add(null);
         mylist.add(new Long(0));
    Object obj= ictx.lookup("java:comp/env/sampleEJB");
    SampleEJBHome home =(SampleEJBHome)PortableRemoteObject.narrow(obj,SampleEJBHome.class);
    SampleEJB sampleEJB = home.create();
    ArrayList retList =sampleEJB.test(mylist);
    I think this is error in Oracle 903 IAS. Let me know If I am doing anything wrong here.
    Thanks
    Ritesh

    I checked the bug status for you. It looks like one of our support analysts has tested the patch for the bug I mentioned to see if it resolves the similar problem you have and determined that it doesn't fix the problem you are facing. The bug you mention is still open and pending some further analysis by our bug fixing team.
    The bug text isn't a 100% match what you have entered here in the forum, so it might be still worth your while to get the patch for bug 2753425 from support and test it in an isolated environment to see if it does resolve your problem. I'd recommend that you talk to your support analyst and discuss this with them.
    cheers
    -steve-

  • Pass object to xslt stylesheet and invoke its methods

    I'd like to pass an external created object to a xslt stylesheet to dynamically modify the xslt file at run time. After searching around for weeks, I'm really desperate.
    I used Xalan transformer's method setParameter(name, obj) to initialize a variable in xslt file with this object. Then the object's method was invoked.
    The class that I want to invoke the method:
    class test{
    private String testString = "abc";
    public String valueOf(){
    return testString;
    xslt file:
    <xsl:param name="myType"></xsl:param>
    <<xsl:variable name="new-pop"
    select="my-class:valueOf($myType)">
    Any help is greatly appreciated.
    Thank you.
    Message was edited by:
    Orbital
    Message was edited by:
    Orbital

    Thank sabre. I have looked through your link.
    The problem is for all the info I knew, we can only
    create a new object inside the stylesheet using new()
    and then invoke this particular object's instance
    method.
    However, I want to pass an already created java
    object into the stylesheet and then invoke its
    method.
    Xalan seems to not allow this. I have tried to pass
    an object as the parameter of
    transformer.setParameter(name, object) but it doesn't
    work.
    Any one know what 3rd party transformer that allow to
    pass object directly into xslt?setParameter will work... in your XSL, you should have
    <xsl:param name="myParam" />set the parameter in your transformer like what you had in your post...
    In your XSL header, you must declare the your Java object namespace and path, such as:
    xml:myJavaObject= "com.MyCompany.MyJavaObject"then in your template or anywhere that you want to use your object, you should have:
    <xsl:variable name="runningMyMethod" select="myJavaObject:myJavaMethod($myParam)" />The XSL will treat $myParam as the instance object, if there is any other method parameters needed to be passed in do:
    <xsl:variable name="runningMyMethod" select="myJavaObject:myJavaMethod($myParam, 'blah', 'blah')" />Good luck.

  • Not able to pass cyclic XML schema type to a webservice method

    I have a webservice method called getData(GetDataDocument
    gDoc).
    I constructed a request with object (which exactly satisfy
    the XML schema def) to call up the getData(). [From my java client
    also I did the same; but the java classes have been generated using
    apache's xmlBeans; this works fine with the same kind of request].
    But the soap request constructed from flex does not get
    generated with all the values that I set in the request object.
    On further observation, I found out that if the schema
    involves cyclic elements, the soap request is not getting
    constructed as desired.
    My schema def:
    <complexType name="PredicateBagType">
    <sequence>
    <choice>
    <element maxOccurs="unbounded" minOccurs="0"
    name="PredicateBag" type="tns:PredicateBagType"/>
    <element maxOccurs="unbounded" minOccurs="0"
    name="BinaryPredicate" type="tns:BinaryPredicateType"/>
    <element maxOccurs="unbounded" minOccurs="0"
    name="UnaryPredicate" type="tns:UnaryPredicateType"/>
    </choice>
    </sequence>
    <attribute name="contextNode"
    type="tns:contextNodeIDType"/>
    <attribute default="false" name="negate"
    type="boolean"/>
    <attribute name="type"
    type="tns:PredicateBagTypeType"/>
    </complexType>
    Note that the PredicateBagType may contain another
    PredicateBagType.
    I have constructed my request with objects in my flex
    application . Though I have set the BinaryPredicate object in my
    PredicateBag object, the soap request constructed looks like this
    which is not desired
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="
    http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="
    http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="
    http://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Body>
    <tns:get_Data maxPrograms="0" personalInfoUse="false"
    xmlns:tns="urn:tva:transport:2005">
    <tns:QueryConstraints>
    <tns:PredicateBag contextNode="1" negate="false"
    type="AND"/>
    </tns:QueryConstraints>
    <tns:RequestedTables>
    <tns:Table type="ProgramInformationTable"/>
    </tns:RequestedTables>
    </tns:get_Data>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>.
    If I comment out the PredicateBagType choice in my xsd, the
    flex application constructs the soap request looks like this.
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="
    http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="
    http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="
    http://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Body>
    <tns:get_Data maxPrograms="0" personalInfoUse="false"
    xmlns:tns="urn:tva:transport:2005">
    <tns:QueryConstraints>
    <tns:PredicateBag contextNode="ProgramInformation"
    negate="false" type="AND">
    <tns:BinaryPredicate fieldID="Genre" fieldValue="Fiction"
    test="contains"/>
    </tns:PredicateBag>
    </tns:QueryConstraints>
    <tns:RequestedTables>
    <tns:Table type="ProgramInformationTable"/>
    </tns:RequestedTables>
    </tns:get_Data>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    This request holds good. But I cannot comment out the
    PredicateBagType from my choice. Is this an issue with soap request
    construction issue in Flex..?

    Yes, <choice> is just "partial" supported in Flex 2 .
    read this
    link
    for partial and not supported tags
    Partially supported XML Schema structures
    The following XML Schema structures or structure attributes
    are only partially implemented in this release:
    <choice>
    <all>
    <union>
    regards
    kcell

Maybe you are looking for

  • Shuffle loading problem

    can anyone help me? i tunes and my shuffle were working fine up until today, but now when i try to load music from i tunes onto my shuffle it comes up with a message saying "cannot read or write to disk" has anybody got an answer to this????????? I h

  • How to turn on opening iTunes after connecting iPhone

    Hello. I've unchecked "Open iTunes after connecting iPhone"... But how i can check it back? I don't see iPhone in iTunes.

  • Posting invoices without a GR or SES

    I have the requirement to be able to do the above. On Creation of the invoice a workflow will then trigger notifying the relevant people of what information is required for the successful releasing of the invoice block. We have this working fine for

  • Deployment order in 6.0

    I'm sure this has been covered before but is there anyway to dictate the deployment order of EJB's contained in a single EAR file? Or does WL use some default scheme - alphanumeric sorting, order in the applications.xml file?? Thanks Tom

  • Help! I can't update Flash Player or Reader

    After I click yes to the question, "Do you want to allow this program to make changes on your computer" it brings up a blank black box which just sits there forever and never does anything else. When I try to close the box by clicking on the red box