IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Collection et Stream Java Discussion :

java util List


Sujet :

Collection et Stream Java

  1. #1
    Invité
    Invité(e)
    Par défaut java util List
    Hi,

    Que fait c bout de script? et pourqoi ça me souligne java.util.List en rouge?

    Merci
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    java.util.List<Bapitrvrec> receipts_1 = new ArrayList<Bapitrvrec>();
    	//	Instantiate the instances of receipts
     	int MAX_RECEIPTS = 3;
     	for ( int i = 0; i < MAX_RECEIPTS; i++ )
     	{
     		receipts_1.add(
     			new Bapitrvrec(
     				travelExpenseModelModel
     				)
     		);
     	}
    Dernière modification par Invité ; 29/10/2008 à 00h28.

  2. #2
    Membre chevronné
    Avatar de Deadpool
    Homme Profil pro
    Inscrit en
    Novembre 2005
    Messages
    1 312
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations forums :
    Inscription : Novembre 2005
    Messages : 1 312
    Points : 2 011
    Points
    2 011
    Par défaut
    Difficile de le dire, y'a pas tout le code là.

    Tout ce que je peux te dire, c'est que y'a une boucle qui créé 3 instances de la classe Bapitrvrec (que je connais pas) et ça les ajoute dans une liste receipts_1 (pas terrible les noms de variables au passage).

    Pour le coup du souligné en rouge, si tu pouvais donner l'erreur exacte ce serait mieux.

  3. #3
    Membre régulier Avatar de spoklo
    Profil pro
    Inscrit en
    Octobre 2008
    Messages
    67
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2008
    Messages : 67
    Points : 76
    Points
    76
    Par défaut
    Citation Envoyé par AlAA Voir le message
    Hi,
    pourqoi ça me souligne java.util.List en rouge?
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    java.util.List<Bapitrvrec> receipts_1 = new ArrayList<Bapitrvrec>();
    Bonjour,

    List et ArrayList se trouve dans le même package. Donc c pas normal qu'il trouve un et pas l'autre ! (ton ArrayList c'est bien un java.util.ArrayList ?)

    j'ai déjà eu ça ceci avec l'IDE eclipse, c'était un bug eclipse, en nettoyant le projet et en redémarrant ça a résolu le problème. j'espère que ca va t'aider.

    une autre piste, essaye de compiler ta classe en ligne de commande. si ça compile le problème vient de l'IDE sinon c'est le JDK (réinstalle le)

  4. #4
    Membre du Club
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    60
    Détails du profil
    Informations personnelles :
    Localisation : Maroc

    Informations forums :
    Inscription : Juin 2007
    Messages : 60
    Points : 64
    Points
    64
    Par défaut
    ça souligne avec quelle couleur ?

    peut etre que ce n est qu'un warning (jaune) et là tu fait un code plus propre, les "imports" ...

    racourci : ctrl+shift+o ça devra te régler l'affaire.

  5. #5
    Invité
    Invité(e)
    Par défaut
    Citation Envoyé par Deadpool Voir le message
    si tu pouvais donner l'erreur exacte ce serait mieux.
    Invalid expression as statement
    Citation Envoyé par spoklo
    une autre piste, essaye de compiler ta classe en ligne de commande.
    plus clairement?

  6. #6
    Expert éminent sénior
    Avatar de adiGuba
    Homme Profil pro
    Développeur Java/Web
    Inscrit en
    Avril 2002
    Messages
    13 938
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Java/Web
    Secteur : Transports

    Informations forums :
    Inscription : Avril 2002
    Messages : 13 938
    Points : 23 190
    Points
    23 190
    Billets dans le blog
    1
    Par défaut
    Salut,

    Citation Envoyé par AlAA Voir le message
    Invalid expression as statement
    L'erreur doit surement venir du code précédent celui que tu nous as montré...

    Vérifies que ta classe soit bien formée, et poste le code complet le cas échéant...

    a++

  7. #7
    Invité
    Invité(e)
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    import com.sap.demo.comp260x.comp260comp.wdp.IPrivateCOMP260XComp;
    import com.sap.demo.comp260x.travelexpensemodel.Bapi_Trip_Create_From_Data_Input;
    import com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException;
    import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
    import com.sap.demo.comp260x.travelexpensemodel.Bapitrvrec;
    Le dernier import, c là ou j'appelle ma classe qui fonctionne (normalement)
    Donc je ne sais pas si c'est un problème de version. Si quelqu'un peut me proposer un script qui fait la même chose mais d'une autre façon.
    A moins qu'il faut un autre import pour le "java.util.List"?

  8. #8
    Membre régulier Avatar de spoklo
    Profil pro
    Inscrit en
    Octobre 2008
    Messages
    67
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2008
    Messages : 67
    Points : 76
    Points
    76
    Par défaut
    Citation Envoyé par AlAA Voir le message
    Invalid expression as statement
    plus clairement?
    ouvre un fenêtre dos (cmd), tu tape : javac MaClasse

  9. #9
    Invité
    Invité(e)
    Par défaut
    Bonjour everybody,

    Sinon une autre proposition...


  10. #10
    Membre chevronné
    Avatar de Deadpool
    Homme Profil pro
    Inscrit en
    Novembre 2005
    Messages
    1 312
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations forums :
    Inscription : Novembre 2005
    Messages : 1 312
    Points : 2 011
    Points
    2 011
    Par défaut
    Citation Envoyé par adiGuba Voir le message
    Vérifies que ta classe soit bien formée, et poste le code complet le cas échéant...

    a++

  11. #11
    Invité
    Invité(e)
    Par défaut
    voilà la classe concernée :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    // ---------------------------------------------------------------------------
    // This file has been generated partially by the Web Dynpro Code Generator.
    // MODIFY CODE ONLY IN SECTIONS ENCLOSED BY @@begin AND @@end.
    // ALL OTHER CHANGES WILL BE LOST IF THE FILE IS REGENERATED.
    // ---------------------------------------------------------------------------
    package com.sap.demo.comp260x.travelexpensemodel;
     
    // 
    // IMPORTANT NOTE: 
    // _ALL_ IMPORT STATEMENTS MUST BE PLACED IN THE FOLLOWING SECTION ENCLOSED
    // BY @@begin imports AND @@end. FURTHERMORE, THIS SECTION MUST ALWAYS CONTAIN
    // AT LEAST ONE IMPORT STATEMENT (E.G. THAT FOR java.lang.String).
    // OTHERWISE, USING THE ECLIPSE FUNCTION "Organize Imports" FOLLOWED BY
    // A WEB DYNPRO CODE GENERATION (E.G. PROJECT BUILD) WILL RESULT IN THE LOSS
    // OF IMPORT STATEMENTS.
    //
    //@@begin imports
    import java.lang.String;
    //@@end
     
    //@@begin documentation
    /**
     * Title:        Web Dynpro Version 6.30
     * Description:  "Bapitrvrec" RFC Adapter ModelClass implementation
     * Copyright:    Copyright (c) 2001 - 2002. All rights reserved.
     * Company:      SAP AG
     * @author       File created by Web Dynpro code generator
     */
    //@@end
     
    public class Bapitrvrec extends com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClass implements java.io.Serializable
    {
      /** Logging location. */
      private static final com.sap.tc.logging.Location logger = com.sap.tc.logging.Location.getLocation(Bapitrvrec.class);
      static {
        //@@begin id
        String id = "$Id$";
        //@@end
        com.sap.tc.logging.Location.getLocation("ID.com.sap.tc.webdynpro").infoT(id);
      }
     
      private static final long serialVersionUID = 858420244L ;
      private static final com.sap.aii.proxy.framework.core.GenerationInfo staticGenerationInfo = new com.sap.aii.proxy.framework.core.GenerationInfo("2.0", 1057090423493L) ;
     
      private static final Class _associatedModelClazz = com.sap.demo.comp260x.travelexpensemodel.TravelExpenseModel.class;
      private static final com.sap.tc.webdynpro.progmodel.model.api.WDModelScopeType DEFAULT_SCOPE =
        com.sap.demo.comp260x.travelexpensemodel.TravelExpenseModel.DEFAULT_MODELSCOPE;
     
      /**  Simple Constructor  */
      public Bapitrvrec () {
        super( descriptor( com.sap.tc.webdynpro.modelimpl.dynamicrfc.RFCMetadataRepository.getSingleton(com.sap.demo.comp260x.travelexpensemodel.TravelExpenseModel.DEFAULT_RFCMETADATA_SYSTEMNAME),
                           com.sap.demo.comp260x.travelexpensemodel.TravelExpenseModel.wdGetStaticMetadataCache().getBaseTypeDescriptorMap(),
                           Bapitrvrec.class,
                           "BAPITRVREC",
                           PROXYTYPE_STRUCTURE, 
                           "Bapitrvrec", 
                           "com.sap.demo.comp260x.travelexpensemodel" ), 
                staticGenerationInfo);
      }
     
      /** Constructor for specific scope
       *  use this Constructor, if this instance should belong to a model instance
       *  of a different scope than the default model scope.
       *  The default model scope can be found in com.sap.demo.comp260x.travelexpensemodel.TravelExpenseModel.DEFAULT_MODELSCOPE
       * 
       *  @param scope the WDModelScopeType representing in which scope this instance is to be maintained
       */
      public Bapitrvrec (com.sap.tc.webdynpro.progmodel.model.api.WDModelScopeType scope) {
        this();
        maintainInScope(scope);
      }
     
      /** Constructor for specific modelInstanceId
       *  use this Constructor, if this instance should belong to a different model instance
       *  than the default model instance.
       *  The default modelInstance has no id (null). 
       * 
       *  @param modelInstanceId a String representing the model instance this modelClass instance should belong to
       */
      public Bapitrvrec (String modelInstanceId) {
        this();
        maintainInInstanceId(modelInstanceId);
      }
     
      /** Constructor for specific scope and modelInstanceId
       *  use this Constructor, of this instance should belong to a differnt scope
       *  and a different model instance than the default model scope and model instance.
       *  The default model scope can be found in com.sap.demo.comp260x.travelexpensemodel.TravelExpenseModel.DEFAULT_MODELSCOPE
       *  The default modelInstance has no id (null). 
       * 
       *  @param scope the WDModelScopeType representing in which scope this instance is to be maintained
       *  @param modelInstanceId a String representing the model instance this modelClass instance should belong to
       */
      public Bapitrvrec (com.sap.tc.webdynpro.progmodel.model.api.WDModelScopeType scope, String modelInstanceId) {
        this();
        maintainInScopeAndInstanceId(scope, modelInstanceId);
      }
     
      /** Constructor for specific model Instance
       *  use this Constructor, if this instance should belong to a specific instance
       *  of the model com.sap.demo.comp260x.travelexpensemodel.TravelExpenseModel 
       *  passed as a parameter to this constructor.
       * 
       *  @param modelInstance the DynamicRFCModel referring to the modelInstance
       */
      public Bapitrvrec ( com.sap.demo.comp260x.travelexpensemodel.TravelExpenseModel modelInstance) {
        this();
        maintainInModel(modelInstance);
      }
     
      /**
       * Returns the modelInstance associated with this ModelClass 
       */
      public TravelExpenseModel modelInstance() {
        return (TravelExpenseModel)associatedModel();
      }
     
      protected com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModel.MetadataCache wdGetMetadataCache() {
        return com.sap.demo.comp260x.travelexpensemodel.TravelExpenseModel.wdGetStaticMetadataCache();	
      }
      protected Class _associatedModelClazz() {
        return _associatedModelClazz;
      }
      protected com.sap.tc.webdynpro.progmodel.model.api.WDModelScopeType _defaultScope(){
        return DEFAULT_SCOPE;
      }
     
      /* ***************************************************************************
       *  ModelAttribute -> Exp_Type
       * **************************************************************************/
      /** getter for ModelAttribute -> Exp_Type 
       *  @return value of ModelAttribute Exp_Type */
      public java.lang.String getExp_Type() {
        return super.getAttributeValueAsString("Exp_Type");
      }
     
      /** setter for ModelAttribute -> Exp_Type 
       *  @param value new value for ModelAttribute Exp_Type */
      public void setExp_Type(java.lang.String value) {
        super.setAttributeValueAsString("Exp_Type", value);
      }
     
      /* ***************************************************************************
       *  ModelAttribute -> Key_Stop
       * **************************************************************************/
      /** getter for ModelAttribute -> Key_Stop 
       *  @return value of ModelAttribute Key_Stop */
      public java.lang.String getKey_Stop() {
        return super.getAttributeValueAsString("Key_Stop");
      }
     
      /** setter for ModelAttribute -> Key_Stop 
       *  @param value new value for ModelAttribute Key_Stop */
      public void setKey_Stop(java.lang.String value) {
        super.setAttributeValueAsString("Key_Stop", value);
      }
     
      /* ***************************************************************************
       *  ModelAttribute -> Paper_Receipt
       * **************************************************************************/
      /** getter for ModelAttribute -> Paper_Receipt 
       *  @return value of ModelAttribute Paper_Receipt */
      public boolean getPaper_Receipt() {
        return super.getAttributeValueAsBoolean("Paper_Receipt");
      }
     
      /** setter for ModelAttribute -> Paper_Receipt 
       *  @param value new value for ModelAttribute Paper_Receipt */
      public void setPaper_Receipt(boolean value) {
        super.setAttributeValueAsBoolean("Paper_Receipt", value);
      }
     
      /* ***************************************************************************
       *  ModelAttribute -> Rec_Amount
       * **************************************************************************/
      /** getter for ModelAttribute -> Rec_Amount 
       *  @return value of ModelAttribute Rec_Amount */
      public java.math.BigDecimal getRec_Amount() {
        return super.getAttributeValueAsBigDecimal("Rec_Amount");
      }
     
      /** setter for ModelAttribute -> Rec_Amount 
       *  @param value new value for ModelAttribute Rec_Amount */
      public void setRec_Amount(java.math.BigDecimal value) {
        super.setAttributeValueAsBigDecimal("Rec_Amount", value);
      }
     
      /* ***************************************************************************
       *  ModelAttribute -> Rec_Curr
       * **************************************************************************/
      /** getter for ModelAttribute -> Rec_Curr 
       *  @return value of ModelAttribute Rec_Curr */
      public java.lang.String getRec_Curr() {
        return super.getAttributeValueAsString("Rec_Curr");
      }
     
      /** setter for ModelAttribute -> Rec_Curr 
       *  @param value new value for ModelAttribute Rec_Curr */
      public void setRec_Curr(java.lang.String value) {
        super.setAttributeValueAsString("Rec_Curr", value);
      }
     
      /* ***************************************************************************
       *  ModelAttribute -> Rec_Date
       * **************************************************************************/
      /** getter for ModelAttribute -> Rec_Date 
       *  @return value of ModelAttribute Rec_Date */
      public java.sql.Date getRec_Date() {
        return super.getAttributeValueAsDate("Rec_Date");
      }
     
      /** setter for ModelAttribute -> Rec_Date 
       *  @param value new value for ModelAttribute Rec_Date */
      public void setRec_Date(java.sql.Date value) {
        super.setAttributeValueAsDate("Rec_Date", value);
      }
     
      /* ***************************************************************************
       *  ModelAttribute -> Rec_Paycurr
       * **************************************************************************/
      /** getter for ModelAttribute -> Rec_Paycurr 
       *  @return value of ModelAttribute Rec_Paycurr */
      public java.lang.String getRec_Paycurr() {
        return super.getAttributeValueAsString("Rec_Paycurr");
      }
     
      /** setter for ModelAttribute -> Rec_Paycurr 
       *  @param value new value for ModelAttribute Rec_Paycurr */
      public void setRec_Paycurr(java.lang.String value) {
        super.setAttributeValueAsString("Rec_Paycurr", value);
      }
     
      /* ***************************************************************************
       *  ModelAttribute -> Rec_Rate
       * **************************************************************************/
      /** getter for ModelAttribute -> Rec_Rate 
       *  @return value of ModelAttribute Rec_Rate */
      public java.math.BigDecimal getRec_Rate() {
        return super.getAttributeValueAsBigDecimal("Rec_Rate");
      }
     
      /** setter for ModelAttribute -> Rec_Rate 
       *  @param value new value for ModelAttribute Rec_Rate */
      public void setRec_Rate(java.math.BigDecimal value) {
        super.setAttributeValueAsBigDecimal("Rec_Rate", value);
      }
     
      /* ***************************************************************************
       *  ModelAttribute -> Rec_Rate_Cm
       * **************************************************************************/
      /** getter for ModelAttribute -> Rec_Rate_Cm 
       *  @return value of ModelAttribute Rec_Rate_Cm */
      public java.math.BigDecimal getRec_Rate_Cm() {
        return super.getAttributeValueAsBigDecimal("Rec_Rate_Cm");
      }
     
      /** setter for ModelAttribute -> Rec_Rate_Cm 
       *  @param value new value for ModelAttribute Rec_Rate_Cm */
      public void setRec_Rate_Cm(java.math.BigDecimal value) {
        super.setAttributeValueAsBigDecimal("Rec_Rate_Cm", value);
      }
     
      /* ***************************************************************************
       *  ModelAttribute -> Rec_Refnr
       * **************************************************************************/
      /** getter for ModelAttribute -> Rec_Refnr 
       *  @return value of ModelAttribute Rec_Refnr */
      public java.lang.String getRec_Refnr() {
        return super.getAttributeValueAsString("Rec_Refnr");
      }
     
      /** setter for ModelAttribute -> Rec_Refnr 
       *  @param value new value for ModelAttribute Rec_Refnr */
      public void setRec_Refnr(java.lang.String value) {
        super.setAttributeValueAsString("Rec_Refnr", value);
      }
     
      /* ***************************************************************************
       *  ModelAttribute -> Receipt_Ok
       * **************************************************************************/
      /** getter for ModelAttribute -> Receipt_Ok 
       *  @return value of ModelAttribute Receipt_Ok */
      public boolean getReceipt_Ok() {
        return super.getAttributeValueAsBoolean("Receipt_Ok");
      }
     
      /** setter for ModelAttribute -> Receipt_Ok 
       *  @param value new value for ModelAttribute Receipt_Ok */
      public void setReceipt_Ok(boolean value) {
        super.setAttributeValueAsBoolean("Receipt_Ok", value);
      }
     
      /* ***************************************************************************
       *  ModelAttribute -> Receiptno
       * **************************************************************************/
      /** getter for ModelAttribute -> Receiptno 
       *  @return value of ModelAttribute Receiptno */
      public java.lang.String getReceiptno() {
        return super.getAttributeValueAsString("Receiptno");
      }
     
      /** setter for ModelAttribute -> Receiptno 
       *  @param value new value for ModelAttribute Receiptno */
      public void setReceiptno(java.lang.String value) {
        super.setAttributeValueAsString("Receiptno", value);
      }
     
      /* ***************************************************************************
       *  ModelAttribute -> Share_Perc
       * **************************************************************************/
      /** getter for ModelAttribute -> Share_Perc 
       *  @return value of ModelAttribute Share_Perc */
      public java.lang.String getShare_Perc() {
        return super.getAttributeValueAsString("Share_Perc");
      }
     
      /** setter for ModelAttribute -> Share_Perc 
       *  @param value new value for ModelAttribute Share_Perc */
      public void setShare_Perc(java.lang.String value) {
        super.setAttributeValueAsString("Share_Perc", value);
      }
     
      /* ***************************************************************************
       *  ModelAttribute -> Shorttxt
       * **************************************************************************/
      /** getter for ModelAttribute -> Shorttxt 
       *  @return value of ModelAttribute Shorttxt */
      public java.lang.String getShorttxt() {
        return super.getAttributeValueAsString("Shorttxt");
      }
     
      /** setter for ModelAttribute -> Shorttxt 
       *  @param value new value for ModelAttribute Shorttxt */
      public void setShorttxt(java.lang.String value) {
        super.setAttributeValueAsString("Shorttxt", value);
      }
     
      /* ***************************************************************************
       *  ModelAttribute -> Tax_Code
       * **************************************************************************/
      /** getter for ModelAttribute -> Tax_Code 
       *  @return value of ModelAttribute Tax_Code */
      public java.lang.String getTax_Code() {
        return super.getAttributeValueAsString("Tax_Code");
      }
     
      /** setter for ModelAttribute -> Tax_Code 
       *  @param value new value for ModelAttribute Tax_Code */
      public void setTax_Code(java.lang.String value) {
        super.setAttributeValueAsString("Tax_Code", value);
      }
     
      /*
       * The following code section can be used for any Java code that is 
       * not to be visible to other controllers/views or that contains constructs
       * currently not supported directly by Web Dynpro (such as inner classes or
       * member variables etc.). </p>
       *
       * Note: The content of this section is in no way managed/controlled
       * by the Web Dynpro Designtime or the Web Dynpro Runtime. 
       */
      //@@begin others
      //@@end
     
      public static class Bapitrvrec_List extends com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCList implements java.io.Serializable , java.util.List   {
     
        protected Class _associatedModelClazz() { return _associatedModelClazz; }
    	protected com.sap.tc.webdynpro.progmodel.model.api.WDModelScopeType _defaultScope(){ return DEFAULT_SCOPE; }
     
        private static final long serialVersionUID = 60422512L ;
     
        public Bapitrvrec_List () {
          super(createElementProperties(com.sap.demo.comp260x.travelexpensemodel.Bapitrvrec.class, new com.sap.demo.comp260x.travelexpensemodel.Bapitrvrec() ));
        }
     
        /** Constructor for specific scope
         *  use this Constructor, if this List should belong to a model instance
         *  of a different scope than the default model scope.
         *  The default model scope can be found in com.sap.demo.comp260x.travelexpensemodel.TravelExpenseModel.DEFAULT_MODELSCOPE
         * 
         *  @param scope the WDModelScopeType representing in which scope this List is to be maintained
         */
        public Bapitrvrec_List (com.sap.tc.webdynpro.progmodel.model.api.WDModelScopeType scope) {
          this();
          maintainInScope(scope);
        }
     
        /** Constructor for specific modelInstanceId
         *  use this Constructor, if this List should belong to a different model instance
         *  than the default model instance.
         *  The default modelInstance has no id (null). 
         * 
         *  @param modelInstanceId a String representing the model instance this List should belong to
         */
        public Bapitrvrec_List (String modelInstanceId) {
          this();
          maintainInInstanceId(modelInstanceId);
        }
     
        /** Constructor for specific scope and modelInstanceId
         *  use this Constructor, of this List should belong to a differnt scope
         *  and a different model instance than the default model scope and model instance.
         *  The default model scope can be found in com.sap.demo.comp260x.travelexpensemodel.TravelExpenseModel.DEFAULT_MODELSCOPE
         *  The default modelInstance has no id (null). 
         * 
         *  @param scope the WDModelScopeType representing in which scope this List is to be maintained
         *  @param modelInstanceId a String representing the model instance this List should belong to
         */
        public Bapitrvrec_List (com.sap.tc.webdynpro.progmodel.model.api.WDModelScopeType scope, String modelInstanceId) {
          this();
          maintainInScopeAndInstanceId(scope, modelInstanceId);
        }
     
        /** Constructor for specific model Instance
         *  use this Constructor, if this instance should belong to a specific instance
         *  of the model com.sap.demo.comp260x.travelexpensemodel.TravelExpenseModel 
         *  passed as a parameter to this constructor.
         * 
         *  @param modelInstance the DynamicRFCModel referring to the modelInstance
         */
        public Bapitrvrec_List ( com.sap.demo.comp260x.travelexpensemodel.TravelExpenseModel modelInstance) {
          this();
          maintainInModel(modelInstance);
        }
     
        public com.sap.demo.comp260x.travelexpensemodel.Bapitrvrec[] toArrayBapitrvrec() {
          return (com.sap.demo.comp260x.travelexpensemodel.Bapitrvrec[])super.toArray(new com.sap.demo.comp260x.travelexpensemodel.Bapitrvrec[] {});
        }
     
        public int lastIndexOfBapitrvrec(com.sap.demo.comp260x.travelexpensemodel.Bapitrvrec item) {
          return super.lastIndexOf(item);
        }
     
        public int indexOfBapitrvrec(com.sap.demo.comp260x.travelexpensemodel.Bapitrvrec item) {
          return super.indexOf(item);
        }
     
        public Bapitrvrec_List subListBapitrvrec(int fromIndex, int toIndex) {
          return (Bapitrvrec_List)super.subList(fromIndex, toIndex);
        }
     
        public void addAllBapitrvrec(Bapitrvrec_List item) {
          super.addAll(item);
        }
     
        public void addBapitrvrec(com.sap.demo.comp260x.travelexpensemodel.Bapitrvrec item) {
          super.add(item);
        }
     
        public boolean removeBapitrvrec(com.sap.demo.comp260x.travelexpensemodel.Bapitrvrec item) {
          return super.remove(item);
        }
     
        public com.sap.demo.comp260x.travelexpensemodel.Bapitrvrec getBapitrvrec(int index) {
          return (com.sap.demo.comp260x.travelexpensemodel.Bapitrvrec)super.get(index);
        }
     
        public boolean containsAllBapitrvrec(Bapitrvrec_List item) {
          return super.containsAll(item);
        }
     
        public void addBapitrvrec(int index, com.sap.demo.comp260x.travelexpensemodel.Bapitrvrec item) {
          super.add(index, item);
        }
     
        public boolean containsBapitrvrec(com.sap.demo.comp260x.travelexpensemodel.Bapitrvrec item) {
          return super.contains(item);
        }
     
        public void addAllBapitrvrec(int index, Bapitrvrec_List item) {
          super.addAll(index, item);
        }
     
        public com.sap.demo.comp260x.travelexpensemodel.Bapitrvrec setBapitrvrec(int index, com.sap.demo.comp260x.travelexpensemodel.Bapitrvrec item) {
          return (com.sap.demo.comp260x.travelexpensemodel.Bapitrvrec)super.set(index, item);
        }
     
        public com.sap.demo.comp260x.travelexpensemodel.Bapitrvrec removeBapitrvrec(int index) {
          return (com.sap.demo.comp260x.travelexpensemodel.Bapitrvrec)super.remove(index);
        }
      }
     
    }
    Voilà le code complet:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    // ---------------------------------------------------------------------------
    // This file has been generated partially by the Web Dynpro Code Generator.
    // MODIFY CODE ONLY IN SECTIONS ENCLOSED BY @@begin AND @@end.
    // ALL OTHER CHANGES WILL BE LOST IF THE FILE IS REGENERATED.
    // ---------------------------------------------------------------------------
    package com.sap.demo.comp260x.comp260comp;
    
    // 
    // IMPORTANT NOTE: 
    // _ALL_ IMPORT STATEMENTS MUST BE PLACED IN THE FOLLOWING SECTION ENCLOSED
    // BY @@begin imports AND @@end. FURTHERMORE, THIS SECTION MUST ALWAYS CONTAIN
    // AT LEAST ONE IMPORT STATEMENT (E.G. THAT FOR IPrivateCOMP260XComp).
    // OTHERWISE, USING THE ECLIPSE FUNCTION "Organize Imports" FOLLOWED BY
    // A WEB DYNPRO CODE GENERATION (E.G. PROJECT BUILD) WILL RESULT IN THE LOSS
    // OF IMPORT STATEMENTS.
    //
    //@@begin imports
    import com.sap.demo.comp260x.comp260comp.wdp.IPrivateCOMP260XComp;
    import com.sap.demo.comp260x.travelexpensemodel.Bapi_Trip_Create_From_Data_Input;
    import com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException;
    import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
    import com.sap.demo.comp260x.travelexpensemodel.Bapitrvrec;
    //@@end
    
    //@@begin documentation
    //@@end
    
    public class COMP260XComp
    {
      /**
       * Logging location.
       */
      private static final com.sap.tc.logging.Location logger = 
        com.sap.tc.logging.Location.getLocation(COMP260XComp.class);
    
      static 
      {
        //@@begin id
        String id = "$Id$";
        //@@end
        com.sap.tc.logging.Location.getLocation("ID.com.sap.tc.webdynpro").infoT(id);
      }
    
      /**
       * Private access to the generated Web Dynpro counterpart 
       * for this controller class.  </p>
       *
       * Use <code>wdThis</code> to gain typed access to the context,
       * to trigger navigation via outbound plugs, to get and enable/disable
       * actions, fire declared events, and access used controllers and/or 
       * component usages.
       *
       * @see com.sap.demo.comp260x.comp260comp.wdp.IPrivateCOMP260XComp for more details
       */
      private final IPrivateCOMP260XComp wdThis;
    
      /**
       * Root node of this controller's context. </p>
       *
       * Provides typed access not only to the elements of the root node 
       * but also to all nodes in the context (methods node<i>XYZ</i>()) 
       * and their currently selected element (methods current<i>XYZ</i>Element()). 
       * It also facilitates the creation of new elements for all nodes 
       * (methods create<i>XYZ</i>Element()). </p>
       *
       * @see com.sap.demo.comp260x.comp260comp.wdp.IPrivateCOMP260XComp.IContextNode for more details.
       */
      private final IPrivateCOMP260XComp.IContextNode wdContext;
    
      /**
       * A shortcut for <code>wdThis.wdGetAPI()</code>. </p>
       * 
       * Represents the generic API of the generic Web Dynpro counterpart 
       * for this controller. </p>
       */
      private final com.sap.tc.webdynpro.progmodel.api.IWDComponent wdControllerAPI;
      
      /**
       * A shortcut for <code>wdThis.wdGetAPI().getComponent()</code>. </p>
       * 
       * Represents the generic API of the Web Dynpro component this controller 
       * belongs to. Can be used to access the message manager, the window manager,
       * to add/remove event handlers and so on. </p>
       */
      private final com.sap.tc.webdynpro.progmodel.api.IWDComponent wdComponentAPI;
      
      public COMP260XComp(IPrivateCOMP260XComp wdThis)
      {
        this.wdThis = wdThis;
        this.wdContext = wdThis.wdGetContext();
        this.wdControllerAPI = wdThis.wdGetAPI();
        this.wdComponentAPI = wdThis.wdGetAPI().getComponent();
      }
    
      //@@begin javadoc:wdDoInit()
      /** Hook method called to initialize controller. */
      //@@end
      public void wdDoInit()
      {
        //@@begin wdDoInit()
        //$$begin Service Controller(-2127839469)
        wdContext.nodeBapi_Trip_Create_From_Data_Input().bind(new Bapi_Trip_Create_From_Data_Input());
        
    	java.util.List<Bapitrvrec> receipts_1 =	new ArrayList<Bapitrvrec>();
    		//	Instantiate the instances of receipts
    		int MAX_RECEIPTS = 3;
    		for ( int i = 0; i < MAX_RECEIPTS; i++ )
    		{
    			receipts_1.add(new Bapitrvrec(travelExpenseModelModel));
    		}
        
        //$$end
        //@@end
      }
    
      //@@begin javadoc:wdDoExit()
      /** Hook method called to clean up controller. */
      //@@end
      public void wdDoExit()
      {
        //@@begin wdDoExit()
        //@@end
      }
    
      //@@begin javadoc:wdDoPostProcessing()
      /**
       * Hook called to handle data retrieval errors before rendering.
       *
       * After doModifyView(), the Web Dynpro Framework gets all context data needed
       * for rendering by validating the contexts (which in turn calls the supply
       * functions and supplying relation roles). In this hook, the application
       * should handle the errors which occurred during validation of the contexts.
       * 
       * Using preorder depth-first traversal, this hook is called for all component
       * controllers starting with the current root component.
       *
       * Permitted operations:
       * - Flushing model queue
       * - Creating messages
       * - Reading context and model data
       *
       * Forbidden operations: 
       * - Invalidating model data
       * - Manipulating the context
       * - Firing outbound plugs
       * - Creating components
       * - ...   
       *
       * @param isCurrentRoot true if this is the root of the current request
       */
      //@@end
      public void wdDoPostProcessing(boolean isCurrentRoot)
      {
        //@@begin wdDoPostProcessing()
        //@@end
      }
    
      //@@begin javadoc:wdDoBeforeNavigation()
      /**
       * Hook before the navigation phase starts.
       *
       * This hook allows you to flush the model queue and handle any
       * errors that occur. Firing outbound plugs is allowed in this hook.
       *
       * Using preorder depth-first traversal, this hook is called for all component
       * controllers starting with the current root component.
       *
       * @param isCurrentRoot true if this is the root of the current request
       */
      //@@end
      public void wdDoBeforeNavigation(boolean isCurrentRoot)
      {
        //@@begin wdDoBeforeNavigation()
        //@@end
      }
      
      //@@begin javadoc:wdDoApplicationStateChange()
      /**
       * Hook that informs the application about a state change.
       * <p>
       * This hook is called e.g. to tell the application that will be
       * <ul>
       *  <li>left via a suspend plug and therefore should go into a suspend/sleep
       *      mode with minimal need of resources. errors that occur. Firing 
       *      outbound plugs is allowed in this hook.
       *  <li>left due to a timeout and could write it's state to a data base if the 
       *      user comes back later on
       * </ul>
       *
       * The concrete reason is available via IWDApplicationStateChangeInfo
       * <p>
       * <b>Important</b>: This hook is called for the top level component only!
       *
       * @param stateChangeInfo contains the information about the nature of the state change
       * @param stateChangeReturn allows the application to ask for a different state change. 
       *        The framework is allowed to ignore it considering i.e. the current resources situation.
       */
      //@@end
      public void wdDoApplicationStateChange(com.sap.tc.webdynpro.progmodel.api.IWDApplicationStateChangeInfo stateChangeInfo, com.sap.tc.webdynpro.progmodel.api.IWDApplicationStateChangeReturn stateChangeReturn)
      {
        //@@begin wdDoApplicationStateChange()
        //@@end
      }
    
      //@@begin javadoc:executeBapi_Trip_Create_From_Data_Input()
      /** Declared method. */
      //@@end
      public void executeBapi_Trip_Create_From_Data_Input( )
      {
        //@@begin executeBapi_Trip_Create_From_Data_Input()
        //$$begin Service Controller(1295687461)
        IWDMessageManager manager = wdComponentAPI.getMessageManager();
        try
        {
          wdContext.currentBapi_Trip_Create_From_Data_InputElement().modelObject().execute();
          wdContext.nodeOutput().invalidate();
        }
        catch(WDDynamicRFCExecuteException e)
        {
          manager.reportException(e.getMessage(), false);
        }
        //$$end
        //@@end
      }
    
      /*
       * The following code section can be used for any Java code that is 
       * not to be visible to other controllers/views or that contains constructs
       * currently not supported directly by Web Dynpro (such as inner classes or
       * member variables etc.). </p>
       *
       * Note: The content of this section is in no way managed/controlled
       * by the Web Dynpro Designtime or the Web Dynpro Runtime. 
       */
      //@@begin others
      //@@end
    }
    Dernière modification par Invité ; 30/10/2008 à 11h12.

  12. #12
    Expert éminent sénior
    Avatar de adiGuba
    Homme Profil pro
    Développeur Java/Web
    Inscrit en
    Avril 2002
    Messages
    13 938
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Java/Web
    Secteur : Transports

    Informations forums :
    Inscription : Avril 2002
    Messages : 13 938
    Points : 23 190
    Points
    23 190
    Billets dans le blog
    1
    Par défaut
    Il n'y a pas l'import pour ArrayList... mais cela devrait générer une erreur sur ArrayList et non pas sur List...


    a++

  13. #13
    Invité
    Invité(e)
    Par défaut
    c pour ça que j'ai posé la question dois-je importer autre chose en plus?

  14. #14
    Expert éminent sénior
    Avatar de adiGuba
    Homme Profil pro
    Développeur Java/Web
    Inscrit en
    Avril 2002
    Messages
    13 938
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Java/Web
    Secteur : Transports

    Informations forums :
    Inscription : Avril 2002
    Messages : 13 938
    Points : 23 190
    Points
    23 190
    Billets dans le blog
    1
    Par défaut
    Ben ce n'était pas clair du tout !

    Pour ArrayList tu dois importer java.util.ArrayList... et un coup d'oeil rapide dans la doc t'aurait donné la réponse bien plus rapidement !

    a++

  15. #15
    Invité
    Invité(e)
    Par défaut
    Malgré que j'ai ajouté :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    import  java.util.*;
    import  java.util.jar.*;
    l'erreur est tjrs là!

  16. #16
    Expert éminent sénior
    Avatar de adiGuba
    Homme Profil pro
    Développeur Java/Web
    Inscrit en
    Avril 2002
    Messages
    13 938
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Java/Web
    Secteur : Transports

    Informations forums :
    Inscription : Avril 2002
    Messages : 13 938
    Points : 23 190
    Points
    23 190
    Billets dans le blog
    1
    Par défaut
    Question con : tu utilises bien un compilateur Java 5.0 (pour les Generics) ?

    a++

  17. #17
    Invité
    Invité(e)
    Par défaut
    Java platform standar edition 6 (build 1.6.0_07-b06)

  18. #18
    Expert éminent sénior
    Avatar de adiGuba
    Homme Profil pro
    Développeur Java/Web
    Inscrit en
    Avril 2002
    Messages
    13 938
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Java/Web
    Secteur : Transports

    Informations forums :
    Inscription : Avril 2002
    Messages : 13 938
    Points : 23 190
    Points
    23 190
    Billets dans le blog
    1
    Par défaut
    Et tu compiles comment ?

    a++

  19. #19
    Invité
    Invité(e)
    Par défaut
    En faite, avant de compiler, ça me souligne déjà l'instruction.
    Et quand je clique sur build the project, j'ai un warning à cause de ça!

  20. #20
    Expert éminent sénior
    Avatar de adiGuba
    Homme Profil pro
    Développeur Java/Web
    Inscrit en
    Avril 2002
    Messages
    13 938
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Java/Web
    Secteur : Transports

    Informations forums :
    Inscription : Avril 2002
    Messages : 13 938
    Points : 23 190
    Points
    23 190
    Billets dans le blog
    1
    Par défaut
    Citation Envoyé par AlAA Voir le message
    En faite, avant de compiler, ça me souligne déjà l'instruction.
    Je reformule : Quel EDI tu utilises ?

    a++

Discussions similaires

  1. faces-config : value de type java.util.List
    Par DamienF dans le forum JSF
    Réponses: 7
    Dernier message: 27/09/2010, 10h36
  2. Extraire le contenu d'un java.util.List
    Par Elasnaoui dans le forum Hibernate
    Réponses: 1
    Dernier message: 17/12/2008, 21h23
  3. Problème avec java.util.List
    Par alphonse62 dans le forum Collection et Stream
    Réponses: 5
    Dernier message: 11/06/2007, 11h03
  4. required : java.util.List
    Par marcxa44 dans le forum Maven
    Réponses: 4
    Dernier message: 11/05/2007, 11h30
  5. Comment creer un objet java.util.List ?
    Par Battosaiii dans le forum Collection et Stream
    Réponses: 6
    Dernier message: 02/11/2006, 12h14

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo