All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scala.xml.dtd.Decl.scala Maven / Gradle / Ivy

There is a newer version: 2.11.2
Show newest version
/*                     __                                               *\
 **     ________ ___   / /  ___     Scala API                            **
 **    / __/ __// _ | / /  / _ |    (c) 2003-2013, LAMP/EPFL             **
 **  __\ \/ /__/ __ |/ /__/ __ |    http://www.scala-lang.org/           **
 ** /____/\___/_/ |_/____/_/ | |                                         **
 **                          |/                                          **
 \*                                                                      */

package scala.xml
package dtd

import Utility.sbToString

abstract class Decl

abstract class MarkupDecl extends Decl {
  def buildString(sb: StringBuilder): StringBuilder
}

/** an element declaration
 */
case class ElemDecl(name: String, contentModel: ContentModel)
extends MarkupDecl {
  override def buildString(sb: StringBuilder): StringBuilder = {
    sb append "'
  }
}

case class AttListDecl(name: String, attrs:List[AttrDecl])
extends MarkupDecl {
  override def buildString(sb: StringBuilder): StringBuilder = {
    sb append "")
  }
}

/** an attribute declaration. at this point, the tpe is a string. Future
 *  versions might provide a way to access the attribute types more
 *  directly.
 */
case class AttrDecl(name: String, tpe: String, default: DefaultDecl) {
  override def toString(): String = sbToString(buildString)

  def buildString(sb: StringBuilder): StringBuilder = {
    sb append "  " append name append ' ' append tpe append ' '
    default buildString sb
  }

}

/** an entity declaration */
abstract class EntityDecl extends MarkupDecl

/** a parsed general entity declaration */
case class ParsedEntityDecl(name: String, entdef: EntityDef) extends EntityDecl {
  override def buildString(sb: StringBuilder): StringBuilder = {
    sb append "'
  }
}

/** a parameter entity declaration */
case class ParameterEntityDecl(name: String, entdef: EntityDef) extends EntityDecl {
  override def buildString(sb: StringBuilder): StringBuilder = {
    sb append "'
  }
}

/** an unparsed entity declaration */
case class UnparsedEntityDecl( name:String, extID:ExternalID, notation:String ) extends EntityDecl {
  override def buildString(sb: StringBuilder): StringBuilder = {
    sb append "'
  }
}
/** a notation declaration */
case class NotationDecl( name:String, extID:ExternalID ) extends MarkupDecl {
  override def buildString(sb: StringBuilder): StringBuilder = {
    sb append "




© 2015 - 2024 Weber Informatics LLC | Privacy Policy