treebolic.generator
Class ModelToDocumentTransformer

java.lang.Object
  extended by treebolic.generator.ModelToDocumentTransformer

public class ModelToDocumentTransformer
extends java.lang.Object

Model to document transformer

Author:
Bernard Bou

Field Summary
private static boolean validate
           
 
Constructor Summary
ModelToDocumentTransformer()
           
 
Method Summary
private static org.w3c.dom.Element makeContent(org.w3c.dom.Document thisDocument, java.lang.String thisString)
          Make content element
private static javax.xml.parsers.DocumentBuilder makeDocumentBuilder()
          Make document builder
private static org.w3c.dom.Element makeEdge(org.w3c.dom.Document thisDocument, IEdge thisEdge)
          Make edge element
static org.w3c.dom.Element makeImage(org.w3c.dom.Document thisDocument, java.lang.String thisImageSrc)
          Make image element
private static org.w3c.dom.Element makeLabel(org.w3c.dom.Document thisDocument, java.lang.String thisString)
          Make label element
private static org.w3c.dom.Element makeLink(org.w3c.dom.Document thisDocument, java.lang.String thisHref, java.lang.String thisTarget)
          Make link element
private static org.w3c.dom.Element makeMenuItem(org.w3c.dom.Document thisDocument, MenuItem thisMenuItem)
          Make menuitem element
private static org.w3c.dom.Element makeMountPoint(org.w3c.dom.Document thisDocument, MountPoint.Mounting thisMountPoint)
          Make mountpoint element
private static org.w3c.dom.Element makeNode(org.w3c.dom.Document thisDocument, INode thisNode)
          Make node element
private static void setAttributes(org.w3c.dom.Element thisElement, java.util.Map<java.lang.String,java.lang.Object> theseAttributes)
          Set attributes
private static void setStyleAttributes(org.w3c.dom.Element thisElement, java.lang.Integer thisStyle)
          Set style attributes
static org.w3c.dom.Document transform(Model thisModel)
          Transform model to document
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

validate

private static boolean validate
Constructor Detail

ModelToDocumentTransformer

public ModelToDocumentTransformer()
Method Detail

transform

public static org.w3c.dom.Document transform(Model thisModel)
Transform model to document

Parameters:
thisModel - model
Returns:
DOM document

makeDocumentBuilder

private static javax.xml.parsers.DocumentBuilder makeDocumentBuilder()
                                                              throws javax.xml.parsers.ParserConfigurationException
Make document builder

Returns:
document builder
Throws:
javax.xml.parsers.ParserConfigurationException

makeNode

private static org.w3c.dom.Element makeNode(org.w3c.dom.Document thisDocument,
                                            INode thisNode)
Make node element

Parameters:
thisDocument - document
thisNode - node
Returns:
node element

makeEdge

private static org.w3c.dom.Element makeEdge(org.w3c.dom.Document thisDocument,
                                            IEdge thisEdge)
Make edge element

Returns:
edge element

makeLabel

private static org.w3c.dom.Element makeLabel(org.w3c.dom.Document thisDocument,
                                             java.lang.String thisString)
Make label element

Parameters:
thisDocument - document
thisString - label
Returns:
label element

makeContent

private static org.w3c.dom.Element makeContent(org.w3c.dom.Document thisDocument,
                                               java.lang.String thisString)
Make content element

Parameters:
thisDocument - document
thisString - content
Returns:
content element

makeImage

public static org.w3c.dom.Element makeImage(org.w3c.dom.Document thisDocument,
                                            java.lang.String thisImageSrc)
Make image element

Parameters:
thisDocument - document
thisImageSrc - image source
Returns:
image element

makeLink

private static org.w3c.dom.Element makeLink(org.w3c.dom.Document thisDocument,
                                            java.lang.String thisHref,
                                            java.lang.String thisTarget)
Make link element

Parameters:
thisDocument - document
thisHref - link href
Returns:
link element

makeMountPoint

private static org.w3c.dom.Element makeMountPoint(org.w3c.dom.Document thisDocument,
                                                  MountPoint.Mounting thisMountPoint)
Make mountpoint element

Parameters:
thisDocument - document
thisMountPoint - mountpoint
Returns:
mountpoint element

makeMenuItem

private static org.w3c.dom.Element makeMenuItem(org.w3c.dom.Document thisDocument,
                                                MenuItem thisMenuItem)
Make menuitem element

Parameters:
thisDocument - document
thisMenuItem - menuitem
Returns:
menuitem

setStyleAttributes

private static void setStyleAttributes(org.w3c.dom.Element thisElement,
                                       java.lang.Integer thisStyle)
Set style attributes

Parameters:
thisElement - element
thisStyle - style

setAttributes

private static void setAttributes(org.w3c.dom.Element thisElement,
                                  java.util.Map<java.lang.String,java.lang.Object> theseAttributes)
Set attributes

Parameters:
thisElement - element
theseAttributes - attributes