< prev index next >

src/com/sun/interview/HelpSetFactory.java

Print this page
rev 145 : 7902237: Fixing raw use of parameterized class
Reviewed-by: jjg


  30 import java.io.File;
  31 
  32 /**
  33  * The interface that implements bridge between javax.help package and
  34  * JavaTest. Default implementation of this interface just provides stubs,
  35  * it doesn't use javax.help and could be used in the batch mode.
  36  * Interview while initialization checks if Desktop is available or not,
  37  * if yes, the rich factory will be used.
  38  *
  39  * @author Dmitry Fazunenko
  40  */
  41 public interface HelpSetFactory {
  42 
  43     /**
  44      * Creates an instance of HelpSet.
  45      * Real implementation should create of javax.help.HelpSet, when a
  46      * stub implementation just object.
  47      *
  48      * @throws com.sun.interview.Interview.Fault if something went wrong
  49      */
  50     public Object createHelpSetObject(String name, Class c) throws Interview.Fault;
  51 
  52     /**
  53      * Creates an instance of HelpSet.
  54      * Real implementation should create of javax.help.HelpSet, when a
  55      * stub implementation just object.
  56      *
  57      * @throws com.sun.interview.Interview.Fault if something went wrong
  58      */
  59     public Object createHelpSetObject(String name, File file) throws Interview.Fault;
  60 
  61     /**
  62      * Updates a HelpSet instance associated with the given interview.
  63      *
  64      * @param interview - interview object to reset HelpSet
  65      * @param object - an instance of javax.help.HelpSet
  66      */
  67     public Object updateHelpSetObject(Interview interview, Object object);
  68 
  69     public Object createHelpID(Object hs, String str);
  70 
  71 
  72     /**
  73      * The very default implementation of the HelpSetFactory interface.
  74      * It should be used in case when help is not required (command line mode)
  75      */
  76     public static final HelpSetFactory DEFAULT = new Default();
  77 
  78     static class Default implements HelpSetFactory {
  79         private static final Object EMPTY = new Object();
  80 
  81         public Object createHelpSetObject(String name, Class c) throws Fault {
  82             return EMPTY;
  83         }
  84 
  85         public Object createHelpSetObject(String name, File file) throws Fault {
  86             return EMPTY;
  87         }
  88 
  89         public Object createHelpID(Object hs, String str) {
  90             return null;
  91         }
  92 
  93         public Object updateHelpSetObject(Interview interview, Object object) {
  94             return object;
  95         }
  96 
  97     }
  98 
  99 }


  30 import java.io.File;
  31 
  32 /**
  33  * The interface that implements bridge between javax.help package and
  34  * JavaTest. Default implementation of this interface just provides stubs,
  35  * it doesn't use javax.help and could be used in the batch mode.
  36  * Interview while initialization checks if Desktop is available or not,
  37  * if yes, the rich factory will be used.
  38  *
  39  * @author Dmitry Fazunenko
  40  */
  41 public interface HelpSetFactory {
  42 
  43     /**
  44      * Creates an instance of HelpSet.
  45      * Real implementation should create of javax.help.HelpSet, when a
  46      * stub implementation just object.
  47      *
  48      * @throws com.sun.interview.Interview.Fault if something went wrong
  49      */
  50     public Object createHelpSetObject(String name, Class<?> c) throws Interview.Fault;
  51 
  52     /**
  53      * Creates an instance of HelpSet.
  54      * Real implementation should create of javax.help.HelpSet, when a
  55      * stub implementation just object.
  56      *
  57      * @throws com.sun.interview.Interview.Fault if something went wrong
  58      */
  59     public Object createHelpSetObject(String name, File file) throws Interview.Fault;
  60 
  61     /**
  62      * Updates a HelpSet instance associated with the given interview.
  63      *
  64      * @param interview - interview object to reset HelpSet
  65      * @param object - an instance of javax.help.HelpSet
  66      */
  67     public Object updateHelpSetObject(Interview interview, Object object);
  68 
  69     public Object createHelpID(Object hs, String str);
  70 
  71 
  72     /**
  73      * The very default implementation of the HelpSetFactory interface.
  74      * It should be used in case when help is not required (command line mode)
  75      */
  76     public static final HelpSetFactory DEFAULT = new Default();
  77 
  78     static class Default implements HelpSetFactory {
  79         private static final Object EMPTY = new Object();
  80 
  81         public Object createHelpSetObject(String name, Class<?> c) throws Fault {
  82             return EMPTY;
  83         }
  84 
  85         public Object createHelpSetObject(String name, File file) throws Fault {
  86             return EMPTY;
  87         }
  88 
  89         public Object createHelpID(Object hs, String str) {
  90             return null;
  91         }
  92 
  93         public Object updateHelpSetObject(Interview interview, Object object) {
  94             return object;
  95         }
  96 
  97     }
  98 
  99 }
< prev index next >