Esempio n. 1
0
 static {
   try {
     resources = ResourceBundle.getBundle("resources.TextViewer", Locale.getDefault());
   } catch (MissingResourceException mre) {
     String errstr = "TextViewer:resources/TextViewer.properties not found";
     // System.exit(1);
     System.err.println(errstr);
   }
 }
Esempio n. 2
0
 static {
   try {
     properties = new Properties();
     properties.load(Notepad.class.getResourceAsStream("resources/NotepadSystem.properties"));
     resources = ResourceBundle.getBundle("resources.Notepad", Locale.getDefault());
   } catch (MissingResourceException | IOException e) {
     System.err.println(
         "resources/Notepad.properties " + "or resources/NotepadSystem.properties not found");
     System.exit(1);
   }
 }
public class RestitutionCompGetDataBeanInfo extends java.beans.SimpleBeanInfo {
  ResourceBundle res =
      ResourceBundle.getBundle(
          "com.ibm.HostPublisher.IntegrationObject.HPub_Resources", Locale.getDefault());

  public BeanInfo[] getAdditionalBeanInfo() {
    try {
      BeanInfo hPubBi1 = Introspector.getBeanInfo(RestitutionCompGetData.class.getSuperclass());

      BeanInfo[] arrayOfBIs = {hPubBi1};
      return arrayOfBIs;
    } catch (IntrospectionException e) {
      e.printStackTrace();
    }

    return null;
  }

  public PropertyDescriptor[] getPropertyDescriptors() {
    try { // Generated Code
      String stringPackageName = new String("IntegrationObject");

      String hPubHODVariablePropDesc = res.getString("hPubHODVariablePropDesc");

      PropertyDescriptor pdMore =
          new PropertyDescriptor(
              "more",
              Class.forName(stringPackageName + "." + "RestitutionCompGetData"),
              "getMore",
              null);

      pdMore.setShortDescription(hPubHODVariablePropDesc);

      PropertyDescriptor pdHPubXMLProperties =
          new PropertyDescriptor(
              "hPubXMLProperties",
              com.ibm.HostPublisher.IntegrationObject.HPubCommon.class,
              "getHPubXMLProperties",
              null);
      String hPubXMLPropDesc = res.getString("hPubXMLPropDesc");
      pdHPubXMLProperties.setShortDescription(hPubXMLPropDesc);

      PropertyDescriptor pdHPubStartPoolName =
          new PropertyDescriptor(
              "hPubStartPoolName",
              com.ibm.HostPublisher.IntegrationObject.HPubCommon.class,
              "getHPubStartPoolName",
              "setHPubStartPoolName");
      String hPubStartPoolNamePropDesc = res.getString("hPubStartPoolNameDescPropDesc");
      pdHPubStartPoolName.setShortDescription(hPubStartPoolNamePropDesc);

      PropertyDescriptor pdHPubConnectionOverrides =
          new PropertyDescriptor(
              "hPubConnectionOverrides",
              com.ibm.HostPublisher.IntegrationObject.HPubCommon.class,
              "getHPubConnectionOverrides",
              "setHPubConnectionOverrides");
      String hPubConnectionOverridesPropDesc = res.getString("hPubConnectionOverridesPropDesc");
      pdHPubConnectionOverrides.setShortDescription(hPubConnectionOverridesPropDesc);

      PropertyDescriptor pdHPubStartChainName =
          new PropertyDescriptor(
              "hPubStartChainName",
              com.ibm.HostPublisher.IntegrationObject.HPubCommon.class,
              "getHPubStartChainName",
              null);
      String hPubStartChainNamePropDesc = res.getString("hPubStartChainNamePropDesc");
      pdHPubStartChainName.setShortDescription(hPubStartChainNamePropDesc);

      PropertyDescriptor pdHPubEndChainName =
          new PropertyDescriptor(
              "hPubEndChainName",
              com.ibm.HostPublisher.IntegrationObject.HPubCommon.class,
              "getHPubEndChainName",
              null);
      String hPubEndChainNamePropDesc = res.getString("hPubEndChainNamePropDesc");
      pdHPubEndChainName.setShortDescription(hPubEndChainNamePropDesc);

      PropertyDescriptor pdHPubStartType =
          new PropertyDescriptor(
              "hPubStartType",
              com.ibm.HostPublisher.IntegrationObject.HPubCommon.class,
              "getHPubStartType",
              null);
      String hPubStartTypePropDesc = res.getString("hPubStartTypePropDesc");
      pdHPubStartType.setShortDescription(hPubStartTypePropDesc);

      PropertyDescriptor pdHPubEndType =
          new PropertyDescriptor(
              "hPubEndType",
              com.ibm.HostPublisher.IntegrationObject.HPubCommon.class,
              "getHPubEndType",
              null);
      String hPubEndTypePropDesc = res.getString("hPubEndTypePropDesc");
      pdHPubEndType.setShortDescription(hPubEndTypePropDesc);

      PropertyDescriptor pdHPubErrorException =
          new PropertyDescriptor(
              "hPubErrorException",
              com.ibm.HostPublisher.IntegrationObject.HPubCommon.class,
              "getHPubErrorException",
              null);
      String hPubExceptionPropDesc = res.getString("hPubExceptionPropDesc");
      pdHPubErrorException.setShortDescription(hPubExceptionPropDesc);

      PropertyDescriptor pdHPubLinkKey =
          new PropertyDescriptor(
              "hPubLinkKey",
              com.ibm.HostPublisher.IntegrationObject.HPubCommon.class,
              "getHPubLinkKey",
              "setHPubLinkKey");
      String hPubLinkKeyPropDesc = res.getString("hPubLinkKeyPropDesc");
      pdHPubLinkKey.setShortDescription(hPubLinkKeyPropDesc);

      PropertyDescriptor[] arrayOfPDs = {
        pdMore,
        pdHPubXMLProperties,
        pdHPubStartPoolName,
        pdHPubConnectionOverrides,
        pdHPubStartChainName,
        pdHPubEndChainName,
        pdHPubStartType,
        pdHPubEndType,
        pdHPubErrorException,
        pdHPubLinkKey
      };
      return arrayOfPDs;
    } catch (Exception e) {
      System.out.println(e);
      return null;
    }
  }

  // ***** *****
  public MethodDescriptor[] getMethodDescriptors() {
    try {
      MethodDescriptor md1 =
          new MethodDescriptor(
              getMethod(
                  com.ibm.HostPublisher.IntegrationObject.HPubCommon.class, "processRequest"));
      String procReqDesc = res.getString("procReqDesc");
      md1.setShortDescription(procReqDesc);

      MethodDescriptor md2 =
          new MethodDescriptor(
              getMethod(
                  com.ibm.HostPublisher.IntegrationObject.HPubCommon.class, "doHPTransaction"));
      String doHPTransDesc = res.getString("doHPTransDesc");
      md2.setShortDescription(doHPTransDesc);

      // method for receiving event
      MethodDescriptor md3 =
          new MethodDescriptor(
              getMethod(
                  com.ibm.HostPublisher.IntegrationObject.HPubCommon.class, "hPubStartPerformed"));
      String hPubStartPerfDesc = res.getString("hPubStartPerfDesc");
      md3.setShortDescription(hPubStartPerfDesc);

      MethodDescriptor[] arrayOfMDs = {md1, md2, md3};
      return arrayOfMDs;

    } catch (IntrospectionException e) {
      e.printStackTrace();
    }
    return null;
  }

  Method getMethod(Class cls, String methodName) throws IntrospectionException {
    Method methods[] = cls.getMethods();

    for (int i = 0; i < methods.length; i++) {
      if (methods[i].getName().equals(methodName)) {
        return methods[i];
      }
    }
    throw new IntrospectionException("No method \"" + methodName);
  }

  // ***** *****
  public EventSetDescriptor[] getEventSetDescriptors() {
    try {
      EventSetDescriptor eventHPubReqComplete =
          new EventSetDescriptor(
              com.ibm.HostPublisher.IntegrationObject.HPubCommon.class,
              "requestComplete",
              com.ibm.HostPublisher.IntegrationObject.HPubReqCompleteListener.class,
              "hPubReqComplete");

      String reqCompleteName = res.getString("reqCompleteName");
      eventHPubReqComplete.setDisplayName(reqCompleteName);
      String reqCompleteDesc = res.getString("reqCompleteDesc");
      eventHPubReqComplete.setShortDescription(reqCompleteDesc);

      EventSetDescriptor[] arrayOfESDs = {eventHPubReqComplete};

      return arrayOfESDs;
    } catch (IntrospectionException e) {
      System.out.println(e);
      return null;
    }
  }
}