Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public final class BlockXml

  1. Object
  2. BlockXml

The .cn1doc XML of a list of blocks, for formats that hold document text inside their own files. A slide’s text box is a list of blocks, and .cn1slides stores it in exactly the vocabulary .cn1doc stores a document body in, so both read and write it the same way.

Not an end-user API: it works on the internal XML reader and writer of the office formats.

Methods

public static void write(XmlOut x, List<Block> blocks) throws IOExceptionWrites blocks as .cn1doc elements.
public static boolean read(XmlScanner x, List<Block> out, Set<String> ids) throws IOExceptionReads the block whose start tag the scanner is on.

Inherited methods

Method details

write

public static void write(XmlOut x, List<Block> blocks) throws IOException
Writes blocks as .cn1doc elements.

Parameters

x XmlOut
the writer, inside an element of the caller’s
blocks List<Block>
the blocks

Throws

IOException
when writing fails

read

public static boolean read(XmlScanner x, List<Block> out, Set<String> ids) throws IOException
Reads the block whose start tag the scanner is on.

Parameters

x XmlScanner
the scanner, on a start tag
out List<Block>
receives the block
ids Set<String>
the ids read so far, shared by everything in one file; a repeated id is an error

Returns

false when the element is not a block, and the caller should skip it

Throws

IOException
when the block is damaged