Package org.geotools.styling

Examples of org.geotools.styling.SLDParser.readXML()


    private Style[] parseSld(Reader xmlIn) throws ServiceException {
        SLDParser parser = new SLDParser(styleFactory, xmlIn);
        Style[] styles = null;

        try {
            styles = parser.readXML();
        } catch (RuntimeException e) {
            throw new ServiceException(e);
        }

        if ((styles == null) || (styles.length == 0)) {
View Full Code Here


     */
    private Style readSLD(String sldName) throws IOException {
        StyleFactory styleFactory = CommonFactoryFinder.getStyleFactory(null);
        SLDParser stylereader = new SLDParser(styleFactory, getClass().getResource(
                sldName));
        Style[] readStyles = stylereader.readXML();
   
        Style style = readStyles[0];
        return style;
    }
   
View Full Code Here

        SLDParser parser = new SLDParser(sFac);
        File styleRes = TestData.file(this, "styles/" + styleName);

        parser.setInput(styleRes);

        Style s = parser.readXML()[0];

        return s;
    }

    protected void assertTestResult(String testName, EncodeHTMLImageMap imageMap) throws Exception{
View Full Code Here

     * @throws IOException DOCUMENT ME!
     */
    public Style loadStyle(File fileName) throws IOException {
        SLDParser stylereader = new SLDParser(styleFactory, fileName);

        return stylereader.readXML()[0];
    }

    /**
     * tests whether a given file is a file containing type information.
     *
 
View Full Code Here

  private Style[] parseSld(Reader xmlIn) throws WmsException {
    SLDParser parser = new SLDParser(styleFactory, xmlIn);
    Style[] styles = null;

    try {
      styles = parser.readXML();
    } catch (RuntimeException e) {
      throw new WmsException(e);
    }

    if ((styles == null) || (styles.length == 0)) {
View Full Code Here

    protected Style getStyle(String styleName) throws Exception {
        SLDParser parser = new SLDParser(sFac);
        URL styleRes = getClass().getResource("/test-data/styles/" + styleName);
        parser.setInput(styleRes);

        Style s = parser.readXML()[0];

        return s;
    }

    /**
 
View Full Code Here

        SLDParser styleReader = new SLDParser(factory, newSldFile.toURL());
        Style[] readStyles = null;
        Style newStyle;

        try {
            readStyles = styleReader.readXML();

            if (readStyles.length == 0) {
                //I think our style parser does pretty much no error reporting.
                //This is one of the many reasons we need a new SLD parser.
                //We could add new exceptions to it, but it's really just
View Full Code Here

        SLDParser parser = new SLDParser(sFac);
        File styleRes = TestData.file(this, "styles/" + styleName);

        parser.setInput(styleRes);

        Style s = parser.readXML()[0];

        return s;
    }

    protected void assertTestResult(String testName, EncodeHTMLImageMap imageMap) throws Exception{
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.