Java Doc for XMLCatalog.java in  » Build » ANT » org » apache » tools » ant » types » 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 » Build » ANT » org.apache.tools.ant.types 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.tools.ant.types.DataType
   org.apache.tools.ant.types.XMLCatalog

XMLCatalog
public class XMLCatalog extends DataType implements Cloneable,EntityResolver,URIResolver(Code)

This data type provides a catalog of resource locations (such as DTDs and XML entities), based on the OASIS "Open Catalog" standard. The catalog entries are used both for Entity resolution and URI resolution, in accordance with the org.xml.sax.EntityResolver EntityResolver and javax.xml.transform.URIResolver URIResolver interfaces as defined in the Java API for XML Processing Specification.

Resource locations can be specified either in-line or in external catalog file(s), or both. In order to use an external catalog file, the xml-commons resolver library ("resolver.jar") must be in your classpath. External catalog files may be either plain text format or XML format. If the xml-commons resolver library is not found in the classpath, external catalog files, specified in <catalogpath> paths, will be ignored and a warning will be logged. In this case, however, processing of inline entries will proceed normally.

Currently, only <dtd> and <entity> elements may be specified inline; these correspond to OASIS catalog entry types PUBLIC and URI respectively.

The following is a usage example:

<xmlcatalog>
  <dtd publicId="" location="/path/to/file.jar" />
  <dtd publicId="" location="/path/to/file2.jar" />
  <entity publicId="" location="/path/to/file3.jar" />
  <entity publicId="" location="/path/to/file4.jar" />
  <catalogpath>
    <pathelement location="/etc/sgml/catalog"/>
  </catalogpath>
  <catalogfiles dir="/opt/catalogs/" includes="**\catalog.xml" />
</xmlcatalog>

Tasks wishing to use <xmlcatalog> must provide a method called createXMLCatalog which returns an instance of XMLCatalog. Nested DTD and entity definitions are handled by the XMLCatalog object and must be labeled dtd and entity respectively.

The following is a description of the resolution algorithm: entities/URIs/dtds are looked up in each of the following contexts, stopping when a valid and readable resource is found:

  1. In the local filesystem
  2. In the classpath
  3. Using the Apache xml-commons resolver (if it is available)
  4. In URL-space

See org.apache.tools.ant.taskdefs.optional.XMLValidateTaskXMLValidateTask for an example of a task that has integrated support for XMLCatalogs.

Possible future extension could provide for additional OASIS entry types to be specified inline.



Field Summary
final public static  StringAPACHE_RESOLVER
     The name of the bridge to the Apache xml-commons resolver class, used to determine whether resolver.jar is present in the classpath.
final public static  StringCATALOG_RESOLVER
    

Constructor Summary
public  XMLCatalog()
    

Method Summary
public  voidaddConfiguredXMLCatalog(XMLCatalog catalog)
     Loads a nested <xmlcatalog> into our definition.
public  voidaddDTD(ResourceLocation dtd)
     Creates the nested <dtd> element.
public  voidaddEntity(ResourceLocation entity)
     Creates the nested <entity> element.
public  PathcreateCatalogPath()
     Creates a nested <catalogpath> element.
public  PathcreateClasspath()
     Allows nested classpath elements.
public  PathgetCatalogPath()
     Returns the catalog path in which to attempt to resolve DTDs.
public  Sourceresolve(String href, String base)
     Implements the URIResolver.resolve() interface method.
Parameters:
  href - an href attribute.
Parameters:
  base - the base URI.
public  InputSourceresolveEntity(String publicId, String systemId)
     Implements the EntityResolver.resolveEntity() interface method.
Parameters:
  publicId - the public id to resolve.
Parameters:
  systemId - the system id to resolve.
throws:
  SAXException - if there is a parsing problem.
throws:
  IOException - if there is an IO problem.
public  voidsetCatalogPathRef(Reference r)
     Allows catalogpath reference.
public  voidsetClasspath(Path classpath)
     Allows simple classpath string.
public  voidsetClasspathRef(Reference r)
     Allows classpath reference.
public  voidsetRefid(Reference r)
     Makes this instance in effect a reference to another XMLCatalog instance.

You must not set another attribute or nest elements inside this element if you make it a reference.


Field Detail
APACHE_RESOLVER
final public static String APACHE_RESOLVER(Code)
The name of the bridge to the Apache xml-commons resolver class, used to determine whether resolver.jar is present in the classpath.



CATALOG_RESOLVER
final public static String CATALOG_RESOLVER(Code)
Resolver base class




Constructor Detail
XMLCatalog
public XMLCatalog()(Code)
Default constructor




Method Detail
addConfiguredXMLCatalog
public void addConfiguredXMLCatalog(XMLCatalog catalog)(Code)
Loads a nested <xmlcatalog> into our definition. Not allowed if this catalog is itself a reference to another catalog -- that is, a catalog cannot both refer to another and contain elements or other attributes.
Parameters:
  catalog - Nested XMLCatalog



addDTD
public void addDTD(ResourceLocation dtd) throws BuildException(Code)
Creates the nested <dtd> element. Not allowed if this catalog is itself a reference to another catalog -- that is, a catalog cannot both refer to another and contain elements or other attributes.
Parameters:
  dtd - the information about the PUBLIC resource mapping tobe added to the catalog
exception:
  BuildException - if this is a reference and no nestedelements are allowed.



addEntity
public void addEntity(ResourceLocation entity) throws BuildException(Code)
Creates the nested <entity> element. Not allowed if this catalog is itself a reference to another catalog -- that is, a catalog cannot both refer to another and contain elements or other attributes.
Parameters:
  entity - the information about the URI resource mapping to beadded to the catalog.
exception:
  BuildException - if this is a reference and no nestedelements are allowed.



createCatalogPath
public Path createCatalogPath()(Code)
Creates a nested <catalogpath> element. Not allowed if this catalog is itself a reference to another catalog -- that is, a catalog cannot both refer to another and contain elements or other attributes. a path to be configured as the catalog path.
exception:
  BuildException - if this is a reference and no nested elements are allowed.



createClasspath
public Path createClasspath()(Code)
Allows nested classpath elements. Not allowed if this catalog is itself a reference to another catalog -- that is, a catalog cannot both refer to another and contain elements or other attributes. a Path instance to be configured.



getCatalogPath
public Path getCatalogPath()(Code)
Returns the catalog path in which to attempt to resolve DTDs. the catalog path



resolve
public Source resolve(String href, String base) throws TransformerException(Code)
Implements the URIResolver.resolve() interface method.
Parameters:
  href - an href attribute.
Parameters:
  base - the base URI. a Source object, or null if href cannot be resolved.
throws:
  TransformerException - if an error occurs.
See Also:   javax.xml.transform.URIResolver.resolve



resolveEntity
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException(Code)
Implements the EntityResolver.resolveEntity() interface method.
Parameters:
  publicId - the public id to resolve.
Parameters:
  systemId - the system id to resolve.
throws:
  SAXException - if there is a parsing problem.
throws:
  IOException - if there is an IO problem. the resolved entity.
See Also:   org.xml.sax.EntityResolver.resolveEntity



setCatalogPathRef
public void setCatalogPathRef(Reference r)(Code)
Allows catalogpath reference. Not allowed if this catalog is itself a reference to another catalog -- that is, a catalog cannot both refer to another and contain elements or other attributes.
Parameters:
  r - an Ant reference containing a classpath to be used asthe catalog path.



setClasspath
public void setClasspath(Path classpath)(Code)
Allows simple classpath string. Not allowed if this catalog is itself a reference to another catalog -- that is, a catalog cannot both refer to another and contain elements or other attributes.
Parameters:
  classpath - the classpath to use to look up entities.



setClasspathRef
public void setClasspathRef(Reference r)(Code)
Allows classpath reference. Not allowed if this catalog is itself a reference to another catalog -- that is, a catalog cannot both refer to another and contain elements or other attributes.
Parameters:
  r - an Ant reference containing a classpath.



setRefid
public void setRefid(Reference r) throws BuildException(Code)
Makes this instance in effect a reference to another XMLCatalog instance.

You must not set another attribute or nest elements inside this element if you make it a reference. That is, a catalog cannot both refer to another and contain elements or attributes.


Parameters:
  r - the reference to which this catalog instance is associated
exception:
  BuildException - if this instance already has been configured.



Fields inherited from org.apache.tools.ant.types.DataType
protected boolean checked(Code)(Java Doc)
protected Reference ref(Code)(Java Doc)

Methods inherited from org.apache.tools.ant.types.DataType
protected void checkAttributesAllowed()(Code)(Java Doc)
protected void checkChildrenAllowed()(Code)(Java Doc)
protected BuildException circularReference()(Code)(Java Doc)
public Object clone() throws CloneNotSupportedException(Code)(Java Doc)
protected void dieOnCircularReference()(Code)(Java Doc)
protected void dieOnCircularReference(Project p)(Code)(Java Doc)
protected void dieOnCircularReference(Stack stack, Project project) throws BuildException(Code)(Java Doc)
protected Object getCheckedRef()(Code)(Java Doc)
protected Object getCheckedRef(Project p)(Code)(Java Doc)
protected Object getCheckedRef(Class requiredClass, String dataTypeName)(Code)(Java Doc)
protected Object getCheckedRef(Class requiredClass, String dataTypeName, Project project)(Code)(Java Doc)
protected String getDataTypeName()(Code)(Java Doc)
public Reference getRefid()(Code)(Java Doc)
public static void invokeCircularReferenceCheck(DataType dt, Stack stk, Project p)(Code)(Java Doc)
protected boolean isChecked()(Code)(Java Doc)
public boolean isReference()(Code)(Java Doc)
protected BuildException noChildrenAllowed()(Code)(Java Doc)
protected void setChecked(boolean checked)(Code)(Java Doc)
public void setRefid(Reference ref)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
protected BuildException tooManyAttributes()(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.