/** * Add another bundle path to this resource bundle. * * <p> * Order of property lookup is first-to-last. * * <p> * This method must be called from the same thread as the call to the constructor. * This eliminates the need for synchronization. * * @param forClass The class using this resource bundle. * @param bundlePath The bundle path. * @return This object (for method chaining). */ public MessageBundle addSearchPath(Class<?> forClass, String bundlePath) { assertSameThread(creationThreadId, "This method can only be called from the same thread that created the object."); MessageBundle srb = new MessageBundle(forClass, bundlePath); if (srb.rb != null) { allKeys.addAll(srb.keySet()); searchBundles.add(srb); } return this; }
/** * Add another bundle path to this resource bundle. * * <p> * Order of property lookup is first-to-last. * * <p> * This method must be called from the same thread as the call to the constructor. * This eliminates the need for synchronization. * * @param forClass The class using this resource bundle. * @param bundlePath The bundle path. * @return This object (for method chaining). */ public MessageBundle addSearchPath(Class<?> forClass, String bundlePath) { assertSameThread(creationThreadId, "This method can only be called from the same thread that created the object."); MessageBundle srb = new MessageBundle(forClass, bundlePath); if (srb.rb != null) { allKeys.addAll(srb.keySet()); searchBundles.add(srb); } return this; }
/** * Add another bundle path to this resource bundle. * * <p> * Order of property lookup is first-to-last. * * <p> * This method must be called from the same thread as the call to the constructor. * This eliminates the need for synchronization. * * @param forClass The class using this resource bundle. * @param bundlePath The bundle path. * @return This object (for method chaining). */ public MessageBundle addSearchPath(Class<?> forClass, String bundlePath) { assertSameThread(creationThreadId, "This method can only be called from the same thread that created the object."); MessageBundle srb = new MessageBundle(forClass, bundlePath); if (srb.rb != null) { allKeys.addAll(srb.keySet()); searchBundles.add(srb); } return this; }