Package io.protostuff.compiler
Class ProtoModule
- java.lang.Object
-
- io.protostuff.compiler.ProtoModule
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ProtoModule
public class ProtoModule extends java.lang.Object implements java.io.SerializableConfiguration for the proto w/c ontains the compile options and arguments.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.HashMap<java.lang.String,java.lang.Object>attributes(package private) java.util.Propertiesconfigstatic java.lang.StringDEFAULT_GENERATOR_NAMEprivate java.lang.Stringencodingprivate java.lang.Stringgeneratorstatic booleanJAVA_9_AND_ABOVEtruefor JDKs 9, 10, 11, etc;falsefor 1.8 and below.private java.util.Propertiesoptionsprivate java.lang.Stringoutputprivate java.io.FileoutputDirprivate CachingProtoLoaderprotoLoaderprivate static longserialVersionUIDprivate java.io.Filesource
-
Constructor Summary
Constructors Constructor Description ProtoModule()ProtoModule(java.io.File source, java.lang.String output, java.lang.String encoding, java.io.File outputDir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.HashMap<java.lang.String,java.lang.Object>getAttributes()java.util.HashMap<java.lang.String,java.lang.Object>getAttrs()Alias forgetAttributes().CachingProtoLoadergetCachingProtoLoader()java.util.PropertiesgetConfig()java.lang.StringgetEncoding()java.lang.StringgetGenerator()java.lang.StringgetOption(java.lang.String key)java.util.PropertiesgetOptions()java.lang.StringgetOutput()java.io.FilegetOutputDir()java.io.FilegetSource()booleanisJavaVersion9()Determines if current runtime environment is JDK version 9 or above.voidsetAttribute(java.lang.String key, java.lang.Object value)voidsetCachingProtoLoader(CachingProtoLoader protoLoader)voidsetEncoding(java.lang.String encoding)voidsetGenerator(java.lang.String generator)Set current generator namevoidsetOption(java.lang.String key, java.lang.String value)voidsetOptions(java.util.Properties options)voidsetOutput(java.lang.String output)voidsetOutputDir(java.io.File outputDir)voidsetSource(java.io.File source)
-
-
-
Field Detail
-
DEFAULT_GENERATOR_NAME
public static final java.lang.String DEFAULT_GENERATOR_NAME
- See Also:
- Constant Field Values
-
JAVA_9_AND_ABOVE
public static final boolean JAVA_9_AND_ABOVE
truefor JDKs 9, 10, 11, etc;falsefor 1.8 and below.
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
source
private java.io.File source
-
output
private java.lang.String output
-
encoding
private java.lang.String encoding
-
outputDir
private java.io.File outputDir
-
generator
private java.lang.String generator
-
options
private java.util.Properties options
-
config
java.util.Properties config
-
protoLoader
private CachingProtoLoader protoLoader
-
attributes
private java.util.HashMap<java.lang.String,java.lang.Object> attributes
-
-
Method Detail
-
getSource
public java.io.File getSource()
- Returns:
- the source
-
setSource
public void setSource(java.io.File source)
- Parameters:
source- the source to set
-
getOutput
public java.lang.String getOutput()
- Returns:
- the output
-
setOutput
public void setOutput(java.lang.String output)
- Parameters:
output- the output to set
-
isJavaVersion9
public boolean isJavaVersion9()
Determines if current runtime environment is JDK version 9 or above.
-
getGenerator
public java.lang.String getGenerator()
- Returns:
- the current generator name that can be used generated code for identification
-
setGenerator
public void setGenerator(java.lang.String generator)
Set current generator name- Parameters:
generator- the generator name
-
getEncoding
public java.lang.String getEncoding()
- Returns:
- the encoding
-
setEncoding
public void setEncoding(java.lang.String encoding)
- Parameters:
encoding- the encoding to set
-
getOutputDir
public java.io.File getOutputDir()
- Returns:
- the outputDir
-
setOutputDir
public void setOutputDir(java.io.File outputDir)
- Parameters:
outputDir- the outputDir to set
-
getOptions
public java.util.Properties getOptions()
- Returns:
- the options
-
setOptions
public void setOptions(java.util.Properties options)
- Parameters:
options-
-
getOption
public java.lang.String getOption(java.lang.String key)
-
setOption
public void setOption(java.lang.String key, java.lang.String value)
-
getCachingProtoLoader
public CachingProtoLoader getCachingProtoLoader()
-
setCachingProtoLoader
public void setCachingProtoLoader(CachingProtoLoader protoLoader)
-
getConfig
public java.util.Properties getConfig()
-
setAttribute
public void setAttribute(java.lang.String key, java.lang.Object value)
-
getAttrs
public java.util.HashMap<java.lang.String,java.lang.Object> getAttrs()
Alias forgetAttributes().
-
getAttributes
public java.util.HashMap<java.lang.String,java.lang.Object> getAttributes()
-
-