Package com.mycila.xmltool

Examples of com.mycila.xmltool.XMLTag


                content);
    }

    @Test
    public void test_load_definitions2() throws Exception {
        XMLTag def = XMLDoc.newDocument(true).addRoot("additionalHeaders")
                .addTag("text")
                .addTag("firstLine").addText(":(")
                .addTag("beforeEachLine").addText(" ( ")
                .addTag("endLine").addText(":(")
                .addTag("firstLineDetectionPattern").addText("\\:\\(")
                .addTag("lastLineDetectionPattern").addText("\\:\\(");

        System.out.println(def.toString());

        AdditionalHeaderDefinition loader = new AdditionalHeaderDefinition(def);
       
        Map<String, String> props = new HashMap<String, String>();
        props.put("year", "2008");
View Full Code Here


        System.out.println(header.buildForDefinition(loader.getDefinitions().get("text"), false));
    }

  @Test
    public void test_advanced_definitions() throws Exception {
        XMLTag def = XMLDoc.newDocument(true).addRoot("additionalHeaders")
                .addTag("csregion")
                .addTag("firstLine").addText("#region LicenseEOL/**")
                .addTag("beforeEachLine").addText(" * ")
                .addTag("endLine").addText(" */EOL#endregion")
                .addTag("firstLineDetectionPattern").addText("#region.*^EOL/\\*\\*.*$")
 
View Full Code Here

        return add(DEFAULT_HEADER_STYLES);
    }

    HeaderStyles add(URL styleLocation) {
        notNull(styleLocation, "Style location");
        XMLTag tag = XMLDoc.from(styleLocation, false);
        ValidationResult res = tag.validate(HEADER_STYLES_SCHEMA);
        if (res.hasError()) {
            throw new LicenseManagerException("Style definition at '" + styleLocation + "' is not valid: " + res.getErrorMessages()[0]);
        }
        final String ns = tag.getPefix("http://mycila.com/license/styles/1.0");
        tag.forEachChild(new CallBack() {
            public void execute(XMLTag doc) {
                Builder builder = add(doc.getAttribute("name"))
                        .defineBegining(doc.getTextOrCDATA("%1$s:definition/%1$s:begining", ns))
                        .defineStartLine(doc.getTextOrCDATA("%1$s:definition/%1$s:startLine", ns))
                        .defineEnding(doc.getTextOrCDATA("%1$s:definition/%1$s:ending", ns))
View Full Code Here

        return add(DEFAULT_DOCUMENT_TYPES);
    }

    DocumentTypes add(URL mappingLocation) {
        notNull(mappingLocation, "Mapping location");
        XMLTag tag = XMLDoc.from(mappingLocation, false);
        ValidationResult res = tag.validate(DOCUMENT_TYPES_SCHEMA);
        if (res.hasError()) {
            throw new LicenseManagerException("Mapping definition at '" + mappingLocation + "' is not valid: " + res.getErrorMessages()[0]);
        }
        tag.forEachChild(new CallBack() {
            public void execute(XMLTag doc) {
                map(doc.getAttribute("extension")).to(headerStyles.getByName(doc.getAttribute("style")));
            }
        });
        return this;
View Full Code Here

    }
    //*/
  }

  private static XMLTag createTopology(int ldapPort) {
    XMLTag xml = XMLDoc.newDocument( true )
        .addRoot( "topology" )
        .addTag( "gateway" )
       
        .addTag( "provider" )
        .addTag( "role" ).addText( "authentication" )
View Full Code Here

    gatewayUrl = "http://localhost:" + gateway.getAddresses()[0].getPort() + "/" + config.getGatewayPath();
    clusterUrl = gatewayUrl + "/cluster";
  }

  private static XMLTag createTopology() {
    XMLTag xml = XMLDoc.newDocument( true )
        .addRoot( "topology" )
        .addTag( "gateway" )
        .addTag( "provider" )
        .addTag( "role" ).addText( "authentication" )
        .addTag( "enabled" ).addText( "true" )
View Full Code Here

    }
    //*/
  }

  private static XMLTag createTopology(int ldapPort) {
    XMLTag xml = XMLDoc.newDocument( true )
        .addRoot( "topology" )
        .addTag( "gateway" )
       
        .addTag( "provider" )
        .addTag( "role" ).addText( "authentication" )
View Full Code Here

   * Creates a topology that is deployed to the gateway instance for the test suite.
   * Note that this topology is shared by all of the test methods in this suite.
   * @return A populated XML structure for a topology file.
   */
  private static XMLTag createTopology() {
    XMLTag xml = XMLDoc.newDocument( true )
        .addRoot( "topology" )
          .addTag( "gateway" )
            .addTag( "provider" )
              .addTag( "role" ).addText( "webappsec" )
              .addTag( "name" ).addText( "WebAppSec" )
View Full Code Here

    gateway.stop();
    FileUtils.deleteQuietly( gatewayHome );
  }

  private static XMLTag createTopology() {
    XMLTag xml = XMLDoc.newDocument( true )
        .addRoot( "topology" )
        .addTag( "gateway" )

        .addTag( "provider" )
        .addTag( "role" ).addText( "authentication" )
View Full Code Here

    gatewayUrl = "http://localhost:" + gateway.getAddresses()[0].getPort() + "/" + config.getGatewayPath();
    clusterUrl = gatewayUrl + "/test-cluster";
  }

  private static XMLTag createTopology() {
    XMLTag xml = XMLDoc.newDocument( true )
        .addRoot( "topology" )
        .addTag( "gateway" )
        .addTag( "provider" )
        .addTag( "role" ).addText( "authentication" )
        .addTag( "enabled" ).addText( "true" )
View Full Code Here

TOP

Related Classes of com.mycila.xmltool.XMLTag

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.