Java Doc for DocumentReader.java in  » Database-ORM » MMBase » org » mmbase » util » xml » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » MMBase » org.mmbase.util.xml 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.mmbase.util.xml.DocumentReader

All known Subclasses:   org.mmbase.util.xml.ModuleReader,  org.mmbase.storage.util.StorageReader,  org.mmbase.storage.search.implementation.database.informix.excalibur.XmlEtxIndicesReader,  org.mmbase.storage.implementation.database.DatabaseStorageLookup,  org.mmbase.util.magicfile.MagicXMLReader,  org.mmbase.util.XMLNodeReader,  org.mmbase.util.xml.BuilderReader,  org.mmbase.util.xml.DocumentWriter,  org.mmbase.util.xml.ApplicationReader,  org.mmbase.util.XMLBasicReader,
DocumentReader
public class DocumentReader (Code)
The DocumentReader class provides methods for loading a xml document in memory. It serves as the base class for DocumentWriter (which adds ways to write a document), and XMLBasicReader, which adds path-like methods with which to retrieve elements. This can also be a class for general static dom utilities.
author:
   Case Roule
author:
   Rico Jansen
author:
   Pierre van Rooden
author:
   Michiel Meeuwissen
version:
   $Id: DocumentReader.java,v 1.39 2008/03/11 11:45:28 michiel Exp $
since:
   MMBase-1.7


Field Summary
final public static  StringDTD_ERROR
    
final public static  StringDTD_ERROR_1_0
    
final protected static  StringFILENOTFOUND
    
final public static  StringPUBLIC_ID_ERROR
    
final public static  StringPUBLIC_ID_ERROR_1_0
    
protected  Documentdocument
    
static  UtilReader.PropertiesMap<String>utilProperties
    

Constructor Summary
protected  DocumentReader()
     Creates an empty document reader.
public  DocumentReader(InputSource source)
     Constructs the document by reading it from a source.
public  DocumentReader(InputSource source, boolean validating)
     Constructs the document by reading it from a source.
public  DocumentReader(InputSource source, Class resolveBase)
     Constructs the document by reading it from a source. You can pass a resolve class to this constructor, allowing you to indicate the package in which the dtd of the document read is to be found.
public  DocumentReader(InputSource source, boolean validating, Class resolveBase)
     Constructs the document by reading it from a source. You can pass a resolve class to this constructor, allowing you to indicate the package in which the dtd of the document read is to be found.
public  DocumentReader(Document doc)
    

Method Summary
public static  voidappendChild(Element parent, Element newChild, String path)
     Appends a child to a parent at the right position.
public static  StringgetAttribute(Element element, String nameSpace, String localName)
    
public  List<Element>getChildElements(String path)
    
public  List<Element>getChildElements(Element e)
    
public  List<Element>getChildElements(String path, String tag)
    
public  List<Element>getChildElements(Element e, String tag)
    
public static  DocumentBuildergetDocumentBuilder()
     Creates a DocumentBuilder with default settings for handler, resolver, or validation, obtaining it from the cache if available.
public static  DocumentBuildergetDocumentBuilder(boolean validating)
    
public static  DocumentBuildergetDocumentBuilder(boolean validating, ErrorHandler handler, EntityResolver resolver)
    
public static  DocumentBuildergetDocumentBuilder(boolean validating, boolean xsd, ErrorHandler handler, EntityResolver resolver)
     Creates a DocumentBuilder.
public  StringgetElementAttributeValue(String path, String attr)
    
public  StringgetElementAttributeValue(Element e, String attr)
    
public  ElementgetElementByPath(String path)
    
Parameters:
  path - Dot-separated list of tags describing path from root element to requested element.NB the path starts with the name of the root element.
public  ElementgetElementByPath(Element e, String path)
    
public  StringgetElementName(Element e)
    
public  StringgetElementValue(String path)
    
public  StringgetElementValue(Element e)
    
public static  StringgetNodeTextValue(Node n)
     Return the text value of a node.
public static  StringgetNodeTextValue(Node n, boolean trim)
    
public  ElementgetRootElement()
    
public  StringgetSystemId()
     Returns the systemID of the InputSource used to read the document.
public static  booleanhasAttribute(Element element, String nameSpace, String localName)
    
public static  voidmain(String argv)
    
public static  voidregisterPublicIDs()
     Register the Public Ids for DTDs used by XMLBasicReader This method is called by XMLEntityResolver.
public static  voidsetNodeTextValue(Node n, String value)
    
public static  voidsetPrefix(Document d, String ns, String prefix)
    
public  voidsetSystemId(String url)
    
public static  DocumenttoDocument(Element element)
     Utility method to make a document of an element.
final protected static  booleanvalidate()
     Returns the default setting for validation for DocumentReaders.
final protected static  booleanvalidate(boolean requested)
     Whether to validate given a request for that.

Field Detail
DTD_ERROR
final public static String DTD_ERROR(Code)
DTD respource filename of the most recent Error DTD



DTD_ERROR_1_0
final public static String DTD_ERROR_1_0(Code)
DTD resource filename of the Error DTD version 1.0



FILENOTFOUND
final protected static String FILENOTFOUND(Code)



PUBLIC_ID_ERROR
final public static String PUBLIC_ID_ERROR(Code)
Public ID of the most recent Error DTD



PUBLIC_ID_ERROR_1_0
final public static String PUBLIC_ID_ERROR_1_0(Code)
Public ID of the Error DTD version 1.0



document
protected Document document(Code)



utilProperties
static UtilReader.PropertiesMap<String> utilProperties(Code)




Constructor Detail
DocumentReader
protected DocumentReader()(Code)
Creates an empty document reader.



DocumentReader
public DocumentReader(InputSource source)(Code)
Constructs the document by reading it from a source.
Parameters:
  source - the input source from which to read the document



DocumentReader
public DocumentReader(InputSource source, boolean validating)(Code)
Constructs the document by reading it from a source.
Parameters:
  source - the input source from which to read the document
Parameters:
  validating - whether to validate the document



DocumentReader
public DocumentReader(InputSource source, Class resolveBase)(Code)
Constructs the document by reading it from a source. You can pass a resolve class to this constructor, allowing you to indicate the package in which the dtd of the document read is to be found. The dtd sould be in the resources package under the package of the class passed.
Parameters:
  source - the input source from which to read the document
Parameters:
  resolveBase - the base class whose package is used to resolve dtds, set to null if unknown



DocumentReader
public DocumentReader(InputSource source, boolean validating, Class resolveBase)(Code)
Constructs the document by reading it from a source. You can pass a resolve class to this constructor, allowing you to indicate the package in which the dtd of the document read is to be found. The dtd sould be in the resources package under the package of the class passed.
Parameters:
  source - the input source from which to read the document
Parameters:
  validating - whether to validate the document
Parameters:
  resolveBase - the base class whose package is used to resolve dtds, set to null if unknown



DocumentReader
public DocumentReader(Document doc)(Code)

since:
   MMBase-1.8




Method Detail
appendChild
public static void appendChild(Element parent, Element newChild, String path)(Code)
Appends a child to a parent at the right position. The right position is defined by a comma separated list of regular expressions. If the the child matches the last element of the path, then the child is appended after similer childs, if not, then it will be appended before them.
Parameters:
  parent - The parent element, to which a new child will be added
Parameters:
  newChild - this new child
Parameters:
  path - The beforementioned comma separated list of regexps. See also java.util.regex.Pattern;Namespace prefixes are ignored.
since:
   MMBase-1.8



getAttribute
public static String getAttribute(Element element, String nameSpace, String localName)(Code)
Returns the value of a certain attribute, either an unqualified attribute or an attribute that fits in the passed namespace



getChildElements
public List<Element> getChildElements(String path)(Code)

Parameters:
  path - Path to the element a List of child elements



getChildElements
public List<Element> getChildElements(Element e)(Code)

Parameters:
  e - Element a List of child elements



getChildElements
public List<Element> getChildElements(String path, String tag)(Code)

Parameters:
  path - Path to the element
Parameters:
  tag - tag to match ("*" means all tags") a List of child elements with the given tag



getChildElements
public List<Element> getChildElements(Element e, String tag)(Code)

Parameters:
  e - Element
Parameters:
  tag - tag to match ("*" means all tags") a List of child elements with the given tag



getDocumentBuilder
public static DocumentBuilder getDocumentBuilder()(Code)
Creates a DocumentBuilder with default settings for handler, resolver, or validation, obtaining it from the cache if available. a DocumentBuilder instance, or null if none could be created



getDocumentBuilder
public static DocumentBuilder getDocumentBuilder(boolean validating)(Code)
Obtain a DocumentBuilder



getDocumentBuilder
public static DocumentBuilder getDocumentBuilder(boolean validating, ErrorHandler handler, EntityResolver resolver)(Code)
See DocumentReader.getDocumentBuilder(boolean,ErrorHandler,EntityResolver)



getDocumentBuilder
public static DocumentBuilder getDocumentBuilder(boolean validating, boolean xsd, ErrorHandler handler, EntityResolver resolver)(Code)
Creates a DocumentBuilder. DocumentBuilders that use the default error handler or entity resolver are cached (one for validating, one for non-validating document buidlers).
Parameters:
  validating - if true, the documentbuilder will validate documents read
Parameters:
  xsd - if true, validating will be done by an XML schema definiton.
Parameters:
  handler - a ErrorHandler class to use for catching parsing errors, pass null to use the default handler
Parameters:
  resolver - a EntityResolver class used for resolving the document's dtd, pass null to use the default resolver a DocumentBuilder instance, or null if none could be created
since:
   MMBase-1.8.



getElementAttributeValue
public String getElementAttributeValue(String path, String attr)(Code)

Parameters:
  path - Path to the element
Parameters:
  attr - Attribute name Value of attribute



getElementAttributeValue
public String getElementAttributeValue(Element e, String attr)(Code)

Parameters:
  e - Element
Parameters:
  attr - Attribute name Value of attribute



getElementByPath
public Element getElementByPath(String path)(Code)

Parameters:
  path - Dot-separated list of tags describing path from root element to requested element.NB the path starts with the name of the root element. Leaf element of the path



getElementByPath
public Element getElementByPath(Element e, String path)(Code)

Parameters:
  e - Element from which the "relative" path is starting.NB the path starts with the name of the root element.
Parameters:
  path - Dot-separated list of tags describing path from root element to requested element Leaf element of the path



getElementName
public String getElementName(Element e)(Code)

Parameters:
  e - Element Tag name of the element



getElementValue
public String getElementValue(String path)(Code)

Parameters:
  path - Path to the element Text value of element



getElementValue
public String getElementValue(Element e)(Code)

Parameters:
  e - Element Text value of element



getNodeTextValue
public static String getNodeTextValue(Node n)(Code)
Return the text value of a node. It includes the contents of all child textnodes and CDATA sections, but ignores everything else (such as comments) The code trims excessive whitespace unless it is included in a CDATA section.
Parameters:
  n - the Node whose value to determine a String representing the node's textual value



getNodeTextValue
public static String getNodeTextValue(Node n, boolean trim)(Code)

since:
   MMBase-1.8.5



getRootElement
public Element getRootElement()(Code)
Determine the root element of the contained document root element



getSystemId
public String getSystemId()(Code)
Returns the systemID of the InputSource used to read the document. This is generally the document's file path. the systemID as a String
since:
   MMBase-1.8



hasAttribute
public static boolean hasAttribute(Element element, String nameSpace, String localName)(Code)
Returns whether an element has a certain attribute, either an unqualified attribute or an attribute that fits in the passed namespace



main
public static void main(String argv) throws Exception(Code)



registerPublicIDs
public static void registerPublicIDs()(Code)
Register the Public Ids for DTDs used by XMLBasicReader This method is called by XMLEntityResolver.



setNodeTextValue
public static void setNodeTextValue(Node n, String value)(Code)

since:
   MMBase-1.8.1



setPrefix
public static void setPrefix(Document d, String ns, String prefix)(Code)

since:
   MMBase-1.8.5



setSystemId
public void setSystemId(String url)(Code)

since:
   MMBase-1.8



toDocument
public static Document toDocument(Element element)(Code)
Utility method to make a document of an element.
since:
   MMBase-1.8



validate
final protected static boolean validate()(Code)
Returns the default setting for validation for DocumentReaders. true if validation is on



validate
final protected static boolean validate(boolean requested)(Code)
Whether to validate given a request for that. So, the request is followed, unless it is configured to 'never' validate.
since:
   MMBase-1.8



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.