Java Doc for XMLContentSpec.java in  » Web-Server » Rimfaxe-Web-Server » org » apache » xerces » framework » 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 » Web Server » Rimfaxe Web Server » org.apache.xerces.framework 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.xerces.framework.XMLContentSpec

All known Subclasses:   org.apache.xerces.validators.common.Grammar,
XMLContentSpec
public class XMLContentSpec (Code)
ContentSpec really exists to aid the parser classes in implementing access to the grammar.

This class is used by the DTD scanner and the validator classes, allowing them to be used separately or together. This "struct" class is used to build content models for validation, where it is more efficient to fetch all of the information for each of these content model "fragments" than to fetch each field one at a time. Since configurations are allowed to have validators without a DTD scanner (i.e. a schema validator) and a DTD scanner without a validator (non-validating processor), this class can be used by each without requiring the presence of the other.

When processing element declarations, the DTD scanner will build up a representation of the content model using the node types that are defined here. Since a non-validating processor only needs to remember the type of content model declared (i.e. ANY, EMPTY, MIXED, or CHILDREN), it is free to discard the specific details of the MIXED and CHILDREN content models described using this class.

In the typical case of a validating processor reading the grammar of the document from a DTD, the information about the content model declared will be preserved and later "compiled" into an efficient form for use during element validation. Each content spec node that is saved is assigned a unique index that is used as a handle for the "value" or "otherValue" fields of other content spec nodes. A leaf node has a "value" that is either an index in the string pool of the element type of that leaf, or a value of -1 to indicate the special "#PCDATA" leaf type used in a mixed content model.

For a mixed content model, the content spec will be made up of leaf and choice content spec nodes, with an optional "zero or more" node. For example, the mixed content declaration "(#PCDATA)" would contain a single leaf node with a node value of -1. A mixed content declaration of "(#PCDATA|foo)*" would have a content spec consisting of two leaf nodes, for the "#PCDATA" and "foo" choices, a choice node with the "value" set to the index of the "#PCDATA" leaf node and the "otherValue" set to the index of the "foo" leaf node, and a "zero or more" node with the "value" set to the index of the choice node. If the content model has more choices, for example "(#PCDATA|a|b)*", then there will be more corresponding choice and leaf nodes, the choice nodes will be chained together through the "value" field with each leaf node referenced by the "otherValue" field.

For element content models, there are sequence nodes and also "zero or one" and "one or more" nodes. The leaf nodes would always have a valid string pool index, as the "#PCDATA" leaf is not used in the declarations for element content models.
version:
   $Id: XMLContentSpec.java,v 1.14 2001/05/31 15:10:02 neilg Exp $


Inner Class :public interface Provider

Field Summary
final public static  intCONTENTSPECNODE_ALL
    
final public static  intCONTENTSPECNODE_ANY
     Represents any namespace specified namespace.
final public static  intCONTENTSPECNODE_ANY_LAX
    
final public static  intCONTENTSPECNODE_ANY_NS
     Represents any namespace element (including "##local").
final public static  intCONTENTSPECNODE_ANY_NS_LAX
    
final public static  intCONTENTSPECNODE_ANY_NS_SKIP
    
final public static  intCONTENTSPECNODE_ANY_OTHER
     Represents any other namespace (XML Schema: ##other).
final public static  intCONTENTSPECNODE_ANY_OTHER_LAX
    
final public static  intCONTENTSPECNODE_ANY_OTHER_SKIP
    
final public static  intCONTENTSPECNODE_ANY_SKIP
    
final public static  intCONTENTSPECNODE_CHOICE
     Represents choice, '|'.
final public static  intCONTENTSPECNODE_LEAF
     Name or #PCDATA.
final public static  intCONTENTSPECNODE_ONE_OR_MORE
     Represents a one or more occurence count, '+'.
final public static  intCONTENTSPECNODE_SEQ
     Represents sequence, ','.
final public static  intCONTENTSPECNODE_ZERO_OR_MORE
     Represents a zero or more occurence count, '*'.
final public static  intCONTENTSPECNODE_ZERO_OR_ONE
     Represents a zero or one occurence count, '?'.
public  intotherValue
     The "right hand" value of the content spec node.
public  inttype
     The content spec node type.
public  intvalue
     The "left hand" value of the content spec node.

Constructor Summary
public  XMLContentSpec()
     Default constructor.
public  XMLContentSpec(int type, int value, int otherValue)
     Constructs a content spec with the specified values.
public  XMLContentSpec(XMLContentSpec contentSpec)
     Constructs a content spec from the values in the specified content spec.
public  XMLContentSpec(XMLContentSpec.Provider provider, int contentSpecIndex)
     Constructs a content spec from the values specified by the given content spec provider and identifier.

Method Summary
public  voidclear()
     Clears the values.
public  booleanequals(Object object)
     Returns true if the two objects are equal.
public  inthashCode()
     Returns a hash code for this node.
public  voidsetValues(int type, int value, int otherValue)
     Sets the values.
public  voidsetValues(XMLContentSpec contentSpec)
     Sets the values of the specified content spec.
public  voidsetValues(XMLContentSpec.Provider provider, int contentSpecIndex)
     Sets the values from the values specified by the given content spec provider and identifier.
public static  StringtoString(XMLContentSpec.Provider provider, StringPool stringPool, int contentSpecIndex)
     Returns a string representation of the specified content spec identifier in the form of a DTD element content model.

Field Detail
CONTENTSPECNODE_ALL
final public static int CONTENTSPECNODE_ALL(Code)
Represents



CONTENTSPECNODE_ANY
final public static int CONTENTSPECNODE_ANY(Code)
Represents any namespace specified namespace. When the element found in the document must belong to a specific namespace, otherValue will contain the name of the namespace. If otherValue is -1 then the element can be from any namespace.

Lists of valid namespaces are created from choice content spec nodes that have any content spec nodes as children.




CONTENTSPECNODE_ANY_LAX
final public static int CONTENTSPECNODE_ANY_LAX(Code)
prcessContent is 'lax' *



CONTENTSPECNODE_ANY_NS
final public static int CONTENTSPECNODE_ANY_NS(Code)
Represents any namespace element (including "##local").



CONTENTSPECNODE_ANY_NS_LAX
final public static int CONTENTSPECNODE_ANY_NS_LAX(Code)



CONTENTSPECNODE_ANY_NS_SKIP
final public static int CONTENTSPECNODE_ANY_NS_SKIP(Code)



CONTENTSPECNODE_ANY_OTHER
final public static int CONTENTSPECNODE_ANY_OTHER(Code)
Represents any other namespace (XML Schema: ##other).

When the content spec node type is set to CONTENTSPECNODE_ANY_OTHER, value will contain the namespace that cannot occur.




CONTENTSPECNODE_ANY_OTHER_LAX
final public static int CONTENTSPECNODE_ANY_OTHER_LAX(Code)



CONTENTSPECNODE_ANY_OTHER_SKIP
final public static int CONTENTSPECNODE_ANY_OTHER_SKIP(Code)



CONTENTSPECNODE_ANY_SKIP
final public static int CONTENTSPECNODE_ANY_SKIP(Code)
processContent is 'skip' *



CONTENTSPECNODE_CHOICE
final public static int CONTENTSPECNODE_CHOICE(Code)
Represents choice, '|'.



CONTENTSPECNODE_LEAF
final public static int CONTENTSPECNODE_LEAF(Code)
Name or #PCDATA. Leaf nodes that represent parsed character data (#PCDATA) have values of -1.



CONTENTSPECNODE_ONE_OR_MORE
final public static int CONTENTSPECNODE_ONE_OR_MORE(Code)
Represents a one or more occurence count, '+'.



CONTENTSPECNODE_SEQ
final public static int CONTENTSPECNODE_SEQ(Code)
Represents sequence, ','.



CONTENTSPECNODE_ZERO_OR_MORE
final public static int CONTENTSPECNODE_ZERO_OR_MORE(Code)
Represents a zero or more occurence count, '*'.



CONTENTSPECNODE_ZERO_OR_ONE
final public static int CONTENTSPECNODE_ZERO_OR_ONE(Code)
Represents a zero or one occurence count, '?'.



otherValue
public int otherValue(Code)
The "right hand" value of the content spec node. // right child for binary ops



type
public int type(Code)
The content spec node type.
See Also:   CONTENTSPECNODE_LEAF
See Also:   CONTENTSPECNODE_ZERO_OR_ONE
See Also:   CONTENTSPECNODE_ZERO_OR_MORE
See Also:   CONTENTSPECNODE_ONE_OR_MORE
See Also:   CONTENTSPECNODE_CHOICE
See Also:   CONTENTSPECNODE_SEQ
See Also:   CONTENTSPECNODE_ALL



value
public int value(Code)
The "left hand" value of the content spec node. // leaf index, single child for unary ops, left child for binary ops.




Constructor Detail
XMLContentSpec
public XMLContentSpec()(Code)
Default constructor.



XMLContentSpec
public XMLContentSpec(int type, int value, int otherValue)(Code)
Constructs a content spec with the specified values.



XMLContentSpec
public XMLContentSpec(XMLContentSpec contentSpec)(Code)
Constructs a content spec from the values in the specified content spec.



XMLContentSpec
public XMLContentSpec(XMLContentSpec.Provider provider, int contentSpecIndex)(Code)
Constructs a content spec from the values specified by the given content spec provider and identifier.




Method Detail
clear
public void clear()(Code)
Clears the values.



equals
public boolean equals(Object object)(Code)
Returns true if the two objects are equal.



hashCode
public int hashCode()(Code)
Returns a hash code for this node.



setValues
public void setValues(int type, int value, int otherValue)(Code)
Sets the values.



setValues
public void setValues(XMLContentSpec contentSpec)(Code)
Sets the values of the specified content spec.



setValues
public void setValues(XMLContentSpec.Provider provider, int contentSpecIndex)(Code)
Sets the values from the values specified by the given content spec provider and identifier. If the specified content spec cannot be provided, the values of this content spec are cleared.



toString
public static String toString(XMLContentSpec.Provider provider, StringPool stringPool, int contentSpecIndex)(Code)
Returns a string representation of the specified content spec identifier in the form of a DTD element content model.

Note: This method is not namespace aware.




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.