Interface XmlSerializable

All Known Subinterfaces:
FileSink, FileSource, IFieldMapping
All Known Implementing Classes:
AbstractFieldMapping, AbstractPipeline, AddFieldsAction, AggregateGroupFieldsAction, AmazonS3File, AmazonS3FileSink, AmazonS3FileSource, Attributes, AvroPipelineInput, AvroPipelineOutput, Bean, BinaryFieldDef, BloombergMessage, BooleanFieldDef, CalculatedField, Column, CompositePipelineAction, ConvertDateTimeToStringAction, ConvertNullToValueAction, ConvertNumberToStringAction, ConvertStringToBooleanAction, ConvertStringToDateTimeAction, ConvertStringToNumberAction, ConvertValueToStringAction, CopyFieldsAction, CsvPipelineInput, CsvPipelineOutput, DataMapping, DataMappingAction, DataMappingObject, DataMappingPart, DataMappingPipeline, DataMappingProblem, DataMappingResult, DataReaderPipelineInput, Dataset, DatasetPipelineInput, DataWriterPipelineOutput, DateTimePattern, DateTimePatternMatch, DecisionTable, DecisionTableAction, DecisionTableCondition, DecisionTableObject, DecisionTableOutcome, DecisionTableResult, DecisionTableRule, DecisionTree, DecisionTreeAction, DecisionTreeNode, DecisionTreeObject, DecisionTreeOutcome, DecisionTreeResult, Diff, EntityDef, EntityDefDiff, EntityRelationshipDef, EntityRelationshipDefDiff, ExcelPipelineInput, ExcelPipelineOutput, FieldDef, FieldDefDiff, FieldMapping, FieldPath, FileSinkPipelineOutput, FileSourcePipelineInput, FilterFieldExistsAction, FilterFieldMatchesPatternAction, FilterFieldNotNullAction, FilterMatchExpression, FixedWidthField, FixedWidthPipelineInput, FixedWidthPipelineOutput, FoundationObject, IndexDef, IndexDefDiff, IndexFieldDef, IndexFieldDefDiff, JdbcConnection, JdbcDataset, JdbcExportedKey, JdbcFieldIndex, JdbcImportedKey, JdbcIndex, JdbcPipelineInput, JdbcPipelineOutput, JdbcQuery, JdbcQueryColumn, JdbcQueryParameter, JdbcSchema, JdbcTable, JdbcTableColumn, JiraIssue, JiraSearch, JsonPipelineInput, JsonRecordPipelineInput, JsonRecordPipelineOutput, LatexPipelineOutput, LocalFile, LocalFileDataset, LocalFileSink, LocalFileSource, MemoryDataset, MicrosoftWordPipelineOutput, MvStoreDataset, NullPipeline, NumberDescriptor, NumberMatch, NumericFieldDef, OpenFinancialExchangePipelineInput, OrcPipelineInput, OrcPipelineOutput, ParquetPipelineInput, ParquetPipelineOutput, PdfPipelineInput, PdfPipelineOutput, Pipeline, PipelineAction, PipelineInput, PipelineObject, PipelineOutput, Property, PropertyDiff, ProxyFileSource, ProxyPipelineInput, ProxyPipelineOutput, RecordDiff, RecordFieldDef, RemoveDuplicatesAction, RenameFieldsAction, SchemaDef, SchemaDefDiff, SchemaObject, SchemaPart, SchemaProblem, SchemaValidationPath, SelectArrangeFieldsAction, ShopifyCustomerCriteria, ShopifyEventCriteria, ShopifyInventoryItem, ShopifyInventoryItemCriteria, ShopifyInventoryLevelCriteria, ShopifyOrder, ShopifyProductCriteria, ShopifyShippingAddress, SortFieldsAction, Tags, TemporalFieldDef, TextFieldDef, Tree, TreeNode, UuidFieldDef, ValidateFieldsExistsAction, ValidateFieldsMatchPatternAction, ValidateFieldsNotNullAction, ValidateMatchExpression, ValidationMessage, ValidationResult, XmlField, XmlPipelineInput, XmlRecordPipelineInput, XmlRecordPipelineOutput

public interface XmlSerializable
The interface implemented by classes to participate in serialization to and from XML.
  • Field Details

  • Method Details

    • toXmlElement

      default Element toXmlElement(Document document)
      Returns an element, created with document, describing this object; the default implementation throws a DataException.
    • fromXmlElement

      default XmlSerializable fromXmlElement(Element element)
    • toXml

      default String toXml()
      Returns this object as indented XML without an XML declaration.
    • toXml

      default String toXml(boolean addXml11Delcaration)
      Returns this object as indented XML, starting with an XML 1.1 declaration if requested.
    • toXml

      default XmlSerializable toXml(Writer writer)
      Writes this object as indented XML, without a declaration, to the writer and then closes it.
    • toXml

      default XmlSerializable toXml(Writer writer, boolean closeWriter)
      Writes this object as indented XML, without a declaration, to the writer, closing it afterwards if closeWriter is true.
    • toXml

      default XmlSerializable toXml(Writer writer, boolean closeWriter, boolean addXml11Delcaration)
      Writes this object as indented XML to the writer, optionally starting with an XML 1.1 declaration and closing the writer afterwards.
    • writeXml

      static <T extends XmlSerializable> T writeXml(T bean, StreamResult outputTarget, boolean closeStream)
      Writes the bean's toXmlElement(Document) as indented XML without a declaration, then flushes the target and closes it if closeStream is true.
    • writeXml

      static <T extends XmlSerializable> T writeXml(T bean, StreamResult outputTarget, boolean closeStream, boolean addXml11Delcaration)
    • fromXml

      default XmlSerializable fromXml(String xml)
    • fromXml

      default XmlSerializable fromXml(InputStream inputStream)
      Parses the XML in the stream and loads this object's state from its root element.
    • setAttribute

      static void setAttribute(Element element, String name, Object value)
      Sets the attribute to the value's text, formatting dates, times and byte arrays (as hex); null or empty values are skipped.
    • getAttribute

      static String getAttribute(Element element, String propertyName)
      Returns the attribute's value or null if it is missing or empty.
    • getAttribute

      static String getAttribute(Element element, String propertyName, String defaultValue)
      Returns the attribute's value or the default if it is missing or empty.
    • getAttribute

      static Character getAttribute(Element element, String propertyName, Character defaultValue)
      Returns the first character of the attribute or the default if it is missing or empty.
    • getAttribute

      static Boolean getAttribute(Element element, String propertyName, Boolean defaultValue)
      Returns true if the attribute is true or yes (ignoring case), false for other text, or the default if it is missing or blank.
    • getAttribute

      static Integer getAttribute(Element element, String propertyName, Integer defaultValue)
      Returns the attribute parsed as an integer or the default if it is missing or blank.
    • getAttribute

      static Long getAttribute(Element element, String propertyName, Long defaultValue)
      Returns the attribute parsed as a long or the default if it is missing or blank.
    • getAttribute

      static <T> T getAttribute(Element element, String propertyName, Class<? extends T> cls)
      Returns the attribute converted to the given type (byte arrays from hex) or null if it is missing or blank.
    • getAttribute

      static <T> T getAttribute(Element element, String propertyName, Class<? extends T> cls, T defaultValue)
      Returns the attribute converted to the given type (byte arrays from hex) or the default if it is missing or blank.
    • getAttribute

      static <T> T getAttribute(Element element, String propertyName, FieldType fieldType)
      Returns the attribute converted to the field type's Java class or null if it is missing or blank.
    • getAttribute

      static <T> T getAttribute(Element element, String propertyName, FieldType fieldType, T defaultValue)
      Returns the attribute converted to the field type's Java class or the default if it is missing or blank.
    • getChildElement

      static Element getChildElement(Element parent, String childTagName)
      Returns the first direct child element with the given tag name, or null if there is none or the parent is null.
    • getChildElements

      static List<Element> getChildElements(Element parent, String childTagName)
      Returns the direct child elements with the given tag name; empty if there are none or the parent is null.
    • forEachGrandChildElement

      static void forEachGrandChildElement(Element parent, String childTagName, String grandchildTagName, Consumer<Element> grandChildElementConsumer)
      Passes each grandchildTagName element under the parent's first childTagName child to the consumer.
    • newInstanceFromXml

      static <T extends XmlSerializable> T newInstanceFromXml(Element element, Class<? super T> type)
      Instantiates the class named in the element's XML_SERIALIZED_CLASS_NAME attribute, which must be assignable to type, and loads it from the element; returns null for a null element.
    • newInstanceFromXml

      static <T extends XmlSerializable> T newInstanceFromXml(InputStream inputStream)
      Parses the XML and instantiates the class named in the root element's XML_SERIALIZED_CLASS_NAME attribute, loading it from that element.