How to return package name?

for example, I have a program Bank.java
package MyBank;
public class Bank {
What should I write in the program if I want the program to return me the package name?
Thanks!

> How if I need to return it statically?
for example I need to return in in the
public static void main method.
so that I cannot use
this.getClass.getPackage.toString( );
Thanks
Then you should make an instance of your class in that static method:
package test;
public class Test {
  public Test() {
  public static void main(String[] args) {
    System.out.println((new Test()).getClass().getPackage().toString());
}

Similar Messages

  • How to find package name of transactioncode

    hai friends,
            how i can find the package name for a given transaction code .
    i think by using se93
    Moderator message: please search for available information.
    Edited by: Thomas Zloch on Jul 8, 2011 9:52 AM

    Not sure, if this is what you're looking for
    SQL> create or replace procedure p0 as
      2  begin
      3    dbms_output.put_line(dbms_utility.format_call_stack);
      4  end;
      5  /
    Procedure created.
    SQL> create or replace procedure p1 as
      2  begin
      3    p0;
      4  end;
      5  /
    Procedure created.
    SQL> create or replace procedure p2 as
      2  begin
      3    p1;
      4  end;
      5  /
    Procedure created.
    SQL> set serveroutput on
    SQL> begin
      2    p2;
      3  end;
      4  /
    ----- PL/SQL Call Stack -----
      object      line  object
      handle    number  name
    3a7f2d618         3  procedure INV_ADM.P0
    39abfeef0         3  procedure INV_ADM.P1
    39c5ae7a0         3  procedure INV_ADM.P2
    3a0f3a538         2  anonymous block
    PL/SQL procedure successfully completed.
    SQL>

  • How to return the name (or ID) of the Task FLow in Script

    Sitaution; two task flows created which can be accessed via Tools > TaskFlows within FDQM
    Task Flow "1.1 Multi Load - Import" --> Should run Batch Process Up to Import (enmBatchProcessLevel: 2)
    Task Flow "2.1 Multi Load - Import Up To Validate" --> Should run Batch Process Up to Validate (enmBatchProcessLevel: 4)
    I have developed one generic script which I would like to use for each task flow.
    Only the enmBatchProcessLevel differs between the task flows and therefore I would like to parse this enmBatchProcessLevel as a parameter my generic script.
    To be able to do this, the script needs to know on which task flow a user has clicked. So, I am looking for a function or statement which returns the name (or ID) of the task flow. Based on this name (or ID) a conditional statement can be performed in which a variable is dynamically filled. This variable can then be parsed as a parameter to my generic script.
    For instance:
    Sub GenericRoutine
         Dim strTaskFlow
         Dim intBatchProcessLevel
         '--Get the Task Flow Name
         strTaskFlow = ......<How to return the TaskFlow name or ID?>
         '--Validate the task flow and fill variable intBatchProcessLevel dynamically
         Select Case strTaskFlow
              Case "1.1 Multi Load - Import"
                   intBatchProcessLevel = 2
              Case "2.1 Multi Load - Import Up To Validate"
                   intBatchProcessLevel = 4
         End Select
         '--Execute generic script
         '--Call Batch script and parse intBatchProcessLevel as a parameter:
         Call sBatchProcess(intBatchProcessLevel)
         '--Execute generic script
    End Sub
    Sub sBatchProcess(Byval intBatchProcessLevel)
         Dim lngProcessLevel
         Dim strDelimiter
         Dim blnAutoMapCorrect
         '--Use intBatchProcessLevel to fill lngProcessLevel
         lngProcessLevel = intBatchProcessLevel
         strDelimiter = "_"
         blnAutoMapCorrect = 0
         Set BATCHENG.PcolFiles = BATCHENG.fFileCollectionCreate(CStr(strDelimiter))
         BATCHENG.mFileCollectionProcess BATCHENG.PcolFiles, CLng(lngProcessLevel), , CBool(blnAutoMapCorrect)
    End Sub
    Edited by: user13642656 on Jul 21, 2011 4:55 AM

    Hi, thanks for your reply.
    The Generic script contains 600+ records, which I would like to maintain once, when having multiple Task Flows for Import, UpToValidate, ValidateOnly, UpToExport, ExportOnly etc.
    Is there a central storage in FDQM workbench for script, like a "Module" in Excel VisualBasic environment? Thanks!

  • [SOLVED]How to search package name only when using yaourt

    I often install a AUR package by yaourt term, but it does not only search terms in package name but also package description, since there are so much packages in AUR, it produce many pages of items, and it can not support more to page one screenful at a time, It
    become difficult to get the right choice,
    Thank you in advance!
    Last edited by netawater (2013-06-14 00:47:06)

    Hey, that's one thing I actually know how to do with regexes! All package descriptions have some spaces at their beginning, the package names themselves have not, so you can just use inverted grepping like so:
    $ pacman -Ss test | grep -v '^ '
    core/perl 5.10.1-5 (base)
    extra/fprint_demo 0.4-2 (fprint)
    extra/ghc 6.12.1-2
    extra/haskell-hunit 1.2.2.1-1
    extra/haskell-quickcheck 2.1.0.3-1
    extra/junit 4.7-1
    extra/kdesdk-kpartloader 4.4.0-1 (kde kdesdk)
    extra/libxtst 1.1.0-1
    extra/memtest86+ 4.00-1
    extra/mono-tools 2.6.1-1
    extra/openoffice-base 3.2.0-1
    extra/openoffice-base-beta 3.2.0_ooo320_m12-1
    extra/perl-test-pod 1.41-1
    extra/python-nose 0.11.1-1
    extra/qemu-kvm 0.12.2-1
    extra/testdisk 6.11.3-2
    extra/unarj 2.63a-2
    extra/xbill 2.1-6
    xyne-any/reflector 5.0-2
    community/buildbot 0.7.11p3-1
    community/cppunit 1.12.1-1
    community/cxxtest 3.10.1-3
    community/dsniff 2.4b1-15
    community/gtk-aurora-engine 1.5.1-1
    community/gtkperf 0.40-3
    community/java-jdom 1.1.1-1
    community/lib32-libxtst 1.1.0-1 (lib32)
    community/perl-test-base 0.59-1
    community/perl-test-deep 0.106-1
    community/perl-test-differences 0.500-1
    community/perl-test-exception 0.29-1
    community/perl-test-manifest 1.23-1
    community/perl-test-mockobject 1.09-1
    community/perl-test-nowarnings 1.01-1
    community/perl-test-tester 0.107-1
    community/perl-test-warn 0.21-2
    community/phoronix-test-suite 2.4.0-1
    community/pmtools 20100123-1
    community/reflector 5.0-2
    community/stress 1.0.0-2
    community/typespeed 0.6.5-2
    arch-games/mangler-snapshot 1.1.20100116-3
    arch-games/ultimatestunts 0.7.5.1-1
    This still shows the repos and the versions (nothing cut wouldn't be able to handle though). It works fine with pacman as you just saw, I can't guarantee for yaourt as I don't have it installed.
    Edit: Hm… I just realized that this still displays the results where 'test' only occured in the package description. Give me some time to figure this out.
    Edit 2: Another grep for 'test' would solve it:
    $ pacman -Ss test | grep -v '^ ' | grep test
    extra/memtest86+ 4.00-1
    extra/perl-test-pod 1.41-1
    extra/testdisk 6.11.3-2
    community/cxxtest 3.10.1-3
    community/perl-test-base 0.59-1
    community/perl-test-deep 0.106-1
    community/perl-test-differences 0.500-1
    community/perl-test-exception 0.29-1
    community/perl-test-manifest 1.23-1
    community/perl-test-mockobject 1.09-1
    community/perl-test-nowarnings 1.01-1
    community/perl-test-tester 0.107-1
    community/perl-test-warn 0.21-2
    community/phoronix-test-suite 2.4.0-1
    arch-games/ultimatestunts 0.7.5.1-1
    Still, it's not that pretty to write the same thing twice. If you really want to do it like this, I suggest you make it a function in your ~/.${SHELL}rc.
    Last edited by Runiq (2010-02-27 08:36:11)

  • How to omit package names?

    Hello all,
    I'm new to javadoc and trying to format my classes sames as the
    sdk doc. The problem is that in the sdk doc on top of the page
    the tree shows the classes with package names, and in the
    parameter lists etc. the package names, e.g. for "String",
    are not shown. How can I do this? I want to get exactly the
    same documentation format as the sdk doc.
    With -noqualifier I can not do what I want. I only can get all
    classes full qualified or no class at all.
    Thanks in advance.
    bye
    Marcus

    We have also addressed this problem in DocFlextor for Javadoc v1.1
    by introducing two new template parameters:
    (1) Omit package qualifiers started with
    (2) Omit all package qualifiers
    You may use freeware DocFlextor Doclet:
    http://www.filigris.com/downloads/
    or look at the whole thing:
    http://www.filigris.com/products/docflextor_for_javadoc/
    -- Leonid Rudy

  • [SOLVED] packer -Ss return package names

    Hey everybody,
    I am writing a a little script which automatizes some of my arch-setup..
    Hence I want to provide this script to some of my friends it should me mostly automated.
    Therefore the script needs capable of installing possible drivers just by getting a hint passed.
    So here is the Question:
    Is it possible to let packer return the exact package names when using the -Ss option?
    Exact name of the package means just the package name without any information.
    Example:
    I want to install the drivers for a Epson printer and my only Information is "SX525WD. A normal search with packer looks like this:
    $ sudo packer -Ss SX525WD
    aur/epson-inkjet-printer-workforce-635-nx625-series 1.0.1-6
    Epson printer driver (ME Office 82WD, 85ND, 900WD, 960FWD / Stylus NX625, SX525WD, SX620FW,
    TX560WD / Stylus Office B42WD, BX525WD, BX625FWD, TX620FWD / WorkForce T42WD, 60, 625, 630,
    633, 635)
    But I would rather like a result like this:
    $ sudo packer -Ss SX525WD
    epson-inkjet-printer-workforce-635-nx625-series
    Is there a possible solution?
    Thank you very much!
    Jakunar
    Last edited by jakunar (2011-12-08 06:50:49)

    I doubt there's a way to do it with packer itself, but it looks like something that shouldn't be very hard to do with regular expressions
    EDIT: I don't know what you're writing the script in, but you could use regular expressions to identify the / in the output and then track until the space and that would give you the package name
    Last edited by kyla (2011-12-08 05:11:09)

  • How to create "package name" for transport request

    Hi experts
    I am trying to create transport request for infopackage/data source/dtp etc...
    but system is asking package name in object directory entery.
    Could you pl. share the information step by step, how to create the "package name"
    Thanks in advance and you can get valuble points pl.
    Chandu

    Hi,
    Go to transaction SE21 and give the package name as ZAPO or any thing starts with Z.
    click on create button.
    give a short description
    in the Package properties block- allowed object types list box - select No restrictions.
    in the transport attributes block- specify the transport layer
    give software component as HOME
    select the check box for changes recorded.
    save the package.
    or
    Go to SE80
    select package from the list box
    give your package name and hit enter button
    the popup asks you for input.
    give the appropriate values and press create button.
    Note: You should be registered as a developer in the system where you are creating the package.
    Hope this solves your problem, Good luck
    Srini

  • How to know package name in plsql

    Hi experts,
    I want to find out all packages' name within one database, is there any views or tables which contains these information? just like user_tables
    regards
    Owen

    If you want to obtain all packages names at the database level you are required privileges, otherwise you will only be able to see the USER_OBJECTS and ALL_OBJECTS. All dba packages is listed at the DBA_OBJECTS:
    select object_name
    from dba_objects
    where object_type='PACKAGE';Required role: select_catalog_role
    This should be granted from an administrator (ask your dba).
    ~ Madrid

  • How to Get Package Name While Running

    Hi
    i want to load Package Name to Table.
    So any idea about ODI Ref Function to get Package Name.

    Hi Nagarjuna,
    You can get package name by doing following steps, as per my knowledge, scenario name and package name both are same in ODI (while creating scenario for package).
    by the time you can retrieve scenario name as package name using below select query with selecting Work Repository schema in ODI variable
    QUERY:
    select SESS_NAME
    from <%=snpRef.getObjectName("L","SNP_SESSION","D")%>
    where SESS_NO = <%=snpRef.getSession("SESS_NO")%>
    Steps:
    1) create a project variable as Get_Package_Name and Data type as Alphanumeric, in Refreshing tab, type above select query and select work repository schema in schema (eg: create WorkRep logical schema in topology manager)
    2) Add Get_Package_Name variable with refresh in package (before interface step)
    3) Generate Scenario for package with same package name with version 001
    When you execute the scenario you can retrieve the package name in Get_Package_Name odi variaable
    Hope this may helps you
    Regards,
    phanikanth

  • How to control package names in packagemaker 3?

    I'm setting up a distribution package (in Tiger I used the older meta-packages to be able to install on Panther) in Packagemaker 3, and I don't seem to have any control over the component package names. ie:
    Make a new distribution package, Tiger-compatible, organization "com.whatever".
    Drag a framework "Foo.framework" from my staging area into the Contents pane. It names the new Choice "Foo", with contents named "Foo". My Foo framework has identifier "com.whatever.foo-framework" but it fills in the package identifier as "com.whatever.fooFramework.foo.pkg", so I correct that to be the same as the framework identifier.
    I can change the Choice name - I enter "Foo Framework". But there is no way to change the contents name - it seems to be tied to the framework's base name. And so is the installer package name:
    Now, when I build the installer package, inside the foo metapackage is the foo installer package, named "foo.pkg". And this is the one that the receipt is named from, BUT I want the receipt to be "foo-framework.pkg".

    You might want to consider starting a new discussion. Since this one is marked solved, less people are likely to look at it. You can link to this one.
    Send Apple feedback. They won't answer, but at least will know there is a problem. If enough people send feedback, it may get the problem solved sooner.
    Feedback

  • How to create package name  what is the transaction code for creation

    Hi,
    I want to create the package and also put that package in my program, how to put the package already saved program.

    Hello Rajyalakshmi
    You do not put a package to or into a program but <b>ASSIGN </b>a report to a package. To reassign a report to a new package (e.g. from $TMP to z-package) call transaction SE80 and right-click on the report name in the tree display. Choose the following function in the context menu:
    Other Functions -> Change Package Assignment
    Regards
      Uwe

  • How to return column name in some table?

    Hi All,
    I know :system.cursor_value which returns the value of the current text item in the form.
    But Is there a way to return the column name and its value in some table?
    Note: I'm using Oracle DB 10g
    Thank you

    Did you read the original post? [...] You don't understand what I want and you don't say antthing useful for my goal!
    This is the SQL and PL/SQL forum. You need the Mind-Readers' forum down the hall.
    First you asked "Is there a way to return the column name and its value in some table?", and were told you can get the former from the data dictionary (you can get the latter from the table itself).
    Then you say you "want to create a trigger on a table", which tells us nothing about your problem.
    Finally you say "but suppose the table contains 50 columns then I have to write 50 columns names three times", which is essentially true - but the process can be automated. What you (probably) need to do is write queries based on the data dictionary tables that generates the PL/SQL that you ultimately put in your triggger - you then use that output to build the trigger(s).
    I don't think there's any way, at run time, to generically fish out all the columns of a table with their :new and :old values - you have to write (or auto-generate) specific code for each table.

  • How to Return List of Packages from Pacman/Yaourt Search

    ----EDIT----
    Changed the name of the script from pacsearch to pacdot.
    Apparently yaourt -Ssaq does this, so this script isn't as necessary as I thought. Although, I still find using pacdot -w to open the results in a text document helpful.
    ----/EDIT----
    This isn't a question; it's a script I wrote. I thought someone else might find this useful.
    I keep finding myself searching with pacman or yaourt and wishing I could get just the package names, not all of the extra stuff. For example, I'd love to be able to run yaourt -Sa $(yaourt -Ssa package). It doesn't seem like pacman and yaourt have an option for this (not that I can tell, at least), so I wrote a python script to do it. Copy it if you'd like. You can name it what you want, but I'll refer to it as pacdot.py.
    pacdot.py package will be like yaourt -Ssa package but only list the package names.
    I added a few extra options:
    pacdot.py -o package will only list results from the official Arch repositories, not the AUR.
    pacdot.py -i package will install all the found packages. If you've ever thought about running something like yaourt -Sa $(yaourt -Ssa package), that's what this command does.
    pacdot.py -w package will:
    Create a file called 'the-package-you-searched.txt',
    Write an example command that would install the found packages,
    (yaourt -Sa all-of-the-results),
    Write each result on a new line, and
    Open the file for you (with your default text editor).
    Here's the code:
    #!/bin/python3
    import argparse
    import re
    from subprocess import Popen, PIPE, call
    from collections import deque
    desc = ''.join(('Search the official Arch and AUR databases ',
    'and return package names only. ',
    'e.g.: `pacdot.py arch` will return "arch", ',
    'whereas `$ yaourt -Ssa arch` will return ',
    '"community/arch 1.3.5-10',
    ' A modern and remarkable revision control system."'
    parser = argparse.ArgumentParser(description=desc)
    parser.add_argument('package',
    help='Package to search with pacman')
    parser.add_argument('-o', '--official', action='store_true',
    help='Search official repositories only, not the AUR')
    parser.add_argument('-i', '--install', action='store_true',
    help='Install found packages')
    parser.add_argument('-w', '--write', action='store_true',
    help='Write to file')
    #Set args strings.
    args = parser.parse_args()
    pkg = args.package
    official_only = args.official
    install = args.install
    write = args.write
    # Do yaourt search.
    package_search = Popen(['yaourt', '-Ssa', '%s' % pkg], stdout=PIPE).communicate()
    # Put each found package into a list.
    package_titles_descs = str(package_search[0]).split('\\n')
    # Strip off the packages descriptions.
    package_titles = [package_titles_descs[i]
    for i in range(0, len(package_titles_descs), 2)]
    # Remove empty item in list.
    del(package_titles[-1])
    # Make a separate list of the non-aur packages.
    package_titles_official = deque(package_titles)
    [package_titles_official.remove(p)
    for p in package_titles if p.startswith('aur')]
    # Strip off extra stuff like repository names and version numbers.
    packages_all = [re.sub('([^/]+)/([^\s]+) (.*)',
    r'\2', str(p))
    for p in package_titles]
    packages_official = [re.sub('([^/]+)/([^\s]+) (.*)',
    r'\2', str(p))
    for p in package_titles_official]
    # Mark the aur packages.
    # (Not needed, just in case you want to modify this script.)
    #packages_aur = packages_all[len(packages_official):]
    # Set target packages to 'all' or 'official repos only'
    # based on argparse arguments.
    if official_only:
    packages = packages_official
    else:
    packages = packages_all
    # Print the good stuff.
    for p in packages:
    print(p)
    if write:
    # Write results to file.
    filename = ''.join((pkg, '.txt'))
    with open(filename, 'a') as f:
    print(''.join(('Yaourt search for "', pkg, '"\n')), file=f)
    print('To install:', file=f)
    packages_string = ' '.join(packages)
    print(' '.join(('yaourt -Sa', packages_string)), file=f)
    print('\nPackage list:', file=f)
    for p in packages:
    print(p, file=f)
    # Open file.
    call(('xdg-open', filename))
    if install:
    # Install packages with yaourt.
    for p in packages:
    print(''.join(('\n\033[1;32m==> ', '\033[1;37m', p,
    '\033[0m')))
    Popen(['yaourt', '-Sa', '%s' % p]).communicate()
    Last edited by GreenRaccoon23 (2014-12-22 19:17:37)

    expac works only with official and unofficial repos, not with the AUR, but it's very nice.
    Adding  '-q' should help, grep to weed out false positives.
    yaourt -Sa $(yaourt -Ssaq pulse)
    works, but
    $ yaourt -Sa $(yaourt -Ssaq chrome)
    resolving dependencies...
    looking for inter-conflicts...
    warning: removing 'chromium' from target list because it conflicts with 'chromium-no-sse2'
    error: unresolvable package conflicts detected
    error: failed to prepare transaction (conflicting dependencies)
    :: chromium-no-sse2 and chromium-scroll-pixelGs are in conflict
    so at least
    $ yaourt -Sa $(yaourt -Ssaq chrome|grep google)
    is needed.
    Edit: Also:
    $ LC_ALL=C TZ=GMT0 diff -Naur /usr/bin/pacsearch /usr/local/bin/pacsearch
    --- /usr/bin/pacsearch 2014-11-21 11:20:37.000000000 +0000
    +++ /usr/local/bin/pacsearch 2014-12-21 08:21:14.758856006 +0000
    @@ -84,7 +84,7 @@
    my %allpkgs = ();
    -my $syncout = `pacman -Ss '@ARGV'`;
    +my $syncout = `pacman -Ssq '@ARGV'`;
    # split each sync search entry into its own array entry
    my @syncpkgs = split(/\n^(?=\w)/m, $syncout);
    # remove the extra \n from the last desc entry
    @@ -110,7 +110,7 @@
    $allpkgs{$pkgfields[1]} = [ @pkgfields ];
    -my $queryout = `pacman -Qs '@ARGV'`;
    +my $queryout = `pacman -Qqs '@ARGV'`;
    # split each querysearch entry into its own array entry
    my @querypkgs = split(/\n^(?=\w)/m, $queryout);
    # remove the extra \n from the last desc entry
    $ /usr/local/bin/pacsearch pulse
    libpulse
    pulseaudio
    libao
    libcanberra-pulse
    libpulse
    paprefs
    pavucontrol
    pulseaudio
    pulseaudio-alsa
    floyd
    libcec
    mate-media-pulseaudio
    mate-settings-daemon-pulseaudio
    ponymix
    projectm-pulseaudio
    Although why not simply use pacman or expac?
    Last edited by karol (2014-12-21 08:26:48)

  • How to find proc/func name from package name and line number?

    Hi,
    We are using the pl/sql call stack dump (dbms_utility.format_call_stack) for some debugging purposes. But in the case of a package body execution, the dump does not return the name of the procedure/function that is being executed, but only the name of the package and the line number being executed. So, we have a requirement wherein we need to extract the type and name of a package subunit from the package name and line number.
    e.g.
    From the information package 'A', line number 739
    we should be able to deduce that line 739 is a part of *'function A.f'*
    Does the oracle database provide any native mechanism (PL/SQL packages or otherwise) to support such functionality? If it does not, how can we achieve the desired result?
    Thanks in advance,
    Shashank

    The approach we are currently planning to take up is this :
    1. Write PL/SQL code to parse the entire source (user_source) and build a database table with a structure like this :
    PACKAGE_NAME | UNIT_TYPE | UNIT_NAME | START_LINE | END_LINE
    =============================================
    A | PROCEDURE | P1 | 20 | 345
    A | FUNCTION | F1 | 347 | 629
    etc..
    2. Start PL/SQL package execution.
    3. Keep dumping call stack snapshots whenever a custom debug procedure is called.
    4. Dump the package name and line number to a log file.
    5. Using the package name and line number, query the table built in step 1 and build the final report which shows the control flow in a readable form.
    What we want is to get rid of step 5 and by some means get the logic to extract the unit type and name in step 4 itself.
    Keep them coming..
    Thanks and regards,
    Shashank

  • How to enter a returnable packaging material during inbound delivery?

    Hi,
    How do you add a returnable packaging material from vendor as a line item in the inbound delivery? When I try to add a LEIH type material as a line item in the inbound delivery (VL32N), the following error is displayed:
    "No item category exists (Table T184L EL VERP  ELP)"
    Thanking you in advance,
    Sreelakshmi

    HI.
    Please reffer the below link.
    ERROR : No item category exists (Table T184L LB VERP  )
    Error while creating I/B delivery: No item category exists (Table T184L EL)
    1) EL = is the delivery type you are using for Returns to Vendors
    2) VERP = is the Item Category Group in the material master of
    3) ELP= Item Usage
    You have to add the missing configuration as follow:
    IMGLogistics ExecutionShippingDeliveriesDefine Item Category
    Determination in Deliveries(Transaction 0184).
    Create a new entry or copy from an existing one for VERP. NOTE: The Delivery Item Category RLLN is the standard defined by SAP, be
    sure you enter the one defined in you company.
    Thanking you

Maybe you are looking for