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 intbytesToInt(byte[] b)Convert byte array to intstatic intcompareVersions(Integer[] left, Integer[] right)Compare document versionsstatic longconvert29to30(long mask)Convert format maskstatic longdeleteBit(long value, int bitNum)Delete bit bitNum from valuestatic CellLineStylegetCellLineStyle(int index)Get cell line stylestatic CellTextPositiongetCellTextPosition(int value)Get text position relative to picturestatic StringgetCurrentMxlPrefix()get mxl document prefix of current versionstatic DetailUsegetDetailUse(int val)Get detail usestatic DimensionAttributePlacementTypegetDimensionAttributePlacementType(int index)Get dimension attribute placement typestatic DimensionPlacementTypegetDimensionPlacementType(int index)Get dimension placement typestatic DrawingLineStylegetDrawingLineStyle(int index)Get drawing line stylestatic DuplexPrintingTypegetDuplexPrintingType(int val)Get duplex printing typestatic ExtensionAlgorithmgetExtensionAlgorithm(int val)ReturnsExtensionAlgorithmvalue of the extension algorithm by its integer value.static FillTypegetFillType(int val)Get fill typestatic DateFractionsgetFractionsFromString(String string)Get date fractions from stringstatic intgetFullMxlPrefixSize()Get mxl document prefix sizestatic GroupHeaderPlacementgetGroupHeaderPlacement(int val)Get groups header placementstatic intgetLineOffset(SpreadsheetLine line)Get line gapstatic intgetLineWidth(SpreadsheetLine line)Get line widthstatic intgetMxlCellLineStyle(CellLineStyle style)Get mxl cell line stylestatic intgetMxlDetailUse(DetailUse detailUse)Get mxl detail usestatic intgetMxlDrawingLineStyle(DrawingLineStyle style)Get mxl drawing line stylestatic intgetMxlDuplexPrintingType(DuplexPrintingType type)Get mxl duplex printing typestatic intgetMxlExtensionAlgorithm(ExtensionAlgorithm extensionAlgorithm)Returns integer value of the extension algorithm ofSpreadsheetDocumentby its enum value.static intgetMxlFillType(FillType fillType)Get mxl fill typestatic intgetMxlGroupHeaderPlacement(GroupHeaderPlacement placement)Get mxl group placementstatic intgetMxlHorizontalAlign(HorizontalAlignment align)Get mxl horizontal alignstatic UUIDgetMxlLineClass(SpreadsheetLine line)Get line class idstatic intgetMxlLineStyle(SpreadsheetLine line)Get line stylestatic intgetMxlNamedItemSubtype(NamedItem item)Get mxl named item subtypestatic intgetMxlNamedItemType(NamedItem item)Get mxl named item typestatic intgetMxlPageOrientation(PageOrientation orientation)Get mxl page orientationstatic intgetMxlPagePlacementAlternation(PagePlacementAlternation alt)Get mxl page placementstatic intgetMxlPattern(Pattern pattern)Get mxl patternstatic intgetMxlPicturesizeMode(PictureSize size)Get mxl picture size modestatic StringgetMxlPrefix()get mxl document prefix of current versionstatic intgetMxlPrefixSize()Get mxl document prefix sizestatic intgetMxlPrintAccuracy(PrintAccuracy accuracy)Get mxl print accuracystatic intgetMxlSavedPicturesDensity(SpreadsheetDocumentSavedPicturesDensity savedPicturesDensity)Returns integer value of the saved pictures density ofSpreadsheetDocumentby its enum value.static intgetMxlSizeChangeMode(SizeChangeMode mode)Get mxl size change modestatic intgetMxlStepDirection(SpreadsheetDocumentStepDirectionType direction)Get mxl step directionstatic intgetMxlTextDirection(SpreadsheetDocumentTextDirectionType direction)Returns integer value of the text direction ofSpreadsheetDocumentby its enum value.static intgetMxlTextPlacement(TextPlacement placement)Get mxl text placementstatic intgetMxlTextPosition(CellTextPosition position)Get value of mxl text position relative to picturestatic intgetMxlVerticalAlign(VerticalAlignment align)Get mxl vertical alignstatic PageOrientationgetPageOrientation(int val)Get page orientationstatic PagePlacementAlternationgetPagePlacementAlternation(int val)Get page placementstatic PatterngetPattern(int patternIndex)Get pattern by indexstatic PictureSizegetPictureSizeMode(int value)Get picture size modestatic PivotTableLinesShowTypegetPivotTableLinesShowType(int index)Get pivot table lines show typestatic PrintAccuracygetPrintAccuracy(int val)Get print accuracystatic SpreadsheetDocumentSavedPicturesDensitygetSavedPicturesDensity(int val)ReturnsSpreadsheetDocumentSavedPicturesDensityvalue of the saved pictures density by its integer value.static SizeChangeModegetSizeChangeMode(int val)Get size change modestatic StandardAppearancegetStandardAppearance(int index)Get standard appearancestatic SpreadsheetDocumentStepDirectionTypegetStepDirection(int val)Get step directionstatic SpreadsheetDocumentTextDirectionTypegetTextDirection(int val)ReturnsSpreadsheetDocumentTextDirectionTypevalue of the text direction by its integer value.static TextPlacementgetTextPlacement(int val)Get text placementstatic booleanisFlagSet(long mask, int key)Is flags set in maskstatic booleanisVersionCorrect(Integer[] version)Check if mxl version is correctstatic intMulDiv(int a, int b, int c)Multiply and dividestatic intreadIntFromFile(IFileEx file)Read int from filestatic StringreadStringFromFile(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(Integer[] left, Integer[] right)
Compare document versions- Parameters:
left-right-- Returns:
-
isVersionCorrect
public static boolean isVersionCorrect(Integer[] 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)
ReturnsSpreadsheetDocumentTextDirectionTypevalue of the text direction by its integer value.- Parameters:
val- Int value of the text direction ofSpreadsheetDocument, either 0 or 1.- Returns:
SpreadsheetDocumentTextDirectionTypevalue of the text direction ofSpreadsheetDocument, either LEFT_TO_RIGHT(0) or RIGHT_TO_LEFT(1), nevernull.
-
getSavedPicturesDensity
public static SpreadsheetDocumentSavedPicturesDensity getSavedPicturesDensity(int val)
ReturnsSpreadsheetDocumentSavedPicturesDensityvalue of the saved pictures density by its integer value.- Parameters:
val- Int value of the saved pictures density ofSpreadsheetDocument- 0, 1, 2 ,3.- Returns:
SpreadsheetDocumentSavedPicturesDensityvalue of the saved pictures density ofSpreadsheetDocument- Original(0), High(1), Medium(2), Low(3), nevernull.
-
getMxlTextDirection
public static int getMxlTextDirection(SpreadsheetDocumentTextDirectionType direction)
Returns integer value of the text direction ofSpreadsheetDocumentby its enum value.- Parameters:
direction-SpreadsheetDocumentTextDirectionTypevalue 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.
-
getMxlSavedPicturesDensity
public static int getMxlSavedPicturesDensity(SpreadsheetDocumentSavedPicturesDensity savedPicturesDensity)
Returns integer value of the saved pictures density ofSpreadsheetDocumentby its enum value.- Parameters:
direction-SpreadsheetDocumentSavedPicturesDensityvalue of the saved pictures ofSpreadsheetDocument- Original(0), High(1), Medium(2), Low(3), cannot benull.- Returns:
- Int value of the saved pictures of
SpreadsheetDocument- 0, 1, 2, 3
-
getMxlExtensionAlgorithm
public static int getMxlExtensionAlgorithm(ExtensionAlgorithm extensionAlgorithm)
Returns integer value of the extension algorithm ofSpreadsheetDocumentby its enum value.- Parameters:
extensionAlgorithm-ExtensionAlgorithmvalue of the text direction ofSpreadsheetDocument, either Replace(0) or Merge(1), cannot benull.- Returns:
- Int value of the extension algorithm of
SpreadsheetDocument, either 0 or 1.
-
getExtensionAlgorithm
public static ExtensionAlgorithm getExtensionAlgorithm(int val)
ReturnsExtensionAlgorithmvalue of the extension algorithm by its integer value.- Parameters:
val- Int value of the extension algorithm ofSpreadsheetDocument, either 0 or 1.- Returns:
ExtensionAlgorithmvalue of the extension algorithm ofSpreadsheetDocument, either Replace(0) or Merge(1), nevernull.
-
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:
-
-