Class Profile
java.lang.Object
com._1c.g5.v8.dt.internal.platform.services.core.profiles.Profile
- All Implemented Interfaces:
IProfile
- Direct Known Subclasses:
ProfileDependenciesModule.TestableProfile
Implementation of
IProfile
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IPlatformSerializerCustomization<?>[]
protected Path
protected ProfileFolder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Check current state of the profile.void
delete()
Delete this profile and underlying resource.void
flush()
Flush the profile.getBooleanValue
(String key) Returns theboolean
value associated with the specifiedkey
in this profile.getNumberValue
(String key) Returns theBigDecimal
value associated with the specifiedkey
in this profile.getStringValue
(String key) Returns the string value associated with the specifiedkey
in this profile.<T extends Value>
TReturns the genericValue
associated with the specifiedkey
in this profile.protected Pair<ProfileFolder,
String> Parse a profile key into the pofile folder and value key.protected ProfileFolder
readRootFolder
(Path location) Reads root folder in the target file-sytem location.void
Removes the value associated with the specifiedkey
in this profile, if any.void
setBooleanValue
(String key, boolean value) Associate aboolean
value with the specifiedkey
in this profile.void
setNumberValue
(String key, BigDecimal value) Associate aBigDecimal
value with the specifiedkey
in this profile.void
setStringValue
(String key, String value) Associate aString
value with the specifiedkey
in this profile.void
Associate a genericValue
with the specifiedkey
in this profile.void
sync()
Ensures that future reads from this profile reflect any changes that were saved to the profile resource (from any sourcees - DT IDE or 1C:Enterprise processes) prior to thesync
invocation.protected String
Construct path to child folder from the parent folder by its path and relative path.toString()
-
Field Details
-
CUSTOMIZATIONS
-
location
-
rootFolder
-
-
Constructor Details
-
Profile
Constructor ofProfile
.- Parameters:
location
- the path to profile file in file-system, cannot benull
-
-
Method Details
-
setValue
Description copied from interface:IProfile
Associate a genericValue
with the specifiedkey
in this profile. Key consist of path to target folder and key name, all splitted with/
delimiter. -
remove
Description copied from interface:IProfile
Removes the value associated with the specifiedkey
in this profile, if any. Key consist of path to target folder and key name, all splitted with/
delimiter. -
getValue
Description copied from interface:IProfile
Returns the genericValue
associated with the specifiedkey
in this profile. Key consist of path to target folder and key name, all splitted with/
delimiter. -
getStringValue
Description copied from interface:IProfile
Returns the string value associated with the specifiedkey
in this profile. Key consist of path to target folder and key name, all splitted with/
delimiter.This is convenience method that executes
IProfile.getValue(String)
method and extracts actual value.- Specified by:
getStringValue
in interfaceIProfile
- Parameters:
key
- the value key, cannot benull
- Returns:
- the value or
null
if the profile has no value associated withkey
-
setStringValue
Description copied from interface:IProfile
Associate aString
value with the specifiedkey
in this profile. Key consist of path to target folder and key name, all splitted with/
delimiter. This is convenience method that wraps actual value and executesIProfile.setValue(String, Value)
.- Specified by:
setStringValue
in interfaceIProfile
- Parameters:
key
- the value key, cannot benull
value
- the value to associate, cannot benull
-
getBooleanValue
Description copied from interface:IProfile
Returns theboolean
value associated with the specifiedkey
in this profile. Key consist of path to target folder and key name, all splitted with/
delimiter.This is convenience method that executes
IProfile.getValue(String)
method and extracts actual value.- Specified by:
getBooleanValue
in interfaceIProfile
- Parameters:
key
- the value key, cannot benull
- Returns:
- the value or
null
if the profile has no value associated withkey
-
setBooleanValue
Description copied from interface:IProfile
Associate aboolean
value with the specifiedkey
in this profile. Key consist of path to target folder and key name, all splitted with/
delimiter. This is convenience method that wraps actual value and executesIProfile.setValue(String, Value)
.- Specified by:
setBooleanValue
in interfaceIProfile
- Parameters:
key
- the value key, cannot benull
value
- the value to associate, cannot benull
-
getNumberValue
Description copied from interface:IProfile
Returns theBigDecimal
value associated with the specifiedkey
in this profile. Key consist of path to target folder and key name, all splitted with/
delimiter.This is convenience method that executes
IProfile.getValue(String)
method and extracts actual value.- Specified by:
getNumberValue
in interfaceIProfile
- Parameters:
key
- the value key, cannot benull
- Returns:
- the value or
null
if the profile has no value associated withkey
-
setNumberValue
Description copied from interface:IProfile
Associate aBigDecimal
value with the specifiedkey
in this profile. Key consist of path to target folder and key name, all splitted with/
delimiter. This is convenience method that wraps actual value and executesIProfile.setValue(String, Value)
.- Specified by:
setNumberValue
in interfaceIProfile
- Parameters:
key
- the value key, cannot benull
value
- the value to associate, cannot benull
-
flush
Description copied from interface:IProfile
Flush the profile. All profile changes will be applied to the underlying resources.- Specified by:
flush
in interfaceIProfile
- Throws:
IOException
- if an I/0 error occurred
-
sync
Description copied from interface:IProfile
Ensures that future reads from this profile reflect any changes that were saved to the profile resource (from any sourcees - DT IDE or 1C:Enterprise processes) prior to thesync
invocation.All changes will be cleared.
- Specified by:
sync
in interfaceIProfile
- Throws:
IOException
- if an I/0 error occurred
-
delete
Description copied from interface:IProfile
Delete this profile and underlying resource. Once a profile has been deleted, attempting any method on the corresponding instance will fail with anIllegalStateException
.- Specified by:
delete
in interfaceIProfile
- Throws:
IOException
- if an I/0 error occurred
-
toString
-
checkState
protected void checkState()Check current state of the profile.- Throws:
IllegalStateException
- if state is incorrect
-
readRootFolder
Reads root folder in the target file-sytem location. Root folder will contain entire folders structure. If file with the given location does not exist, it will be created.- Parameters:
location
- the path to profile file in file-system, cannot benull
- Throws:
IOException
- if an I/O error occurred during folder read
-
parseKey
Parse a profile key into the pofile folder and value key.- Parameters:
key
- the value key, cannot benull
createIfAbsent
- whether need to create all nonexistent necessary parent folders if absent- Returns:
- the pair of: profile folder and key or
null
, if absent andcreateIfAbsent
isfalse
-
toChild
Construct path to child folder from the parent folder by its path and relative path.- Parameters:
parentPath
- the parent path, can benull
for root folderrelativePath
- the relative path, cannot benull
- Returns:
- the path to child folder, never
null
-