Documentation ¶
Index ¶
- func FormatProperties(tab Properties) string
- func FormatPropertiesWithSegment(tab Properties) string
- type Arguments
- type Attributes
- type Atts
- type Environment
- type Parameters
- type Properties
- type Resources
- type SimpleArguments
- type SimpleAttributes
- func (inst *SimpleAttributes) Export(dst map[string]lang.Object) map[string]lang.Object
- func (inst *SimpleAttributes) GetAttribute(name string) lang.Object
- func (inst *SimpleAttributes) GetAttributeRequired(name string) (lang.Object, error)
- func (inst *SimpleAttributes) Import(src map[string]lang.Object)
- func (inst *SimpleAttributes) SetAttribute(name string, value lang.Object)
- type SimpleEnvironment
- type SimpleParameters
- type SimpleProperties
- func (inst *SimpleProperties) Clear()
- func (inst *SimpleProperties) Export(dst map[string]string) map[string]string
- func (inst *SimpleProperties) GetProperty(name string, defaultValue string) string
- func (inst *SimpleProperties) GetPropertyRequired(name string) (string, error)
- func (inst *SimpleProperties) Import(src map[string]string)
- func (inst *SimpleProperties) SetProperty(name string, value string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatPropertiesWithSegment ¶
func FormatPropertiesWithSegment(tab Properties) string
FormatPropertiesWithSegment 将属性表格式化为文本形式(支持分段)
Types ¶
type Arguments ¶
func CreateArguments ¶
func CreateArguments() Arguments
type Attributes ¶
type Attributes interface { Atts GetAttributeRequired(name string) (lang.Object, error) Import(map[string]lang.Object) Export(map[string]lang.Object) map[string]lang.Object }
func CreateAttributes ¶
func CreateAttributes() Attributes
type Environment ¶
type Environment interface { GetEnv(name string) (string, error) SetEnv(name string, value string) Import(map[string]string) Export(map[string]string) map[string]string }
func CreateEnvironment ¶
func CreateEnvironment() Environment
type Parameters ¶
type Parameters interface { GetParam(name string) (string, error) Import(map[string]string) Export(map[string]string) map[string]string }
func CreateParameters ¶
func CreateParameters() Parameters
type Properties ¶
type Properties interface { GetPropertyRequired(name string) (string, error) GetProperty(name string, defaultValue string) string SetProperty(name string, value string) Clear() Export(map[string]string) map[string]string Import(map[string]string) }
Properties 接口表示对属性列表的引用。
func CreateProperties ¶
func CreateProperties() Properties
func ParseProperties ¶
func ParseProperties(text string, container Properties) (Properties, error)
ParseProperties 函数把参数 text 解析为属性表,存入dest中。
type Resources ¶
type Resources interface { GetText(path string) (string, error) GetBinary(path string) ([]byte, error) GetReader(path string) (io.ReadCloser, error) }
Resources 接口提供一组获取资源的方法
type SimpleArguments ¶
type SimpleArguments struct {
// contains filtered or unexported fields
}
func (*SimpleArguments) Export ¶
func (inst *SimpleArguments) Export() []string
func (*SimpleArguments) GetArgument ¶
func (inst *SimpleArguments) GetArgument(name string) (string, error)
func (*SimpleArguments) Import ¶
func (inst *SimpleArguments) Import(args []string)
type SimpleAttributes ¶
type SimpleAttributes struct {
// contains filtered or unexported fields
}
func (*SimpleAttributes) GetAttribute ¶
func (inst *SimpleAttributes) GetAttribute(name string) lang.Object
func (*SimpleAttributes) GetAttributeRequired ¶ added in v0.0.3
func (inst *SimpleAttributes) GetAttributeRequired(name string) (lang.Object, error)
func (*SimpleAttributes) SetAttribute ¶ added in v0.0.3
func (inst *SimpleAttributes) SetAttribute(name string, value lang.Object)
type SimpleEnvironment ¶
type SimpleEnvironment struct {
// contains filtered or unexported fields
}
func (*SimpleEnvironment) Export ¶
func (inst *SimpleEnvironment) Export(dst map[string]string) map[string]string
func (*SimpleEnvironment) GetEnv ¶
func (inst *SimpleEnvironment) GetEnv(name string) (string, error)
func (*SimpleEnvironment) Import ¶
func (inst *SimpleEnvironment) Import(src map[string]string)
func (*SimpleEnvironment) SetEnv ¶
func (inst *SimpleEnvironment) SetEnv(name string, value string)
type SimpleParameters ¶
type SimpleParameters struct { }
func (*SimpleParameters) Export ¶
func (inst *SimpleParameters) Export(table map[string]string) map[string]string
func (*SimpleParameters) GetParam ¶
func (inst *SimpleParameters) GetParam(name string) (string, error)
func (*SimpleParameters) Import ¶
func (inst *SimpleParameters) Import(src map[string]string)
type SimpleProperties ¶
type SimpleProperties struct {
// contains filtered or unexported fields
}
SimpleProperties 实现一个简单的 Properties 集合
func (*SimpleProperties) Export ¶
func (inst *SimpleProperties) Export(dst map[string]string) map[string]string
Export 把本集合中的所有键值对导出
func (*SimpleProperties) GetProperty ¶
func (inst *SimpleProperties) GetProperty(name string, defaultValue string) string
GetProperty 在集合中取指定的值,如果没有则返回默认值
func (*SimpleProperties) GetPropertyRequired ¶
func (inst *SimpleProperties) GetPropertyRequired(name string) (string, error)
GetPropertyRequired 在集合中取指定的值,如果没有则返回error
func (*SimpleProperties) Import ¶
func (inst *SimpleProperties) Import(src map[string]string)
Import 把参数 src 中的所有键值对导入本集合,保留原有内容(如果没有被覆盖)
func (*SimpleProperties) SetProperty ¶
func (inst *SimpleProperties) SetProperty(name string, value string)
SetProperty 给集合中指定的键值对赋值
Click to show internal directories.
Click to hide internal directories.