
org.specrunner.source.ISource Maven / Gradle / Ivy
/*
SpecRunner - Acceptance Test Driven Development Tool
Copyright (C) 2011-2013 Thiago Santos
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see
*/
package org.specrunner.source;
import java.io.File;
import java.net.URI;
import java.util.List;
import nu.xom.Document;
import nu.xom.Element;
import org.specrunner.source.resource.IResourceManager;
/**
* Stand for the source of specifications.
*
* @author Thiago Santos
*
*/
public interface ISource extends IEncoded {
/**
* The source reference as String.
*
* @return The source as String.
*/
String getString();
/**
* The source reference as a java.io.File
instance.
*
* @return A file, if possible, otherwise null, if a File representation do
* not exist.
*/
File getFile();
/**
* The source reference as a java.net.URI
instance.
*
* @return A uri, if possible, otherwise null, if a URI representation do
* not exist.
*/
URI getURI();
/**
* Returns the reference as a relative String.
*
* @param other
* The reference to be compared.
* @return The relative reference as String.
*/
String relative(ISource other);
/**
* The relative source resolved.
*
* @param other
* The reference to be opened.
* @return The relative reference.
* @throws SourceException
* On creation errors.
*/
ISource resolve(ISource other) throws SourceException;
/**
* The source factory.
*
* @return The source factory used to create the source.
*/
ISourceFactory getFactory();
/**
* A resource manager. Responsible for handling JavaScripts, CSS, etc,
* related to the specification.
*
* @return The resource reference.
*/
IResourceManager getManager();
/**
* The specification document.
*
* @return The specification as document.
* @throws SourceException
* On creation error.
*/
Document getDocument() throws SourceException;
/**
* The specification scenarios.
*
* @return The specification as document.
* @throws SourceException
* On creation error.
*/
List getScenarios() throws SourceException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy