public abstract class AbstractConfig extends Object implements Serializable
| Constructor and Description |
|---|
AbstractConfig() |
AbstractConfig(ScopeModel scopeModel) |
| Modifier and Type | Method and Description |
|---|---|
static void |
appendAttributes(Map<String,String> parameters,
Object config)
Put attributes of specify 'config' into 'parameters' argument
|
static void |
appendAttributes(Map<String,String> parameters,
Object config,
String prefix) |
static void |
appendParameters(Map<String,String> parameters,
Object config) |
static void |
appendParameters(Map<String,String> parameters,
Object config,
String prefix) |
boolean |
equals(Object obj) |
ApplicationModel |
getApplicationModel() |
ConfigMode |
getConfigMode() |
String |
getId() |
Map<String,String> |
getMetaData()
The new instance of the AbstractConfig subclass should return empty metadata.
The purpose is to get the attributes set by the user instead of the default value when the
refresh() method handles attribute overrides. |
Map<String,String> |
getMetaData(String prefix) |
static String |
getPluralTagName(Class<?> cls) |
List<String> |
getPrefixes() |
ScopeModel |
getScopeModel() |
static String |
getTagName(Class<?> cls) |
static String |
getTypePrefix(Class<? extends AbstractConfig> cls) |
int |
hashCode() |
Boolean |
isDefault() |
boolean |
isNeedRefresh() |
boolean |
isRefreshed() |
boolean |
isValid()
FIXME check @Parameter(required=true) and any conditions that need to match.
|
void |
overrideWithConfig(AbstractConfig newOne,
boolean overrideAll) |
void |
refresh()
Dubbo config property override
|
void |
setDefault(Boolean isDefault) |
void |
setId(String id) |
void |
setNeedRefresh(boolean needRefresh) |
void |
setScopeModel(ScopeModel scopeModel) |
String |
toString() |
public AbstractConfig()
public AbstractConfig(ScopeModel scopeModel)
public static void appendParameters(Map<String,String> parameters, Object config, String prefix)
public static void appendAttributes(Map<String,String> parameters, Object config)
parameters - config - public static void appendAttributes(Map<String,String> parameters, Object config, String prefix)
public ApplicationModel getApplicationModel()
public ScopeModel getScopeModel()
public final void setScopeModel(ScopeModel scopeModel)
@Parameter(excluded=true) public String getId()
public void setId(String id)
public Map<String,String> getMetaData()
The new instance of the AbstractConfig subclass should return empty metadata.
The purpose is to get the attributes set by the user instead of the default value when the refresh() method handles attribute overrides.
The default value of the field should be set in the checkDefault() method,
which will be called at the end of refresh(), so that it will not affect the behavior of attribute overrides.
Notice! This method should include all properties in the returning map, treat @Parameter differently compared to appendParameters?
// FIXME: this method should be completely replaced by appendParameters? // -- Url parameter may use key, but props override only use property name. So replace it with appendAttributes().@Parameter(excluded=true, attribute=false) public List<String> getPrefixes()
public static String getTypePrefix(Class<? extends AbstractConfig> cls)
public ConfigMode getConfigMode()
public void overrideWithConfig(AbstractConfig newOne, boolean overrideAll)
public void refresh()
@Parameter(excluded=true, attribute=false) public boolean isRefreshed()
@Parameter(excluded=true, attribute=false) public boolean isValid()
@Parameter(excluded=true, attribute=false) public Boolean isDefault()
public void setDefault(Boolean isDefault)
@Parameter(excluded=true, attribute=false) public boolean isNeedRefresh()
public void setNeedRefresh(boolean needRefresh)
Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.