Java Doc for OverrideCombiner.java in  » Library » Apache-commons-configuration-1.4-src » org » apache » commons » configuration » tree » 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 » Library » Apache commons configuration 1.4 src » org.apache.commons.configuration.tree 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.configuration.tree.NodeCombiner
      org.apache.commons.configuration.tree.OverrideCombiner

OverrideCombiner
public class OverrideCombiner extends NodeCombiner (Code)

A concrete combiner implementation that is able to construct an override combination.

An override combination means that nodes in the first node structure take precedence over nodes in the second, or - in other words - nodes of the second structure are only added to the resulting structure if they do not occure in the first one. This is especially suitable for dealing with the properties of configurations that are defined in an override section of a configuration definition file (hence the name).

This combiner will iterate over the second node hierarchy and find all nodes that are not contained in the first hierarchy; these are added to the result. If a node can be found in both structures, it is checked whether a combination (in a recursive way) can be constructed for the two, which will then be added. Per default, nodes are combined, which occur only once in both structures. This test is implemented in the canCombine() method.

As is true for the UnionCombiner , for this combiner list nodes are important. The addListNode() can be called to declare certain nodes as list nodes. This has the effect that these nodes will never be combined.


author:
   author:
   href="http://jakarta.apache.org/commons/configuration/team-list.html">Commons
author:
   Configuration team
version:
   $Id: OverrideCombiner.java 439648 2006-09-02 20:42:10Z oheger $
since:
   1.3




Method Summary
protected  voidaddAttributes(ViewNode result, ConfigurationNode node1, ConfigurationNode node2)
     Handles the attributes during a combination process.
protected  ConfigurationNodecanCombine(ConfigurationNode node1, ConfigurationNode node2, ConfigurationNode child)
     Tests if a child node of the second node can be combined with the given child node of the first node.
public  ConfigurationNodecombine(ConfigurationNode node1, ConfigurationNode node2)
     Constructs an override combination for the passed in node structures.



Method Detail
addAttributes
protected void addAttributes(ViewNode result, ConfigurationNode node1, ConfigurationNode node2)(Code)
Handles the attributes during a combination process. First all attributes of the first node will be added to the result. Then all attributes of the second node, which are not contained in the first node, will also be added.
Parameters:
  result - the resulting node
Parameters:
  node1 - the first node
Parameters:
  node2 - the second node



canCombine
protected ConfigurationNode canCombine(ConfigurationNode node1, ConfigurationNode node2, ConfigurationNode child)(Code)
Tests if a child node of the second node can be combined with the given child node of the first node. If this is the case, the corresponding node will be returned, otherwise null. This implementation checks whether the child node occurs only once in both hierarchies and is no known list node.
Parameters:
  node1 - the first node
Parameters:
  node2 - the second node
Parameters:
  child - the child node (of the first node) a child of the second node, with which a combination is possible



combine
public ConfigurationNode combine(ConfigurationNode node1, ConfigurationNode node2)(Code)
Constructs an override combination for the passed in node structures.
Parameters:
  node1 - the first node
Parameters:
  node2 - the second node the resulting combined node structure



Fields inherited from org.apache.commons.configuration.tree.NodeCombiner
protected Set listNodes(Code)(Java Doc)

Methods inherited from org.apache.commons.configuration.tree.NodeCombiner
public void addListNode(String nodeName)(Code)(Java Doc)
abstract public ConfigurationNode combine(ConfigurationNode node1, ConfigurationNode node2)(Code)(Java Doc)
protected ViewNode createViewNode()(Code)(Java Doc)
public Set getListNodes()(Code)(Java Doc)
public boolean isListNode(ConfigurationNode node)(Code)(Java Doc)

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.