public static void main(String[] args) {
    ClassicEngineBoot.getInstance().start();
    final TreeMap globalAttributes = new TreeMap();
    final ElementMetaData[] datas = ElementTypeRegistry.getInstance().getAllElementTypes();
    for (int i = 0; i < datas.length; i++) {
      final ElementMetaData data = datas[i];
      if (data instanceof AbstractMetaData == false) {
        continue;
      }
      printMetaBundle(data, globalAttributes);
    }
    System.out.println("-----------------------------------------------------");

    final Iterator iterator = globalAttributes.entrySet().iterator();
    while (iterator.hasNext()) {
      final Map.Entry o = (Map.Entry) iterator.next();

      final AttributeMetaData attribute = (AttributeMetaData) o.getValue();
      final AbstractMetaData aamd = (AbstractMetaData) attribute;
      final String akeyPrefix = aamd.getKeyPrefix();
      final String abundle = aamd.getBundleLocation();
      final String aname = attribute.getName();

      System.out.println(akeyPrefix + aname + ".display-name=" + aname);
      System.out.println(
          akeyPrefix + aname + ".grouping=" + filter(aamd.getGrouping(Locale.ENGLISH), "Group"));
      System.out.println(
          akeyPrefix + aname + ".description=" + filter(aamd.getDescription(Locale.ENGLISH), ""));
      System.out.println(
          akeyPrefix
              + aname
              + ".deprecated="
              + filter(aamd.getDeprecationMessage(Locale.ENGLISH), ""));
    }
  }
  public static void main(final String[] args) {
    final HashMap styles = new HashMap();

    ClassicEngineBoot.getInstance().start();
    final ElementMetaData[] elementMetaDatas =
        ElementTypeRegistry.getInstance().getAllElementTypes();
    for (int i = 0; i < elementMetaDatas.length; i++) {
      final ElementMetaData elementMetaData = elementMetaDatas[i];
      final StyleMetaData[] styleMetaDatas = elementMetaData.getStyleDescriptions();
      for (int j = 0; j < styleMetaDatas.length; j++) {
        final StyleMetaData styleMetaData = styleMetaDatas[j];
        styles.put(styleMetaData.getName(), styleMetaData);
      }
    }

    final StyleMetaData[] stylesArray =
        (StyleMetaData[]) styles.values().toArray(new StyleMetaData[styles.size()]);
    Arrays.sort(stylesArray, new PlainMetaDataComparator());

    for (int i = 0; i < stylesArray.length; i++) {
      StyleMetaData metaData = stylesArray[i];
      final String name = metaData.getName();
      System.out.println("style." + name + ".display-name=" + name);
      System.out.println(
          "style." + name + ".grouping=" + filter(metaData.getGrouping(Locale.ENGLISH), "Group"));
      System.out.println(
          "style." + name + ".description=" + filter(metaData.getDescription(Locale.ENGLISH), ""));
      System.out.println(
          "style."
              + name
              + ".deprecated="
              + filter(metaData.getDeprecationMessage(Locale.ENGLISH), ""));
    }
  }
  /**
   * Starts parsing.
   *
   * @param attrs the attributes.
   * @throws SAXException if there is a parsing error.
   */
  protected void startParsing(final Attributes attrs) throws SAXException {
    super.startParsing(attrs);
    namespace = attrs.getValue(getUri(), "namespace"); // NON-NLS
    if (namespace == null) {
      throw new ParseException("Attribute 'namespace' is undefined", getLocator());
    }

    namespacePrefix = attrs.getValue(getUri(), "namespace-prefix"); // NON-NLS
    if (namespacePrefix == null) {
      namespacePrefix = ElementTypeRegistry.getInstance().getNamespacePrefix(namespace);
    }
    mandatory = "true".equals(attrs.getValue(getUri(), "mandatory")); // NON-NLS
    computed = "true".equals(attrs.getValue(getUri(), "computed")); // NON-NLS
    transientFlag = "true".equals(attrs.getValue(getUri(), "transient")); // NON-NLS
    bulk = "true".equals(attrs.getValue(getUri(), "prefer-bulk")); // NON-NLS
    designTimeValue = "true".equals(attrs.getValue(getUri(), "design-time-value")); // NON-NLS

    final String valueTypeText = attrs.getValue(getUri(), "value-type"); // NON-NLS
    if (valueTypeText == null) {
      throw new ParseException("Attribute 'value-type' is undefined", getLocator());
    }
    try {
      final ClassLoader classLoader = ObjectUtilities.getClassLoader(getClass());
      valueType = Class.forName(valueTypeText, false, classLoader);
    } catch (Exception e) {
      throw new ParseException("Attribute 'value-type' is not valid", e, getLocator());
    }

    valueRole = attrs.getValue(getUri(), "value-role"); // NON-NLS
    if (valueRole == null) {
      valueRole = "Value"; // NON-NLS
    }

    propertyEditor = attrs.getValue(getUri(), "propertyEditor"); // NON-NLS

    final String metaDataCoreClass = attrs.getValue(getUri(), "impl"); // NON-NLS
    if (metaDataCoreClass != null) {
      attributeCore =
          ObjectUtilities.loadAndInstantiate(
              metaDataCoreClass, AttributeReadHandler.class, AttributeCore.class);
      if (attributeCore == null) {
        throw new ParseException(
            "Attribute 'impl' references a invalid AttributeCore implementation.", getLocator());
      }
    } else {
      attributeCore = new DefaultAttributeCore();
    }
  }
  /** @noinspection ThrowableResultOfMethodCallIgnored */
  public static void main(final String[] args) {
    boolean offlineMode = false;
    boolean offlineModeSecurityManager = false;

    int parsePos;
    for (parsePos = 0; parsePos < args.length; parsePos += 1) {
      final String arg = args[parsePos];
      if ("--offline".equals(arg) || "-o".equals(arg)) // NON-NLS
      {
        offlineMode = true;
        continue;
      }
      if ("--with-offline-mode-security-manager".equals(arg)) // NON-NLS
      {
        offlineModeSecurityManager = true;
        continue;
      }
      break;
    }

    final File[] files = new File[args.length - parsePos];
    for (int i = 0; i < args.length; i++) {
      final String arg = args[i];
      files[i] = new File(arg);
    }

    System.setProperty("sun.awt.exception.handler", ThrowableHandler.class.getName()); // NON-NLS
    Thread.setDefaultUncaughtExceptionHandler(ThrowableHandler.getInstance());

    System.setProperty(
        "java.util.prefs.PreferencesFactory", BinaryPreferencesFactory.class.getName()); // NON-NLS
    System.setProperty("sun.swing.enableImprovedDragGesture", "true"); // NON-NLS

    ProxySelector.setDefault(new FirewallingProxySelector(ProxySelector.getDefault()));
    if (offlineModeSecurityManager) {
      try {
        System.setSecurityManager(new FirewallingSecurityManager());
      } catch (SecurityException se) {
        DebugLog.log(
            "Unable to set security manager. An other security manager prevented us from gaining control."); // NON-NLS
      }
    }
    if (offlineMode) {
      WorkspaceSettings.getInstance().setOfflineMode(true);
    }

    PropertyEditorManager.registerEditor(Color.class, ColorPropertyEditor.class);

    try {
      SwingUtilities.invokeAndWait(new SetLookAndFeelTask());
      SwingUtilities.invokeAndWait(new InstallAWTHandlerRunnable());

      SwingUtilities.invokeAndWait(new InitializeSplashScreenTask());
      // avoid the big cascading boot so that we can update the splashscreen
      // with some meaning full messages

      SwingUtilities.invokeAndWait(new UpdateStatusTask("Booting Base Libraries ..")); // NON-NLS
      LibLoaderBoot.getInstance().start();
      if (LibLoaderBoot.getInstance().isBootFailed()) {
        throw new IllegalStateException(
            "Booting failed", LibLoaderBoot.getInstance().getBootFailureReason());
      }
      SwingUtilities.invokeAndWait(
          new UpdateStatusTask("Booting Font Rendering System ..")); // NON-NLS
      LibFontBoot.getInstance().start();
      if (LibFontBoot.getInstance().isBootFailed()) {
        throw new IllegalStateException(
            "Booting failed", LibFontBoot.getInstance().getBootFailureReason());
      }
      SwingUtilities.invokeAndWait(new UpdateStatusTask("Booting Reporting-Engine ..")); // NON-NLS
      ClassicEngineBoot.getInstance().start();
      if (ClassicEngineBoot.getInstance().isBootFailed()) {
        throw new IllegalStateException(
            "Booting failed", ClassicEngineBoot.getInstance().getBootFailureReason());
      }
      SwingUtilities.invokeAndWait(new UpdateStatusTask("Booting Report-Designer ..")); // NON-NLS
      ReportDesignerBoot.getInstance().start();
      if (ReportDesignerBoot.getInstance().isBootFailed()) {
        throw new IllegalStateException(
            "Booting failed", ReportDesignerBoot.getInstance().getBootFailureReason());
      }

      // initialize some of the more expensive model components.
      SwingUtilities.invokeAndWait(new UpdateStatusTask("Preloading classes ..")); // NON-NLS
      ExpressionRegistry.getInstance();
      ExpressionsTreeModel.getTreeModel();
      ExpressionUtil.getInstance();
      preloadFonts();

      SwingUtilities.invokeAndWait(
          new UpdateStatusTask("Checking initial configuration ..")); // NON-NLS
      SettingsUtil.createInitialConfiguration();

      SwingUtilities.invokeAndWait(new UpdateStatusTask("Collecting Sample Reports ..")); // NON-NLS
      SamplesTreeBuilder.getSampleTreeModel();

      SwingUtilities.invokeAndWait(new UpdateStatusTask("Starting  ..")); // NON-NLS
      SwingUtilities.invokeAndWait(new CreateReportDesignerFrame(files));
      SwingUtilities.invokeAndWait(new VersionCheckerTask());

      final ElementMetaData data =
          ElementTypeRegistry.getInstance().getElementType("page-header"); // NON-NLS
      final AttributeMetaData[] datas = data.getAttributeDescriptions();
      final int x = datas.length; // ensure that there is some metadata.
    } catch (Throwable t) {
      if (splashScreen != null) {
        splashScreen.dispose();
      }
      UncaughtExceptionsModel.getInstance().addException(t);
      final ExceptionDialog dialog = new ExceptionDialog();
      dialog.setModal(true);
      dialog.showDialog();
      System.exit(1);
    }
  }