ResourceObject (Apache FOP Core 2.11 API)
Date: 2025-04-24

org.apache.fop.afp.modca

## Class ResourceObject

- java.lang.Object
- - org.apache.fop.afp.modca.AbstractAFPObject
  - - org.apache.fop.afp.modca.AbstractStructuredObject
    - - org.apache.fop.afp.modca.AbstractTripletStructuredObject
      - - org.apache.fop.afp.modca.AbstractNamedAFPObject
        - - org.apache.fop.afp.modca.ResourceObject

- All Implemented Interfaces:
    Streamable

      public class ResourceObject
      extends AbstractNamedAFPObject

  This resource structured field begins an envelope that is used to carry resource objects in print-file-level (external) resource groups.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.fop.afp.modca.AbstractAFPObject

      `AbstractAFPObject.Category, AbstractAFPObject.Type`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static byte` | `TYPE_BARCODE` barcode object type
    `static byte` | `TYPE_CODE_PAGE` code page type
    `static byte` | `TYPE_CODED_FONT` coded font type
    `static byte` | `TYPE_DOCUMENT` document object type
    `static byte` | `TYPE_FONT_CHARACTER_SET` font character set type
    `static byte` | `TYPE_FORMDEF` form def type
    `static byte` | `TYPE_GRAPHIC` graphics object type
    `static byte` | `TYPE_IMAGE` image object type
    `static byte` | `TYPE_OBJECT_CONTAINER` object container type
    `static byte` | `TYPE_OVERLAY_OBJECT` overlay object type
    `static byte` | `TYPE_PAGE_SEGMENT` page segment object type
    `static byte` | `TYPE_PAGEDEF` page def type

    - ### Fields inherited from class org.apache.fop.afp.modca.AbstractNamedAFPObject

      `name`

    - ### Fields inherited from class org.apache.fop.afp.modca.AbstractTripletStructuredObject

      `triplets`

    - ### Fields inherited from class org.apache.fop.afp.modca.AbstractAFPObject

      `LOG, SF_CLASS, SF_HEADER_LENGTH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ResourceObject(String name)` Default constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AbstractNamedAFPObject` | `getDataObject()` Returns the data object referenced by this resource object
    `void` | `setDataObject(AbstractNamedAFPObject namedObject)` Sets the data object referenced by this resource object
    `void` | `setType(byte type)` Sets Resource Object Type triplet
    `String` | `toString()`
    `protected void` | `writeContent(OutputStream os)` Helper method to write the contents of the Object.
    `protected void` | `writeEnd(OutputStream os)` Helper method to write the end of the Object.
    `protected void` | `writeStart(OutputStream os)` Helper method to write the start of the Object.

    - ### Methods inherited from class org.apache.fop.afp.modca.AbstractNamedAFPObject

      `copySF, getName, getNameBytes, getNameLength, setName`

    - ### Methods inherited from class org.apache.fop.afp.modca.AbstractTripletStructuredObject

      `addTriplet, addTriplets, getFullyQualifiedName, getTripletDataLength, getTriplets, hasTriplet, hasTriplets, setComment, setFullyQualifiedName, setFullyQualifiedName, setObjectClassification, writeTriplets`

    - ### Methods inherited from class org.apache.fop.afp.modca.AbstractStructuredObject

      `writeToStream`

    - ### Methods inherited from class org.apache.fop.afp.modca.AbstractAFPObject

      `copySF, truncate, writeChunksToStream, writeObjects`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### TYPE_GRAPHIC

          public static final byte TYPE_GRAPHIC

      graphics object type
      See Also:
        Constant Field Values

    - #### TYPE_BARCODE

          public static final byte TYPE_BARCODE

      barcode object type
      See Also:
        Constant Field Values

    - #### TYPE_IMAGE

          public static final byte TYPE_IMAGE

      image object type
      See Also:
        Constant Field Values

    - #### TYPE_FONT_CHARACTER_SET

          public static final byte TYPE_FONT_CHARACTER_SET

      font character set type
      See Also:
        Constant Field Values

    - #### TYPE_CODE_PAGE

          public static final byte TYPE_CODE_PAGE

      code page type
      See Also:
        Constant Field Values

    - #### TYPE_CODED_FONT

          public static final byte TYPE_CODED_FONT

      coded font type
      See Also:
        Constant Field Values

    - #### TYPE_OBJECT_CONTAINER

          public static final byte TYPE_OBJECT_CONTAINER

      object container type
      See Also:
        Constant Field Values

    - #### TYPE_DOCUMENT

          public static final byte TYPE_DOCUMENT

      document object type
      See Also:
        Constant Field Values

    - #### TYPE_PAGE_SEGMENT

          public static final byte TYPE_PAGE_SEGMENT

      page segment object type
      See Also:
        Constant Field Values

    - #### TYPE_OVERLAY_OBJECT

          public static final byte TYPE_OVERLAY_OBJECT

      overlay object type
      See Also:
        Constant Field Values

    - #### TYPE_PAGEDEF

          public static final byte TYPE_PAGEDEF

      page def type
      See Also:
        Constant Field Values

    - #### TYPE_FORMDEF

          public static final byte TYPE_FORMDEF

      form def type
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ResourceObject

          public ResourceObject(String name)

      Default constructor
      Parameters:
        `name` - the name of this resource (reference id)

  - ### Method Detail

    - #### setDataObject

          public void setDataObject(AbstractNamedAFPObject namedObject)

      Sets the data object referenced by this resource object
      Parameters:
        `namedObject` - the named data object

    - #### getDataObject

          public AbstractNamedAFPObject getDataObject()

      Returns the data object referenced by this resource object
      Returns:
        the data object referenced by this resource object

    - #### writeStart

          protected void writeStart(OutputStream os)
                             throws IOException

      Helper method to write the start of the Object.
      Overrides:
        `writeStart` in class `AbstractStructuredObject`
      Parameters:
        `os` - The stream to write to
      Throws:
        `IOException` - throws an I/O exception if one occurred

    - #### writeContent

          protected void writeContent(OutputStream os)
                               throws IOException

      Helper method to write the contents of the Object.
      Overrides:
        `writeContent` in class `AbstractStructuredObject`
      Parameters:
        `os` - The stream to write to
      Throws:
        `IOException` - throws an I/O exception if one occurred

    - #### writeEnd

          protected void writeEnd(OutputStream os)
                           throws IOException

      Helper method to write the end of the Object.
      Overrides:
        `writeEnd` in class `AbstractStructuredObject`
      Parameters:
        `os` - The stream to write to
      Throws:
        `IOException` - an I/O exception if one occurred

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `AbstractNamedAFPObject`

    - #### setType

          public void setType(byte type)

      Sets Resource Object Type triplet
      Parameters:
        `type` - the resource object type

Copyright © 2025 Apache Software Foundation. All rights reserved.