com.phasmidsoftware.xmldoc.xml

Members list

Type members

Classlikes

object ChildNames

Object to manage translation of a name to a Seq of names.

Object to manage translation of a name to a Seq of names.

CONSIDER removing this altogether because there is another mechanism (Feature.multiExtractor) which does something similar.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
ChildNames.type
object Extractor

Companion object to Extractor.

Companion object to Extractor.

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Extractor.type
trait Extractor[T] extends NamedFunction[Extractor[T]]

Trait to define the behavior of an extractor (parser) that takes an XML Node and return Try[T] where T is the underlying type of the Extractor.

Trait to define the behavior of an extractor (parser) that takes an XML Node and return Try[T] where T is the underlying type of the Extractor.

Type parameters

T

the type to be constructed.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
Self type
trait Extractors

Trait which defines many useful Extractors, where the result is an instance of Extractor[T] or MultiExtractor[T].

Trait which defines many useful Extractors, where the result is an instance of Extractor[T] or MultiExtractor[T].

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Text
object AbstractView
object Alias
object Altitude
object AltitudeMode
object AxisScale
object BalloonStyle
object BgColor
object Camera
object Color
object ColorMode
object ColorModeEnum
object ColorStyle
object Container
object ContainerData
object Coordinates
object Data
object DisplayMode
object Document
object DrawOrder
object ExtendedData
object Extrude
object Feature
object FeatureData
object Fill
object FlyToView
object Folder
object Geometry
object GeometryData
object GroundOverlay
object Heading
object HotSpot
object Icon
object IconStyle
object ImagePyramid
object ItemIcon
object KML
object Key
object KmlData
object LabelStyle
object LatLonBox
object Latitude
object LineString
object LineStyle
object LinearRing
object Link
object ListItemType
object ListStyle
object Location
object Longitude
object LookAt
object Model
object ModelScale
object MultiGeometry
object NetworkLink
object Open
object Orientation
object Outline
object Overlay
object OverlayData
object OverlayXY
object Pair
object PhotoOverlay
object Placemark
object Point
object PolyStyle
object Polygon
object Range
object RefreshMode
object ResourceMap
object Roll
object Rotation
object RotationXY
object Scale
object SchemaData
object ScreenOverlay
object ScreenXY
object Shape
object ShapeEnum
object SimpleData
object Size
object State
object Style
object StyleMap
object StyleSelector
object StyleURL
object SubStyle
object SubStyleData
object Tessellate
object TextColor
object Tilt
object UnitsEnum
object ViewVolume
object Visibility
object Width
object Extractors
Show all
object Extractors extends Extractors

Companion object to Extractors.

Companion object to Extractors.

Attributes

Companion
trait
Supertypes
trait Extractors
class Object
trait Matchable
class Any
Self type
Extractors.type
case class GenericCData(text: String) extends GenericContent

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed trait GenericContent

A fully generic representation of XML content: used for anything that doesn't have (or doesn't need) a specialist type. GenericElement carries a tag, its attributes, and its children — any of which may themselves be unmodeled elements, or text.

A fully generic representation of XML content: used for anything that doesn't have (or doesn't need) a specialist type. GenericElement carries a tag, its attributes, and its children — any of which may themselves be unmodeled elements, or text.

The "mixing" of specialist and generic content happens one level up, in whatever container type models a specific element (e.g. a Story's content might be Seq[Either[ParagraphStyleRange, GenericElement]]) — GenericElement itself doesn't know or care whether its parent is specialist or generic.

fromNode/toXmlString are hand-written rather than built from the Extractor/Renderer combinators (extractor1...extractor7, renderer1...renderer7): those all assume a fixed, known number of fields, each mapped by name to one specific attribute or child — a "capture whatever's left over" field, of unbounded/unnamed size, isn't something they can express (the parallel is a fixed-arity method versus a varargs method). That said, GenericElement still has ordinary Extractor[GenericElement]/Renderer[GenericElement] instances below, delegating to fromElem/toXmlString — these let GenericElement be used as a normal field type within an otherwise-specialist extractorN/rendererN, for a specific, named field that's deliberately left generic (as opposed to modeling an unbounded remainder, which these instances don't help with).

NOTE: scala.xml.Comment and scala.xml.EntityRef nodes are not treated specially and fall through to GenericText via their .text value, which loses their distinct node type (a comment would round-trip as plain escaped text, not a comment) — this is judged an acceptable gap because InDesign-generated IDML content does not appear to contain either. scala.xml.PCData (CDATA sections) and scala.xml.Text are handled properly.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class GenericElement(tag: String, attributes: Seq[(String, String)], children: Seq[GenericContent]) extends GenericContent

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class GenericText(text: String) extends GenericContent

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Companion object to MultiExtractor.

Companion object to MultiExtractor.

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

Trait to define the behavior of an iterable type which can be constructed from an XML NodeSeq.

Trait to define the behavior of an iterable type which can be constructed from an XML NodeSeq.

Type parameters

T

the (iterable) type to be constructed.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Companion object for the MultiExtractorBase class. This object provides predefined ranges that can be used when working with extractors or other numerical validations.

Companion object for the MultiExtractorBase class. This object provides predefined ranges that can be used when working with extractors or other numerical validations.

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
case class MultiExtractorBase[P](range: Range)(using evidence$1: Extractor[P]) extends MultiExtractor[Seq[P]]

MultiExtractorBase class to deal with minimum and maximum numbers of elements. This is not used for situations where different subtypes are grouped together (for example, Folder can contain any number of "Features," which can be of type Container, Document, Folder, or Placemark.)

MultiExtractorBase class to deal with minimum and maximum numbers of elements. This is not used for situations where different subtypes are grouped together (for example, Folder can contain any number of "Features," which can be of type Container, Document, Folder, or Placemark.)

Type parameters

P

element type of the MultiExtractor to be returned. requires implicit evidence of Extractor[P].

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait MultiExtractor[Seq[P]]
trait NamedFunction[MultiExtractor[Seq[P]]]
class Object
trait Matchable
class Any
Show all
Known subtypes
trait NamedFunction[E]

Trait to allow for functions to have names. A function, for example T=>R, can simply extend NamedFunction[T=>R] and toString will show the name.

Trait to allow for functions to have names. A function, for example T=>R, can simply extend NamedFunction[T=>R] and toString will show the name.

The name is held as a var. It is updated by the ^^ method.

CONSIDER having a method which adds to the name but doesn't replace it.

Type parameters

E

the type of the function to be named.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object NamedFunction

The NamedFunction object provides utilities for working with instances of the NamedFunction trait, including methods to assert and combine named function instances.

The NamedFunction object provides utilities for working with instances of the NamedFunction trait, including methods to assert and combine named function instances.

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
object NodeParser extends JavaTokenParsers

Object NodeParser provides a functionality to parse strings into integers using the JavaTokenParsers. In particular, these parsers do not "see" white space. This object leverages the built-in parser combinators to interpret and transform input data.

Object NodeParser provides a functionality to parse strings into integers using the JavaTokenParsers. In particular, these parsers do not "see" white space. This object leverages the built-in parser combinators to interpret and transform input data.

Attributes

Supertypes
trait JavaTokenParsers
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Show all
Self type
NodeParser.type
object Plural extends JavaTokenParsers

The Plural object is a parser utility extending JavaTokenParsers to analyze a given string and determine its plural or singular nature based on specific patterns.

The Plural object is a parser utility extending JavaTokenParsers to analyze a given string and determine its plural or singular nature based on specific patterns.

It provides the following primary functionality:

  • The unapply method evaluates if a string represents a plural form. It attempts to parse the input as both singular (that ends with s) and plural in reverse.
  • Definitions of multiple helper Parser methods to define the behavior for detecting specific plural or singular cases:
  • singularEndsInS: Identifies certain patterns of singular words that end in s.
  • plural: Consists of combined patterns (plural1, plural2, endsInS, or fails a match).
  • plural1, plural2: Encodes specific reverse transformations for certain plural endings.
  • endsInS: Matches plural strings ending in s followed by a root word.
  • root: Matches a generic alphanumeric word boundary.

The parsing logic uses compositional and pattern-matching techniques to identify and reverse strings as needed.

Attributes

Supertypes
trait JavaTokenParsers
trait RegexParsers
trait Parsers
class Object
trait Matchable
class Any
Show all
Self type
Plural.type
implicit class RichXml(node: Node)

Implicit class to make dealing with Nodes a bit easier.

Implicit class to make dealing with Nodes a bit easier.

Value parameters

node

a Node.

Attributes

Supertypes
class Object
trait Matchable
class Any
class SubclassExtractor[T](val labels: Seq[String])(implicit tsm: MultiExtractor[Seq[T]]) extends Extractor[Seq[T]]

Class which extends an Extractor of Seq[T].

Class which extends an Extractor of Seq[T].

NOTE: used by subclassExtractor1 method (itself unused).

Type parameters

T

the type to be constructed.

Value parameters

labels

a set of labels (tags)

tsm

an (implicit) MultiExtractor of Seq[T].

Attributes

Supertypes
trait Extractor[Seq[T]]
trait NamedFunction[Extractor[Seq[T]]]
class Object
trait Matchable
class Any
trait TagToExtractorFunc[T] extends String => Extractor[T]

Trait which extends a function of type String => Extractor[T]. When the apply method is invoked with a particular label, an appropriate Extractor[T] is returned.

Trait which extends a function of type String => Extractor[T]. When the apply method is invoked with a particular label, an appropriate Extractor[T] is returned.

CONSIDER renaming this because it isn't an extractor, but a function which creates an extractor from a String.

Type parameters

T

the underlying type of the result of invoking apply. T may be an Iterable type.

Attributes

Supertypes
trait String => Extractor[T]
class Object
trait Matchable
class Any
Known subtypes

Trait which extends TagToExtractorFunc for an underlying sequence type.

Trait which extends TagToExtractorFunc for an underlying sequence type.

Type parameters

T

the underlying type of the resulting sequence when invoking apply.

Attributes

Supertypes
trait TagToExtractorFunc[Seq[T]]
trait String => Extractor[Seq[T]]
class Object
trait Matchable
class Any
object Zip

Utility for reading the contents of a zip archive (such as an IDML package) in memory, without extracting it to disk. This is deliberately format-agnostic: it knows nothing about IDML's internal structure, only how to list and read the entries of a zip file.

Utility for reading the contents of a zip archive (such as an IDML package) in memory, without extracting it to disk. This is deliberately format-agnostic: it knows nothing about IDML's internal structure, only how to list and read the entries of a zip file.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Zip.type

Value members

Concrete fields

val logger: Logger

Implicits

Implicits

final implicit def RichXml(node: Node): RichXml

Implicit class to make dealing with Nodes a bit easier.

Implicit class to make dealing with Nodes a bit easier.

Value parameters

node

a Node.

Attributes