public class GraphManager extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
GraphManager.Factory |
static interface |
GraphManager.Writer |
| Constructor and Description |
|---|
GraphManager(BaseBean root) |
| Modifier and Type | Method and Description |
|---|---|
void |
completeRootBinding(BaseBean beanRoot,
Node doc) |
void |
createRootBinding(BaseBean beanRoot,
BeanProp prop,
Node doc)
This method is called by the createRoot() method of the root bean
(part of the BaseBean class).
|
static Node |
createRootElementNode(String name) |
static Document |
createXmlDocument(InputSource in,
boolean validate) |
static Document |
createXmlDocument(InputSource in,
boolean validate,
EntityResolver er,
ErrorHandler eh) |
static Document |
createXmlDocument(InputStream in,
boolean validate)
Creates a DOM document from the input stream.
|
static Document |
createXmlDocument(InputStream in,
boolean validate,
EntityResolver er)
Creates a DOM document from the input stream.
|
static void |
debug(boolean d) |
Object |
defaultScalarValue(int type) |
void |
fillProperties(BeanProp[] prop,
Node node)
This method is called by the generated beans when they are
building themselves from a DOM tree.
|
String |
getAttributeName(String name)
Return the name of the attribute if this is the name of an attribute,
return null otherwise.
|
BaseBean |
getBeanRoot()
Return the root of the bean graph
|
protected XMLUtil.DOMWriter |
getDOMWriter() |
static Node |
getElementNode(String name,
Node doc)
Parse the DOM tree until the element named 'name' is found.
|
static String |
getKeyPropertyName(Bean theRoot,
String propName,
String[] prop,
String[] key,
boolean keyName) |
String |
getKeyPropertyName(String propName) |
String |
getKeyPropertyName(String propName,
String[] prop,
String[] key) |
String |
getKeyPropertyName(String propName,
String[] prop,
String[] key,
boolean keyName)
Return the bean holding the property 'name' as a BaseBean object
|
NodeFactory |
getNodeFactory()
Return the DOM node factory
|
static int |
getPropertyIndex(Bean theRoot,
String name) |
int |
getPropertyIndex(String name)
If the property is an indexed property, return the index of
the property.
|
static String |
getPropertyName(String name)
Return the name of the property of the PropertyChangeEvent named name.
|
static Bean |
getPropertyParent(Bean theRoot,
String name) |
BaseBean |
getPropertyParent(String name)
Return the bean holding the property 'name' as a BaseBean object
|
static String |
getPropertyParentName(String name)
Return the name of the bean holding the property 'name'
|
Document |
getXmlDocument()
This returns the DOM Document object, root
of the current DOM graph.
|
boolean |
isAttribute(String name)
Return true if this is the name of an attribute
|
protected static void |
printLevel(OutputStream out,
int level,
String indent,
String text) |
protected static void |
printLevel(StringBuffer out,
int level,
String indent) |
protected static void |
printLevel(StringBuffer out,
int level,
String indent,
String text) |
protected static void |
printLevel(Writer out,
int level,
String indent)
Indent by 2 spaces for every @level.
|
protected static void |
printLevel(Writer out,
int level,
String indent,
String text) |
void |
reindent(String indent)
Take the current DOM tree and readjust whitespace so that it
looks pretty.
|
void |
setDoctype(String publicId,
String systemId) |
static void |
setFactory(InputStream in,
GraphManager.Factory factory)
Associate a factory to a stream
|
static void |
setFactory(InputStream in,
GraphManager.Factory factory,
GraphManager.Writer writer)
Set an external factory to use instead of the default one
|
void |
setNodeFactory(Document doc)
This method sets the DOM nodes factory.
|
void |
setWriteCData(boolean value) |
void |
setWriter(GraphManager.Writer writer)
Set an external writer to use instead of the default one
|
void |
setXmlDocument(Node doc) |
static String |
trimPropertyName(String propName)
Return the bean holding the property 'name' as a BaseBean object
|
protected void |
write(OutputStream out,
String encoding) |
protected void |
write(Writer out) |
void |
write(Writer out,
Node node) |
protected void |
write(Writer out,
String encoding) |
public GraphManager(BaseBean root)
public static void setFactory(InputStream in, GraphManager.Factory factory) throws Schema2BeansException
Schema2BeansExceptionpublic static void setFactory(InputStream in, GraphManager.Factory factory, GraphManager.Writer writer) throws Schema2BeansException
Schema2BeansExceptionpublic void setWriter(GraphManager.Writer writer)
public void setWriteCData(boolean value)
public static Node createRootElementNode(String name) throws Schema2BeansRuntimeException
Schema2BeansRuntimeExceptionpublic void setXmlDocument(Node doc) throws Schema2BeansRuntimeException
Schema2BeansRuntimeExceptionpublic Document getXmlDocument()
public static Node getElementNode(String name, Node doc)
public void createRootBinding(BaseBean beanRoot, BeanProp prop, Node doc) throws Schema2BeansException
Schema2BeansExceptionpublic void setNodeFactory(Document doc)
public NodeFactory getNodeFactory()
public BaseBean getBeanRoot()
protected void write(OutputStream out, String encoding) throws IOException
IOExceptionprotected void write(Writer out) throws IOException
IOExceptionprotected void write(Writer out, String encoding) throws IOException
IOExceptionpublic void write(Writer out, Node node) throws IOException, Schema2BeansException
IOExceptionSchema2BeansExceptionprotected XMLUtil.DOMWriter getDOMWriter()
public void reindent(String indent)
protected static void printLevel(Writer out, int level, String indent) throws IOException
IOExceptionprotected static void printLevel(StringBuffer out, int level, String indent)
protected static void printLevel(Writer out, int level, String indent, String text) throws IOException
IOExceptionprotected static void printLevel(OutputStream out, int level, String indent, String text) throws IOException
IOExceptionprotected static void printLevel(StringBuffer out, int level, String indent, String text)
public static Document createXmlDocument(InputStream in, boolean validate) throws Schema2BeansRuntimeException
Schema2BeansRuntimeExceptionpublic static Document createXmlDocument(InputStream in, boolean validate, EntityResolver er) throws Schema2BeansRuntimeException
Schema2BeansRuntimeExceptionpublic static Document createXmlDocument(InputSource in, boolean validate) throws Schema2BeansException
Schema2BeansExceptionpublic static Document createXmlDocument(InputSource in, boolean validate, EntityResolver er, ErrorHandler eh) throws Schema2BeansException
Schema2BeansExceptionpublic void fillProperties(BeanProp[] prop, Node node) throws Schema2BeansException
Schema2BeansExceptionpublic BaseBean getPropertyParent(String name)
public String getKeyPropertyName(String propName, String[] prop, String[] key, boolean keyName)
public static String getKeyPropertyName(Bean theRoot, String propName, String[] prop, String[] key, boolean keyName)
public static String trimPropertyName(String propName)
public static String getPropertyParentName(String name)
public static String getPropertyName(String name)
public String getAttributeName(String name)
public boolean isAttribute(String name)
public int getPropertyIndex(String name)
public static void debug(boolean d)
public Object defaultScalarValue(int type)
Copyright © 2017–2019 Eclipse Foundation. All rights reserved.