|
JavaTM 2 Platform Std. Ed. v1. 4.0 |
||||||||||
ÀüÀÇ Å¬·¡½º ´ÙÀ½ÀÇ Å¬·¡½º | ÇÁ·¹ÀÓ ÀÖ¾î ÇÁ·¹ÀÓ ¾øÀ½ | ||||||||||
°³¿ä: »óÀÚ | Çʵå | constructor | ¸Þ¼Òµå | »ó¼¼: Çʵå | constructor | ¸Þ¼Òµå |
java.lang.Object | +--java.util.ResourceBundle | +--java.util.ListResourceBundle
ListResourceBundle
´Â ¸®½ºÆ®¸¦ Æí¸®ÇÏ°í ¿ëÀÌÇÏ°Ô »ç¿ëÇÒ ¼ö ÀÖ´Â ·ÎÄÉÀÏ¿¡ ´ëÇÑ ¸®¼Ò½º¸¦ °ü¸®ÇÏ´Â ResourceBundle
ÀÇ abstract ¼ºê Ŭ·¡½ºÀÔ´Ï´Ù. ¸®¼Ò½º ¹øµé ÀϹÝÀûÀ¸·Î ºÙ¾î¼´Â ResourceBundle
¸¦ ÂüÁ¶ÇØ ÁÖ¼¼¿ä.
¼ºê Ŭ·¡½º´Â getContents
¸¦ ¿À¹ö¶óÀ̵å(override) ÇØ, ¹è¿À» Á¦°øÇÏÁö ¾ÊÀ¸¸é ¾ÈµË´Ï´Ù. ÀÌ °æ¿ì, ¹è¿ÀÇ °¢ Ç׸ñÀº ¿ÀºêÁ§Æ®ÀÇ Æä¾îÀÔ´Ï´Ù. °¢ Æä¾îÀÇ ÃÖÃÊÀÇ ¿ä¼Ò´Â String
Ű·Î, 2 ¹øÂ°ÀÇ ¿ä¼Ò´Â ÀÌ Å°¿¡ °ü·ÃÇÏ´Â °ªÀÔ´Ï´Ù.
´ÙÀ½ÀÇ ¿¹ ´Â º£À̽º¸í ¡¸MyResources¡¹ÀÇ ¸®¼Ò½º ¹øµé ÆÐ¹Ð¸®ÀÇ 2 °³ÀÇ ¸â¹ö¸¦ ³ªÅ¸³À´Ï´Ù. ¡¸MyResources¡¹´Â ¹øµé ÆÐ¹Ð¸®ÀÇ µðÆúÆ®ÀÇ ¸â¹ö·Î, ¡¸MyResources_fr¡¹´Â ÇÁ¶û½ºÀÇ ¸â¹öÀÔ´Ï´Ù. ÀÌ·¯ÇÑ ¸â¹ö´Â ListResourceBundle
¿¡ ±Ù°ÅÇϰí ÀÖ½À´Ï´Ù(°ü·Ã ¿¹ ¿¡¼´Â ÇÁ·ÎÆÛƼ ÆÄÀÏ¿¡ ±Ù°ÅÇÏÁö ¾Ê´Â ÀÌ ÆÐ¹Ð¸®¿¡°Ô ¹øµéÀ» Ãß°¡ÇÏ´Â ¹æ¹ýÀ» ³ªÅ¸³À´Ï´Ù). ÀÌ ¿¹ÀÇ Å°ÀÇ Çü½ÄÀº s1 µîÀÔ´Ï´Ù. ½ÇÁ¦ÀÇ Å°´Â ¹øµé·ÎºÎÅÍ ¿ÀºêÁ§Æ®¸¦ ²¨³»±â À§Çؼ(¶§¹®¿¡) ÇÁ·Î±×·¥À¸·Î »ç¿ëÇϴ Ű¿Í °°Àº°¡ ÀǸ®, ¹¹µçÁö ±¦Âú½À´Ï´Ù. Ű¿¡´Â ´ë¹®ÀÚ/¼Ò¹®ÀÚÀÇ ±¸º°ÀÌ ÀÖ½À´Ï´Ù.
public class MyResources extends ListResourceBundle { public Object[][] getContents() { return contents; } static final Object[][] contents = { // LOCALIZE THIS {"s1", "The disk \"{1}\" contains {0}. "}, // MessageFormat pattern {"s2", "1"}, // location of {0} in pattern {"s3", "My Disk"}, // sample disk name {"s4", "no files"}, // first ChoiceFormat choice {"s5", "one file"}, // second ChoiceFormat choice {"s6", "{0, number} files"}, // third ChoiceFormat choice {"s7", "3 Mar 96"}, // sample date {"s8", new Dimension(1,5)} // real object, not just string // END OF MATERIAL TO LOCALIZE }; } public class MyResources_fr extends ListResourceBundle { public Object[][] getContents() { return contents; } static final Object[][] contents = { // LOCALIZE THIS {"s1", "Le disque \"{1}\" {0}. "}, // MessageFormat pattern {"s2", "1"}, // location of {0} in pattern {"s3", "Mon disque"}, // sample disk name {"s4", "ne contient pas de fichiers"}, // first ChoiceFormat choice {"s5", "contient un fichier"}, // second ChoiceFormat choice {"s6", "contient {0, number} fichiers"}, // third ChoiceFormat choice {"s7", "3 mars 1996"}, // sample date {"s8", new Dimension(1,3)} // real object, not just string // END OF MATERIAL TO LOCALIZE }; }
ResourceBundle
,
PropertyResourceBundle
ÇʵåÀÇ °³¿ä |
Ŭ·¡½º java.util. ResourceBundle ¿¡¼ »ó¼Ó¹ÞÀº Çʵå |
parent |
»ý¼ºÀÚÀÇ °³¿ä | |
ListResourceBundle ()
À¯ÀÏÇÑ constructor ÀÔ´Ï´Ù. |
¸Þ¼ÒµåÀÇ °³¿ä | |
protected abstract Object [][] |
getContents ()
Ŭ·¡½ºÀÇ ¼³¸íÀ» ÂüÁ¶ÇØ ÁÖ¼¼¿ä. |
Enumeration |
getKeys ()
ResourceBundle.getKeys ÀÇ ±¸ÇöÀÔ´Ï´Ù. |
Object |
handleGetObject (String key)
ÀÌ ¸®¼Ò½º ¹øµé·ÎºÎÅÍ ÁöÁ¤µÈ ŰÀÇ ¿ÀºêÁ§Æ®¸¦ ÃëµæÇÕ´Ï´Ù. |
Ŭ·¡½º java.util. ResourceBundle ¿¡¼ »ó¼Ó¹ÞÀº ¸Þ¼Òµå |
getBundle , getBundle , getBundle , getLocale , getObject , getString , getStringArray , setParent |
Ŭ·¡½º java.lang. Object ¿¡¼ »ó¼Ó¹ÞÀº ¸Þ¼Òµå |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
»ý¼ºÀÚÀÇ »ó¼¼ |
public ListResourceBundle()
¸Þ¼ÒµåÀÇ »ó¼¼ |
public final Object handleGetObject(String key)
ResourceBundle
ÀÇ ±â¼ú:
ResourceBundle
³»ÀÇ handleGetObject
key
- ¹Ù¶÷Á÷ÇÑ ¿ÀºêÁ§Æ®ÀÇ Å°
public Enumeration getKeys()
ResourceBundle
³»ÀÇ getKeys
protected abstract Object [][] getContents()
|
JavaTM 2 Platform Std. Ed. v1. 4.0 |
||||||||||
ÀüÀÇ Å¬·¡½º ´ÙÀ½ÀÇ Å¬·¡½º | ÇÁ·¹ÀÓ ÀÖ¾î ÇÁ·¹ÀÓ ¾øÀ½ | ||||||||||
°³¿ä: »óÀÚ | Çʵå | constructor | ¸Þ¼Òµå | »ó¼¼: Çʵå | constructor | ¸Þ¼Òµå |
Java, Java 2 D, ¹× JDBC ´Â ¹Ì±¹ ¹× ±× ¿ÜÀÇ ³ª¶ó¿¡ ÀÖ¾î¼ÀÇ ¹Ì±¹ Sun Microsystems, Inc. ÀÇ »óÇ¥ ȤÀº µî·Ï»óÇ¥ÀÔ´Ï´Ù.
Copyright 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.