Class Encoders
- java.lang.Object
-
- com.inductiveautomation.ignition.common.xmlserialization.encoding.Encoders
-
- All Implemented Interfaces:
ArrayElementEncoder,AttributeEncoder,Encoder
- Direct Known Subclasses:
Encoders.BoolEncoder,Encoders.ByteEncoder,Encoders.ClassEncoder,Encoders.ColorEncoder,Encoders.DateEncoder,Encoders.DoubleEncoder,Encoders.FloatEncoder,Encoders.IntEncoder,Encoders.LongEncoder,Encoders.QualityCodeEncoder,Encoders.ShortEncoder,Encoders.SignatureEncoder,Encoders.StringEncoder,Encoders.UUIDEncoder
public abstract class Encoders extends java.lang.Object implements AttributeEncoder, ArrayElementEncoder
Contains logic to encode various types is either text meant for XML or as binary, and to decode those types.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEncoders.BoolEncoderstatic classEncoders.ByteEncoderstatic classEncoders.ClassEncoderstatic classEncoders.ColorEncoderstatic classEncoders.DateEncoderstatic classEncoders.DoubleEncoderstatic classEncoders.FloatEncoderstatic classEncoders.IntEncoderstatic classEncoders.LongEncoderstatic classEncoders.QualityCodeEncoderstatic classEncoders.ShortEncoderstatic classEncoders.SignatureEncoderstatic classEncoders.StringEncoderstatic classEncoders.UUIDEncoder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AttributeEncoderforBoolean(boolean b)static AttributeEncoderforByte(byte b)static AttributeEncoderforClass(java.lang.Class clazz)static AttributeEncoderforColor(java.awt.Color color)static AttributeEncoderforDate(java.util.Date d)static AttributeEncoderforDouble(double d)static AttributeEncoderforFloat(float f)static AttributeEncoderforInt(int i)static AttributeEncoderforLong(long l)static AttributeEncoderforQualityCode(QualityCode code)static AttributeEncoderforShort(short s)static AttributeEncoderforSignature(java.lang.Class[] array)static AttributeEncoderforString(java.lang.String s, boolean escape)intgetCodecType()Return the unique code for the type that this encoder encodes.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.inductiveautomation.ignition.common.xmlserialization.encoding.ArrayElementEncoder
resetObject
-
Methods inherited from interface com.inductiveautomation.ignition.common.xmlserialization.encoding.Encoder
getBinaryLength, objectToBinary, objectToString
-
-
-
-
Constructor Detail
-
Encoders
protected Encoders(CodecType type)
-
-
Method Detail
-
getCodecType
public int getCodecType()
Description copied from interface:AttributeEncoderReturn the unique code for the type that this encoder encodes. This must be the ordinal() of the corresponding CodecType enum value.
This is only used on Encoders for element attributes, because attributes need to be read in with no intervention, so this ID is used to look up the correct decoder. For element bodies, the handler has the chance to instantiate the correct decoder before parsing, so no type code is needed.
- Specified by:
getCodecTypein interfaceAttributeEncoder
-
forByte
public static AttributeEncoder forByte(byte b)
-
forShort
public static AttributeEncoder forShort(short s)
-
forInt
public static AttributeEncoder forInt(int i)
-
forLong
public static AttributeEncoder forLong(long l)
-
forFloat
public static AttributeEncoder forFloat(float f)
-
forDouble
public static AttributeEncoder forDouble(double d)
-
forBoolean
public static AttributeEncoder forBoolean(boolean b)
-
forDate
public static AttributeEncoder forDate(java.util.Date d)
-
forString
public static AttributeEncoder forString(java.lang.String s, boolean escape)
-
forClass
public static AttributeEncoder forClass(java.lang.Class clazz)
-
forSignature
public static AttributeEncoder forSignature(java.lang.Class[] array)
-
forColor
public static AttributeEncoder forColor(java.awt.Color color)
-
forQualityCode
public static AttributeEncoder forQualityCode(QualityCode code)
-
-