Skip to content

java代码生成xml文件

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE
Unknown
license.txt
Notifications You must be signed in to change notification settings

fartherp/javaxml

Repository files navigation

生成XML文件

Build Status Coverage Status Maven Central Sonatype Nexus (Snapshots) GitHub release License Project Stats
Quality gate

Document

java公用信息

Sample Code

Document document = new Document("-//mybatis.org//DTD Mapper 3.0//EN", "http://mybatis.org/dtd/mybatis-3-mapper.dtd");
XmlElement answer = new XmlElement("mapper");
String namespace = "com.github.codegenerator.Mapper";
answer.addAttribute(new Attribute("namespace", namespace));
document.setRootElement(answer);

XmlElement

  1. 实例: Field field = new Field("age", new JavaTypeInfo("java.lang.Integer"));
  2. 初始值: setInitializationString(String initializationString);
  3. transient: setTransient(boolean transient);
  4. volatile: setVolatile(boolean volatile);

Sample Code

XmlElement xmlElement = new XmlElement("select");
Attribute attribute = new Attribute("id", "findAll");
xmlElement.addAttribute(attribute);
TextElement textElement = new TextElement("select * from table");
xmlElement.addElement(textElement);

TextElement

Sample Code

TextElement textElement = new TextElement("select * from table");

Attribute

Sample Code

Attribute attribute = new Attribute("id", "update");

About

java代码生成xml文件

Resources

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE
Unknown
license.txt

Stars

Watchers

Forks

Packages

No packages published