类 XmlExportVisitor
java.lang.Object
com.example.graphics.visitor.XmlExportVisitor
- 所有已实现的接口:
ShapeVisitor
Visitor implementation that exports shapes to XML format.
This is an implementation of the Visitor pattern.
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
clear()
Clear all shapes and reset the visitorGet the XML representation of all visited shapesvoid
Visit a Circle shapevoid
Visit a Line shapevoid
Visit a Rectangle shapevoid
Visit a Triangle shape
-
字段详细资料
-
document
-
rootElement
-
-
构造器详细资料
-
XmlExportVisitor
public XmlExportVisitor()Constructor initializes the XML document
-
-
方法详细资料
-
visit
从接口复制的说明:ShapeVisitor
Visit a Circle shape- 指定者:
visit
在接口中ShapeVisitor
- 参数:
circle
- the circle to visit
-
visit
从接口复制的说明:ShapeVisitor
Visit a Rectangle shape- 指定者:
visit
在接口中ShapeVisitor
- 参数:
rectangle
- the rectangle to visit
-
visit
从接口复制的说明:ShapeVisitor
Visit a Line shape- 指定者:
visit
在接口中ShapeVisitor
- 参数:
line
- the line to visit
-
visit
从接口复制的说明:ShapeVisitor
Visit a Triangle shape- 指定者:
visit
在接口中ShapeVisitor
- 参数:
triangle
- the triangle to visit
-
getXmlOutput
Get the XML representation of all visited shapes- 返回:
- an XML string representing all shapes
-
clear
public void clear()Clear all shapes and reset the visitor
-