Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter Portal
11g Release 1 (11.1.1.7.0)
E15995-06


oracle.wcps.l10n.annotation
Annotation Type L10n


@Documented
@Retention(value=RUNTIME)
@Target(value={TYPE,FIELD,METHOD,PARAMETER})
public @interface L10n

Annotation used to specify (mark) the annotated element with a specific resource bundle.

Example code usage:

 package test.l10n;
 
 import oracle.wcps.l10n.annotation.L10n;
 import oracle.wcps.l10n.annotation.L10nName;
 import oracle.wcps.l10n.annotation.L10nDesc;
 
 // No "bundle" set, so test.l10n.MyLocalizedClass.properties
 // will be used.
 @L10n()
 @L10nName(key="MyLocalizedClass.name")
 @L10nDesc(key="MyLocalizedClass.description")
 class MyLocalizedClass
 {
      // Retrieves "myValue.name" from 
      // test.l10n.MyLocalizedClass.properties
      @L10nName(key="myValue.name")
      private String myValue;
      
      // Retrieves "getMyValue.description" from 
      // test.l10n.CustomResources
      @L10n(bundle="test.l10n.CustomResources")
      @L10nName(key="getMyValue.description")
      public String getMyValue()
      {
          return myValue;
      }
      
      // Retrieves "doStuff.parameter" from 
      // test.l10n.BundleResources
      public void doStuff(@L10nDesc(key="doStuff.parameter")
                          String parameter)
      {
          // Do some stuff here...
          // .
          // .
          // .
      }
 }
 

Optional Element Summary
 java.lang.String bundle
          The resource bundle to use for localization.

 

bundle

public abstract java.lang.String bundle
The resource bundle to use for localization. If the default is set, the current class will be used as the resources.
Default:
""

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter Portal
11g Release 1 (11.1.1.7.0)
E15995-06


Copyright © 2009, 2013, Oracle and/or its affiliates. All rights reserved.