Java Doc for XmlElement.java in  » Content-Management-System » dspace » org » purl » sword » base » 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 » Content Management System » dspace » org.purl.sword.base 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.purl.sword.base.XmlElement

All known Subclasses:   org.w3.atom.Content,  org.purl.sword.base.Service,  org.purl.sword.base.Collection,  org.w3.atom.Link,  org.w3.atom.TextConstruct,  org.purl.sword.base.Workspace,  org.w3.atom.Source,  org.w3.atom.Entry,  org.w3.atom.Generator,  org.w3.atom.Author,
XmlElement
public class XmlElement (Code)
Parent class for all classes that represent an XML element. This provides some common utility methods that are useful for marshalling and unmarshalling data.
author:
   Neil Taylor


Field Summary
final protected static  StringDATE_FORMAT
     The Date format that is used to parse dates to and from the ISO format in the XML data.
protected  StringlocalName
    
protected  Stringprefix
     The name to use for the prefix.

Constructor Summary
public  XmlElement(String localName)
    
public  XmlElement(String prefix, String localName)
     Create a new instance.

Method Summary
protected  StringdateToString(Date date)
     Convert the date to a string.
public  StringgetQualifiedName()
     Retrieve the qualified name for this object.
public  StringgetQualifiedName(String name)
     Retrieve the qualified name.
protected  booleanisInstanceOf(Element element, String localName, String namespaceURI)
     Determines if the specified element is an instance of the element name.
protected  DatestringToDate(String date)
     Convert the string into a Date object.
protected  booleanunmarshallBoolean(Element element)
     Extract a boolean value from the specified element.
protected  DateunmarshallDate(Element element)
     Extract an date value from the specified element.
protected  intunmarshallInteger(Element element)
     Extract an integer value from the specified element.
protected  StringunmarshallString(Element element)
     Extract a string value from the specified element.

Field Detail
DATE_FORMAT
final protected static String DATE_FORMAT(Code)
The Date format that is used to parse dates to and from the ISO format in the XML data.



localName
protected String localName(Code)



prefix
protected String prefix(Code)
The name to use for the prefix.




Constructor Detail
XmlElement
public XmlElement(String localName)(Code)

Parameters:
  localName -



XmlElement
public XmlElement(String prefix, String localName)(Code)
Create a new instance.




Method Detail
dateToString
protected String dateToString(Date date)(Code)
Convert the date to a string. If the date is null, the result will result to a default date of 1st January 1970. FIXME - is this sensible?
Parameters:
  date - The Date object. The Date, expressed as a string in the format yyyy-MM-ddTHH:mm:ssZ.



getQualifiedName
public String getQualifiedName()(Code)
Retrieve the qualified name for this object. This uses the prefix and local name stored in this object. A string of the format 'prefix:localName'



getQualifiedName
public String getQualifiedName(String name)(Code)
Retrieve the qualified name. The prefix for this object is prepended onto the specified local name.
Parameters:
  name - the specified local name. A string of the format 'prefix:name'



isInstanceOf
protected boolean isInstanceOf(Element element, String localName, String namespaceURI)(Code)
Determines if the specified element is an instance of the element name. If you are checking the name title in the ATOM namespace, then the local name should be 'title' and the namespaceURI is the URI for the ATOM namespace.
Parameters:
  element - The specified element.
Parameters:
  localName - The local name for the element.
Parameters:
  namespaceURI - The namespace for the element. True if the element matches the localname and namespace. Otherwise, false.



stringToDate
protected Date stringToDate(String date) throws ParseException(Code)
Convert the string into a Date object.
Parameters:
  date - The date, represented as a string. A Date.
throws:
  ParseException - If the string does not match the format of yyyy-MM-ddTHH:mm:ssZ.



unmarshallBoolean
protected boolean unmarshallBoolean(Element element) throws UnmarshallException(Code)
Extract a boolean value from the specified element. The boolean value is represented as the string 'true' or 'false' as the only child of the specified element.
Parameters:
  element - The element that contains the boolean value. True or false, based on the string in the element's content.
throws:
  UnmarshallException - If the element does not contain a single child, or ifthe child does not contain the value 'true' or 'false'.



unmarshallDate
protected Date unmarshallDate(Element element) throws UnmarshallException(Code)
Extract an date value from the specified element. The date value is represented as a string in the only child of the element.
Parameters:
  element - The element that contains the date. The date.
throws:
  UnmarshallException - If the element does not contain a single child, or ifthe child does not contain the valid date.



unmarshallInteger
protected int unmarshallInteger(Element element) throws UnmarshallException(Code)
Extract an integer value from the specified element. The integer value is represented as a string in the only child of the specified element.
Parameters:
  element - The element that contains the integer. The integer.
throws:
  UnmarshallException - If the element does not contain a single child, or ifthe child does not contain the valid integer.



unmarshallString
protected String unmarshallString(Element element) throws UnmarshallException(Code)
Extract a string value from the specified element. The value is the only child of the specified element.
Parameters:
  element - The element that contains the string value. The string.
throws:
  UnmarshallException - If the element does not contain a single child.



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.