Class PlatformSerializerUtil
- java.lang.Object
-
- com._1c.g5.v8.dt.core.streams.impl.PlatformSerializerUtil
-
public final class PlatformSerializerUtil extends Object
Contains useful method for serializaion/deserialization platform object fromIListInStream
/IListOutStream
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Border
getBorderByCompositeId(int platformBorderKind, CompositeId borderId, Version runtimeVersion, org.eclipse.xtext.scoping.IGlobalScopeProvider scopeProvider)
GetsBorder
byCompositeId
static Color
getColorByCompositeId(int platformColorKind, CompositeId colorId, Version runtimeVersion, org.eclipse.xtext.scoping.IGlobalScopeProvider scopeProvider)
GetsColor
byCompositeId
static Font
getFontByCompositeId(int platformFontKind, CompositeId fontId, Version runtimeVersion, org.eclipse.xtext.scoping.IGlobalScopeProvider scopeProvider)
GetsFont
byCompositeId
static int
MulDiv(int nNumber, int nNumerator, int nDenominator)
Multiplies two 32-bit values and then divides the 64-bit result by a third 32-bit value.static Border
readBorder(IListInStream lis, Version runtimeVersion, org.eclipse.xtext.scoping.IGlobalScopeProvider scopeProvider)
ReadsBorder
static Color
readColor(IListInStream lis, Version runtimeVersion, org.eclipse.xtext.scoping.IGlobalScopeProvider scopeProvider)
ReadsColor
static Date
readDate(IListInStream lis)
ReadsDate
static Value
readDefaultValue(IListInStream lis)
ReadsValue
.static Font
readFont(IListInStream lis, Version runtimeVersion, org.eclipse.xtext.scoping.IGlobalScopeProvider scopeProvider)
ReadsFont
static Map<String,String>
readLocalStrings(IListInStream lis)
Reads collection of local strings from streamstatic Picture
readPicture(IListInStream lis, Version runtimeVersion)
ReadsPicture
static CompositeId
readReference(IListInStream lis)
ReadsCompositeId
static Value
readValue(IListInStream lis)
ReadsValue
.static void
writeBorder(IListOutStream los, Border border, boolean withoutStyleItem)
WritesBorder
to the streamstatic void
writeColor(IListOutStream los, Color color, boolean withoutStyleItem)
WritesColor
to the streamstatic void
writeDate(IListOutStream los, Date date)
WritesDate
to the streamstatic void
writeDefaultValue(IListOutStream los, Value value)
WritesValue
to the stream.static void
writeFont(IListOutStream los, Font serializeFont, boolean withoutStyleItem)
WritesFont
to the streamstatic void
writeLocalStrings(IListOutStream los, Collection<? extends Map.Entry<String,String>> localStrings)
Writes collection of local string to the streamstatic void
writePicture(IListOutStream los, Picture picture)
WritesPicture
to the streamstatic void
writeReference(IListOutStream los, CompositeId ref)
WritesCompositeId
to the streamstatic void
writeValue(IListOutStream los, Value value)
WritesValue
to the stream.
-
-
-
Method Detail
-
readColor
public static Color readColor(IListInStream lis, Version runtimeVersion, org.eclipse.xtext.scoping.IGlobalScopeProvider scopeProvider)
ReadsColor
- Parameters:
lis
- stream for reading, can't benull
runtimeVersion
- actual runtime configuration version, can't benull
scopeProvider
- actualIGlobalScopeProvider
, can't benull
- Returns:
- read
Color
from the stream, nevernull
-
writeColor
public static void writeColor(IListOutStream los, Color color, boolean withoutStyleItem)
WritesColor
to the stream
-
readBorder
public static Border readBorder(IListInStream lis, Version runtimeVersion, org.eclipse.xtext.scoping.IGlobalScopeProvider scopeProvider)
ReadsBorder
- Parameters:
lis
- stream for reading, can't benull
runtimeVersion
- actual runtime configuration version, can't benull
scopeProvider
- actualIGlobalScopeProvider
, can't benull
- Returns:
- read
Border
from the stream, nevernull
-
writeBorder
public static void writeBorder(IListOutStream los, Border border, boolean withoutStyleItem)
WritesBorder
to the stream
-
readFont
public static Font readFont(IListInStream lis, Version runtimeVersion, org.eclipse.xtext.scoping.IGlobalScopeProvider scopeProvider)
ReadsFont
- Parameters:
lis
- stream for reading, can't benull
runtimeVersion
- actual runtime configuration version, can't benull
scopeProvider
- actualIGlobalScopeProvider
, can't benull
- Returns:
- read
Font
from the stream, ornull
if it's default font or font can't be read
-
writeFont
public static void writeFont(IListOutStream los, Font serializeFont, boolean withoutStyleItem)
WritesFont
to the stream
-
readLocalStrings
public static Map<String,String> readLocalStrings(IListInStream lis)
Reads collection of local strings from stream- Parameters:
lis
- stream for reading, can't benull
- Returns:
- collection of local strings from stream, never
null
-
writeLocalStrings
public static void writeLocalStrings(IListOutStream los, Collection<? extends Map.Entry<String,String>> localStrings)
Writes collection of local string to the stream- Parameters:
los
- stream for writing, can't benull
localStrings
- writing local strings, can't benull
-
readValue
public static Value readValue(IListInStream lis)
- Parameters:
lis
- stream for reading, can't benull
- Returns:
- read
Value
from the stream, nevernull
-
readDefaultValue
public static Value readDefaultValue(IListInStream lis)
- Parameters:
lis
- stream for reading, can't benull
- Returns:
- read
Value
from the stream, nevernull
-
writeValue
public static void writeValue(IListOutStream los, Value value)
WritesValue
to the stream. Support onlyUndefinedValu
,BooleanValue
,NumberValue
,StringValue
,DateValue
- Parameters:
los
- actual stream, can't benull
value
- writingValue
, can't benull
-
writeDefaultValue
public static void writeDefaultValue(IListOutStream los, Value value)
WritesValue
to the stream. Support onlyUndefinedValu
,BooleanValue
,NumberValue
,StringValue
,DateValue
- Parameters:
los
- actual stream, can't benull
value
- writingValue
, can't benull
-
readReference
public static CompositeId readReference(IListInStream lis)
ReadsCompositeId
- Parameters:
lis
- stream for reading, can't benull
- Returns:
- read
CompositeId
from the stream, nevernull
-
writeReference
public static void writeReference(IListOutStream los, CompositeId ref)
WritesCompositeId
to the stream- Parameters:
los
- actual stream, can't benull
ref
- writingCompositeId
, can't benull
-
getColorByCompositeId
public static Color getColorByCompositeId(int platformColorKind, CompositeId colorId, Version runtimeVersion, org.eclipse.xtext.scoping.IGlobalScopeProvider scopeProvider)
GetsColor
byCompositeId
- Parameters:
platformColorKind
- kind of the color: win, web, stylecolorId
- corresponding to colorCompositeId
runtimeVersion
- actual runtime configuration version, can't benull
scopeProvider
- actualIGlobalScopeProvider
, can't benull
- Returns:
- read
Color
, can benull
if no color for thisCompositeId
-
getFontByCompositeId
public static Font getFontByCompositeId(int platformFontKind, CompositeId fontId, Version runtimeVersion, org.eclipse.xtext.scoping.IGlobalScopeProvider scopeProvider)
GetsFont
byCompositeId
- Parameters:
platformFontKind
- kind of the font: system, v8_fontfontId
- corresponding to colorCompositeId
runtimeVersion
- actual runtime configuration version, can't benull
scopeProvider
- actualIGlobalScopeProvider
, can't benull
- Returns:
- read
Font
, can benull
if no font for thisCompositeId
-
getBorderByCompositeId
public static Border getBorderByCompositeId(int platformBorderKind, CompositeId borderId, Version runtimeVersion, org.eclipse.xtext.scoping.IGlobalScopeProvider scopeProvider)
GetsBorder
byCompositeId
- Parameters:
platformBorderKind
- kind of the border: stylefontId
- corresponding to color CompositeIdruntimeVersion
- actual runtime configuration version, can't benull
scopeProvider
- actualIGlobalScopeProvider
, can't benull
- Returns:
- read
Border
, can benull
if no border for thisCompositeId
-
readDate
public static Date readDate(IListInStream lis)
ReadsDate
- Parameters:
lis
- stream for reading, can't benull
- Returns:
- read
Date
from the stream, nevernull
-
writeDate
public static void writeDate(IListOutStream los, Date date)
WritesDate
to the stream- Parameters:
los
- actual stream, can't benull
date
- writingDate
, can't benull
-
readPicture
public static Picture readPicture(IListInStream lis, Version runtimeVersion)
ReadsPicture
- Parameters:
lis
- stream for reading, can't benull
runtimeVersion
- actual runtime configuration version, can't benull
- Returns:
- read
Picture
from the stream, ornull
if picture is not found among standard collection pictures
-
writePicture
public static void writePicture(IListOutStream los, Picture picture)
WritesPicture
to the stream- Parameters:
los
- actual stream, can't benull
picture
- writingPicture
, can't benull
-
MulDiv
public static int MulDiv(int nNumber, int nNumerator, int nDenominator)
Multiplies two 32-bit values and then divides the 64-bit result by a third 32-bit value. The final result is rounded to the nearest integer. Similar to WinAPi function MulDiv (winbase.h).- Parameters:
nNumber
- the multiplicandnNumerator
- the multipliernDenominator
- the number by which the result of the multiplication operation is to be divided- Returns:
- the result of the multiply and devide
-
-