Interface PrismParserNoIO

  • All Superinterfaces:
    PrismParser
    All Known Implementing Classes:
    PrismParserImplNoIO

    public interface PrismParserNoIO
    extends PrismParser
    The same as PrismParser but has no IOException on parseXYZ methods. It is used when parsing from strings or DOM structures where no IOExceptions occur. For methods' descriptions please see the parent interface (PrismParser).
    Author:
    mederly
    • Method Detail

      • language

        @NotNull
        @NotNull PrismParserNoIO language​(@Nullable
                                          @Nullable String language)
        Description copied from interface: PrismParser
        For string inputs: sets the data language that the parser will try to parse; null means auto-detect. For other kinds of input (DOM and XNode) the language is fixed to XML or none, respectively.
        Specified by:
        language in interface PrismParser
        Parameters:
        language - The language
        Returns:
        Updated parser.
      • xml

        @NotNull
        @NotNull PrismParserNoIO xml()
        Description copied from interface: PrismParser
        Sets the language of the parser to be XML.
        Specified by:
        xml in interface PrismParser
        Returns:
        Updated parser.
      • json

        @NotNull
        @NotNull PrismParserNoIO json()
        Description copied from interface: PrismParser
        Sets the language of the parser to be JSON.
        Specified by:
        json in interface PrismParser
        Returns:
        Updated parser.
      • yaml

        @NotNull
        @NotNull PrismParserNoIO yaml()
        Description copied from interface: PrismParser
        Sets the language of the parser to be YAML.
        Specified by:
        yaml in interface PrismParser
        Returns:
        Updated parser.
      • context

        @NotNull
        @NotNull PrismParserNoIO context​(@NotNull
                                         @NotNull ParsingContext context)
        Description copied from interface: PrismParser
        Provides a parsing context for the parser. The context contains e.g. selection of strict/compat mode of operation (set by client) or a list of warnings (maintained by the parser).
        Specified by:
        context in interface PrismParser
        Parameters:
        context - The parsing context.
        Returns:
        Updated parser.
      • strict

        @NotNull
        @NotNull PrismParserNoIO strict()
        Description copied from interface: PrismParser
        Switches the parser into "strict" parsing mode.
        Specified by:
        strict in interface PrismParser
        Returns:
        Updated parser.
      • compat

        @NotNull
        @NotNull PrismParserNoIO compat()
        Description copied from interface: PrismParser
        Switches the parser into "compatibility" (or relaxed) parsing mode. TODO description here
        Specified by:
        compat in interface PrismParser
        Returns:
        Updated parser.
      • definition

        @NotNull
        @NotNull PrismParserNoIO definition​(ItemDefinition<?> itemDefinition)
        Description copied from interface: PrismParser
        Tells parser which definition to use when parsing item (or an item value). Optional.
        Specified by:
        definition in interface PrismParser
        Parameters:
        itemDefinition - The definition
        Returns:
        Updated parser.
      • name

        @NotNull
        @NotNull PrismParserNoIO name​(QName itemName)
        Description copied from interface: PrismParser
        Tells parser what name to use for parsed item. Optional.
        Specified by:
        name in interface PrismParser
        Parameters:
        itemName - Item name to use.
        Returns:
        Updated parser.
      • type

        @NotNull
        @NotNull PrismParserNoIO type​(QName typeName)
        Description copied from interface: PrismParser
        Tells parser what data type to expect. Optional.
        Specified by:
        type in interface PrismParser
        Parameters:
        typeName - Data type to expect.
        Returns:
        Updated parser.
      • type

        @NotNull
        @NotNull PrismParserNoIO type​(Class<?> typeClass)
        Description copied from interface: PrismParser
        Tells parser what data type to expect. Optional.
        Specified by:
        type in interface PrismParser
        Parameters:
        typeClass - Data type to expect.
        Returns:
        Updated parser.
      • parseItemValue

        <IV extends PrismValue> IV parseItemValue()
                                           throws SchemaException
        Description copied from interface: PrismParser
        Parses the input as a prism value. (Container value, reference value, property value.) May return raw property values as part of the prism structure, if definitions are not known.
        Specified by:
        parseItemValue in interface PrismParser
        Returns:
        The item.
        Throws:
        SchemaException
      • parseRealValue

        <T> T parseRealValue​(Class<T> clazz)
                      throws SchemaException
        Description copied from interface: PrismParser
        Parses a real value - either property or container value.
        Specified by:
        parseRealValue in interface PrismParser
        Parameters:
        clazz - Expected class of the data. May be null if unknown.
        Returns:
        Real value - POJO, Containerable, Objectable or Referencable.
        Throws:
        SchemaException
      • parseRealValue

        <T> T parseRealValue()
                      throws SchemaException
        Description copied from interface: PrismParser
        Parses a real value. The class is not supplied by the caller, so it has to be determined from the data source.
        Specified by:
        parseRealValue in interface PrismParser
        Returns:
        Real value - POJO, Containerable, Objectable or Referencable.
        Throws:
        SchemaException
      • parseToXNode

        RootXNode parseToXNode()
                        throws SchemaException
        Description copied from interface: PrismParser
        Parses the input into RootXNode. This is a bit unusual approach, skipping the unmarshalling phase altogether. But it is useful at some places.
        Specified by:
        parseToXNode in interface PrismParser
        Returns:
        RootXNode corresponding to the input.
        Throws:
        SchemaException
      • parseItemOrRealValue

        Object parseItemOrRealValue()
                             throws SchemaException
        Description copied from interface: PrismParser
        Parses either an item, or a real value. It depends on the type declaration or item name in the source data. 1) If explicit type is present, it is taken into account. If it corresponds to a prism item, the input is parsed as a prism item. Otherwise, it is parsed as a real value (containerable or simple POJO), if possible. 2) If there is no type, the item name is consulted. If it corresponds to a prism item, the input is parsed as a prism item. Otherwise, an exception is thrown. Pre-set parameters (itemDefinition, typeName, itemName) must NOT be present. Use with utmost care. If at all possible, avoid it.
        Specified by:
        parseItemOrRealValue in interface PrismParser
        Returns:
        either prism item (Item) or a real value (Object)
        Throws:
        SchemaException
      • parseObjects

        @NotNull
        @NotNull List<PrismObject<? extends Objectable>> parseObjects()
                                                               throws SchemaException
        Description copied from interface: PrismParser
        Parses the input as a collection of prism objects. For XML the input must be formatted as a collection of objects (TODO change this). For other languages the input may contain one or more objects.
        Specified by:
        parseObjects in interface PrismParser
        Returns:
        A list of objects.
        Throws:
        SchemaException