at.newmedialab.ldpath.model.functions
Class CleanHtmlFunction<Node>

java.lang.Object
  extended by at.newmedialab.ldpath.model.functions.CleanHtmlFunction<Node>
All Implemented Interfaces:
NodeFunction<Collection<Node>,Node>, SelectorFunction<Node>, LDPathConstruct<Node>

public class CleanHtmlFunction<Node>
extends Object
implements SelectorFunction<Node>

Function to clean up HTML and remove all script and style elements from the content.

Author: Sebastian Schaffert


Constructor Summary
CleanHtmlFunction()
           
 
Method Summary
 Collection<Node> apply(RDFBackend<Node> backend, Node context, Collection<Node>... args)
          Apply the function to the list of nodes passed as arguments and return the result as type T.
 String getDescription()
          A short human-readable description of what the node function does.
 String getPathExpression(RDFBackend<Node> backend)
          Return the name of the NodeFunction for registration in the function registry
 String getSignature()
          A string describing the signature of this node function, e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CleanHtmlFunction

public CleanHtmlFunction()
Method Detail

apply

public Collection<Node> apply(RDFBackend<Node> backend,
                              Node context,
                              Collection<Node>... args)
                       throws IllegalArgumentException
Apply the function to the list of nodes passed as arguments and return the result as type T. Throws IllegalArgumentException if the function cannot be applied to the nodes passed as argument or the number of arguments is not correct.

Specified by:
apply in interface NodeFunction<Collection<Node>,Node>
Parameters:
args - a list of KiWiNodes
Returns:
Throws:
IllegalArgumentException

getPathExpression

public String getPathExpression(RDFBackend<Node> backend)
Return the name of the NodeFunction for registration in the function registry

Specified by:
getPathExpression in interface LDPathConstruct<Node>
Parameters:
backend -
Returns:

getSignature

public String getSignature()
A string describing the signature of this node function, e.g. "fn:content(uris : Nodes) : Nodes". The syntax for representing the signature can be chosen by the implementer. This method is for informational purposes only.

Specified by:
getSignature in interface NodeFunction<Collection<Node>,Node>
Returns:

getDescription

public String getDescription()
A short human-readable description of what the node function does.

Specified by:
getDescription in interface NodeFunction<Collection<Node>,Node>
Returns:


Copyright © 2012 Salzburg Research. All Rights Reserved.