类 XMLExportVisitor
java.lang.Object
com.example.renderer.visitor.XMLExportVisitor
- 所有已实现的接口:
ExportVisitor
XML导出访问者实现类
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void访问圆形对象void将椭圆对象转换为XML格式输出void将矩形对象转换为XML格式输出void将三角形对象转换为XML格式输出
-
构造器详细资料
-
XMLExportVisitor
public XMLExportVisitor()
-
-
方法详细资料
-
visitCircle
从接口复制的说明:ExportVisitor访问圆形对象- 指定者:
visitCircle在接口中ExportVisitor- 参数:
c- 要处理的圆形对象
-
visitRectangle
将矩形对象转换为XML格式输出输出格式: <rectangle x="x" y="y" width="width" height="height"/>
- 指定者:
visitRectangle在接口中ExportVisitor- 参数:
r- 要导出的矩形对象(不能为null)- 抛出:
NullPointerException- 如果矩形对象为nullIllegalArgumentException- 如果矩形宽度或高度为负数
-
visitEllipse
将椭圆对象转换为XML格式输出输出格式: <ellipse cx="centerX" cy="centerY" rx="xRadius" ry="yRadius"/>
- 指定者:
visitEllipse在接口中ExportVisitor- 参数:
e- 要导出的椭圆对象(不能为null)- 抛出:
NullPointerException- 如果椭圆对象为nullIllegalArgumentException- 如果椭圆宽度或高度为负数
-
visitTriangle
将三角形对象转换为XML格式输出输出格式: <polygon points="x1,y1 x2,y2 x3,y3"/>
- 指定者:
visitTriangle在接口中ExportVisitor- 参数:
t- 要导出的三角形对象(不能为null)- 抛出:
NullPointerException- 如果三角形对象为null
-