Class FieldDescriptionData

Object
com.zebra.sdk.printer.FieldDescriptionData
All Implemented Interfaces:
Comparable<FieldDescriptionData>

public class FieldDescriptionData extends Object implements Comparable<FieldDescriptionData>
This class is used to describe format variable fields.
For example, in CPCL, the following format will contain 2 FieldDescriptionData.
 ! DF SHELF.FMT
 ! 0 200 200 210 1
 CENTER
 TEXT 4 3 0 15 \\
 TEXT 4 0 0 95 \\
 FORM
 PRINT
 
The first FieldDescriptionData will contain a fieldNumber of 1, and a fieldName of null. The second FieldDescriptionData will contain a fieldNumber of 2, and a fieldName of null.


In ZPL, the following ^FN command will contain 2 FieldDescriptionData.
 
 ^XA
 ^DFR:SHELF.ZPL^FS
 ^FO25,25^A0N,50,50^FN15"Name"^FS
 ^FO25,75^A0N,50,50^FN15"Address"^FS
 ^FO25,125^A0N,50,50^FN18^FS
 ^FO25,175^A0N,50,50^FN15
 ^XZ
 
The first FieldDescriptionData will contain a fieldNumber of 15, and a fieldName of "Address". The second FieldDescriptionData will contain a fieldNumber of 18, and a fieldName of null.
Note: If a label format contains multiple Field Numbers, only 1 will be returned since the data will be shared by all variables with the number. The fieldName portion of the variable will be the last one in the format, unless it is not present. For example, in the format above, there are 3 ^FN15's. The first 2 have a "prompt" parameter, the third does not. The second one, "Address", overwrites the first one, "Name". The third one is not present, so the previous one, "Address", is preserved.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final String

    In CPCL, this field is always null.
    In ZPL, this field will correspond to the optional name parameter of the ^FN command, or null if the parameter is not present
    final int

    In CPCL, this number will be the number of the variable field in the format.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FieldDescriptionData(int fieldNumber, String fieldName)
    Create a descriptor for a field
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • fieldNumber

      public final int fieldNumber

      In CPCL, this number will be the number of the variable field in the format. The fields are numbered starting at 1.
      In ZPL, this number will correspond to the ^FN number.
    • fieldName

      public final String fieldName

      In CPCL, this field is always null.
      In ZPL, this field will correspond to the optional name parameter of the ^FN command, or null if the parameter is not present
  • Constructor Details

    • FieldDescriptionData

      public FieldDescriptionData(int fieldNumber, String fieldName)
      Create a descriptor for a field
      Parameters:
      fieldNumber - the number of the field
      fieldName - the name of the field, or null if not present
  • Method Details