org.specrunner.source.resource.positional.core
Class AbstractResourceHeader

java.lang.Object
  extended by org.specrunner.source.resource.core.AbstractResource
      extended by org.specrunner.source.resource.positional.core.AbstractResourcePositional
          extended by org.specrunner.source.resource.positional.core.AbstractResourceHeader
All Implemented Interfaces:
IResource, IResourcePositional, IPresentation
Direct Known Subclasses:
CSSResource, JSResource

public abstract class AbstractResourceHeader
extends AbstractResourcePositional

Default resource to be written in header part.

Author:
Thiago Santos

Constructor Summary
protected AbstractResourceHeader(ISource parent, String path, boolean classpath, EType type, Position position)
          Creates a header resource.
 
Method Summary
 nu.xom.Node asNode()
          The object representation as node.
 String asString()
          The object representation as string.
 boolean equals(Object obj)
           
protected abstract  File getFile(ISource output, String name)
          Get the file which represents the output resource.
protected abstract  nu.xom.Element getHeaderTag()
          Get the element which represents the resource.
protected abstract  nu.xom.Element getHeaderTag(ISource output, String name)
          Ges the element which represents the source provided extra information.
 int hashCode()
           
 String toString()
           
 ISource writeTo(ISource output)
          Write the resource to the target, e returns the resulting source.
 
Methods inherited from class org.specrunner.source.resource.positional.core.AbstractResourcePositional
getPosition, setPosition
 
Methods inherited from class org.specrunner.source.resource.core.AbstractResource
filterExisting, getParent, getResourcePath, getResourceURLs, getType, isClasspath, setClasspath, setParent, setResourcePath, setType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.specrunner.source.resource.IResource
getParent, getResourcePath, getType, isClasspath, setClasspath, setParent, setResourcePath, setType
 

Constructor Detail

AbstractResourceHeader

protected AbstractResourceHeader(ISource parent,
                                 String path,
                                 boolean classpath,
                                 EType type,
                                 Position position)
Creates a header resource.

Parameters:
parent - The source.
path - The resource path.
classpath - The classpath flag.
type - The resource nature.
position - The resource position.
Method Detail

writeTo

public ISource writeTo(ISource output)
                throws ResourceException
Description copied from interface: IResource
Write the resource to the target, e returns the resulting source.

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

getHeaderTag

protected abstract nu.xom.Element getHeaderTag()
Get the element which represents the resource.

Returns:
The corresponding element.

getHeaderTag

protected abstract nu.xom.Element getHeaderTag(ISource output,
                                               String name)
Ges the element which represents the source provided extra information.

Parameters:
output - The output source.
name - The output name.
Returns:
The corresponding element.

getFile

protected abstract File getFile(ISource output,
                                String name)
Get the file which represents the output resource.

Parameters:
output - The output source.
name - The name.
Returns:
The result file.

asString

public String asString()
Description copied from interface: IPresentation
The object representation as string.

Returns:
String representation.

asNode

public nu.xom.Node asNode()
Description copied from interface: IPresentation
The object representation as node.

Returns:
Node representation.

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2014. All rights reserved.