Class XMLSchemaGenerator

java.lang.Object
com.codename1.rad.annotations.processors.XMLSchemaGenerator

public class XMLSchemaGenerator extends Object
  • Constructor Details

  • Method Details

    • setPartialSchema

      public void setPartialSchema(boolean partial)
    • setAllTags

      public void setAllTags(Map<String,TypeElement> tags)
    • setChecksum

      public void setChecksum(String checksum)
      Sets a checksum to embed in the file. This can be any checksum, not necessarily related to the file contents, which is used to determine if the file needs to be updated. Currently the checksum is based on the imports in the file.
      Parameters:
      checksum -
    • addInclude

      public void addInclude(File includeFile)
    • addSubGenerator

      public void addSubGenerator(XMLSchemaGenerator generator)
    • writeToFile

      public void writeToFile() throws IOException
      Writes to file. Will not overwrite existing file at location. Will create parent directory if necessary.
      Throws:
      IOException
    • getCommonDir

      public File getCommonDir()
    • getJavaSourceFile

      public File getJavaSourceFile()
      Gets the Java source file associated with this schema, if it is in the common/src/main/java directory
      Returns:
    • isJavaSourceChanged

      public boolean isJavaSourceChanged()
      Checks if the Java source file has changed since the schema file was generated. If no java source file is found, this returns false. If schema file doesn't exist, this returns true. If both Java source file and schema file exists, this returns true if the source file has been modified after the schema file was modified.
      Returns:
    • getSchemaFile

      public File getSchemaFile() throws IOException
      Throws:
      IOException
    • setWriteElements

      public void setWriteElements(boolean writeElements)
    • writeSchema

      public StringBuilder writeSchema(StringBuilder sb) throws IOException
      Throws:
      IOException
    • writeSchema

      public StringBuilder writeSchema(StringBuilder sb, boolean writeHeader) throws IOException
      Throws:
      IOException