站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JDK 5 Documentation v1.1.8, Java 2 SDK 英文文档

Class java.util.PropertyResourceBundle - JDK 5 Documentation v1.1.8, Java 2 SDK 英文文档

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.util.PropertyResourceBundle

java.lang.Object
   |
   +----java.util.ResourceBundle
           |
           +----java.util.PropertyResourceBundle

public class PropertyResourceBundle
extends ResourceBundle
PropertyResourceBundle is an abstract subclass of ResourceBundle that manages resources for a locale using a set of static strings from a property file. See ResourceBundle for more information about resource bundles in general.

The property file contains the keys that you use in your source code in calls to ResourceBundle.getString and similar methods, and their corresponding values, etc. The name of the property file indicates the resource bundle's family and locale.

In the following example, the keys are of the form "s1"... The actual keys are entirely up to your choice, so long as they are the same as the keys you use in your program to retrieve the objects from the bundle. Keys are case-sensitive.

 s1=3
 s2=MeinDisk
 s3=3 Mar 96
 s4=Der disk '{1}' a {0} a {2}.
 s5=0
 s6=keine Datein
 s7=1
 s8=ein Datei
 s9=2
 s10={0}|3 Datein
 s11=Der Format worf ein Exception: {0}
 s12=ERROR
 s14=Resulte
 s13=Dialogue
 s15=Pattern
 s16=1,3
 

See Also:
ResourceBundle, ListResourceBundle

Constructor Index

 o PropertyResourceBundle(InputStream)
Creates a property resource

Method Index

 o getKeys()
Implementation of ResourceBundle.getKeys.
 o handleGetObject(String)
Override of ResourceBundle, same semantics

Constructors

 o PropertyResourceBundle
 public PropertyResourceBundle(InputStream stream) throws IOException
Creates a property resource

Parameters:
file - property file to read from.

Methods

 o handleGetObject
 public Object handleGetObject(String key)
Override of ResourceBundle, same semantics

Overrides:
handleGetObject in class ResourceBundle
 o getKeys
 public Enumeration getKeys()
Implementation of ResourceBundle.getKeys.

Overrides:
getKeys in class ResourceBundle

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Submit a bug or feature - Version 1.1.8 of Java Platform API Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1995-1999 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.