Package org.freeplane.n3.nanoxml

Examples of org.freeplane.n3.nanoxml.ContentReader


  public String toXmlString() {
    try {
      final String header = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
      final StringWriter writer = new StringWriter();
      final CdataContentXmlWriter xmlWriter = new CdataContentXmlWriter(writer);
      xmlWriter.addRawContent(header);
      xmlWriter.addRawContent(System.getProperty("line.separator"));
      xmlWriter.write(toXml(), true);
      return writer.toString();
    }
    catch (IOException e) {
      // StringWriter does not throw an exception but anyhow...
      throw new RuntimeException(e);
View Full Code Here


    if (!configXml.exists()) {
      LogUtils.info(pathToFile + " does not exist yet");
      return;
    }
    try {
      final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
      inputStream = new BufferedInputStream(new FileInputStream(configXml));
      final IXMLReader reader = new StdXMLReader(inputStream);
      parser.setReader(reader);
      final XMLElement loader = (XMLElement) parser.parse();
      final Vector<XMLElement> formats = loader.getChildren();
      for (XMLElement elem : formats) {
        final String type = elem.getAttribute("type", null);
        final String style = elem.getAttribute("style", null);
        final String name = elem.getAttribute("name", null);
View Full Code Here

  void loadConditions(final DefaultComboBoxModel filterConditionModel, final String pathToFilterFile,
      final boolean showPopupOnError)
          throws IOException {
    try {
      final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
      File filterFile = new File(pathToFilterFile);
      final IXMLReader reader = new StdXMLReader(new BufferedInputStream(new FileInputStream(filterFile)));
      parser.setReader(reader);
      reader.setSystemID(filterFile.toURL().toString());
      final XMLElement loader = (XMLElement) parser.parse();
      final Vector<XMLElement> conditions = loader.getChildren();
      for (int i = 0; i < conditions.size(); i++) {
        final ASelectableCondition condition = getConditionFactory().loadCondition(conditions.get(i));
        if(condition != null){
          filterConditionModel.addElement(condition);
View Full Code Here

    File[] addonXmlFiles = addOnsDir.listFiles(new FilenameFilter() {
      public boolean accept(File dir, String name) {
        return name.endsWith(".plugin.xml");
      }
    });
    final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
    for (File file : addonXmlFiles) {
      BufferedInputStream inputStream = null;
      try {
        inputStream = new BufferedInputStream(new FileInputStream(file));
        final IXMLReader reader = new StdXMLReader(inputStream);
        parser.setReader(reader);
        registerInstalledAddOn(new AddOnProperties(AddOnType.PLUGIN, (XMLElement) parser.parse()));
      }
      catch (final Exception e) {
        LogUtils.warn("error parsing " + file, e);
      }
      finally {
View Full Code Here

  }
 
  private void createXSLTExportActions( final String xmlDescriptorFile) {
    InputStream xmlDescriptorStream = null;
    try {
      final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
      final URL resource = ResourceController.getResourceController().getResource(xmlDescriptorFile);
      xmlDescriptorStream = resource.openStream();
      final IXMLReader reader = new StdXMLReader(xmlDescriptorStream);
      parser.setReader(reader);
      final XMLElement xml = (XMLElement) parser.parse();
      final Enumeration<XMLElement> actionDescriptors = xml.enumerateChildren();
      while (actionDescriptors.hasMoreElements()) {
        final XMLElement descriptor = actionDescriptors.nextElement();
        final String name = descriptor.getAttribute("name", null);
        final XMLElement xmlProperties = descriptor.getFirstChildNamed("properties");
View Full Code Here

    if (!configXml.exists()) {
      LogUtils.info(pathToFile + " does not exist yet");
      return;
    }
    try {
      final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
      final IXMLReader reader = new StdXMLReader(new BufferedInputStream(new FileInputStream(configXml)));
      parser.setReader(reader);
      final XMLElement loader = (XMLElement) parser.parse();
      final Vector<XMLElement> scannerElements = loader.getChildren();
      for (XMLElement elem : scannerElements) {
        scanners.add(parseScanner(elem));
      }
      boolean haveDefault = false;
View Full Code Here

      @Override
            public boolean accept(File dir, String name) {
        return name.endsWith(".script.xml");
      }
    });
    final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
    for (File file : addonXmlFiles) {
      BufferedInputStream inputStream = null;
      try {
        inputStream = new BufferedInputStream(new FileInputStream(file));
        final IXMLReader reader = new StdXMLReader(inputStream);
        parser.setReader(reader);
        final ScriptAddOnProperties addOn = new ScriptAddOnProperties((XMLElement) parser.parse());
        addOn.setAddOnPropertiesFile(file);
        AddOnsController.getController().registerInstalledAddOn(addOn);
      }
      catch (final Exception e) {
        LogUtils.warn("error parsing " + file, e);
View Full Code Here

    String marshalled = ResourceController.getResourceController().getProperty(window_preference_storage_property);
    return unmarschall(marshalled, dialog);
  }
  protected XMLElement unmarschall(final String marshalled, final JDialog dialog) {
    if (marshalled != null) {
      final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
      final IXMLReader xmlReader = new StdXMLReader(new StringReader(marshalled));
      parser.setReader(xmlReader);
      try {
        final XMLElement storage = (XMLElement) parser.parse();
        if (storage != null) {
          x = Integer.parseInt(storage.getAttribute("x", "-1"));
          y = Integer.parseInt(storage.getAttribute("y", "-1"));
          width = Integer.parseInt(storage.getAttribute("width", "-1"));
          height = Integer.parseInt(storage.getAttribute("height", "-1"));
View Full Code Here

      return;
    }
    try {
      final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
      inputStream = new BufferedInputStream(new FileInputStream(configXml));
      final IXMLReader reader = new StdXMLReader(inputStream);
      parser.setReader(reader);
      final XMLElement loader = (XMLElement) parser.parse();
      final Vector<XMLElement> formats = loader.getChildren();
      for (XMLElement elem : formats) {
        final String type = elem.getAttribute("type", null);
View Full Code Here

      final boolean showPopupOnError)
          throws IOException {
    try {
      final IXMLParser parser = XMLParserFactory.createDefaultXMLParser();
      File filterFile = new File(pathToFilterFile);
      final IXMLReader reader = new StdXMLReader(new BufferedInputStream(new FileInputStream(filterFile)));
      parser.setReader(reader);
      reader.setSystemID(filterFile.toURL().toString());
      final XMLElement loader = (XMLElement) parser.parse();
      final Vector<XMLElement> conditions = loader.getChildren();
      for (int i = 0; i < conditions.size(); i++) {
        final ASelectableCondition condition = getConditionFactory().loadCondition(conditions.get(i));
        if(condition != null){
View Full Code Here

TOP

Related Classes of org.freeplane.n3.nanoxml.ContentReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.