类 XMLExportVisitor

java.lang.Object
com.example.renderer.visitor.XMLExportVisitor
所有已实现的接口:
ExportVisitor

public class XMLExportVisitor extends Object implements ExportVisitor
XML导出访问者实现类
  • 构造器详细资料

    • XMLExportVisitor

      public XMLExportVisitor()
  • 方法详细资料

    • visitCircle

      public void visitCircle(Circle c)
      从接口复制的说明: ExportVisitor
      访问圆形对象
      指定者:
      visitCircle 在接口中 ExportVisitor
      参数:
      c - 要处理的圆形对象
    • visitRectangle

      public void visitRectangle(Rectangle r)
      将矩形对象转换为XML格式输出

      输出格式: <rectangle x="x" y="y" width="width" height="height"/>

      指定者:
      visitRectangle 在接口中 ExportVisitor
      参数:
      r - 要导出的矩形对象(不能为null)
      抛出:
      NullPointerException - 如果矩形对象为null
      IllegalArgumentException - 如果矩形宽度或高度为负数
    • visitEllipse

      public void visitEllipse(Ellipse e)
      将椭圆对象转换为XML格式输出

      输出格式: <ellipse cx="centerX" cy="centerY" rx="xRadius" ry="yRadius"/>

      指定者:
      visitEllipse 在接口中 ExportVisitor
      参数:
      e - 要导出的椭圆对象(不能为null)
      抛出:
      NullPointerException - 如果椭圆对象为null
      IllegalArgumentException - 如果椭圆宽度或高度为负数
    • visitTriangle

      public void visitTriangle(Triangle t)
      将三角形对象转换为XML格式输出

      输出格式: <polygon points="x1,y1 x2,y2 x3,y3"/>

      指定者:
      visitTriangle 在接口中 ExportVisitor
      参数:
      t - 要导出的三角形对象(不能为null)
      抛出:
      NullPointerException - 如果三角形对象为null