Class XMLSchemaGenerator
java.lang.Object
com.codename1.rad.annotations.processors.XMLSchemaGenerator
-
Constructor Summary
ConstructorsConstructorDescriptionXMLSchemaGenerator(ProcessingEnvironment processingEnvironment, ViewProcessor.JavaEnvironment env, File rootDirectory, TypeElement javaClass, TypeElement builderClass) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInclude(File includeFile) voidaddSubGenerator(XMLSchemaGenerator generator) Gets the Java source file associated with this schema, if it is in the common/src/main/java directorybooleanChecks if the Java source file has changed since the schema file was generated.voidsetAllTags(Map<String, TypeElement> tags) voidsetChecksum(String checksum) Sets a checksum to embed in the file.voidsetPartialSchema(boolean partial) voidsetWriteElements(boolean writeElements) writeSchema(StringBuilder sb, boolean writeHeader) voidWrites to file.
-
Constructor Details
-
XMLSchemaGenerator
public XMLSchemaGenerator(ProcessingEnvironment processingEnvironment, ViewProcessor.JavaEnvironment env, File rootDirectory, TypeElement javaClass, TypeElement builderClass)
-
-
Method Details
-
setPartialSchema
public void setPartialSchema(boolean partial) -
setAllTags
-
setChecksum
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
-
addSubGenerator
-
writeToFile
Writes to file. Will not overwrite existing file at location. Will create parent directory if necessary.- Throws:
IOException
-
getCommonDir
-
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
- Throws:
IOException
-
setWriteElements
public void setWriteElements(boolean writeElements) -
writeSchema
- Throws:
IOException
-
writeSchema
- Throws:
IOException
-