org.specrunner.source.resource
Interface IResource

All Superinterfaces:
IPresentation
All Known Subinterfaces:
IResourceElement, IResourcePositional
All Known Implementing Classes:
AbstractResource, AbstractResourceElement, AbstractResourceElementAtt, AbstractResourceHeader, AbstractResourcePositional, CSSResource, ImageResource, JavaScriptResource, JSResource, StylesheetResource

public interface IResource
extends IPresentation

A resource is something attached somehow to the source. For example, CSSs, Java Scripts, images, etc.

Author:
Thiago Santos

Method Summary
 ISource getParent()
          The reference parent.
 String getResourcePath()
          The resource path, relative to classpath. i.e.
 EType getType()
          The resource type.
 boolean isClasspath()
          The resource is relative to classpath?
 void setClasspath(boolean classpath)
          Set the classpath context.
 void setParent(ISource parent)
          Change the resource parent.
 void setResourcePath(String path)
          Set the resource path.
 void setType(EType type)
          Resource type.
 ISource writeTo(ISource target)
          Write the resource to the target, e returns the resulting source.
 
Methods inherited from interface org.specrunner.util.xom.IPresentation
asNode, asString
 

Method Detail

getParent

ISource getParent()
The reference parent.

Returns:
The parent.

setParent

void setParent(ISource parent)
Change the resource parent.

Parameters:
parent - The new parent.

getResourcePath

String getResourcePath()
The resource path, relative to classpath. i.e. '/css/specrunner.css'

Returns:
The path.

setResourcePath

void setResourcePath(String path)
Set the resource path.

Parameters:
path - The resource path.

isClasspath

boolean isClasspath()
The resource is relative to classpath?

Returns:
true, if so, false, otherwise.

setClasspath

void setClasspath(boolean classpath)
Set the classpath context.

Parameters:
classpath - true, for classpath relative, false, otherwise.

getType

EType getType()
The resource type.

Returns:
The resource.

setType

void setType(EType type)
Resource type.

Parameters:
type - The new type.

writeTo

ISource writeTo(ISource target)
                throws ResourceException
Write the resource to the target, e returns the resulting source.

Parameters:
target - The target reference.
Returns:
The result source.
Throws:
ResourceException - On writing errors.


Copyright © 2014. All rights reserved.