Package com.crawljax.core.state
Class Eventable
- java.lang.Object
-
- org.jgrapht.graph.DefaultEdge
-
- com.crawljax.core.state.Eventable
-
- All Implemented Interfaces:
Serializable,Cloneable
public class Eventable extends org.jgrapht.graph.DefaultEdge implements Serializable
Eventable class: an element having an event attached to it (onclick, onmouseover, ...) so that it can change the DOM state.- Author:
- mesbah
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEventable.EventTypeThe event type.
-
Field Summary
Fields Modifier and Type Field Description private Elementelementprivate Eventable.EventTypeeventTypeprivate longidprivate Identificationidentificationprivate com.google.common.collect.ImmutableList<FormInput>relatedFormInputsprivate StringrelatedFrameprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description Eventable()Default constructor to support saving instances of this class as an XML.Eventable(CandidateElement candidateElement, Eventable.EventType eventType, long id)Create a new Eventable for a candidateElement and eventType.Eventable(Identification identification, Eventable.EventType eventType)Create a new Eventable for a identification and eventType.Eventable(Identification identification, Eventable.EventType eventType, String relatedFrame)Create a new Eventable for a identification and eventType.Eventable(Node node, Eventable.EventType eventType)Create a new Eventable for a node and eventType.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()booleanequals(Object object)ObjectgetEdgeSource()ObjectgetEdgeTarget()ElementgetElement()Eventable.EventTypegetEventType()longgetId()IdentificationgetIdentification()com.google.common.collect.ImmutableList<FormInput>getRelatedFormInputs()Retrieve the related form inputs.StringgetRelatedFrame()StateVertexgetSourceStateVertex()StateVertexgetTargetStateVertex()inthashCode()voidsetElement(Element element)voidsetEventType(Eventable.EventType eventType)private voidsetField(String fieldName, StateVertex source)voidsetId(long id)voidsetIdentification(Identification identification)voidsetRelatedFormInputs(List<FormInput> relatedFormInputs)Set the list of formInputs.voidsetSource(StateVertex source)voidsetTarget(StateVertex target)StringtoString()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
id
private long id
-
eventType
private Eventable.EventType eventType
-
identification
private Identification identification
-
element
private Element element
-
relatedFormInputs
private com.google.common.collect.ImmutableList<FormInput> relatedFormInputs
-
relatedFrame
private String relatedFrame
-
-
Constructor Detail
-
Eventable
public Eventable()
Default constructor to support saving instances of this class as an XML.
-
Eventable
public Eventable(Identification identification, Eventable.EventType eventType)
Create a new Eventable for a identification and eventType.- Parameters:
identification- the identification object.eventType- the event type.
-
Eventable
public Eventable(Identification identification, Eventable.EventType eventType, String relatedFrame)
Create a new Eventable for a identification and eventType.- Parameters:
identification- the identification object.eventType- the event.relatedFrame- the frame containing this element.
-
Eventable
public Eventable(Node node, Eventable.EventType eventType)
Create a new Eventable for a node and eventType.- Parameters:
node- The DOM element.eventType- the event type.
-
Eventable
public Eventable(CandidateElement candidateElement, Eventable.EventType eventType, long id)
Create a new Eventable for a candidateElement and eventType.- Parameters:
candidateElement- The CandidateElement element.eventType- the event type. TODO ali remove
-
-
Method Detail
-
getEventType
public Eventable.EventType getEventType()
- Returns:
- the eventType.
-
setEventType
public void setEventType(Eventable.EventType eventType)
- Parameters:
eventType- the eventType to set
-
getId
public long getId()
- Returns:
- the id
-
setId
public void setId(long id)
- Parameters:
id- the id to set
-
getIdentification
public Identification getIdentification()
- Returns:
- the identification
-
setIdentification
public void setIdentification(Identification identification)
- Parameters:
identification- the identification to set
-
getElement
public Element getElement()
- Returns:
- the element
-
setElement
public void setElement(Element element)
- Parameters:
element- the element to set
-
getRelatedFormInputs
public com.google.common.collect.ImmutableList<FormInput> getRelatedFormInputs()
Retrieve the related form inputs.- Returns:
- the formInputs
-
setRelatedFormInputs
public void setRelatedFormInputs(List<FormInput> relatedFormInputs)
Set the list of formInputs.- Parameters:
relatedFormInputs- the list of formInputs
-
getSourceStateVertex
public StateVertex getSourceStateVertex()
- Returns:
- the source state.
- Throws:
CrawljaxException- if the source cannot be found.
-
getTargetStateVertex
public StateVertex getTargetStateVertex()
- Returns:
- the target state.
- Throws:
CrawljaxException- if the target cannot be found.
-
getRelatedFrame
public String getRelatedFrame()
- Returns:
- the relatedFrame
-
setSource
public void setSource(StateVertex source)
-
setField
private void setField(String fieldName, StateVertex source)
-
setTarget
public void setTarget(StateVertex target)
-
toString
public String toString()
- Overrides:
toStringin classorg.jgrapht.graph.DefaultEdge
-
getEdgeSource
public Object getEdgeSource()
-
getEdgeTarget
public Object getEdgeTarget()
-
-