クラス ContentLoader

java.lang.Object
org.thinkit.framework.content.ContentLoader

public final class ContentLoader
extends Object
The class that defines the process of loading the content data based on the specified content definition.

It provides a load(InputStream, Set) method to load content data without conditions, and a load(InputStream, Set, List) method to load content data with conditions.

If the value of "conditionId" defined in the content is an empty string, the record will be loaded unconditionally. If you have defined a value for the conditionId of the content, be sure to define a condition for the content and call load(InputStream, Set, List).

 If the condition is not specified:
 List<Map<String, String>> contents = ContentLoader.load(contentStream, attributes);
 
 If the condition is specified:
 List<Map<String, String>> contents = ContentLoader.load(contentStream, attributes, conditions);
 
導入されたバージョン:
1.0.0
  • メソッドの詳細

    • load

      public static List<Map<String,​String>> load​(@NonNull @NonNull InputStream contentStream, @NonNull @NonNull Set<String> attributes)
      Gets each element defined in the content file specified as an argument and return it as List.

      Use this load(InputStream, Set) method if there are no fetch conditions in the content definition.

       Get the content data without conditions:
       List<Map<String, String>> contents = ContentLoader.load(contentStream, attributes);
       
      パラメータ:
      contentStream - The stream of content file
      attributes - The Attribute names to be acquired
      戻り値:
      The List containing the elements retrieved from the content file
      例外:
      NullPointerException - If null is passed as an argument
      IllegalArgumentException - If the attribute list is empty
    • load

      public static List<Map<String,​String>> load​(@NonNull @NonNull InputStream contentStream, @NonNull @NonNull Set<String> attributes, @NonNull @NonNull List<Map<String,​String>> conditions)
      Gets each element defined in the content file specified and return it as a list.

      Use this load(InputStream, Set, List) method if there are no acquisition conditions in the content definition.

       Get the content data with conditions:
       List<Map<String, String>> contents = ContentLoader.load(contentStream, attributes, conditions);
       
      パラメータ:
      contentStream - The stream of content file
      attributes - The Attribute names to be acquired
      conditions - The conditional list to use when getting data from the content file
      戻り値:
      The List containing the elements retrieved from the content file
      例外:
      NullPointerException - If null is passed as an argument
      IllegalArgumentException - If the attribute list is empty