org.specrunner.source.resource.element.core
Class AbstractResourceElementAtt

java.lang.Object
  extended by org.specrunner.source.resource.core.AbstractResource
      extended by org.specrunner.source.resource.element.core.AbstractResourceElement
          extended by org.specrunner.source.resource.element.core.AbstractResourceElementAtt
All Implemented Interfaces:
IResourceElement, IResource, IPresentation
Direct Known Subclasses:
ImageResource, JavaScriptResource, StylesheetResource

public abstract class AbstractResourceElementAtt
extends AbstractResourceElement

A resource.

Author:
Thiago Santos

Constructor Summary
AbstractResourceElementAtt(ISource parent, String path, boolean classpath, EType type, nu.xom.Element element, String reference, String prefix)
          Creates a resource.
 
Method Summary
protected  void appendChild(nu.xom.Element root)
          Append child elements, by default add a comment.
 nu.xom.Node asNode()
          The object representation as node.
 String asString()
          The object representation as string.
protected  String getPrefix()
          Get a description prefix.
protected  String getReferenceName()
          Get the attribute name reference.
 ISource writeTo(ISource target)
          Write the resource to the target, e returns the resulting source.
 
Methods inherited from class org.specrunner.source.resource.element.core.AbstractResourceElement
getElement, setElement
 
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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.specrunner.source.resource.IResource
getParent, getResourcePath, getType, isClasspath, setClasspath, setParent, setResourcePath, setType
 

Constructor Detail

AbstractResourceElementAtt

public AbstractResourceElementAtt(ISource parent,
                                  String path,
                                  boolean classpath,
                                  EType type,
                                  nu.xom.Element element,
                                  String reference,
                                  String prefix)
Creates a resource.

Parameters:
parent - The source parent.
path - The resource path.
classpath - The classpath flag.
type - The resource nature.
element - The referred element.
reference - The reference attribute.
prefix - The name to log.
Method Detail

writeTo

public ISource writeTo(ISource target)
                throws ResourceException
Description copied from interface: IResource
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.

getReferenceName

protected String getReferenceName()
Get the attribute name reference.

Returns:
The reference. i.e. href, src, etc.

asString

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

Returns:
String representation.

getPrefix

protected String getPrefix()
Get a description prefix.

Returns:
The prefix.

asNode

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

Returns:
Node representation.

appendChild

protected void appendChild(nu.xom.Element root)
Append child elements, by default add a comment.

Parameters:
root - The root element.


Copyright © 2014. All rights reserved.