Language Specification Question

I am in the process of developing a Java language extension and have encountered a bizarre syntax question. Please consider the following code:
public class Example
    public static void main(String[] arg) throws Exception
        Bar<String> bar = new Bar<String>(new Foo<String>(){
            public String makeT() {
                return "hi";
class Bar<T> implements Foo<T>
    public Bar(Foo<T> maker) {
        this.maker = maker;
    Foo<T> maker;
    public T makeT()
        return maker.makeT();
    public void foo()
        class T {};
        T t = makeT();
interface Foo<T>
    T makeT();
}The point of this large and cumbersome example is to ensure that 1. I have a type and a type parameter which conflict, 2. the type parameter does not take prececdence, and 3. that I can instantiate an instance of the type parameter. My question is this: is there any syntax which would allow me, inside of the Bar.foo method, to create a reference of the type parameter[t] type rather than the local class type?
I know that this is a convoluted example, but it comes as a result of the metaprogramming environment my team is trying to develop. If there is no such syntax, this will not be a problem; we just need to know definitively one way or the other and consulting the community seemed to be a good heuristic before I dive into the language spec.

The point of this large and cumbersome example is to ensure that 1. I have a type and a type parameter which conflict, 2. the type parameter does not take prececdence, and 3. that I can instantiate an instance of the type parameter. My question is this: is there any syntax which would allow me, inside of the Bar.foo method, to create a reference of the type parameter type rather than the local class type?
Do you mean other than by calling makeT() or maker.makeT()? It's hard to see how, given that the values of type parameters are not accessible in run-time. In particular there is no way to call any constructor that the value of T might have.
If you change the definition of Bar to be basically a decorator for Class<T> then you can create instances of T using reflection:
class Baz<T> implements Foo<T> {
    Class<T> clazz;
    public Baz(Class<T> c) {
     clazz = c;
    public T makeT() {
     try {
         return clazz.newInstance();
     } catch (Exception e) {
         throw new RuntimeException(e);
}

Similar Messages

  • How do I surface language specific texts in Integrated ITS?

    Hello all,
    I'm new to both stand alone and integrated ITS and am researching the upgrade process. In our stand alone templates we used htrc files with our html templates to show language specific texts.
    Example.
    html template code for a field label
    `if (i==2) DETAIL-FLABEL[2]= #KAFN end`
    htrc name value pair
    z_pz01_en.htrc
    KAFN     Known As First Name
    z_pz01_de.htrc
    KAFN     Bekannt unter dem Vornamen
    I see no hint that htrc's can be used in integrated and am not seeing anything in the way of resource based language texts in integrated. I think I've hit every document out there yet, I have a feeling I'm missing something obvious. Your help is appreciated.
    Doug

    Edgar,
    Thanks so much for the detail!
    I have run through the steps for manual creation of translations as well as SIAC_UPLOAD of htrc files and have it working and documented. I will add a few more findings here for others who find this post later.
    Some of our old htrc files had duplicate keys (probably from original German version). In stand alone ITS the last key in the file was used so this didn't matter. In integrated ITS this matters for 2 reasons.
    1 Uploading/Converting htrc files having logged in in English will cause failures if any of the text being entered in the service parameters has characters that arent consistent with the codepage being used for EN. (Ex. back Azureück). Clean up htrc files to use only the language they should contain.
    2 Stand alone ITS was forgiving of htrc files containing duplicate keys. Integrated ITS is not. Remove all duplicate keys.
    3. This one is obvious but... if  parameters have already been entered in another language you may be prompted to confirm you are changing language and there are several prompts along the way. As these prompts will appear in the logon language itu2019s important to eitheru2026
    a. Be fluent in all supported languages , oru2026
    b. Memorize button and menu positions.
    I do have one additional question.
    Our old stand alone setup had an alternate corporate "APCI" design that we used...
    File system view -
    hostDEV_WWWmimesdesigns"apci"webgui as opposed to the out of box
    hostDEV_WWWmimesdesignssap_streamlinewebgui I suppose.
    I believe this was then referenced in the global services file ~DESIGN="APCI"
    I'm starting research to understand if there is an analog to this in the integrated webgui service or precisely what I have to do to accomplish alternate styles for webgui and our Z_services.
    Thanks again, points on the way, If I could award more I would.
    Doug

  • Language specific entries

    Hi
    Example in Vendor master for a particular field is maintained other language entries...it should be displayed at table level right ?
    Example: se16 -> LFA1-ACTSS = all should language entries should be listed ?
    Rgds
    MM

    ACTSS is Social Security Number,
    what does this field have to do with language specific entries?
    Can you elaborate your question? maybe give an example

  • Language specific settings for ESS/MSS

    Hello Experts,
    I got a question on language specific settings on the portal:
    1) Suppose i have configured my ESS/MSS BP  and my settings are in English language. Now when i logged in to the portal and click, it is opened in English language only, but when i click on Leave Request page, this particular page is opened in some other language (i mean other than English), so what might be the problem and where are the settings needs to be done if i encounter these kind of errors.
    Cheers
    Vijay

    Hi Vijay
    There are so many things that could affect language here is the ones I am aware of
    1) IE locale
    2) JCO language setting
    3) Forced Language in Iview itself
    4) Missing translations in the translation cycle
    5) Java Dictionary bugs see 1082994
    6) WD JAVA runtime bugs see 1265969
    Best wishes
    Stuart

  • Java Language Specification error reports

    Well, I wanted to report a typo in The Java Language Specification, Third Edition (http://java.sun.com/docs/books/jls/download/langspec-3.0.pdf), so from http://java.sun.com/docs/books/jls/ I clicked on the "feedback form" link (which points at http://developers.sun.com/contact/feedback.jsp?&category=doc&mailsubject=Java%20Language%20Specification%20Feedback). This was redirected to http://www.oracle.com/technetwork/community/join/overview/index.html which offers no such feedback form. Consider this sort-of-broken link as the first problem I'm reporting.
    The second problem is in the aforementioned pdf, section 4.8 (Raw Types), page 58, where on can read:
    "The type of the member(s) of Inner depends on the type parameter of Outer. If Outer is raw, Inner must be treated as raw as well, as their is no valid binding for T."
    This should be instead:
    "The type of the member(s) of Inner depends on the type parameter of Outer. If Outer is raw, Inner must be treated as raw as well, as there is no valid binding for T."
    I think a forum category should be created for just this: error reports about the documentation (pdfs, APIs, support web pages).
    Edited by: Urhixidur on 2011-09-08 09:23

    Your intentions are admirable, but you are probably wasting your time. This is a forum for Java development related questions and 99.5% of the visitors are not related to Oracle at all. most likely nothing will be done with your information.
    I think a forum category should be created for just this: error reports about the documentation (pdfs, APIs, support web pages).It is a good idea actually, but such a thing would need very tight moderation and then there is still the question of how to arrange that something is actually done with the reports.

  • Issue with language specific characters combined with AD-Logon to BO platform and client tools

    We are using SSO via Win AD to logon to BO-Launchpad. Generally this is working which means for Launch Pad no manual log on is needed. But  this is not working for users which have language specific letters in their AD name (e.g. öäüéèê...).
    What we have tried up to now:
    If the AD-User name is Test-BÖ the log on is working with the user name Test-BO with logon type AD
    If the logon Type "SAP" is used than it is possible to use the name Test-BÖ as the username
    Generally it is no problem in AD to use language specific letters (which means it is possible to e.g. log on to Windows with the user Test-BÖ)
    It is possible to read out the AD attributes from BO side and add them to the user. Which means in the user attributes the AD name Test-BÖ is shown via automatic import from AD. So it's not the problem that the character does not reach BO.
    I have opened a ticket concerning that. SAP 1th level support is telling me that this is not a BO problem. They say it is a problem of Tomcat. I don't believe that because the log on with authentification type SAP is working.
    I have set up the same combination (AD User Test-BÖ with SAP User Test-BÖ) as a single sign on authentification in SAP BW and there it is working without problems.
    Which leads me to the conlusion: It is not a problem of AD. It is something which is connected to the BO platform but only combined with logon type AD because SAP Logon is working with language specific characters.

    I have found this article with BO support:
    You cannot add a user name or an object name that only differs by a character with a diacritic mark
    Basically this means AD stores the country specific letters as a base letter internally. Which means that if you have created a user with a country specific letter in the name you can also logon with the Base letter to Windows.
    SAP-GUI and Windows are maybe replacing the country specific letters by the base letter. Due to that SSO is working. BO seems not to be able to do that. Up to now the supporter from BO is telling me that this is not a BO problem.
    Seems to be magic that the colleagues of SAP-GUI are able to to it.

  • 508- Document Properties - Disabled ..."All of the text on this page lacks a language specification"

    Hi,
    When i try to do 508 check. I got the following error message
    "All of the text on this page lacks a language specification'
    I checked "FILE=>Document Properties". All "Document Properties" are disabled. 
    We are using Adobe LiveCycle Designer ES2 to create this dynamic for and save it as static PDF file.
    Still, we have same issue. I am not sure, how to change or setup the language in adobe livecycle designer es2.
    thank you,

    Ah, I don't know that. "Tables" is a collection, not a simple array, and some careless experimentation shows that you cannot simply use .concat to paste them together.
    I'm pretty sure I've seen a couple of workarounds for a situation like this. Perhaps it's time to read "[CS3][JS] everyItem() and getElements()" -- i.e. Marc Autret's blog posts about this, at the end of that thread.
    That is, if you stick to using everyItem()! Perhaps it's easier to build an array "the old fashioned way". This code is based on my earlier assumption you had textframes-in-textframes, but you can rewrite it to cater for groups as well:
    t = app.layoutWindows[0].activePage.textFrames.everyItem().tables;
    tableList = [];
    for (i=0; i<t.length; i++)
      tableList.push (t[i]);
    t = app.layoutWindows[0].activePage.textFrames.everyItem().textFrames.everyItem().tables;
    for (i=0; i<t.length; i++)
      tableList.push (t[i]);
    alert (tableList.length);

  • Problem with language specific letters in Translation Builder editor

    Hello,
    I'm trying to translate some reports from Slovenian to Croatian using OTB, but as soon as I scroll up or down through translation form some Croatian language specific letters (čćžšđ) either convert to c (čć) or d (đ) or become "unreadable" (šž). The latest (šž) are displayed correctly on the report when strings are exported back to RDF file.
    According Troubleshooting section in OTB help I tried to change both base and translation font but with no success.
    Any experience, any hint or trick?
    Thanks in advance.
    Dev6i patch10
    RDBMS=Oracle10g
    WinXPsp2
    NLS_LANG=CROATIAN_CROATIA.EE8MSWIN1250

    Naveen,
    This is more of a portal problem.
    First, you should submit an OSS message to get the <b>best support possible</b> from SAP.
    Second, if you don't like that solution, THEN come back and post it on SDN. You will get better answers in the Enterprise Portal forum here on SDN.
    Regards,
    Greg

  • Language specific template is not working

    Hi all,
    I have converted AR invoice report to xml. which has a standard template and language specifis tempalte.
    while running in development instance i use to select the language specific template using the options button in SRS. it works fine.
    but same thing when i try to do ti in QAT, it is not working it is picking the language specific template. even though when i manually select the language specific template while submitting but the standard template is assigned.
    Please help me to solve this isssue.
    Thanks
    Rajesh

    Thanks Rajesh for posting the solution you found. I ran into the same problem then went into the concurrent program definition for the invoice and removed the MLS Function and now when I choose a different language template it works.
    Thanks,
    Ken

  • Accessibility - Language Specification

    Using Adobe Life Cycle Designer how do you add a language specification for forms? It is important to specific a language for accessibility reasons. We know how to do that in Adobe 7 but not in designer. In the past we have has problems editing forms in Adobe that were created in Designer. Anyone know this answer?

    Every form has a locale, set on the "form1" subform. You can change the form's locale by going to "File | Form Properties... | Defaults" and changing the "Default Form Locale" dropdown. (Note that this menu option is only available when you have a form open.)
    Every object on the form will, by default, have the same locale as the form. If you want an object to have a different locale than that of the form, select the object on canvas, and go to the Object Inspector's Field palette. At the bottom of the palette (you may have to resize if to see this) there's a "Locale" dropdown. This sets the locale of the selected object.
    If the selected object is a subform, then all the objects in that subform will inherit the locale of the subform (instead of the locale of the form).
    Stephanie Legault
    Software Developer
    Adobe Systems

  • Need Help on Language specific URL's

    Hi,
    Im creating URL iview.In that iview i need to provide different HTML links for each language.I've referred the document(http://help.sap.com/saphelp_nw04/helpdata/en/44/aabd5c7e8e0a47e10000000a1553f7/frameset.htm).As per the step 2 mentioned in the above link,I could not found the "Language-specific URL's mode".Can anybody faced the situation?..Pls help me to get rid of this..
    Regards,
    Murugan a

    Here is the answer.  It is available in SP 18.
    See <a href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/ep/~form/handler">SAP Note 961793</a>

  • Specific question on seek

    Ok here is a specific question unlike my previous one.
    If i store records with a fixed record length something like :
    RandomAccessFile file = new RandomAccessFile("example.txt","rw");
               long pos = inputLong("Type the record number for saving the data:");I am using the "pos" to give my record a location. Thus searching for a record i would use something like
    file.seek(50*pos);My question is, here to locate a record i must know its pos number before hand, is it possible to locate a record with letters instead of a number?

    I believe by pos he means "index" or "recordnumber" (i.e. each "record" is 50 bytes long, fixed-width and pos is really which of these records/items he wishes to retrieve).
    As far as locating them with letters, that depends. If you simply wish to find a record that contains specific letters, then you will have to read each record and then check if it contains those letters. If, on the other hand, each record has a "key" (i.e. the first two letters of each record must be unique) then you can read through the entire file when you initially access it and create a hashmap containing these keys and there "position" or "index". Then, when the user says give me AZ, you simply retrieve the "index" from the hashmap and read the corresponding record.
    Edit: That example I gave you in your ":( Help" thread does exactly this second option.

  • HR-ABAP Language specific

    Hi Experts,
    I have created a custom infotype. Now I need to make it language specific as such, If logged in French language the lables and error messages should be in french and I created with English and should be applicable for both French and English as well.
    Regards,
    Srik

    Hi,
    The blank screen is ok...
    Now use the menu (example) -> Translation -> Short texts -> Screen painter -> Screen painter texts
    Enter the programname (should be something like MP999900 and the screen number) and translate the texts.
    Do this for all the objects you need translated.
    Regards

  • Language Specific query

    Hi Experts,
    I extended (Project LOV)VO extension as per client requirement. But after done, when I click on Project LOV  , the 'Project Name' display data in different language. But its previously showing English language. For this purpose I have to do changes anywhere or any specific settings. Can anyone please suggest me. Your helps valuable.
    Thanks,
    Prasad

    Hi Prasad ,
    I honesty have no idea  why did it display result in different language after the VO substitution ,but let's investigate . Could you check this and confim running your query from database .
    By any change have used any where condition using ICX language specific in your extended VO query .
    Regards ,
    Keerthi

  • Language specific pop up

    hi all,
    i am sorry as  i havnt tried enough to search the solution in forum .. but can anyone let me know how to create a language-specific pop-up  in BSP ?

    Hi Shal,
    you can use the Online Text Repository to support language specific text fields in BSP.
    Look here http://help.sap.com/saphelp_nw04/helpdata/en/93/bccd3a00746f4ae10000000a11402f/frameset.htm
    Cheers
    Graham Robbo

Maybe you are looking for

  • How can i create a new and tableless database using database configuration

    How can i create a new and tableless database using database configuration

  • IPod classic (160gb) not recognized by computer

    I have a 7th gen 160gb iPod classic which isn't recognized by my computer. I recently replaced the hard drive and battery and it seemed to go off without a hitch. After I put the front plate back on the screen lit up and everything was working. I con

  • 2.1 + 2.0 = a perfectly normal 4.1?

    I wanted to know if I buy one 2.1 and one 2.0 (the rear) and make a 4.1 system with it, would it sound the same as a normal 4. When playing music with this 4.1 system (w/ CMSS) the rear speaker was a lower quality copy of the front speaker, is it nor

  • Archiving old mail - as mail is running very slow

    Can someone please give me some guidance as to how to archive my older emails in Mail? I have to keep a copy of everything but some of my inbox's have 20,000+ emails in them and this is making Mail run very slow. I would love to be able to select for

  • Problems saving results of Headstart Utilities

    I've problems with two utilities concerning journalling: 1. Maintain journal tables HSU_CJNT Revision 6.5.0.4 This package does not want to save the changes made to the journal tables in the repository. The error is CDA-01305: Column: UID 1 uniquenes