Package com._1c.g5.v8.dt.moxel.util
Class MxlSerializerUtil
- java.lang.Object
-
- com._1c.g5.v8.dt.moxel.util.MxlSerializerUtil
-
public class MxlSerializerUtil extends Object
Utils for mxl serializer
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
bytesToInt(byte[] b)
Convert byte array to intstatic int
compareVersions(int[] left, int[] right)
Compare document versionsstatic long
convert29to30(long mask)
Convert format maskstatic long
deleteBit(long value, int bitNum)
Delete bit bitNum from valuestatic CellLineStyle
getCellLineStyle(int index)
Get cell line stylestatic CellTextPosition
getCellTextPosition(int value)
Get text position relative to picturestatic String
getCurrentMxlPrefix()
get mxl document prefix of current versionstatic DetailUse
getDetailUse(int val)
Get detail usestatic DimensionAttributePlacementType
getDimensionAttributePlacementType(int index)
Get dimension attribute placement typestatic DimensionPlacementType
getDimensionPlacementType(int index)
Get dimension placement typestatic DrawingLineStyle
getDrawingLineStyle(int index)
Get drawing line stylestatic DuplexPrintingType
getDuplexPrintingType(int val)
Get duplex printing typestatic FillType
getFillType(int val)
Get fill typestatic DateFractions
getFractionsFromString(String string)
Get date fractions from stringstatic int
getFullMxlPrefixSize()
Get mxl document prefix sizestatic GroupHeaderPlacement
getGroupHeaderPlacement(int val)
Get groups header placementstatic int
getLineOffset(SpreadsheetLine line)
Get line gapstatic int
getLineWidth(SpreadsheetLine line)
Get line widthstatic int
getMxlCellLineStyle(CellLineStyle style)
Get mxl cell line stylestatic int
getMxlDetailUse(DetailUse detailUse)
Get mxl detail usestatic int
getMxlDrawingLineStyle(DrawingLineStyle style)
Get mxl drawing line stylestatic int
getMxlDuplexPrintingType(DuplexPrintingType type)
Get mxl duplex printing typestatic int
getMxlFillType(FillType fillType)
Get mxl fill typestatic int
getMxlGroupHeaderPlacement(GroupHeaderPlacement placement)
Get mxl group placementstatic int
getMxlHorizontalAlign(HorizontalAlignment align)
Get mxl horizontal alignstatic UUID
getMxlLineClass(SpreadsheetLine line)
Get line class idstatic int
getMxlLineStyle(SpreadsheetLine line)
Get line stylestatic int
getMxlNamedItemSubtype(NamedItem item)
Get mxl named item subtypestatic int
getMxlNamedItemType(NamedItem item)
Get mxl named item typestatic int
getMxlPageOrientation(PageOrientation orientation)
Get mxl page orientationstatic int
getMxlPagePlacementAlternation(PagePlacementAlternation alt)
Get mxl page placementstatic int
getMxlPattern(Pattern pattern)
Get mxl patternstatic int
getMxlPicturesizeMode(PictureSize size)
Get mxl picture size modestatic String
getMxlPrefix()
get mxl document prefix of current versionstatic int
getMxlPrefixSize()
Get mxl document prefix sizestatic int
getMxlPrintAccuracy(PrintAccuracy accuracy)
Get mxl print accuracystatic int
getMxlSizeChangeMode(SizeChangeMode mode)
Get mxl size change modestatic int
getMxlStepDirection(SpreadsheetDocumentStepDirectionType direction)
Get mxl step directionstatic int
getMxlTextDirection(SpreadsheetDocumentTextDirectionType direction)
Returns integer value of the text direction ofSpreadsheetDocument
by its enum value.static int
getMxlTextPlacement(TextPlacement placement)
Get mxl text placementstatic int
getMxlTextPosition(CellTextPosition position)
Get value of mxl text position relative to picturestatic int
getMxlVerticalAlign(VerticalAlignment align)
Get mxl vertical alignstatic PageOrientation
getPageOrientation(int val)
Get page orientationstatic PagePlacementAlternation
getPagePlacementAlternation(int val)
Get page placementstatic Pattern
getPattern(int patternIndex)
Get pattern by indexstatic PictureSize
getPictureSizeMode(int value)
Get picture size modestatic PivotTableLinesShowType
getPivotTableLinesShowType(int index)
Get pivot table lines show typestatic PrintAccuracy
getPrintAccuracy(int val)
Get print accuracystatic SizeChangeMode
getSizeChangeMode(int val)
Get size change modestatic StandardAppearance
getStandardAppearance(int index)
Get standard appearancestatic SpreadsheetDocumentStepDirectionType
getStepDirection(int val)
Get step directionstatic SpreadsheetDocumentTextDirectionType
getTextDirection(int val)
ReturnsSpreadsheetDocumentTextDirectionType
value of the text direction by its integer value.static TextPlacement
getTextPlacement(int val)
Get text placementstatic boolean
isFlagSet(long mask, int key)
Is flags set in maskstatic boolean
isVersionCorrect(int[] version)
Check if mxl version is correctstatic int
MulDiv(int a, int b, int c)
Multiply and dividestatic int
readIntFromFile(IFileEx file)
Read int from filestatic String
readStringFromFile(IFileEx file)
Read string from file.
-
-
-
Method Detail
-
getMxlPrefix
public static String getMxlPrefix()
get mxl document prefix of current version- Returns:
- mxl document prefix
-
getMxlPrefixSize
public static int getMxlPrefixSize()
Get mxl document prefix size- Returns:
- mxl document prefix size
-
getFullMxlPrefixSize
public static int getFullMxlPrefixSize()
Get mxl document prefix size- Returns:
- mxl document prefix size
-
getCurrentMxlPrefix
public static String getCurrentMxlPrefix()
get mxl document prefix of current version- Returns:
-
MulDiv
public static int MulDiv(int a, int b, int c)
Multiply and divide- Parameters:
a
-b
-c
-- Returns:
-
bytesToInt
public static int bytesToInt(byte[] b)
Convert byte array to int- Parameters:
b
-- Returns:
-
readIntFromFile
public static int readIntFromFile(IFileEx file)
Read int from file- Parameters:
file
-- Returns:
-
readStringFromFile
public static String readStringFromFile(IFileEx file)
Read string from file.- Parameters:
file
-IFileEx
- Returns:
- result string
-
isFlagSet
public static boolean isFlagSet(long mask, int key)
Is flags set in mask- Parameters:
mask
-key
-- Returns:
-
compareVersions
public static int compareVersions(int[] left, int[] right)
Compare document versions- Parameters:
left
-right
-- Returns:
-
isVersionCorrect
public static boolean isVersionCorrect(int[] version)
Check if mxl version is correct- Parameters:
version
-- Returns:
-
deleteBit
public static long deleteBit(long value, int bitNum)
Delete bit bitNum from value- Parameters:
value
-bitNum
-- Returns:
-
convert29to30
public static long convert29to30(long mask)
Convert format mask- Parameters:
mask
-
-
getPattern
public static Pattern getPattern(int patternIndex)
Get pattern by index- Parameters:
patternIndex
-- Returns:
-
getMxlPattern
public static int getMxlPattern(Pattern pattern)
Get mxl pattern- Parameters:
pattern
-- Returns:
-
getCellLineStyle
public static CellLineStyle getCellLineStyle(int index)
Get cell line style- Parameters:
index
-- Returns:
-
getMxlCellLineStyle
public static int getMxlCellLineStyle(CellLineStyle style)
Get mxl cell line style- Parameters:
style
-- Returns:
-
getDrawingLineStyle
public static DrawingLineStyle getDrawingLineStyle(int index)
Get drawing line style- Parameters:
index
-- Returns:
-
getMxlDrawingLineStyle
public static int getMxlDrawingLineStyle(DrawingLineStyle style)
Get mxl drawing line style- Parameters:
style
-- Returns:
-
getMxlLineStyle
public static int getMxlLineStyle(SpreadsheetLine line)
Get line style- Parameters:
line
-- Returns:
-
getPictureSizeMode
public static PictureSize getPictureSizeMode(int value)
Get picture size mode- Parameters:
value
-- Returns:
-
getMxlPicturesizeMode
public static int getMxlPicturesizeMode(PictureSize size)
Get mxl picture size mode- Parameters:
size
-- Returns:
-
getMxlTextPosition
public static int getMxlTextPosition(CellTextPosition position)
Get value of mxl text position relative to picture- Parameters:
position
- -CellTextPosition
- Returns:
- value of mxl text position relative to picture
-
getCellTextPosition
public static CellTextPosition getCellTextPosition(int value)
Get text position relative to picture- Parameters:
value
- - mxl text position relative to picture- Returns:
- text position relative to picture
-
getFractionsFromString
public static DateFractions getFractionsFromString(String string)
Get date fractions from string- Parameters:
string
-- Returns:
-
getPageOrientation
public static PageOrientation getPageOrientation(int val)
Get page orientation- Parameters:
val
-- Returns:
-
getMxlPageOrientation
public static int getMxlPageOrientation(PageOrientation orientation)
Get mxl page orientation- Parameters:
orientation
-- Returns:
-
getPrintAccuracy
public static PrintAccuracy getPrintAccuracy(int val)
Get print accuracy- Parameters:
val
-- Returns:
-
getMxlPrintAccuracy
public static int getMxlPrintAccuracy(PrintAccuracy accuracy)
Get mxl print accuracy- Parameters:
accuracy
-- Returns:
-
getDuplexPrintingType
public static DuplexPrintingType getDuplexPrintingType(int val)
Get duplex printing type- Parameters:
val
-- Returns:
-
getMxlDuplexPrintingType
public static int getMxlDuplexPrintingType(DuplexPrintingType type)
Get mxl duplex printing type- Parameters:
type
-- Returns:
-
getPagePlacementAlternation
public static PagePlacementAlternation getPagePlacementAlternation(int val)
Get page placement- Parameters:
val
-- Returns:
-
getMxlPagePlacementAlternation
public static int getMxlPagePlacementAlternation(PagePlacementAlternation alt)
Get mxl page placement- Parameters:
alt
-- Returns:
-
getStepDirection
public static SpreadsheetDocumentStepDirectionType getStepDirection(int val)
Get step direction- Parameters:
val
-- Returns:
-
getMxlStepDirection
public static int getMxlStepDirection(SpreadsheetDocumentStepDirectionType direction)
Get mxl step direction- Parameters:
direction
-- Returns:
-
getTextDirection
public static SpreadsheetDocumentTextDirectionType getTextDirection(int val)
ReturnsSpreadsheetDocumentTextDirectionType
value of the text direction by its integer value.- Parameters:
val
- Int value of the text direction ofSpreadsheetDocument
, either 0 or 1.- Returns:
SpreadsheetDocumentTextDirectionType
value of the text direction ofSpreadsheetDocument
, either LEFT_TO_RIGHT(0) or RIGHT_TO_LEFT(1), nevernull
.
-
getMxlTextDirection
public static int getMxlTextDirection(SpreadsheetDocumentTextDirectionType direction)
Returns integer value of the text direction ofSpreadsheetDocument
by its enum value.- Parameters:
direction
-SpreadsheetDocumentTextDirectionType
value of the text direction ofSpreadsheetDocument
, either LEFT_TO_RIGHT(0) or RIGHT_TO_LEFT(1), cannot benull
.- Returns:
- Int value of the text direction of
SpreadsheetDocument
, either 0 or 1.
-
getTextPlacement
public static TextPlacement getTextPlacement(int val)
Get text placement- Parameters:
val
-- Returns:
-
getMxlTextPlacement
public static int getMxlTextPlacement(TextPlacement placement)
Get mxl text placement- Parameters:
placement
-- Returns:
-
getDetailUse
public static DetailUse getDetailUse(int val)
Get detail use- Parameters:
val
-- Returns:
-
getMxlDetailUse
public static int getMxlDetailUse(DetailUse detailUse)
Get mxl detail use- Parameters:
detailUse
-- Returns:
-
getSizeChangeMode
public static SizeChangeMode getSizeChangeMode(int val)
Get size change mode- Parameters:
val
-- Returns:
-
getMxlSizeChangeMode
public static int getMxlSizeChangeMode(SizeChangeMode mode)
Get mxl size change mode- Parameters:
mode
-- Returns:
-
getGroupHeaderPlacement
public static GroupHeaderPlacement getGroupHeaderPlacement(int val)
Get groups header placement- Parameters:
val
-- Returns:
-
getMxlGroupHeaderPlacement
public static int getMxlGroupHeaderPlacement(GroupHeaderPlacement placement)
Get mxl group placement- Parameters:
placement
-- Returns:
-
getLineOffset
public static int getLineOffset(SpreadsheetLine line)
Get line gap- Parameters:
line
-- Returns:
-
getMxlLineClass
public static UUID getMxlLineClass(SpreadsheetLine line)
Get line class id- Parameters:
line
-- Returns:
-
getLineWidth
public static int getLineWidth(SpreadsheetLine line)
Get line width- Parameters:
line
-- Returns:
-
getMxlHorizontalAlign
public static int getMxlHorizontalAlign(HorizontalAlignment align)
Get mxl horizontal align- Parameters:
align
-- Returns:
-
getMxlVerticalAlign
public static int getMxlVerticalAlign(VerticalAlignment align)
Get mxl vertical align- Parameters:
align
-- Returns:
-
getMxlNamedItemType
public static int getMxlNamedItemType(NamedItem item)
Get mxl named item type- Parameters:
item
-- Returns:
-
getMxlNamedItemSubtype
public static int getMxlNamedItemSubtype(NamedItem item)
Get mxl named item subtype- Parameters:
item
-- Returns:
-
getFillType
public static FillType getFillType(int val)
Get fill type- Parameters:
val
-- Returns:
-
getMxlFillType
public static int getMxlFillType(FillType fillType)
Get mxl fill type- Parameters:
fillType
-- Returns:
-
getDimensionAttributePlacementType
public static DimensionAttributePlacementType getDimensionAttributePlacementType(int index)
Get dimension attribute placement type- Parameters:
index
-- Returns:
-
getDimensionPlacementType
public static DimensionPlacementType getDimensionPlacementType(int index)
Get dimension placement type- Parameters:
index
-- Returns:
-
getStandardAppearance
public static StandardAppearance getStandardAppearance(int index)
Get standard appearance- Parameters:
index
-- Returns:
-
getPivotTableLinesShowType
public static PivotTableLinesShowType getPivotTableLinesShowType(int index)
Get pivot table lines show type- Parameters:
index
-- Returns:
-
-