You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2022/03/12 11:46:15 UTC
[ws-axiom] branch master updated: Enforce consistent formatting in core-mixins
This is an automated email from the ASF dual-hosted git repository.
veithen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ws-axiom.git
The following commit(s) were added to refs/heads/master by this push:
new 6bf98b2 Enforce consistent formatting in core-mixins
6bf98b2 is described below
commit 6bf98b2b6ce56bd3964f411f6d8db54665b9f9f5
Author: Andreas Veithen <an...@gmail.com>
AuthorDate: Sat Mar 12 11:46:08 2022 +0000
Enforce consistent formatting in core-mixins
---
mixins/core-mixins/pom.xml | 16 ++
.../org/apache/axiom/core/AttributeMatcher.java | 105 ++++++-------
.../src/main/java/org/apache/axiom/core/Axis.java | 22 +--
.../main/java/org/apache/axiom/core/Builder.java | 2 +
.../axiom/core/ChildNotAllowedException.java | 3 +-
.../java/org/apache/axiom/core/ClonePolicy.java | 15 +-
.../apache/axiom/core/CloneableCharacterData.java | 4 +-
.../java/org/apache/axiom/core/CoreAttribute.java | 34 +++--
.../org/apache/axiom/core/CoreCDATASection.java | 4 +-
.../axiom/core/CoreCharacterDataContainer.java | 5 +-
.../CoreCharacterDataContainingParentNode.java | 5 +-
.../apache/axiom/core/CoreCharacterDataNode.java | 12 +-
.../java/org/apache/axiom/core/CoreChildNode.java | 39 +++--
.../java/org/apache/axiom/core/CoreComment.java | 4 +-
.../java/org/apache/axiom/core/CoreDocument.java | 9 +-
.../apache/axiom/core/CoreDocumentFragment.java | 4 +-
.../axiom/core/CoreDocumentTypeDeclaration.java | 7 +
.../java/org/apache/axiom/core/CoreElement.java | 157 +++++++++----------
.../org/apache/axiom/core/CoreEntityReference.java | 3 +
.../java/org/apache/axiom/core/CoreLeafNode.java | 4 +-
.../org/apache/axiom/core/CoreModelException.java | 3 +-
.../axiom/core/CoreModelStreamException.java | 6 +-
.../apache/axiom/core/CoreNSAwareAttribute.java | 8 +-
.../org/apache/axiom/core/CoreNSAwareElement.java | 1 +
.../apache/axiom/core/CoreNSAwareNamedNode.java | 9 +-
.../apache/axiom/core/CoreNSUnawareAttribute.java | 8 +-
.../apache/axiom/core/CoreNSUnawareElement.java | 4 +-
.../apache/axiom/core/CoreNSUnawareNamedNode.java | 5 +-
.../axiom/core/CoreNamespaceDeclaration.java | 12 +-
.../main/java/org/apache/axiom/core/CoreNode.java | 45 +++---
.../java/org/apache/axiom/core/CoreParentNode.java | 80 ++++++----
.../axiom/core/CoreProcessingInstruction.java | 5 +-
.../org/apache/axiom/core/CoreTypedAttribute.java | 5 +-
.../axiom/core/CyclicRelationshipException.java | 3 +-
.../axiom/core/DeferredParsingException.java | 16 +-
.../java/org/apache/axiom/core/DetachPolicy.java | 43 +++---
.../java/org/apache/axiom/core/ElementAction.java | 6 +-
.../java/org/apache/axiom/core/ElementMatcher.java | 170 ++++++++++-----------
.../java/org/apache/axiom/core/IdentityMapper.java | 2 +-
.../java/org/apache/axiom/core/InputContext.java | 8 +-
.../main/java/org/apache/axiom/core/Mapper.java | 2 +-
.../main/java/org/apache/axiom/core/Mappers.java | 10 +-
.../apache/axiom/core/NSAwareAttributeMatcher.java | 70 +++++----
.../axiom/core/NamespaceDeclarationMatcher.java | 34 +++--
.../org/apache/axiom/core/NoParentException.java | 3 +-
.../apache/axiom/core/NodeConsumedException.java | 7 +-
.../java/org/apache/axiom/core/NodeFactory.java | 2 +-
.../java/org/apache/axiom/core/NodeFactory2.java | 6 +-
.../org/apache/axiom/core/NodeFactoryImpl.java | 53 ++++---
.../java/org/apache/axiom/core/NodeIterator.java | 33 ++--
.../main/java/org/apache/axiom/core/NodeType.java | 101 ++++++------
.../axiom/core/SelfRelationshipException.java | 3 +-
.../main/java/org/apache/axiom/core/Semantics.java | 32 ++--
.../axiom/core/impl/AbstractNodeIterator.java | 58 ++++---
.../apache/axiom/core/impl/AttributeIterator.java | 21 ++-
.../apache/axiom/core/impl/ElementsIterator.java | 12 +-
.../java/org/apache/axiom/core/impl/Flags.java | 10 +-
.../org/apache/axiom/core/impl/NodesIterator.java | 10 +-
.../org/apache/axiom/core/impl/TreeWalkerImpl.java | 108 +++++++------
.../axiom/core/impl/builder/BuildableContext.java | 99 +++++++-----
.../axiom/core/impl/builder/BuilderHandler.java | 87 ++++++-----
.../axiom/core/impl/builder/BuilderImpl.java | 8 +-
.../axiom/core/impl/builder/BuilderListener.java | 17 +--
.../apache/axiom/core/impl/builder/Context.java | 67 ++++----
.../org/apache/axiom/core/impl/builder/Model.java | 19 ++-
.../axiom/core/impl/builder/PlainXMLModel.java | 4 +-
.../axiom/core/impl/builder/UnwrappingContext.java | 41 ++---
.../axiom/core/impl/mixin/CoreAttributeMixin.java | 27 ++--
.../core/impl/mixin/CoreCDATASectionMixin.java | 10 +-
...CoreCharacterDataContainingParentNodeMixin.java | 3 +-
.../impl/mixin/CoreCharacterDataNodeMixin.java | 25 +--
.../axiom/core/impl/mixin/CoreChildNodeMixin.java | 45 +++---
.../axiom/core/impl/mixin/CoreCommentMixin.java | 10 +-
.../core/impl/mixin/CoreDocumentFragmentMixin.java | 14 +-
.../axiom/core/impl/mixin/CoreDocumentMixin.java | 48 +++---
.../mixin/CoreDocumentTypeDeclarationMixin.java | 28 ++--
.../axiom/core/impl/mixin/CoreElementMixin.java | 75 +++++----
.../core/impl/mixin/CoreEntityReferenceMixin.java | 14 +-
.../axiom/core/impl/mixin/CoreLeafNodeMixin.java | 4 +-
.../impl/mixin/CoreMixedContentContainerMixin.java | 3 +-
.../core/impl/mixin/CoreNSAwareAttributeMixin.java | 11 +-
.../core/impl/mixin/CoreNSAwareElementMixin.java | 12 +-
.../impl/mixin/CoreNSUnawareAttributeMixin.java | 3 +-
.../core/impl/mixin/CoreNSUnawareElementMixin.java | 9 +-
.../impl/mixin/CoreNSUnawareNamedNodeMixin.java | 6 +-
.../impl/mixin/CoreNamespaceDeclarationMixin.java | 12 +-
.../axiom/core/impl/mixin/CoreNodeMixin.java | 29 ++--
.../axiom/core/impl/mixin/CoreParentNodeMixin.java | 130 +++++++++-------
.../impl/mixin/CoreProcessingInstructionMixin.java | 13 +-
.../core/impl/mixin/CoreTypedAttributeMixin.java | 8 +-
.../apache/axiom/core/impl/mixin/package-info.java | 51 ++++---
.../apache/axiom/core/util/TopologicalSort.java | 28 ++--
92 files changed, 1307 insertions(+), 1121 deletions(-)
diff --git a/mixins/core-mixins/pom.xml b/mixins/core-mixins/pom.xml
index ce2a3b3..2b2948b 100644
--- a/mixins/core-mixins/pom.xml
+++ b/mixins/core-mixins/pom.xml
@@ -48,4 +48,20 @@
<scope>provided</scope>
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.github.veithen.maven</groupId>
+ <artifactId>java-format-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/AttributeMatcher.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/AttributeMatcher.java
index f3dd3fe..17a6021 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/AttributeMatcher.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/AttributeMatcher.java
@@ -18,85 +18,74 @@
*/
package org.apache.axiom.core;
-/**
- * Selects, creates or updates an attribute based on some match rule.
- */
+/** Selects, creates or updates an attribute based on some match rule. */
public interface AttributeMatcher {
/**
- * Check if the given attribute matches. The values of the <code>namespaceURI</code> and
- * <code>name</code> parameters are those passed to
- * {@link CoreElement#coreGetAttribute(AttributeMatcher, String, String)} or
- * {@link CoreElement#coreSetAttribute(AttributeMatcher, String, String, String, String)}, or
- * they are determined by the return values of {@link #getNamespaceURI(CoreAttribute)} and
- * {@link #getName(CoreAttribute)} if
- * {@link CoreElement#coreSetAttribute(AttributeMatcher, CoreAttribute, Semantics)}
- * is used. It is
- * not required that these parameters strictly represent the namespace URI and local name of the
- * attribute. Their exact meaning is defined by the particular {@link AttributeMatcher}
- * implementation.
- *
- * @param attr
- * the attribute to check
- * @param namespaceURI
- * see above
- * @param name
- * see above
+ * Check if the given attribute matches. The values of the <code>namespaceURI</code> and <code>
+ * name</code> parameters are those passed to {@link
+ * CoreElement#coreGetAttribute(AttributeMatcher, String, String)} or {@link
+ * CoreElement#coreSetAttribute(AttributeMatcher, String, String, String, String)}, or they are
+ * determined by the return values of {@link #getNamespaceURI(CoreAttribute)} and {@link
+ * #getName(CoreAttribute)} if {@link CoreElement#coreSetAttribute(AttributeMatcher,
+ * CoreAttribute, Semantics)} is used. It is not required that these parameters strictly
+ * represent the namespace URI and local name of the attribute. Their exact meaning is defined
+ * by the particular {@link AttributeMatcher} implementation.
+ *
+ * @param attr the attribute to check
+ * @param namespaceURI see above
+ * @param name see above
* @return <code>true</code> if the attribute matches, <code>false</code> otherwise
*/
boolean matches(CoreAttribute attr, String namespaceURI, String name);
/**
* Get the {@code namespaceURI} parameter for an existing attribute. This method is used by
- * {@link CoreElement#coreSetAttribute(AttributeMatcher, CoreAttribute, Semantics)}
- * which passes its return value as parameter to {@link #matches(CoreAttribute, String, String)}.
- *
+ * {@link CoreElement#coreSetAttribute(AttributeMatcher, CoreAttribute, Semantics)} which passes
+ * its return value as parameter to {@link #matches(CoreAttribute, String, String)}.
+ *
* @param attr the attribute
- * @return the {@code namespaceURI} parameter to be passed to {@link #matches(CoreAttribute, String, String)}
+ * @return the {@code namespaceURI} parameter to be passed to {@link #matches(CoreAttribute,
+ * String, String)}
*/
String getNamespaceURI(CoreAttribute attr);
-
+
/**
- * Get the {@code name} parameter for an existing attribute. This method is used by
- * {@link CoreElement#coreSetAttribute(AttributeMatcher, CoreAttribute, Semantics)}
- * which passes its return value as parameter to {@link #matches(CoreAttribute, String, String)}.
- *
+ * Get the {@code name} parameter for an existing attribute. This method is used by {@link
+ * CoreElement#coreSetAttribute(AttributeMatcher, CoreAttribute, Semantics)} which passes its
+ * return value as parameter to {@link #matches(CoreAttribute, String, String)}.
+ *
* @param attr the attribute
- * @return the {@code name} parameter to be passed to {@link #matches(CoreAttribute, String, String)}
+ * @return the {@code name} parameter to be passed to {@link #matches(CoreAttribute, String,
+ * String)}
*/
String getName(CoreAttribute attr);
-
+
/**
* Create a new attribute node. The values of the <code>namespaceURI</code>, <code>name</code>,
- * <code>prefix</code> and <code>value</code> parameters are those passed to
- * {@link CoreElement#coreSetAttribute(AttributeMatcher, String, String, String, String)}.
- *
- * @param nodeFactory
- * the node factory to be used to create the new attribute node
- * @param namespaceURI
- * see above
- * @param name
- * see above
- * @param prefix
- * see above
- * @param value
- * see above
+ * <code>prefix</code> and <code>value</code> parameters are those passed to {@link
+ * CoreElement#coreSetAttribute(AttributeMatcher, String, String, String, String)}.
+ *
+ * @param nodeFactory the node factory to be used to create the new attribute node
+ * @param namespaceURI see above
+ * @param name see above
+ * @param prefix see above
+ * @param value see above
* @return
- * @throws CoreModelException
+ * @throws CoreModelException
*/
- CoreAttribute createAttribute(NodeFactory2 nodeFactory, String namespaceURI, String name, String prefix, String value) throws CoreModelException;
-
+ CoreAttribute createAttribute(
+ NodeFactory2 nodeFactory, String namespaceURI, String name, String prefix, String value)
+ throws CoreModelException;
+
/**
* Update an existing attribute. The values of the <code>prefix</code> and <code>value</code>
- * parameters are those passed to
- * {@link CoreElement#coreSetAttribute(AttributeMatcher, String, String, String, String)}.
- *
- * @param attr
- * the attribute to update
- * @param prefix
- * see above
- * @param value
- * see above
- * @throws CoreModelException
+ * parameters are those passed to {@link CoreElement#coreSetAttribute(AttributeMatcher, String,
+ * String, String, String)}.
+ *
+ * @param attr the attribute to update
+ * @param prefix see above
+ * @param value see above
+ * @throws CoreModelException
*/
void update(CoreAttribute attr, String prefix, String value) throws CoreModelException;
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/Axis.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/Axis.java
index e2e56fc..16f918b 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/Axis.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/Axis.java
@@ -18,22 +18,14 @@
*/
package org.apache.axiom.core;
-/**
- * Identifies a node-set relative to a given node.
- */
+/** Identifies a node-set relative to a given node. */
public enum Axis {
- /**
- * The children of the node.
- */
+ /** The children of the node. */
CHILDREN,
-
- /**
- * The descendants of the node.
- */
+
+ /** The descendants of the node. */
DESCENDANTS,
-
- /**
- * The descendants of the node and the node itself.
- */
+
+ /** The descendants of the node and the node itself. */
DESCENDANTS_OR_SELF
-}
\ No newline at end of file
+}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/Builder.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/Builder.java
index 0d16d23..315e562 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/Builder.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/Builder.java
@@ -20,6 +20,8 @@ package org.apache.axiom.core;
public interface Builder {
void next() throws DeferredParsingException;
+
boolean isCompleted();
+
void close();
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/ChildNotAllowedException.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/ChildNotAllowedException.java
index f3da063..6547a4b 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/ChildNotAllowedException.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/ChildNotAllowedException.java
@@ -27,8 +27,7 @@ package org.apache.axiom.core;
public class ChildNotAllowedException extends HierarchyException {
private static final long serialVersionUID = 1L;
- public ChildNotAllowedException() {
- }
+ public ChildNotAllowedException() {}
public ChildNotAllowedException(String message) {
super(message);
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/ClonePolicy.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/ClonePolicy.java
index 9de1857..c0bd69e 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/ClonePolicy.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/ClonePolicy.java
@@ -18,24 +18,23 @@
*/
package org.apache.axiom.core;
-/**
- * Defines how an object model tree is to be cloned.
- */
+/** Defines how an object model tree is to be cloned. */
public interface ClonePolicy<T> {
Class<? extends CoreNode> getTargetNodeClass(T options, CoreNode node);
+
boolean repairNamespaces(T options);
+
boolean cloneAttributes(T options);
+
boolean cloneChildren(T options, NodeType nodeType);
/**
* Post-process a cloned node. This method is called after all information from the original
* node has been copied (for elements, this includes the attributes of the element) and the node
* has been inserted into the cloned tree, but before any children are added.
- *
- * @param options
- * API specific options
- * @param clone
- * the clone to be post-processed
+ *
+ * @param options API specific options
+ * @param clone the clone to be post-processed
*/
void postProcess(T options, CoreNode clone);
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CloneableCharacterData.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CloneableCharacterData.java
index 2b9a7b0..d0f35ec 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CloneableCharacterData.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CloneableCharacterData.java
@@ -20,9 +20,7 @@ package org.apache.axiom.core;
import org.apache.axiom.core.stream.CharacterData;
-/**
- * {@link CharacterData} that should be cloned when the owning node is cloned.
- */
+/** {@link CharacterData} that should be cloned when the owning node is cloned. */
public interface CloneableCharacterData extends CharacterData {
<T> CharacterData clone(ClonePolicy<T> policy, T options);
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreAttribute.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreAttribute.java
index 6ad492c..c1fc5d4 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreAttribute.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreAttribute.java
@@ -21,42 +21,42 @@ package org.apache.axiom.core;
public interface CoreAttribute extends CoreCharacterDataContainingParentNode {
/**
* Get the owner element of this attribute.
- *
+ *
* @return the owner element of the attribute
*/
CoreElement coreGetOwnerElement();
-
+
/**
* Check if this node has an owner element.
- *
+ *
* @return <code>true</code> if and only if this node currently has an owner element
*/
boolean coreHasOwnerElement();
-
+
/**
* Remove this attribute from its owner element.
- *
- * @param semantics
- * the API semantics to use; determines the new owner document for the attribute
+ *
+ * @param semantics the API semantics to use; determines the new owner document for the
+ * attribute
* @return <code>true</code> if the attribute had an owner element and has been removed from
- * that element; <code>false</code> if the attribute didn't have an owner element and no
- * changes have been made
+ * that element; <code>false</code> if the attribute didn't have an owner element and no
+ * changes have been made
*/
boolean coreRemove(Semantics semantics);
-
+
/**
* Get the attribute immediately following the current attribute.
- *
+ *
* @return the next attribute, or <code>null</code> if the attribute is the last attribute of
- * its owner element or if the attribute has no owner element
+ * its owner element or if the attribute has no owner element
*/
CoreAttribute coreGetNextAttribute();
-
+
/**
* Get the attribute immediately preceding the current attribute.
- *
+ *
* @return the previous attribute, or <code>null</code> if the attribute is the first attribute
- * of its owner element or if the attribute has no owner element
+ * of its owner element or if the attribute has no owner element
*/
CoreAttribute coreGetPreviousAttribute();
@@ -65,8 +65,12 @@ public interface CoreAttribute extends CoreCharacterDataContainingParentNode {
void coreSetSpecified(boolean specified);
void internalSetOwnerElement(CoreElement element);
+
void internalUnsetOwnerElement(CoreDocument newOwnerDocument);
+
void internalSetNextAttribute(CoreAttribute nextAttribute);
+
void internalInsertAttributeAfter(CoreAttribute attr);
+
boolean internalRemove(Semantics semantics, CoreElement newOwner);
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreCDATASection.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreCDATASection.java
index 762af06..48cd272 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreCDATASection.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreCDATASection.java
@@ -18,6 +18,4 @@
*/
package org.apache.axiom.core;
-public interface CoreCDATASection extends CoreChildNode, CoreCharacterDataContainingParentNode {
-
-}
+public interface CoreCDATASection extends CoreChildNode, CoreCharacterDataContainingParentNode {}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreCharacterDataContainer.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreCharacterDataContainer.java
index a61127b..a80769d 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreCharacterDataContainer.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreCharacterDataContainer.java
@@ -18,6 +18,5 @@
*/
package org.apache.axiom.core;
-public interface CoreCharacterDataContainer extends CoreCharacterDataSourceNode, CoreCharacterDataSinkNode {
-
-}
+public interface CoreCharacterDataContainer
+ extends CoreCharacterDataSourceNode, CoreCharacterDataSinkNode {}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreCharacterDataContainingParentNode.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreCharacterDataContainingParentNode.java
index 2b2beda..3c84f7f 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreCharacterDataContainingParentNode.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreCharacterDataContainingParentNode.java
@@ -18,6 +18,5 @@
*/
package org.apache.axiom.core;
-public interface CoreCharacterDataContainingParentNode extends CoreCharacterDataContainer, CoreParentNode {
-
-}
+public interface CoreCharacterDataContainingParentNode
+ extends CoreCharacterDataContainer, CoreParentNode {}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreCharacterDataNode.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreCharacterDataNode.java
index ded2d2a..46e0aff 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreCharacterDataNode.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreCharacterDataNode.java
@@ -23,15 +23,15 @@ public interface CoreCharacterDataNode extends CoreLeafNode, CoreCharacterDataCo
Object coreGetCharacterData();
void coreSetCharacterData(Object data);
-
+
/**
- * Check whether this text node contains element content whitespace (also called
- * "ignorable whitespace").
- *
+ * Check whether this text node contains element content whitespace (also called "ignorable
+ * whitespace").
+ *
* @return <code>true</code> if the text node contains ignorable whitespace, <code>false</code>
- * otherwise
+ * otherwise
*/
boolean coreIsIgnorable();
-
+
void coreSetIgnorable(boolean ignorable);
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreChildNode.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreChildNode.java
index 82823f6..3142752 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreChildNode.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreChildNode.java
@@ -21,66 +21,73 @@ package org.apache.axiom.core;
public interface CoreChildNode extends CoreNode {
/**
* Check if this node has a parent.
- *
+ *
* @return <code>true</code> if and only if this node currently has a parent
*/
boolean coreHasParent();
-
+
/**
* Get the parent of this node.
- *
+ *
* @return the parent of this node or <code>null</code> if this node doesn't have a parent
*/
CoreParentNode coreGetParent();
-
+
/**
* Get the parent element of this node.
- *
+ *
* @return the parent element of this node or <code>null</code> if the node has no parent or if
- * the parent is not an element
+ * the parent is not an element
*/
CoreElement coreGetParentElement();
CoreChildNode coreGetNextSibling() throws CoreModelException;
+
CoreChildNode coreGetPreviousSibling();
CoreChildNode coreGetNextSibling(NodeFilter filter) throws CoreModelException;
+
CoreChildNode coreGetPreviousSibling(NodeFilter filter);
/**
* Get the next sibling if it is available. The sibling is available if it is complete or if the
* builder has started building the node. In contrast to {@link #coreGetNextSibling()}, this
* method will never modify the state of the underlying parser.
- *
+ *
* @return the next sibling or <code>null</code> if the node has no next sibling or the builder
- * has not yet started to build the next sibling
+ * has not yet started to build the next sibling
*/
CoreChildNode coreGetNextSiblingIfAvailable();
void coreInsertSiblingAfter(CoreChildNode sibling) throws CoreModelException;
+
void coreInsertSiblingBefore(CoreChildNode sibling) throws CoreModelException;
-
+
void coreInsertSiblingsBefore(CoreDocumentFragment fragment);
-
+
void coreDetach(Semantics semantics);
+
void coreDetach(CoreDocument newOwnerDocument);
void coreReplaceWith(CoreChildNode newNode, Semantics semantics) throws CoreModelException;
/**
* Clone this node according to the provided policy.
- *
- * @param policy
- * the policy to use when cloning this node (and its children)
- * @param targetParent
- * the node to which the clone should be added; may be <code>null</code>
+ *
+ * @param policy the policy to use when cloning this node (and its children)
+ * @param targetParent the node to which the clone should be added; may be <code>null</code>
* @return the clone of this node
*/
- <T> CoreNode coreClone(ClonePolicy<T> policy, T options, CoreParentNode targetParent) throws CoreModelException;
+ <T> CoreNode coreClone(ClonePolicy<T> policy, T options, CoreParentNode targetParent)
+ throws CoreModelException;
void internalSetParent(CoreParentNode parent);
+
void internalUnsetParent(CoreDocument newOwnerDocument);
+
void internalDetach(DetachPolicy detachPolicy, CoreParentNode newParent);
+
void internalSetNextSibling(CoreChildNode nextSibling);
+
void internalSetPreviousSibling(CoreChildNode previousSibling);
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreComment.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreComment.java
index b57d5c0..862b0ce 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreComment.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreComment.java
@@ -18,6 +18,4 @@
*/
package org.apache.axiom.core;
-public interface CoreComment extends CoreChildNode, CoreCharacterDataContainingParentNode {
-
-}
+public interface CoreComment extends CoreChildNode, CoreCharacterDataContainingParentNode {}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreDocument.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreDocument.java
index 3513819..b810541 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreDocument.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreDocument.java
@@ -20,13 +20,20 @@ package org.apache.axiom.core;
public interface CoreDocument extends CoreParentNode {
String coreGetInputEncoding();
+
void coreSetInputEncoding(String inputEncoding);
+
String coreGetXmlVersion();
+
void coreSetXmlVersion(String xmlVersion);
+
String coreGetXmlEncoding();
+
void coreSetXmlEncoding(String xmlEncoding);
+
Boolean coreGetStandalone();
+
void coreSetStandalone(Boolean standalone);
-
+
CoreElement coreGetDocumentElement() throws CoreModelException;
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreDocumentFragment.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreDocumentFragment.java
index ecd57ee..3c5c973 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreDocumentFragment.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreDocumentFragment.java
@@ -18,6 +18,4 @@
*/
package org.apache.axiom.core;
-public interface CoreDocumentFragment extends CoreMixedContentContainer {
-
-}
+public interface CoreDocumentFragment extends CoreMixedContentContainer {}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclaration.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclaration.java
index c217e56..b49d81c 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclaration.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclaration.java
@@ -20,11 +20,18 @@ package org.apache.axiom.core;
public interface CoreDocumentTypeDeclaration extends CoreLeafNode {
String coreGetRootName();
+
void coreSetRootName(String rootName);
+
String coreGetPublicId();
+
void coreSetPublicId(String publicId);
+
String coreGetSystemId();
+
void coreSetSystemId(String systemId);
+
String coreGetInternalSubset();
+
void coreSetInternalSubset(String internalSubset);
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreElement.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreElement.java
index 48e86c9..620b3c7 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreElement.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreElement.java
@@ -23,137 +23,122 @@ import java.util.Iterator;
public interface CoreElement extends CoreChildNode, CoreMixedContentContainer, CoreNamedNode {
/**
* Get the first attribute of this element.
- *
+ *
* @return the first attribute, or <code>null</code> if this element has no attributes
*/
CoreAttribute coreGetFirstAttribute();
/**
* Get the last attribute of this element.
- *
+ *
* @return the last attribute, or <code>null</code> if this element has no attributes
*/
CoreAttribute coreGetLastAttribute();
-
+
/**
* Get the first attribute selected by a given {@link AttributeMatcher}.
- *
- * @param matcher
- * the {@link AttributeMatcher} implementation to use
- * @param namespaceURI
- * the <code>namespaceURI</code> parameter to pass to
- * {@link AttributeMatcher#matches(CoreAttribute, String, String)}
- * @param name
- * the <code>name</code> parameter to pass to
- * {@link AttributeMatcher#matches(CoreAttribute, String, String)}
+ *
+ * @param matcher the {@link AttributeMatcher} implementation to use
+ * @param namespaceURI the <code>namespaceURI</code> parameter to pass to {@link
+ * AttributeMatcher#matches(CoreAttribute, String, String)}
+ * @param name the <code>name</code> parameter to pass to {@link
+ * AttributeMatcher#matches(CoreAttribute, String, String)}
* @return the (first) matching attribute, or <code>null</code> if no matching attribute was
- * found
+ * found
*/
CoreAttribute coreGetAttribute(AttributeMatcher matcher, String namespaceURI, String name);
-
+
/**
* Create or update an attribute based on a given {@link AttributeMatcher}.
- *
- * @param matcher
- * the {@link AttributeMatcher} implementation to use
- * @param namespaceURI
- * the <code>namespaceURI</code> parameter to pass to
- * {@link AttributeMatcher#matches(CoreAttribute, String, String)} and
- * {@link AttributeMatcher#createAttribute(CoreElement, String, String, String, String)}
- * @param name
- * the <code>name</code> parameter to pass to
- * {@link AttributeMatcher#matches(CoreAttribute, String, String)} and
- * {@link AttributeMatcher#createAttribute(CoreElement, String, String, String, String)}
- * @param prefix
- * the <code>prefix</code> parameter to pass to
- * {@link AttributeMatcher#createAttribute(CoreElement, String, String, String, String)}
- * and {@link AttributeMatcher#update(CoreAttribute, String, String)}
- * @param value
- * the <code>value</code> parameter to pass to
- * {@link AttributeMatcher#createAttribute(CoreElement, String, String, String, String)}
- * and {@link AttributeMatcher#update(CoreAttribute, String, String)}
+ *
+ * @param matcher the {@link AttributeMatcher} implementation to use
+ * @param namespaceURI the <code>namespaceURI</code> parameter to pass to {@link
+ * AttributeMatcher#matches(CoreAttribute, String, String)} and {@link
+ * AttributeMatcher#createAttribute(CoreElement, String, String, String, String)}
+ * @param name the <code>name</code> parameter to pass to {@link
+ * AttributeMatcher#matches(CoreAttribute, String, String)} and {@link
+ * AttributeMatcher#createAttribute(CoreElement, String, String, String, String)}
+ * @param prefix the <code>prefix</code> parameter to pass to {@link
+ * AttributeMatcher#createAttribute(CoreElement, String, String, String, String)} and {@link
+ * AttributeMatcher#update(CoreAttribute, String, String)}
+ * @param value the <code>value</code> parameter to pass to {@link
+ * AttributeMatcher#createAttribute(CoreElement, String, String, String, String)} and {@link
+ * AttributeMatcher#update(CoreAttribute, String, String)}
*/
- void coreSetAttribute(AttributeMatcher matcher, String namespaceURI, String name, String prefix, String value) throws CoreModelException;
-
+ void coreSetAttribute(
+ AttributeMatcher matcher, String namespaceURI, String name, String prefix, String value)
+ throws CoreModelException;
+
/**
- * Add a new attribute or replace an existing attribute based on a given
- * {@link AttributeMatcher}. If a matching attribute on this element is found, it is replaced by
- * the specified attribute. If no matching attribute is found, then the specified attribute is
- * added to this element. If the attribute is already owned by this element, then calling this
- * method has no effect.
- *
- * @param matcher
- * the {@link AttributeMatcher} implementation to use
- * @param attr
- * the new attribute to add
- * @param semantics
- * determines the new owner document for the replaced attribute
+ * Add a new attribute or replace an existing attribute based on a given {@link
+ * AttributeMatcher}. If a matching attribute on this element is found, it is replaced by the
+ * specified attribute. If no matching attribute is found, then the specified attribute is added
+ * to this element. If the attribute is already owned by this element, then calling this method
+ * has no effect.
+ *
+ * @param matcher the {@link AttributeMatcher} implementation to use
+ * @param attr the new attribute to add
+ * @param semantics determines the new owner document for the replaced attribute
* @return the attribute that was replaced by the new attribute, or <code>null</code> if no
- * matching attribute existed.
+ * matching attribute existed.
*/
- CoreAttribute coreSetAttribute(AttributeMatcher matcher, CoreAttribute attr, Semantics semantics);
+ CoreAttribute coreSetAttribute(
+ AttributeMatcher matcher, CoreAttribute attr, Semantics semantics);
/**
* Append an attribute to this element. The attribute is simply added at the end of the list of
* attributes for this element. This method should be used with care because no provisions are
* made to ensure uniqueness of attribute names.
- *
- * @param attr
- * the attribute to append
+ *
+ * @param attr the attribute to append
*/
void coreAppendAttribute(CoreAttribute attr);
-
+
/**
* Remove an attribute based on a given {@link AttributeMatcher}.
- *
- * @param matcher
- * the {@link AttributeMatcher} implementation to use
- * @param namespaceURI
- * the <code>namespaceURI</code> parameter to pass to
- * {@link AttributeMatcher#matches(CoreAttribute, String, String)}
- * @param name
- * the <code>name</code> parameter to pass to
- * {@link AttributeMatcher#matches(CoreAttribute, String, String)}
- * @return <code>true</code> if a matching attribute was found (and has been removed),
- * <code>false</code> if no matching attribute was found
+ *
+ * @param matcher the {@link AttributeMatcher} implementation to use
+ * @param namespaceURI the <code>namespaceURI</code> parameter to pass to {@link
+ * AttributeMatcher#matches(CoreAttribute, String, String)}
+ * @param name the <code>name</code> parameter to pass to {@link
+ * AttributeMatcher#matches(CoreAttribute, String, String)}
+ * @return <code>true</code> if a matching attribute was found (and has been removed), <code>
+ * false</code> if no matching attribute was found
*/
- boolean coreRemoveAttribute(AttributeMatcher matcher, String namespaceURI, String name, Semantics semantics);
-
- <T extends CoreAttribute,S> Iterator<S> coreGetAttributesByType(Class<T> type, Mapper<S,? super T> mapper, Semantics semantics);
-
+ boolean coreRemoveAttribute(
+ AttributeMatcher matcher, String namespaceURI, String name, Semantics semantics);
+
+ <T extends CoreAttribute, S> Iterator<S> coreGetAttributesByType(
+ Class<T> type, Mapper<S, ? super T> mapper, Semantics semantics);
+
/**
* Look up the namespace URI associated to the given prefix.
- *
- * @param prefix
- * The prefix to look for. If this parameter is the empty string, then the URI of the
- * default namespace will be returned.
- * @param semantics
- * The API semantics to use.
+ *
+ * @param prefix The prefix to look for. If this parameter is the empty string, then the URI of
+ * the default namespace will be returned.
+ * @param semantics The API semantics to use.
* @return the namespace URI or <code>null</code> if the prefix is not bound; if the prefix is
- * the empty string and no default namespace declaration exists, then an empty string is
- * returned
+ * the empty string and no default namespace declaration exists, then an empty string is
+ * returned
* @see Semantics#isUseStrictNamespaceLookup()
*/
String coreLookupNamespaceURI(String prefix, Semantics semantics) throws CoreModelException;
-
+
/**
* Find a prefix associated to the given namespace URI. Default namespaces are not taken into
* account by this method.
- *
- * @param namespaceURI
- * The namespace URI to look for. This parameter must not be <code>null</code> (XML
- * forbids to bind a prefix to the null namespace).
- * @param semantics
- * The API semantics to use.
+ *
+ * @param namespaceURI The namespace URI to look for. This parameter must not be <code>null
+ * </code> (XML forbids to bind a prefix to the null namespace).
+ * @param semantics The API semantics to use.
* @return a prefix bound to the given namespace URI or <code>null</code> if none is found
- * @throws IllegalArgumentException
- * if <code>namespaceURI</code> is <code>null</code>
+ * @throws IllegalArgumentException if <code>namespaceURI</code> is <code>null</code>
* @see Semantics#isUseStrictNamespaceLookup()
*/
// TODO: wrong Javadoc: null vs. empty string
// TODO: we can support default namespaces!
String coreLookupPrefix(String namespaceURI, Semantics semantics) throws CoreModelException;
-
+
void corePromote(CoreElement newElement, Semantics semantics) throws CoreModelException;
void internalSetFirstAttribute(CoreAttribute firstAttribute);
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreEntityReference.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreEntityReference.java
index 94b4529..1652bce 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreEntityReference.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreEntityReference.java
@@ -20,7 +20,10 @@ package org.apache.axiom.core;
public interface CoreEntityReference extends CoreLeafNode {
String coreGetName();
+
void coreSetName(String name);
+
String coreGetReplacementText();
+
void coreSetReplacementText(String replacementText);
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreLeafNode.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreLeafNode.java
index dbdd7d5..872e271 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreLeafNode.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreLeafNode.java
@@ -18,6 +18,4 @@
*/
package org.apache.axiom.core;
-public interface CoreLeafNode extends CoreChildNode {
-
-}
+public interface CoreLeafNode extends CoreChildNode {}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreModelException.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreModelException.java
index 7e0db37..b9b9343 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreModelException.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreModelException.java
@@ -26,8 +26,7 @@ package org.apache.axiom.core;
public abstract class CoreModelException extends Exception {
private static final long serialVersionUID = 1204321445792058777L;
- public CoreModelException() {
- }
+ public CoreModelException() {}
public CoreModelException(String message) {
super(message);
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreModelStreamException.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreModelStreamException.java
index de9a2dd..a7020df 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreModelStreamException.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreModelStreamException.java
@@ -38,13 +38,13 @@ public class CoreModelStreamException extends StreamException {
}
return super.initCause(cause);
}
-
+
/**
* Get the {@link CoreModelException} wrapped by this exception.
- *
+ *
* @return the wrapped exception
*/
public CoreModelException getCoreModelException() {
- return (CoreModelException)getCause();
+ return (CoreModelException) getCause();
}
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSAwareAttribute.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSAwareAttribute.java
index 1d18e2f..feea9cc 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSAwareAttribute.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSAwareAttribute.java
@@ -18,9 +18,5 @@
*/
package org.apache.axiom.core;
-/**
- * Represents a namespace aware attribute information item.
- */
-public interface CoreNSAwareAttribute extends CoreTypedAttribute, CoreNSAwareNamedNode {
-
-}
+/** Represents a namespace aware attribute information item. */
+public interface CoreNSAwareAttribute extends CoreTypedAttribute, CoreNSAwareNamedNode {}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSAwareElement.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSAwareElement.java
index 8da88df..6328ec2 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSAwareElement.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSAwareElement.java
@@ -23,5 +23,6 @@ import org.apache.axiom.core.stream.XmlInput;
public interface CoreNSAwareElement extends CoreElement, CoreNSAwareNamedNode {
XmlInput getXmlInput(boolean cache, boolean incremental) throws StreamException;
+
void validateName(String staxPrefix, String staxLocalName, String staxNamespaceURI);
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSAwareNamedNode.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSAwareNamedNode.java
index 50646c9..5b9e576 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSAwareNamedNode.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSAwareNamedNode.java
@@ -18,14 +18,17 @@
*/
package org.apache.axiom.core;
-/**
- * Represents a namespace aware named information item.
- */
+/** Represents a namespace aware named information item. */
public interface CoreNSAwareNamedNode extends CoreNamedNode {
void initName(String namespaceURI, String localName, String prefix, Object namespaceHelper);
+
String coreGetNamespaceURI();
+
String coreGetPrefix();
+
void coreSetPrefix(String prefix);
+
String coreGetLocalName();
+
void coreSetName(String namespaceURI, String localName, String prefix);
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSUnawareAttribute.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSUnawareAttribute.java
index 77b3a43..9b920d2 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSUnawareAttribute.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSUnawareAttribute.java
@@ -18,9 +18,5 @@
*/
package org.apache.axiom.core;
-/**
- * Represents a namespace unaware attribute information item.
- */
-public interface CoreNSUnawareAttribute extends CoreTypedAttribute, CoreNSUnawareNamedNode {
-
-}
+/** Represents a namespace unaware attribute information item. */
+public interface CoreNSUnawareAttribute extends CoreTypedAttribute, CoreNSUnawareNamedNode {}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSUnawareElement.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSUnawareElement.java
index 1606a81..5b0be0b 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSUnawareElement.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSUnawareElement.java
@@ -18,6 +18,4 @@
*/
package org.apache.axiom.core;
-public interface CoreNSUnawareElement extends CoreElement, CoreNSUnawareNamedNode {
-
-}
+public interface CoreNSUnawareElement extends CoreElement, CoreNSUnawareNamedNode {}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSUnawareNamedNode.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSUnawareNamedNode.java
index 6f03387..86dfc43 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSUnawareNamedNode.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNSUnawareNamedNode.java
@@ -18,10 +18,9 @@
*/
package org.apache.axiom.core;
-/**
- * Represents a namespace unaware named information item.
- */
+/** Represents a namespace unaware named information item. */
public interface CoreNSUnawareNamedNode extends CoreNamedNode {
String coreGetName();
+
void coreSetName(String name);
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNamespaceDeclaration.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNamespaceDeclaration.java
index 75d0cf5..0ed9d3d 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNamespaceDeclaration.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNamespaceDeclaration.java
@@ -18,19 +18,17 @@
*/
package org.apache.axiom.core;
-/**
- * Represents a namespace declaration information item.
- */
+/** Represents a namespace declaration information item. */
public interface CoreNamespaceDeclaration extends CoreAttribute {
void init(String prefix, String namespaceURI, Object namespaceHelper);
-
+
/**
* Get the prefix declared by this namespace declaration.
- *
+ *
* @return the prefix, or the empty string if this namespace declaration defines the default
- * namespace
+ * namespace
*/
String coreGetDeclaredPrefix();
-
+
void coreSetDeclaredNamespace(String prefix, String namespaceURI);
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNode.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNode.java
index 8620088..626580a 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNode.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreNode.java
@@ -24,50 +24,57 @@ import org.apache.axiom.core.stream.XmlHandler;
public interface CoreNode {
/**
* Get the owner document to which this node belongs.
- *
- * @param create
- * indicates whether the owner document should be created if it has not been created
- * yet
+ *
+ * @param create indicates whether the owner document should be created if it has not been
+ * created yet
* @return the owner document or <code>null</code> if the owner document has not been created
- * yet and <code>create</code> is <code>false</code>
+ * yet and <code>create</code> is <code>false</code>
*/
CoreDocument coreGetOwnerDocument(boolean create);
-
+
CoreNode getRootOrOwnerDocument();
-
+
boolean coreHasSameOwnerDocument(CoreNode other);
-
+
void coreSetOwnerDocument(CoreDocument document);
-
+
NodeFactory coreGetNodeFactory();
-
+
/**
* Get the node type.
- *
+ *
* @return the node type
*/
NodeType coreGetNodeType();
-
+
Class<? extends CoreNode> coreGetNodeClass();
/**
* Clone this node according to the provided policy.
- *
- * @param policy
- * the policy to use when cloning this node (and its children)
+ *
+ * @param policy the policy to use when cloning this node (and its children)
* @return the clone of this node
*/
<T> CoreNode coreClone(ClonePolicy<T> policy, T options) throws CoreModelException;
-
+
<T> void init(ClonePolicy<T> policy, T options, CoreNode other) throws CoreModelException;
- <T> void cloneChildrenIfNecessary(ClonePolicy<T> policy, T options, CoreNode clone) throws CoreModelException;
- void internalSerialize(XmlHandler handler, boolean cache) throws CoreModelException, StreamException;
+ <T> void cloneChildrenIfNecessary(ClonePolicy<T> policy, T options, CoreNode clone)
+ throws CoreModelException;
+
+ void internalSerialize(XmlHandler handler, boolean cache)
+ throws CoreModelException, StreamException;
boolean internalGetFlag(int flag);
+
void internalSetFlag(int flag, boolean value);
+
int internalGetFlags(int mask);
+
void internalSetFlags(int mask, int flags);
+
<T> void initAncillaryData(ClonePolicy<T> policy, T options, CoreNode other);
- <T> CoreNode internalClone(ClonePolicy<T> policy, T options, CoreParentNode targetParent) throws CoreModelException;
+
+ <T> CoreNode internalClone(ClonePolicy<T> policy, T options, CoreParentNode targetParent)
+ throws CoreModelException;
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreParentNode.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreParentNode.java
index 3f61f18..ccfb571 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreParentNode.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreParentNode.java
@@ -22,79 +22,101 @@ import org.apache.axiom.core.stream.StreamException;
import org.apache.axiom.core.stream.XmlHandler;
import org.apache.axiom.core.stream.XmlReader;
-/**
- * Interface for parent nodes.
- */
+/** Interface for parent nodes. */
public interface CoreParentNode extends CoreNode {
int COMPLETE = 0;
int ATTRIBUTES_PENDING = 1;
int INCOMPLETE = 2;
-
+
/**
* A request was made to discard the node, but some of the events corresponding to this node
* have not been consumed yet.
*/
int DISCARDING = 3;
-
- /**
- * The node has been discarded and all corresponding events have been consumed.
- */
+
+ /** The node has been discarded and all corresponding events have been consumed. */
int DISCARDED = 4;
-
+
int COMPACT = 5;
-
+
Builder coreGetBuilder();
+
void internalBuildNext() throws CoreModelException;
+
InputContext coreGetInputContext();
+
void coreSetInputContext(InputContext context);
+
int getState();
+
boolean isExpanded();
+
void forceExpand();
+
void coreSetState(int state);
+
void coreBuild() throws CoreModelException;
void serializeStartEvent(XmlHandler handler) throws CoreModelException, StreamException;
+
void serializeEndEvent(XmlHandler handler) throws StreamException;
+
void internalAppendChildWithoutBuild(CoreChildNode child);
/**
- * Get the first child if it is available. The child is available if it is complete or
- * if the builder has started building the node. In the latter case,
- * {@link OMNode#isComplete()} may return <code>false</code> when called on the child.
- * In contrast to {@link OMContainer#getFirstOMChild()}, this method will never modify
- * the state of the underlying parser.
- *
- * @return the first child or <code>null</code> if the container has no children or
- * the builder has not yet started to build the first child
+ * Get the first child if it is available. The child is available if it is complete or if the
+ * builder has started building the node. In the latter case, {@link OMNode#isComplete()} may
+ * return <code>false</code> when called on the child. In contrast to {@link
+ * OMContainer#getFirstOMChild()}, this method will never modify the state of the underlying
+ * parser.
+ *
+ * @return the first child or <code>null</code> if the container has no children or the builder
+ * has not yet started to build the first child
*/
CoreChildNode coreGetFirstChildIfAvailable();
-
+
CoreChildNode coreGetFirstChild() throws CoreModelException;
+
CoreChildNode coreGetFirstChild(NodeFilter filter) throws CoreModelException;
-
+
CoreChildNode coreGetLastChild() throws CoreModelException;
+
CoreChildNode coreGetLastChild(NodeFilter filter) throws CoreModelException;
-
+
void coreAppendChild(CoreChildNode child) throws CoreModelException;
+
void coreAppendChildren(CoreDocumentFragment fragment) throws CoreModelException;
-
+
XmlReader coreGetReader(XmlHandler handler, boolean cache, boolean incremental);
-
- <T extends CoreNode,S> NodeIterator<S> coreGetNodes(Axis axis, Class<T> type, Mapper<S,? super T> mapper, Semantics semantics);
- <T extends CoreElement,S> NodeIterator<S> coreGetElements(Axis axis, Class<T> type, ElementMatcher<? super T> matcher, String namespaceURI, String name, Mapper<S,? super T> mapper, Semantics semantics);
-
+ <T extends CoreNode, S> NodeIterator<S> coreGetNodes(
+ Axis axis, Class<T> type, Mapper<S, ? super T> mapper, Semantics semantics);
+
+ <T extends CoreElement, S> NodeIterator<S> coreGetElements(
+ Axis axis,
+ Class<T> type,
+ ElementMatcher<? super T> matcher,
+ String namespaceURI,
+ String name,
+ Mapper<S, ? super T> mapper,
+ Semantics semantics);
+
void coreSetCharacterData(Object data, Semantics semantics) throws CoreModelException;
-
+
void coreRemoveChildren(Semantics semantics) throws CoreModelException;
-
+
void coreDiscard(boolean consumeInput) throws CoreModelException;
void coreMoveChildrenFrom(CoreParentNode other, Semantics semantics) throws CoreModelException;
- void internalCheckNewChild(CoreChildNode newChild, CoreChildNode replacedChild) throws CoreModelException;
+ void internalCheckNewChild(CoreChildNode newChild, CoreChildNode replacedChild)
+ throws CoreModelException;
+
void internalSetContent(Object content);
+
Object internalGetContent();
+
Content internalGetContent(boolean create);
+
Object internalGetCharacterData(ElementAction elementAction) throws CoreModelException;
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreProcessingInstruction.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreProcessingInstruction.java
index 45f6b6d..5bb610e 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreProcessingInstruction.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreProcessingInstruction.java
@@ -18,8 +18,9 @@
*/
package org.apache.axiom.core;
-public interface CoreProcessingInstruction extends CoreChildNode, CoreCharacterDataContainingParentNode {
+public interface CoreProcessingInstruction
+ extends CoreChildNode, CoreCharacterDataContainingParentNode {
String coreGetTarget();
-
+
void coreSetTarget(String target);
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreTypedAttribute.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreTypedAttribute.java
index fd95dad..1f71b24 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreTypedAttribute.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CoreTypedAttribute.java
@@ -18,10 +18,9 @@
*/
package org.apache.axiom.core;
-/**
- * Represents an attribute information item that is not a namespace declaration.
- */
+/** Represents an attribute information item that is not a namespace declaration. */
public interface CoreTypedAttribute extends CoreAttribute, CoreNamedNode {
String coreGetType();
+
void coreSetType(String type);
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CyclicRelationshipException.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CyclicRelationshipException.java
index 22f6f30..b8c4ab0 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/CyclicRelationshipException.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/CyclicRelationshipException.java
@@ -25,8 +25,7 @@ package org.apache.axiom.core;
public class CyclicRelationshipException extends HierarchyException {
private static final long serialVersionUID = 1L;
- public CyclicRelationshipException() {
- }
+ public CyclicRelationshipException() {}
public CyclicRelationshipException(String message) {
super(message);
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/DeferredParsingException.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/DeferredParsingException.java
index b0f02d9..40620b9 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/DeferredParsingException.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/DeferredParsingException.java
@@ -22,17 +22,17 @@ import org.apache.axiom.core.stream.StreamException;
/**
* Indicates that a parsing error occurred. This exception may be thrown by any core model method
- * that accesses parts of the tree that have not been visited before. This exception wraps a
- * {@link StreamException} that further describes the parsing error. The {@link StreamException}
- * itself typically wraps an exception specific to the underlying parser, e.g. a
- * {@link javax.xml.stream.XMLStreamException}.
+ * that accesses parts of the tree that have not been visited before. This exception wraps a {@link
+ * StreamException} that further describes the parsing error. The {@link StreamException} itself
+ * typically wraps an exception specific to the underlying parser, e.g. a {@link
+ * javax.xml.stream.XMLStreamException}.
*/
public class DeferredParsingException extends DeferredBuildingException {
private static final long serialVersionUID = 1L;
/**
* Constructor.
- *
+ *
* @param cause the cause
*/
public DeferredParsingException(StreamException cause) {
@@ -46,13 +46,13 @@ public class DeferredParsingException extends DeferredBuildingException {
}
return super.initCause(cause);
}
-
+
/**
* Get the {@link StreamException} wrapped by this exception.
- *
+ *
* @return the wrapped exception
*/
public StreamException getStreamException() {
- return (StreamException)getCause();
+ return (StreamException) getCause();
}
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/DetachPolicy.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/DetachPolicy.java
index f169cb9..53d04c3 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/DetachPolicy.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/DetachPolicy.java
@@ -18,33 +18,32 @@
*/
package org.apache.axiom.core;
-/**
- * Determines how nodes are detached from an object model tree.
- */
+/** Determines how nodes are detached from an object model tree. */
public interface DetachPolicy {
- DetachPolicy NEW_DOCUMENT = new DetachPolicy() {
- @Override
- public CoreDocument getNewOwnerDocument(CoreParentNode owner) {
- return null;
- }
- };
-
- DetachPolicy SAME_DOCUMENT = new DetachPolicy() {
- @Override
- public CoreDocument getNewOwnerDocument(CoreParentNode owner) {
- return owner.coreGetOwnerDocument(true);
- }
- };
-
+ DetachPolicy NEW_DOCUMENT =
+ new DetachPolicy() {
+ @Override
+ public CoreDocument getNewOwnerDocument(CoreParentNode owner) {
+ return null;
+ }
+ };
+
+ DetachPolicy SAME_DOCUMENT =
+ new DetachPolicy() {
+ @Override
+ public CoreDocument getNewOwnerDocument(CoreParentNode owner) {
+ return owner.coreGetOwnerDocument(true);
+ }
+ };
+
/**
* Get the new owner document for the node (or group of child nodes) to be detached. This method
* is called before any node is detached.
- *
- * @param owner
- * The owner of the node (or group of child nodes) to be detached. For child nodes,
- * this is the parent node. For attributes, this is the owner element.
+ *
+ * @param owner The owner of the node (or group of child nodes) to be detached. For child nodes,
+ * this is the parent node. For attributes, this is the owner element.
* @return the new owner document or <code>null</code> to (lazily) create a new owner document
- * for the node(s)
+ * for the node(s)
*/
CoreDocument getNewOwnerDocument(CoreParentNode owner);
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/ElementAction.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/ElementAction.java
index 6775d0b..787fcc5 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/ElementAction.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/ElementAction.java
@@ -18,4 +18,8 @@
*/
package org.apache.axiom.core;
-public enum ElementAction { SKIP, RECURSE, RETURN_NULL }
\ No newline at end of file
+public enum ElementAction {
+ SKIP,
+ RECURSE,
+ RETURN_NULL
+}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/ElementMatcher.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/ElementMatcher.java
index 0518fb2..18918e9 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/ElementMatcher.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/ElementMatcher.java
@@ -18,102 +18,98 @@
*/
package org.apache.axiom.core;
-/**
- * Selects elements based on some match rule.
- */
+/** Selects elements based on some match rule. */
public interface ElementMatcher<T extends CoreElement> {
+ /** Matches any {@link CoreElement}. */
+ ElementMatcher<CoreElement> ANY =
+ new ElementMatcher<CoreElement>() {
+ @Override
+ public boolean matches(CoreElement element, String namespaceURI, String name) {
+ return true;
+ }
+ };
+
/**
- * Matches any {@link CoreElement}.
- */
- ElementMatcher<CoreElement> ANY = new ElementMatcher<CoreElement>() {
- @Override
- public boolean matches(CoreElement element, String namespaceURI, String name) {
- return true;
- }
- };
-
- /**
- * Matches {@link CoreNSAwareElement} nodes by qualified name, i.e. namespace URI and local name.
- */
- ElementMatcher<CoreNSAwareElement> BY_QNAME = new ElementMatcher<CoreNSAwareElement>() {
- @Override
- public boolean matches(CoreNSAwareElement element, String namespaceURI, String name) {
- return name.equals(element.coreGetLocalName())
- && namespaceURI.equals(element.coreGetNamespaceURI());
- }
- };
-
- /**
- * Matches {@link CoreNSAwareElement} nodes by namespace URI.
- */
- ElementMatcher<CoreNSAwareElement> BY_NAMESPACE_URI = new ElementMatcher<CoreNSAwareElement>() {
- @Override
- public boolean matches(CoreNSAwareElement element, String namespaceURI, String name) {
- return namespaceURI.equals(element.coreGetNamespaceURI());
- }
- };
-
- /**
- * Matches {@link CoreNSAwareElement} nodes by local name.
- */
- ElementMatcher<CoreNSAwareElement> BY_LOCAL_NAME = new ElementMatcher<CoreNSAwareElement>() {
- @Override
- public boolean matches(CoreNSAwareElement element, String namespaceURI, String name) {
- return name.equals(element.coreGetLocalName());
- }
- };
-
- /**
- * Matches elements (of any kind) by tag name.
+ * Matches {@link CoreNSAwareElement} nodes by qualified name, i.e. namespace URI and local
+ * name.
*/
- ElementMatcher<CoreElement> BY_NAME = new ElementMatcher<CoreElement>() {
- @Override
- public boolean matches(CoreElement element, String namespaceURI, String name) {
- if (element instanceof CoreNSUnawareElement) {
- return name.equals(((CoreNSUnawareElement)element).coreGetName());
- } else {
- CoreNSAwareElement nsAwareElement = (CoreNSAwareElement)element;
- String prefix = nsAwareElement.coreGetPrefix();
- int prefixLength = prefix.length();
- String localName = nsAwareElement.coreGetLocalName();
- if (prefixLength == 0) {
- return name.equals(localName);
- } else {
- int localNameLength = localName.length();
- if (prefixLength + localNameLength + 1 == name.length()) {
- if (name.charAt(prefixLength) != ':') {
- return false;
- }
- for (int i=0; i<localNameLength; i++) {
- if (name.charAt(prefixLength+i+1) != localName.charAt(i)) {
- return false;
- }
- }
- for (int i=0; i<prefix.length(); i++) {
- if (name.charAt(i) != prefix.charAt(i)) {
+ ElementMatcher<CoreNSAwareElement> BY_QNAME =
+ new ElementMatcher<CoreNSAwareElement>() {
+ @Override
+ public boolean matches(
+ CoreNSAwareElement element, String namespaceURI, String name) {
+ return name.equals(element.coreGetLocalName())
+ && namespaceURI.equals(element.coreGetNamespaceURI());
+ }
+ };
+
+ /** Matches {@link CoreNSAwareElement} nodes by namespace URI. */
+ ElementMatcher<CoreNSAwareElement> BY_NAMESPACE_URI =
+ new ElementMatcher<CoreNSAwareElement>() {
+ @Override
+ public boolean matches(
+ CoreNSAwareElement element, String namespaceURI, String name) {
+ return namespaceURI.equals(element.coreGetNamespaceURI());
+ }
+ };
+
+ /** Matches {@link CoreNSAwareElement} nodes by local name. */
+ ElementMatcher<CoreNSAwareElement> BY_LOCAL_NAME =
+ new ElementMatcher<CoreNSAwareElement>() {
+ @Override
+ public boolean matches(
+ CoreNSAwareElement element, String namespaceURI, String name) {
+ return name.equals(element.coreGetLocalName());
+ }
+ };
+
+ /** Matches elements (of any kind) by tag name. */
+ ElementMatcher<CoreElement> BY_NAME =
+ new ElementMatcher<CoreElement>() {
+ @Override
+ public boolean matches(CoreElement element, String namespaceURI, String name) {
+ if (element instanceof CoreNSUnawareElement) {
+ return name.equals(((CoreNSUnawareElement) element).coreGetName());
+ } else {
+ CoreNSAwareElement nsAwareElement = (CoreNSAwareElement) element;
+ String prefix = nsAwareElement.coreGetPrefix();
+ int prefixLength = prefix.length();
+ String localName = nsAwareElement.coreGetLocalName();
+ if (prefixLength == 0) {
+ return name.equals(localName);
+ } else {
+ int localNameLength = localName.length();
+ if (prefixLength + localNameLength + 1 == name.length()) {
+ if (name.charAt(prefixLength) != ':') {
+ return false;
+ }
+ for (int i = 0; i < localNameLength; i++) {
+ if (name.charAt(prefixLength + i + 1) != localName.charAt(i)) {
+ return false;
+ }
+ }
+ for (int i = 0; i < prefix.length(); i++) {
+ if (name.charAt(i) != prefix.charAt(i)) {
+ return false;
+ }
+ }
+ return true;
+ } else {
return false;
}
}
- return true;
- } else {
- return false;
}
}
- }
- }
- };
-
+ };
+
/**
- * Check if the given element matches. The values of the <code>namespaceURI</code> and
- * <code>name</code> parameters are those passed to
- * {@link CoreParentNode#coreGetElements(Axis, Class, ElementMatcher, String, String, ExceptionTranslator, Semantics)}.
- *
- * @param element
- * the element to check
- * @param namespaceURI
- * see above
- * @param name
- * see above
+ * Check if the given element matches. The values of the <code>namespaceURI</code> and <code>
+ * name</code> parameters are those passed to {@link CoreParentNode#coreGetElements(Axis, Class,
+ * ElementMatcher, String, String, ExceptionTranslator, Semantics)}.
+ *
+ * @param element the element to check
+ * @param namespaceURI see above
+ * @param name see above
* @return <code>true</code> if the element matches, <code>false</code> otherwise
*/
boolean matches(T element, String namespaceURI, String name);
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/IdentityMapper.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/IdentityMapper.java
index 0ccf94a..d8a30df 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/IdentityMapper.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/IdentityMapper.java
@@ -18,7 +18,7 @@
*/
package org.apache.axiom.core;
-final class IdentityMapper<S,T extends S> implements Mapper<S,T> {
+final class IdentityMapper<S, T extends S> implements Mapper<S, T> {
@Override
public S map(T object) {
return object;
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/InputContext.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/InputContext.java
index b02cdd6..f5408c6 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/InputContext.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/InputContext.java
@@ -27,11 +27,9 @@ public interface InputContext {
* Enables pass-through mode for this context. In this mode, events for the parent information
* item linked to this context (and its descendants) are passed directly to the specified
* handler instead of building nodes for them.
- *
- * @param handler
- * the handler to send events to
- * @throws IllegalStateException
- * if a pass-through handler has already been set for this context
+ *
+ * @param handler the handler to send events to
+ * @throws IllegalStateException if a pass-through handler has already been set for this context
*/
void setPassThroughHandler(XmlHandler passThroughHandler);
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/Mapper.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/Mapper.java
index d1cd5f0..77f95a0 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/Mapper.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/Mapper.java
@@ -18,6 +18,6 @@
*/
package org.apache.axiom.core;
-public interface Mapper<S,T> {
+public interface Mapper<S, T> {
S map(T object);
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/Mappers.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/Mappers.java
index a082b9c..e25019e 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/Mappers.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/Mappers.java
@@ -21,17 +21,17 @@ package org.apache.axiom.core;
public final class Mappers {
@SuppressWarnings("rawtypes")
private static final IdentityMapper IDENTITY = new IdentityMapper();
-
+
private Mappers() {}
-
+
@SuppressWarnings("unchecked")
- public static <S,T extends S> Mapper<S,T> upcast() {
+ public static <S, T extends S> Mapper<S, T> upcast() {
// This is an optimization for the following type safe instruction:
// return new IdentityMapper<S,T>();
return IDENTITY;
}
-
- public static <T> Mapper<T,T> identity() {
+
+ public static <T> Mapper<T, T> identity() {
return upcast();
}
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/NSAwareAttributeMatcher.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/NSAwareAttributeMatcher.java
index 11a021e..6801d19 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/NSAwareAttributeMatcher.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/NSAwareAttributeMatcher.java
@@ -21,57 +21,59 @@ package org.apache.axiom.core;
/**
* {@link AttributeMatcher} implementation that matches attributes based on their namespace URI and
* local name. Parameters are defined as follows:
+ *
* <dl>
- * <dt><code>namespaceURI</code>
- * <dd>The namespace URI of the attribute.
- * <dt><code>name</code>
- * <dd>The local name of the attribute.
- * <dt><code>value</code>
- * <dd>The attribute value.
- * <dt><code>prefix</code>
- * <dd>The prefix to be used when creating a new attribute or updating an existing one.
+ * <dt><code>namespaceURI</code>
+ * <dd>The namespace URI of the attribute.
+ * <dt><code>name</code>
+ * <dd>The local name of the attribute.
+ * <dt><code>value</code>
+ * <dd>The attribute value.
+ * <dt><code>prefix</code>
+ * <dd>The prefix to be used when creating a new attribute or updating an existing one.
* </dl>
+ *
* If the namespace URI is the empty string, then this class will also match namespace unaware
- * attributes. Note that the class doesn't match namespace declarations (for which
- * {@link NamespaceDeclarationMatcher} can be used).
+ * attributes. Note that the class doesn't match namespace declarations (for which {@link
+ * NamespaceDeclarationMatcher} can be used).
*/
public final class NSAwareAttributeMatcher implements AttributeMatcher {
private final Semantics semantics;
private final boolean matchNSUnawareAttributes;
private final boolean updatePrefix;
-
+
/**
* Constructor.
- *
- * @param semantics
- * Specifies the {@link Semantics} to be used by
- * {@link #update(CoreAttribute, String, String)}.
- * @param matchNSUnawareAttributes
- * Specifies if {@link CoreNSUnawareAttribute} instances can also be matched. Only
- * applies to the case where <code>namespaceURI</code> is the empty string.
- * @param updatePrefix
- * Specifies if the prefix of an existing attribute should be updated (based on the
- * value of the <code>prefix</code> parameter. If this is <code>false</code>, then
- * <code>prefix</code> is only used when creating new attributes and prefixes of
- * existing attributes are preserved (i.e. only their value is updated).
+ *
+ * @param semantics Specifies the {@link Semantics} to be used by {@link #update(CoreAttribute,
+ * String, String)}.
+ * @param matchNSUnawareAttributes Specifies if {@link CoreNSUnawareAttribute} instances can
+ * also be matched. Only applies to the case where <code>namespaceURI</code> is the empty
+ * string.
+ * @param updatePrefix Specifies if the prefix of an existing attribute should be updated (based
+ * on the value of the <code>prefix</code> parameter. If this is <code>false</code>, then
+ * <code>prefix</code> is only used when creating new attributes and prefixes of existing
+ * attributes are preserved (i.e. only their value is updated).
*/
- public NSAwareAttributeMatcher(Semantics semantics, boolean matchNSUnawareAttributes,
- boolean updatePrefix) {
+ public NSAwareAttributeMatcher(
+ Semantics semantics, boolean matchNSUnawareAttributes, boolean updatePrefix) {
this.semantics = semantics;
this.matchNSUnawareAttributes = matchNSUnawareAttributes;
this.updatePrefix = updatePrefix;
}
-
+
@Override
public boolean matches(CoreAttribute attr, String namespaceURI, String name) {
if (attr instanceof CoreNSAwareAttribute) {
- CoreNSAwareAttribute nsAwareAttr = (CoreNSAwareAttribute)attr;
+ CoreNSAwareAttribute nsAwareAttr = (CoreNSAwareAttribute) attr;
// Optimization: first compare the local names because they are in general
// shorter and have higher "uniqueness"
return name.equals(nsAwareAttr.coreGetLocalName())
&& namespaceURI.equals(nsAwareAttr.coreGetNamespaceURI());
- } else if (matchNSUnawareAttributes && namespaceURI.length() == 0 && attr instanceof CoreNSUnawareAttribute) {
- return name.equals(((CoreNSUnawareAttribute)attr).coreGetName());
+ } else if (matchNSUnawareAttributes
+ && namespaceURI.length() == 0
+ && attr instanceof CoreNSUnawareAttribute) {
+ return name.equals(((CoreNSUnawareAttribute) attr).coreGetName());
} else {
return false;
}
@@ -79,16 +81,18 @@ public final class NSAwareAttributeMatcher implements AttributeMatcher {
@Override
public String getNamespaceURI(CoreAttribute attr) {
- return ((CoreNSAwareAttribute)attr).coreGetNamespaceURI();
+ return ((CoreNSAwareAttribute) attr).coreGetNamespaceURI();
}
@Override
public String getName(CoreAttribute attr) {
- return ((CoreNSAwareAttribute)attr).coreGetLocalName();
+ return ((CoreNSAwareAttribute) attr).coreGetLocalName();
}
@Override
- public CoreAttribute createAttribute(NodeFactory2 nodeFactory, String namespaceURI, String name, String prefix, String value) throws CoreModelException {
+ public CoreAttribute createAttribute(
+ NodeFactory2 nodeFactory, String namespaceURI, String name, String prefix, String value)
+ throws CoreModelException {
CoreNSAwareAttribute attr = nodeFactory.createNSAwareAttribute();
attr.coreSetName(namespaceURI, name, prefix);
attr.coreSetCharacterData(value, null);
@@ -99,7 +103,7 @@ public final class NSAwareAttributeMatcher implements AttributeMatcher {
public void update(CoreAttribute attr, String prefix, String value) throws CoreModelException {
attr.coreSetCharacterData(value, semantics);
if (updatePrefix && attr instanceof CoreNSAwareAttribute) {
- ((CoreNSAwareAttribute)attr).coreSetPrefix(prefix);
+ ((CoreNSAwareAttribute) attr).coreSetPrefix(prefix);
}
}
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/NamespaceDeclarationMatcher.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/NamespaceDeclarationMatcher.java
index 446507a..38b6c8d 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/NamespaceDeclarationMatcher.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/NamespaceDeclarationMatcher.java
@@ -21,21 +21,22 @@ package org.apache.axiom.core;
/**
* {@link AttributeMatcher} that matches {@link CoreNamespaceDeclaration} attributes based on the
* declared prefix. Parameters are defined as follows:
+ *
* <dl>
- * <dt><code>namespaceURI</code>
- * <dd>Not used.
- * <dt><code>name</code>
- * <dd>The prefix declared by the namespace declaration, or the empty string for the default
- * namespace declaration.
- * <dt><code>value</code>
- * <dd>The namespace URI of the namespace declaration.
- * <dt><code>prefix</code>
- * <dd>Not used.
+ * <dt><code>namespaceURI</code>
+ * <dd>Not used.
+ * <dt><code>name</code>
+ * <dd>The prefix declared by the namespace declaration, or the empty string for the default
+ * namespace declaration.
+ * <dt><code>value</code>
+ * <dd>The namespace URI of the namespace declaration.
+ * <dt><code>prefix</code>
+ * <dd>Not used.
* </dl>
*/
public final class NamespaceDeclarationMatcher implements AttributeMatcher {
private final Semantics semantics;
-
+
public NamespaceDeclarationMatcher(Semantics semantics) {
this.semantics = semantics;
}
@@ -43,7 +44,7 @@ public final class NamespaceDeclarationMatcher implements AttributeMatcher {
@Override
public boolean matches(CoreAttribute attr, String namespaceURI, String name) {
if (attr instanceof CoreNamespaceDeclaration) {
- String prefix = ((CoreNamespaceDeclaration)attr).coreGetDeclaredPrefix();
+ String prefix = ((CoreNamespaceDeclaration) attr).coreGetDeclaredPrefix();
return name.equals(prefix);
} else {
return false;
@@ -51,7 +52,12 @@ public final class NamespaceDeclarationMatcher implements AttributeMatcher {
}
@Override
- public CoreAttribute createAttribute(NodeFactory2 nodeFactory, String namespaceURI, String name, String prefix, String value) {
+ public CoreAttribute createAttribute(
+ NodeFactory2 nodeFactory,
+ String namespaceURI,
+ String name,
+ String prefix,
+ String value) {
CoreNamespaceDeclaration decl = nodeFactory.createNamespaceDeclaration();
decl.coreSetDeclaredNamespace(name, value);
return decl;
@@ -64,11 +70,11 @@ public final class NamespaceDeclarationMatcher implements AttributeMatcher {
@Override
public String getName(CoreAttribute attr) {
- return ((CoreNamespaceDeclaration)attr).coreGetDeclaredPrefix();
+ return ((CoreNamespaceDeclaration) attr).coreGetDeclaredPrefix();
}
@Override
public void update(CoreAttribute attr, String prefix, String value) throws CoreModelException {
attr.coreSetCharacterData(value, semantics);
}
-}
\ No newline at end of file
+}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/NoParentException.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/NoParentException.java
index 6c8df6b..f0e2135 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/NoParentException.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/NoParentException.java
@@ -25,8 +25,7 @@ package org.apache.axiom.core;
public class NoParentException extends HierarchyException {
private static final long serialVersionUID = 1L;
- public NoParentException() {
- }
+ public NoParentException() {}
public NoParentException(String message) {
super(message);
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeConsumedException.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeConsumedException.java
index cbba28d..62ed31f 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeConsumedException.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeConsumedException.java
@@ -18,12 +18,9 @@
*/
package org.apache.axiom.core;
-/**
- * Indicates that a requested node has been consumed and is no longer available.
- */
+/** Indicates that a requested node has been consumed and is no longer available. */
public class NodeConsumedException extends DeferredBuildingException {
private static final long serialVersionUID = 1L;
- public NodeConsumedException() {
- }
+ public NodeConsumedException() {}
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeFactory.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeFactory.java
index 9ec85ee..4828521 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeFactory.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeFactory.java
@@ -20,6 +20,6 @@ package org.apache.axiom.core;
public interface NodeFactory {
NodeFactory2 getFactory2();
-
+
<T extends CoreNode> T createNode(Class<T> type);
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeFactory2.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeFactory2.java
index a891f56..71389aa 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeFactory2.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeFactory2.java
@@ -61,9 +61,9 @@ public interface NodeFactory2 {
CoreEntityReference createEntityReference();
/**
- * Create the namespace helper object that will be passed to
- * {@link CoreNSAwareNamedNode#initName(String, String, String, Object)}.
- *
+ * Create the namespace helper object that will be passed to {@link
+ * CoreNSAwareNamedNode#initName(String, String, String, Object)}.
+ *
* @return the namespace helper
*/
Object createNamespaceHelper();
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeFactoryImpl.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeFactoryImpl.java
index 09839d8..6349764 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeFactoryImpl.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeFactoryImpl.java
@@ -35,18 +35,25 @@ import org.apache.axiom.core.util.TopologicalSort;
public abstract class NodeFactoryImpl implements NodeFactory {
private final NodeFactory2 factory2;
- private final Map<Class<?>,Constructor<?>> constructorMap;
-
+ private final Map<Class<?>, Constructor<?>> constructorMap;
+
public NodeFactoryImpl(ClassLoader cl, String factory2ClassName, String... packages) {
try {
- factory2 = (NodeFactory2)cl.loadClass(factory2ClassName).getDeclaredField("INSTANCE").get(null);
+ factory2 =
+ (NodeFactory2)
+ cl.loadClass(factory2ClassName).getDeclaredField("INSTANCE").get(null);
} catch (ReflectiveOperationException ex) {
throw new NodeFactoryException("Failed to instantiate NodeFactory2 implementation", ex);
}
List<Class<?>> implementations = new ArrayList<Class<?>>();
for (String pkg : packages) {
try {
- BufferedReader in = new BufferedReader(new InputStreamReader(cl.getResourceAsStream(pkg.replace('.', '/') + "/nodetypes.index"), "UTF-8"));
+ BufferedReader in =
+ new BufferedReader(
+ new InputStreamReader(
+ cl.getResourceAsStream(
+ pkg.replace('.', '/') + "/nodetypes.index"),
+ "UTF-8"));
try {
String line;
while ((line = in.readLine()) != null) {
@@ -64,17 +71,22 @@ public abstract class NodeFactoryImpl implements NodeFactory {
in.close();
}
} catch (IOException ex) {
- throw new NodeFactoryException("Failed to load node type index for package " + pkg, ex);
+ throw new NodeFactoryException(
+ "Failed to load node type index for package " + pkg, ex);
}
}
- implementations = TopologicalSort.sort(implementations, new EdgeRelation<Class<?>>() {
- @Override
- public boolean isEdge(Class<?> from, Class<?> to) {
- return to.isAssignableFrom(from);
- }
- });
- Map<Class<?>,Class<?>> interfaceToImplementationMap = new HashMap<Class<?>,Class<?>>();
- Map<Class<?>,Constructor<?>> implementationToConstructorMap = new HashMap<Class<?>,Constructor<?>>();
+ implementations =
+ TopologicalSort.sort(
+ implementations,
+ new EdgeRelation<Class<?>>() {
+ @Override
+ public boolean isEdge(Class<?> from, Class<?> to) {
+ return to.isAssignableFrom(from);
+ }
+ });
+ Map<Class<?>, Class<?>> interfaceToImplementationMap = new HashMap<Class<?>, Class<?>>();
+ Map<Class<?>, Constructor<?>> implementationToConstructorMap =
+ new HashMap<Class<?>, Constructor<?>>();
Set<Class<?>> ambiguousInterfaces = new HashSet<Class<?>>();
for (Class<?> implementation : implementations) {
Set<Class<?>> interfaces = new HashSet<Class<?>>();
@@ -93,12 +105,14 @@ public abstract class NodeFactoryImpl implements NodeFactory {
try {
implementationToConstructorMap.put(implementation, implementation.getConstructor());
} catch (NoSuchMethodException ex) {
- throw new NodeFactoryException("Failed to get constructor for " + implementation.getName(), ex);
+ throw new NodeFactoryException(
+ "Failed to get constructor for " + implementation.getName(), ex);
}
}
- constructorMap = new HashMap<Class<?>,Constructor<?>>();
- for (Map.Entry<Class<?>,Class<?>> entry : interfaceToImplementationMap.entrySet()) {
- constructorMap.put(entry.getKey(), implementationToConstructorMap.get(entry.getValue()));
+ constructorMap = new HashMap<Class<?>, Constructor<?>>();
+ for (Map.Entry<Class<?>, Class<?>> entry : interfaceToImplementationMap.entrySet()) {
+ constructorMap.put(
+ entry.getKey(), implementationToConstructorMap.get(entry.getValue()));
}
// TODO: this should eventually go away
constructorMap.putAll(implementationToConstructorMap);
@@ -115,7 +129,7 @@ public abstract class NodeFactoryImpl implements NodeFactory {
collectInterfaces(superclass, interfaces);
}
}
-
+
@Override
public NodeFactory2 getFactory2() {
return factory2;
@@ -130,7 +144,8 @@ public abstract class NodeFactoryImpl implements NodeFactory {
try {
return type.cast(constructor.newInstance());
} catch (InvocationTargetException ex) {
- throw new NodeFactoryException("Caught exception thrown by constructor", ex.getCause());
+ throw new NodeFactoryException(
+ "Caught exception thrown by constructor", ex.getCause());
} catch (InstantiationException ex) {
throw new NodeFactoryException("Failed to invoke constructor", ex);
} catch (IllegalAccessException ex) {
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeIterator.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeIterator.java
index 9198784..dccf7f9 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeIterator.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeIterator.java
@@ -23,28 +23,29 @@ import java.util.Iterator;
/**
* Extended iterator interface used by various methods in {@link CoreParentNode}. It defines an
- * additional method that allows to replace the child node returned by the last call to
- * {@link #next()}.
- * <p>
- * All implementations of this interface must satisfy the following requirements:
+ * additional method that allows to replace the child node returned by the last call to {@link
+ * #next()}.
+ *
+ * <p>All implementations of this interface must satisfy the following requirements:
+ *
* <ol>
- * <li>The implementation MUST properly implement the {@link #remove()} method, i.e. it is not
- * allowed to throw {@link UnsupportedOperationException}.
- * <li>A {@link ConcurrentModificationException} MUST be thrown when the iterator is used after the
- * last node returned by {@link Iterator#next()} has been removed using a method other than
- * {@link Iterator#remove()} (e.g. {@link CoreChildNode#coreDetach(Semantics)}).
- * <li>If a {@link CoreModelException} occurs inside {@link Iterator#hasNext()},
- * {@link Iterator#next()} or {@link Iterator#remove()}, then the implementation MUST use the
- * supplied {@link ExceptionTranslator} to translate that checked exception into an unchecked
- * exception.
+ * <li>The implementation MUST properly implement the {@link #remove()} method, i.e. it is not
+ * allowed to throw {@link UnsupportedOperationException}.
+ * <li>A {@link ConcurrentModificationException} MUST be thrown when the iterator is used after
+ * the last node returned by {@link Iterator#next()} has been removed using a method other
+ * than {@link Iterator#remove()} (e.g. {@link CoreChildNode#coreDetach(Semantics)}).
+ * <li>If a {@link CoreModelException} occurs inside {@link Iterator#hasNext()}, {@link
+ * Iterator#next()} or {@link Iterator#remove()}, then the implementation MUST use the
+ * supplied {@link ExceptionTranslator} to translate that checked exception into an unchecked
+ * exception.
* </ol>
*/
public interface NodeIterator<T> extends Iterator<T> {
/**
* Replace the current node.
- *
- * This method only has an effect if the current node is a {@link CoreChildNode}.
- *
+ *
+ * <p>This method only has an effect if the current node is a {@link CoreChildNode}.
+ *
* @param newNode
* @throws CoreModelException
*/
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeType.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeType.java
index 61f3084..943d993 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeType.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/NodeType.java
@@ -21,96 +21,85 @@ package org.apache.axiom.core;
import java.util.EnumSet;
public enum NodeType {
- /**
- * The node is a {@link CoreDocument}.
- */
+ /** The node is a {@link CoreDocument}. */
DOCUMENT(CoreDocument.class),
-
- /**
- * The node is a {@link CoreDocumentTypeDeclaration}.
- */
+
+ /** The node is a {@link CoreDocumentTypeDeclaration}. */
DOCUMENT_TYPE_DECLARATION(CoreDocumentTypeDeclaration.class),
-
- /**
- * The node is a {@link CoreNSUnawareElement}.
- */
+
+ /** The node is a {@link CoreNSUnawareElement}. */
NS_UNAWARE_ELEMENT(CoreNSUnawareElement.class),
-
- /**
- * The node is a {@link CoreNSAwareElement}.
- */
+
+ /** The node is a {@link CoreNSAwareElement}. */
NS_AWARE_ELEMENT(CoreNSAwareElement.class),
-
- /**
- * The node is a {@link CoreNSUnawareAttribute}.
- */
+
+ /** The node is a {@link CoreNSUnawareAttribute}. */
NS_UNAWARE_ATTRIBUTE(CoreNSUnawareAttribute.class),
-
- /**
- * The node is a {@link CoreNSAwareAttribute}.
- */
+
+ /** The node is a {@link CoreNSAwareAttribute}. */
NS_AWARE_ATTRIBUTE(CoreNSAwareAttribute.class),
-
- /**
- * The node is a {@link CoreNamespaceDeclaration}.
- */
+
+ /** The node is a {@link CoreNamespaceDeclaration}. */
NAMESPACE_DECLARATION(CoreNamespaceDeclaration.class),
-
- /**
- * The node is a {@link CoreProcessingInstruction}.
- */
+
+ /** The node is a {@link CoreProcessingInstruction}. */
PROCESSING_INSTRUCTION(CoreProcessingInstruction.class),
-
- /**
- * The node is a {@link CoreDocumentFragment}.
- */
+
+ /** The node is a {@link CoreDocumentFragment}. */
DOCUMENT_FRAGMENT(CoreDocumentFragment.class),
-
- /**
- * The node is a {@link CoreCharacterDataNode}.
- */
+
+ /** The node is a {@link CoreCharacterDataNode}. */
CHARACTER_DATA(CoreCharacterDataNode.class),
-
- /**
- * The node is a {@link CoreComment}.
- */
+
+ /** The node is a {@link CoreComment}. */
COMMENT(CoreComment.class),
-
- /**
- * The node is a {@link CoreCDATASection}.
- */
+
+ /** The node is a {@link CoreCDATASection}. */
CDATA_SECTION(CoreCDATASection.class),
-
- /**
- * The node is a {@link CoreEntityReference}.
- */
+
+ /** The node is a {@link CoreEntityReference}. */
ENTITY_REFERENCE(CoreEntityReference.class);
static {
// TODO: add missing node types here (once we have tests that exercise the code)
COMMENT.allowedChildTypes = EnumSet.of(CHARACTER_DATA);
- DOCUMENT.allowedChildTypes = EnumSet.of(CHARACTER_DATA, COMMENT, DOCUMENT_TYPE_DECLARATION, NS_AWARE_ELEMENT, NS_UNAWARE_ELEMENT, PROCESSING_INSTRUCTION);
+ DOCUMENT.allowedChildTypes =
+ EnumSet.of(
+ CHARACTER_DATA,
+ COMMENT,
+ DOCUMENT_TYPE_DECLARATION,
+ NS_AWARE_ELEMENT,
+ NS_UNAWARE_ELEMENT,
+ PROCESSING_INSTRUCTION);
DOCUMENT_FRAGMENT.allowedChildTypes = EnumSet.allOf(NodeType.class);
EnumSet<NodeType> s = EnumSet.of(CHARACTER_DATA, ENTITY_REFERENCE);
NS_AWARE_ATTRIBUTE.allowedChildTypes = s;
NS_UNAWARE_ATTRIBUTE.allowedChildTypes = s;
NAMESPACE_DECLARATION.allowedChildTypes = s;
- s = EnumSet.of(CDATA_SECTION, CHARACTER_DATA, COMMENT, ENTITY_REFERENCE, NS_AWARE_ELEMENT, NS_UNAWARE_ELEMENT, PROCESSING_INSTRUCTION);
+ s =
+ EnumSet.of(
+ CDATA_SECTION,
+ CHARACTER_DATA,
+ COMMENT,
+ ENTITY_REFERENCE,
+ NS_AWARE_ELEMENT,
+ NS_UNAWARE_ELEMENT,
+ PROCESSING_INSTRUCTION);
NS_AWARE_ELEMENT.allowedChildTypes = s;
NS_UNAWARE_ELEMENT.allowedChildTypes = s;
}
private final Class<? extends CoreNode> iface;
private EnumSet<NodeType> allowedChildTypes;
-
+
private NodeType(Class<? extends CoreNode> iface) {
this.iface = iface;
}
-
+
public Class<? extends CoreNode> getInterface() {
return iface;
}
-
+
public boolean isChildTypeAllowed(NodeType childType) {
if (allowedChildTypes == null) {
throw new UnsupportedOperationException();
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/SelfRelationshipException.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/SelfRelationshipException.java
index 4ce1313..f8e24c6 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/SelfRelationshipException.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/SelfRelationshipException.java
@@ -25,8 +25,7 @@ package org.apache.axiom.core;
public class SelfRelationshipException extends HierarchyException {
private static final long serialVersionUID = 1L;
- public SelfRelationshipException() {
- }
+ public SelfRelationshipException() {}
public SelfRelationshipException(String message) {
super(message);
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/Semantics.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/Semantics.java
index 3d429a8..0407f36 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/Semantics.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/Semantics.java
@@ -20,40 +20,36 @@ package org.apache.axiom.core;
import java.util.Iterator;
-/**
- * Defines the semantics of a particular API.
- */
+/** Defines the semantics of a particular API. */
public interface Semantics {
DetachPolicy getDetachPolicy();
-
+
/**
* Determine how namespace lookups are performed.
- *
+ *
* @return {@code true} if only namespace declarations are taken into account. {@code false} if
- * the prefixes of the element and its ancestors are also taken into account (limited to
- * instanced of {@link CoreNSAwareElement}), even if no explicit namespace declarations
- * exists for these prefixes.
+ * the prefixes of the element and its ancestors are also taken into account (limited to
+ * instanced of {@link CoreNSAwareElement}), even if no explicit namespace declarations
+ * exists for these prefixes.
*/
boolean isUseStrictNamespaceLookup();
-
+
/**
* Check if the given node type is a parent node type. This determines the set of nodes that are
* selected by {@link Axis#DESCENDANTS} and {@link Axis#DESCENDANTS_OR_SELF}.
- *
- * @param node
- * the node type to check
+ *
+ * @param node the node type to check
* @return {@code true} if the node type is a parent node; {@link false} if the node type is
- * considered a leaf node type
+ * considered a leaf node type
*/
boolean isParentNode(NodeType nodeType);
/**
* Translate the given exception to an unchecked exception. This is used by {@link NodeIterator}
- * to translate exceptions that are triggered in {@link Iterator#hasNext()},
- * {@link Iterator#next()} and {@link Iterator#remove()}.
- *
- * @param ex
- * the original (checked) exception
+ * to translate exceptions that are triggered in {@link Iterator#hasNext()}, {@link
+ * Iterator#next()} and {@link Iterator#remove()}.
+ *
+ * @param ex the original (checked) exception
* @return the corresponding unchecked exception
*/
RuntimeException toUncheckedException(CoreModelException ex);
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/AbstractNodeIterator.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/AbstractNodeIterator.java
index 49b2652..e3a244a 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/AbstractNodeIterator.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/AbstractNodeIterator.java
@@ -30,24 +30,27 @@ import org.apache.axiom.core.Mapper;
import org.apache.axiom.core.NodeIterator;
import org.apache.axiom.core.Semantics;
-public abstract class AbstractNodeIterator<T extends CoreNode,S> implements NodeIterator<S> {
+public abstract class AbstractNodeIterator<T extends CoreNode, S> implements NodeIterator<S> {
private final CoreParentNode startNode;
private final Axis axis;
private final Class<T> type;
- private final Mapper<S,? super T> mapper;
+ private final Mapper<S, ? super T> mapper;
private final Semantics semantics;
private T currentNode;
-
- /**
- * The parent of the current node. This is used to detect concurrent modifications.
- */
+
+ /** The parent of the current node. This is used to detect concurrent modifications. */
private CoreParentNode currentParent;
-
+
private T nextNode;
private boolean hasNext;
private int depth;
-
- public AbstractNodeIterator(CoreParentNode startNode, Axis axis, Class<T> type, Mapper<S,? super T> mapper, Semantics semantics) {
+
+ public AbstractNodeIterator(
+ CoreParentNode startNode,
+ Axis axis,
+ Class<T> type,
+ Mapper<S, ? super T> mapper,
+ Semantics semantics) {
this.startNode = startNode;
this.axis = axis;
this.type = type;
@@ -59,8 +62,10 @@ public abstract class AbstractNodeIterator<T extends CoreNode,S> implements Node
private void computeNext(Axis axis) {
CoreNode node = currentNode;
- if (node instanceof CoreChildNode && ((CoreChildNode)node).coreGetParent() != currentParent) {
- throw new ConcurrentModificationException("The current node has been removed using a method other than Iterator#remove()");
+ if (node instanceof CoreChildNode
+ && ((CoreChildNode) node).coreGetParent() != currentParent) {
+ throw new ConcurrentModificationException(
+ "The current node has been removed using a method other than Iterator#remove()");
}
try {
while (true) {
@@ -70,7 +75,7 @@ public abstract class AbstractNodeIterator<T extends CoreNode,S> implements Node
if (node == null) {
node = startNode.coreGetFirstChild();
} else {
- node = ((CoreChildNode)node).coreGetNextSibling();
+ node = ((CoreChildNode) node).coreGetNextSibling();
}
break;
case DESCENDANTS:
@@ -85,8 +90,11 @@ public abstract class AbstractNodeIterator<T extends CoreNode,S> implements Node
} else {
boolean visitChildren = true;
while (true) {
- if (visitChildren && node instanceof CoreParentNode && semantics.isParentNode(node.coreGetNodeType())) {
- CoreChildNode firstChild = ((CoreParentNode)node).coreGetFirstChild();
+ if (visitChildren
+ && node instanceof CoreParentNode
+ && semantics.isParentNode(node.coreGetNodeType())) {
+ CoreChildNode firstChild =
+ ((CoreParentNode) node).coreGetFirstChild();
if (firstChild != null) {
depth++;
node = firstChild;
@@ -97,13 +105,14 @@ public abstract class AbstractNodeIterator<T extends CoreNode,S> implements Node
node = null;
break;
}
- CoreChildNode nextSibling = ((CoreChildNode)node).coreGetNextSibling();
+ CoreChildNode nextSibling =
+ ((CoreChildNode) node).coreGetNextSibling();
if (nextSibling != null) {
node = nextSibling;
break;
}
depth--;
- node = ((CoreChildNode)node).coreGetParent();
+ node = ((CoreChildNode) node).coreGetParent();
visitChildren = false;
}
}
@@ -138,7 +147,10 @@ public abstract class AbstractNodeIterator<T extends CoreNode,S> implements Node
public final S next() {
if (hasNext()) {
currentNode = nextNode;
- currentParent = currentNode instanceof CoreChildNode ? ((CoreChildNode)currentNode).coreGetParent() : null;
+ currentParent =
+ currentNode instanceof CoreChildNode
+ ? ((CoreChildNode) currentNode).coreGetParent()
+ : null;
hasNext = false;
S mapped = mapper.map(currentNode);
if (mapped != currentNode && mapped instanceof CoreNode) {
@@ -159,11 +171,11 @@ public abstract class AbstractNodeIterator<T extends CoreNode,S> implements Node
// the next sibling or parent, even if axis is DESCENDANTS or DESCENDANTS_OR_SELF.
computeNext(Axis.CHILDREN);
if (currentNode instanceof CoreChildNode) {
-// try {
- ((CoreChildNode)currentNode).coreDetach(semantics);
-// } catch (CoreModelException ex) {
-// throw exceptionTranslator.toUncheckedException(ex);
-// }
+ // try {
+ ((CoreChildNode) currentNode).coreDetach(semantics);
+ // } catch (CoreModelException ex) {
+ // throw exceptionTranslator.toUncheckedException(ex);
+ // }
}
currentNode = null;
}
@@ -173,6 +185,6 @@ public abstract class AbstractNodeIterator<T extends CoreNode,S> implements Node
// Move to next node before replacing the current one
// TODO: this may not be the right thing to do in all cases
computeNext(Axis.CHILDREN);
- ((CoreChildNode)currentNode).coreReplaceWith(newNode, semantics);
+ ((CoreChildNode) currentNode).coreReplaceWith(newNode, semantics);
}
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/AttributeIterator.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/AttributeIterator.java
index 34432f8..6e56569 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/AttributeIterator.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/AttributeIterator.java
@@ -27,23 +27,28 @@ import org.apache.axiom.core.CoreElement;
import org.apache.axiom.core.Mapper;
import org.apache.axiom.core.Semantics;
-public final class AttributeIterator<T extends CoreAttribute,S> implements Iterator<S> {
+public final class AttributeIterator<T extends CoreAttribute, S> implements Iterator<S> {
private final Class<T> type;
- private final Mapper<S,? super T> mapper;
+ private final Mapper<S, ? super T> mapper;
private final Semantics semantics;
private CoreAttribute currentAttribute;
private CoreAttribute nextAttribute;
private boolean nextAttributeSet;
-
- private AttributeIterator(CoreAttribute firstAttribute, Class<T> type, Mapper<S,? super T> mapper, Semantics semantics) {
+
+ private AttributeIterator(
+ CoreAttribute firstAttribute,
+ Class<T> type,
+ Mapper<S, ? super T> mapper,
+ Semantics semantics) {
this.type = type;
this.mapper = mapper;
this.semantics = semantics;
nextAttribute = firstAttribute;
nextAttributeSet = true;
}
-
- public static <T extends CoreAttribute,S> Iterator<S> create(CoreElement element, Class<T> type, Mapper<S,? super T> mapper, Semantics semantics) {
+
+ public static <T extends CoreAttribute, S> Iterator<S> create(
+ CoreElement element, Class<T> type, Mapper<S, ? super T> mapper, Semantics semantics) {
CoreAttribute attribute = element.coreGetFirstAttribute();
while (attribute != null && !type.isInstance(attribute)) {
attribute = attribute.coreGetNextAttribute();
@@ -51,10 +56,10 @@ public final class AttributeIterator<T extends CoreAttribute,S> implements Itera
if (attribute == null) {
return Collections.<S>emptyList().iterator();
} else {
- return new AttributeIterator<T,S>(attribute, type, mapper, semantics);
+ return new AttributeIterator<T, S>(attribute, type, mapper, semantics);
}
}
-
+
@Override
public final boolean hasNext() {
if (!nextAttributeSet) {
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/ElementsIterator.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/ElementsIterator.java
index 5f5737d..2452464 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/ElementsIterator.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/ElementsIterator.java
@@ -26,12 +26,20 @@ import org.apache.axiom.core.ElementMatcher;
import org.apache.axiom.core.Mapper;
import org.apache.axiom.core.Semantics;
-public final class ElementsIterator<T extends CoreElement,S> extends AbstractNodeIterator<T,S> {
+public final class ElementsIterator<T extends CoreElement, S> extends AbstractNodeIterator<T, S> {
private final ElementMatcher<? super T> matcher;
private final String namespaceURI;
private final String name;
- public ElementsIterator(CoreParentNode startNode, Axis axis, Class<T> type, ElementMatcher<? super T> matcher, String namespaceURI, String name, Mapper<S,? super T> mapper, Semantics semantics) {
+ public ElementsIterator(
+ CoreParentNode startNode,
+ Axis axis,
+ Class<T> type,
+ ElementMatcher<? super T> matcher,
+ String namespaceURI,
+ String name,
+ Mapper<S, ? super T> mapper,
+ Semantics semantics) {
super(startNode, axis, type, mapper, semantics);
this.matcher = matcher;
this.namespaceURI = namespaceURI;
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/Flags.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/Flags.java
index cfdeb13..bfe45a6 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/Flags.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/Flags.java
@@ -24,10 +24,10 @@ import org.apache.axiom.core.CoreParentNode;
public final class Flags {
private Flags() {}
-
+
/**
- * Defines the bit mask for the part of the flags that indicate the state of a
- * {@link CoreParentNode}.
+ * Defines the bit mask for the part of the flags that indicate the state of a {@link
+ * CoreParentNode}.
*/
public static final int STATE_MASK = 7;
@@ -37,9 +37,9 @@ public final class Flags {
* to a document node (which may be the parent or simply the owner document).
*/
public static final int HAS_PARENT = 8;
-
+
public static final int DEFAULT_ATTR = 16;
-
+
/**
* Used to store the information returned by {@link CoreCharacterDataNode#coreIsIgnorable()}.
*/
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/NodesIterator.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/NodesIterator.java
index 4e3c80a..54a5132 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/NodesIterator.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/NodesIterator.java
@@ -25,9 +25,13 @@ import org.apache.axiom.core.CoreParentNode;
import org.apache.axiom.core.Mapper;
import org.apache.axiom.core.Semantics;
-public final class NodesIterator<T extends CoreNode,S> extends AbstractNodeIterator<T,S> {
- public NodesIterator(CoreParentNode startNode, Axis axis, Class<T> type,
- Mapper<S,? super T> mapper, Semantics semantics) {
+public final class NodesIterator<T extends CoreNode, S> extends AbstractNodeIterator<T, S> {
+ public NodesIterator(
+ CoreParentNode startNode,
+ Axis axis,
+ Class<T> type,
+ Mapper<S, ? super T> mapper,
+ Semantics semantics) {
super(startNode, axis, type, mapper, semantics);
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/TreeWalkerImpl.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/TreeWalkerImpl.java
index 0dd33d3..59009e4 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/TreeWalkerImpl.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/TreeWalkerImpl.java
@@ -35,46 +35,44 @@ import org.apache.axiom.core.stream.XmlReader;
public final class TreeWalkerImpl implements XmlReader {
private static final int STATE_NONE = 0;
-
+
/**
* Indicates that the serializer is synthesizing a start fragment event. This state can only be
* reached if the root node is not a document.
*/
private static final int STATE_START_FRAGMENT = 1;
-
- /**
- * Indicates that the current node is a leaf node.
- */
+
+ /** Indicates that the current node is a leaf node. */
private static final int STATE_LEAF = 2;
-
+
/**
* Indicates that the current node is a parent node and that events for child nodes have not yet
* been generated.
*/
private static final int STATE_NOT_VISITED = 3;
-
+
/**
* Indicates that the current node is an element and that events for its attribute nodes have
* already been generated.
*/
private static final int STATE_ATTRIBUTES_VISITED = 4;
-
+
/**
* Indicates that the current node is a parent node and that events for child nodes have already
* been generated.
*/
private static final int STATE_VISITED = 5;
-
+
/**
- * Indicates that the current node is a parent node for which the builder has been
- * put into pass through mode. In this state, events are not synthesized from the
- * object model but passed through from the underlying XML source used to build the
- * tree. This state is only reachable if {@link #preserve} is <code>true</code>.
+ * Indicates that the current node is a parent node for which the builder has been put into pass
+ * through mode. In this state, events are not synthesized from the object model but passed
+ * through from the underlying XML source used to build the tree. This state is only reachable
+ * if {@link #preserve} is <code>true</code>.
*/
private static final int STATE_PASS_THROUGH = 6;
-
+
private static final int STATE_STREAMING = 7;
-
+
private static final int STATE_ATTRIBUTE = 8;
/**
@@ -88,22 +86,23 @@ public final class TreeWalkerImpl implements XmlReader {
private final boolean preserve;
private final boolean incremental;
private CoreNode node;
-
+
/**
- * The stream from which events are included. This is only set if {@link #state} is
- * {@link #STATE_STREAMING}.
+ * The stream from which events are included. This is only set if {@link #state} is {@link
+ * #STATE_STREAMING}.
*/
private XmlReader reader;
-
+
private int state = STATE_NONE;
-
- public TreeWalkerImpl(XmlHandler handler, CoreParentNode root, boolean preserve, boolean incremental) {
+
+ public TreeWalkerImpl(
+ XmlHandler handler, CoreParentNode root, boolean preserve, boolean incremental) {
this.handler = handler;
this.root = root;
this.preserve = preserve;
this.incremental = incremental;
}
-
+
@Override
public boolean proceed() throws StreamException {
if (incremental && !handler.drain()) {
@@ -127,7 +126,7 @@ public final class TreeWalkerImpl implements XmlReader {
} else if (state == STATE_VISITED && previousNode == root) {
nextNode = null;
} else if (state == STATE_NOT_VISITED && previousNode instanceof CoreElement) {
- final CoreElement element = (CoreElement)previousNode;
+ final CoreElement element = (CoreElement) previousNode;
// TODO: handle case with preserve == false
CoreAttribute firstAttribute = element.coreGetFirstAttribute();
if (firstAttribute == null) {
@@ -138,7 +137,7 @@ public final class TreeWalkerImpl implements XmlReader {
state = STATE_NOT_VISITED;
}
} else if (state == STATE_NOT_VISITED || state == STATE_ATTRIBUTES_VISITED) {
- final CoreParentNode parent = (CoreParentNode)previousNode;
+ final CoreParentNode parent = (CoreParentNode) previousNode;
int nodeState = parent.getState();
if (nodeState == CoreParentNode.COMPACT) {
nextNode = previousNode;
@@ -156,7 +155,8 @@ public final class TreeWalkerImpl implements XmlReader {
CoreChildNode child = parent.coreGetFirstChildIfAvailable();
if (child == null) {
nextNode = parent;
- if (nodeState == CoreParentNode.DISCARDING || nodeState == CoreParentNode.DISCARDED) {
+ if (nodeState == CoreParentNode.DISCARDING
+ || nodeState == CoreParentNode.DISCARDED) {
throw new NodeConsumedException();
}
parent.coreGetInputContext().setPassThroughHandler(handler);
@@ -170,7 +170,7 @@ public final class TreeWalkerImpl implements XmlReader {
nextNode = previousNode;
state = STATE_VISITED;
} else if (previousNode instanceof CoreChildNode) {
- final CoreChildNode previousChildNode = (CoreChildNode)previousNode;
+ final CoreChildNode previousChildNode = (CoreChildNode) previousNode;
if (preserve) {
CoreChildNode sibling = previousChildNode.coreGetNextSibling();
if (sibling == null) {
@@ -186,16 +186,18 @@ public final class TreeWalkerImpl implements XmlReader {
CoreParentNode parent = previousChildNode.coreGetParent();
nextNode = parent;
int nodeState = parent.getState();
-
+
// TODO: <hack>
- if (nodeState == CoreParentNode.INCOMPLETE && parent.coreGetInputContext() == null) {
+ if (nodeState == CoreParentNode.INCOMPLETE
+ && parent.coreGetInputContext() == null) {
nodeState = CoreParentNode.COMPLETE;
}
// </hack>
-
+
if (nodeState == CoreParentNode.COMPLETE) {
state = STATE_VISITED;
- } else if (nodeState == CoreParentNode.DISCARDING || nodeState == CoreParentNode.DISCARDED) {
+ } else if (nodeState == CoreParentNode.DISCARDING
+ || nodeState == CoreParentNode.DISCARDED) {
throw new NodeConsumedException();
} else {
parent.coreGetInputContext().setPassThroughHandler(handler);
@@ -207,7 +209,7 @@ public final class TreeWalkerImpl implements XmlReader {
}
}
} else {
- final CoreAttribute attribute = (CoreAttribute)previousNode;
+ final CoreAttribute attribute = (CoreAttribute) previousNode;
// TODO: handle case with preserve == false
CoreAttribute nextAttribute = attribute.coreGetNextAttribute();
if (nextAttribute == null) {
@@ -218,14 +220,17 @@ public final class TreeWalkerImpl implements XmlReader {
state = STATE_NOT_VISITED;
}
}
-
+
// More closely examine the case where we move to a node that has not
// been visited yet. It may be a sourced element or a leaf node
if (state == STATE_NOT_VISITED) {
if (nextNode instanceof CoreNSAwareElement) {
- XmlInput input = ((CoreNSAwareElement)nextNode).getXmlInput(preserve, incremental);
+ XmlInput input =
+ ((CoreNSAwareElement) nextNode).getXmlInput(preserve, incremental);
if (input != null) {
- reader = input.createReader(new DocumentElementExtractingFilterHandler(handler));
+ reader =
+ input.createReader(
+ new DocumentElementExtractingFilterHandler(handler));
state = STATE_STREAMING;
}
} else if (nextNode instanceof CoreLeafNode) {
@@ -234,19 +239,19 @@ public final class TreeWalkerImpl implements XmlReader {
state = STATE_ATTRIBUTE;
}
}
-
+
switch (state) {
case STATE_START_FRAGMENT:
handler.startFragment();
break;
case STATE_LEAF:
- ((CoreLeafNode)nextNode).internalSerialize(handler, preserve);
+ ((CoreLeafNode) nextNode).internalSerialize(handler, preserve);
break;
case STATE_ATTRIBUTE:
- ((CoreAttribute)nextNode).internalSerialize(handler, preserve);
+ ((CoreAttribute) nextNode).internalSerialize(handler, preserve);
break;
case STATE_NOT_VISITED:
- ((CoreParentNode)nextNode).serializeStartEvent(handler);
+ ((CoreParentNode) nextNode).serializeStartEvent(handler);
break;
case STATE_ATTRIBUTES_VISITED:
handler.attributesCompleted();
@@ -255,17 +260,18 @@ public final class TreeWalkerImpl implements XmlReader {
if (nextNode == null) {
handler.completed();
} else {
- ((CoreParentNode)nextNode).serializeEndEvent(handler);
+ ((CoreParentNode) nextNode).serializeEndEvent(handler);
}
break;
- case STATE_PASS_THROUGH: {
- CoreParentNode parent = (CoreParentNode)nextNode;
- parent.coreGetInputContext().getBuilder().next();
- if (parent.coreGetInputContext() == null) {
- state = STATE_VISITED;
+ case STATE_PASS_THROUGH:
+ {
+ CoreParentNode parent = (CoreParentNode) nextNode;
+ parent.coreGetInputContext().getBuilder().next();
+ if (parent.coreGetInputContext() == null) {
+ state = STATE_VISITED;
+ }
+ break;
}
- break;
- }
case STATE_STREAMING:
if (reader.proceed()) {
state = STATE_VISITED;
@@ -273,7 +279,8 @@ public final class TreeWalkerImpl implements XmlReader {
}
break;
case STATE_CONTENT_VISITED:
- handler.processCharacterData(((CoreParentNode)nextNode).internalGetContent(), false);
+ handler.processCharacterData(
+ ((CoreParentNode) nextNode).internalGetContent(), false);
break;
default:
throw new IllegalStateException();
@@ -288,7 +295,10 @@ public final class TreeWalkerImpl implements XmlReader {
@Override
public void dispose() {
if (!preserve && node != null) {
- CoreParentNode parent = node instanceof CoreParentNode ? (CoreParentNode)node : ((CoreChildNode)node).coreGetParent();
+ CoreParentNode parent =
+ node instanceof CoreParentNode
+ ? (CoreParentNode) node
+ : ((CoreChildNode) node).coreGetParent();
while (true) {
InputContext context = parent.coreGetInputContext();
if (context != null) {
@@ -297,7 +307,7 @@ public final class TreeWalkerImpl implements XmlReader {
if (parent == root) {
break;
}
- parent = ((CoreChildNode)parent).coreGetParent();
+ parent = ((CoreChildNode) parent).coreGetParent();
}
}
if (reader != null) {
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/BuildableContext.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/BuildableContext.java
index 017da17..a80f4cb 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/BuildableContext.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/BuildableContext.java
@@ -44,18 +44,16 @@ final class BuildableContext extends Context implements InputContext {
private final Context parentContext;
private CoreParentNode target;
-
+
private Object pendingCharacterData;
-
+
/**
- * The {@link XmlHandler} object to send events to if pass-through is enabled. See
- * {@link InputContext#setPassThroughHandler(XmlHandler)} for more details.
+ * The {@link XmlHandler} object to send events to if pass-through is enabled. See {@link
+ * InputContext#setPassThroughHandler(XmlHandler)} for more details.
*/
private XmlHandler passThroughHandler;
-
- /**
- * Tracks the nesting depth when pass-through is enabled.
- */
+
+ /** Tracks the nesting depth when pass-through is enabled. */
private int passThroughDepth;
BuildableContext(BuilderHandler builderHandler, Context parentContext, int depth) {
@@ -75,7 +73,8 @@ final class BuildableContext extends Context implements InputContext {
@Override
public void setPassThroughHandler(XmlHandler passThroughHandler) {
if (this.passThroughHandler != null) {
- throw new IllegalStateException("A pass-through handler has already been set for this context");
+ throw new IllegalStateException(
+ "A pass-through handler has already been set for this context");
}
target.coreSetState(CoreParentNode.DISCARDING);
this.passThroughHandler = passThroughHandler;
@@ -83,7 +82,7 @@ final class BuildableContext extends Context implements InputContext {
builderHandler.decrementActiveContextCount();
}
}
-
+
@Override
public void setTarget(CoreParentNode target) {
this.target = target;
@@ -110,7 +109,7 @@ final class BuildableContext extends Context implements InputContext {
builderHandler.decrementActiveContextCount();
return parentContext;
}
-
+
private Context decrementPassThroughDepth() {
if (passThroughDepth == 0) {
if (passThroughHandler != NullXmlHandler.INSTANCE) {
@@ -125,7 +124,7 @@ final class BuildableContext extends Context implements InputContext {
return this;
}
}
-
+
private void addChild(CoreChildNode node) {
if (pendingCharacterData != null) {
CoreCharacterDataNode cdataNode = builderHandler.nodeFactory.createCharacterDataNode();
@@ -138,10 +137,10 @@ final class BuildableContext extends Context implements InputContext {
builderHandler.nodeAdded(node);
}
}
-
+
@Override
- void startDocument(String inputEncoding, String xmlVersion, String xmlEncoding,
- Boolean standalone) {
+ void startDocument(
+ String inputEncoding, String xmlVersion, String xmlEncoding, Boolean standalone) {
CoreDocument document = builderHandler.model.createDocument();
if (document == null) {
document = builderHandler.nodeFactory.createDocument();
@@ -161,12 +160,15 @@ final class BuildableContext extends Context implements InputContext {
}
@Override
- void processDocumentTypeDeclaration(String rootName, String publicId, String systemId,
- String internalSubset) throws StreamException {
+ void processDocumentTypeDeclaration(
+ String rootName, String publicId, String systemId, String internalSubset)
+ throws StreamException {
if (passThroughHandler != null) {
- passThroughHandler.processDocumentTypeDeclaration(rootName, publicId, systemId, internalSubset);
+ passThroughHandler.processDocumentTypeDeclaration(
+ rootName, publicId, systemId, internalSubset);
} else {
- CoreDocumentTypeDeclaration node = builderHandler.nodeFactory.createDocumentTypeDeclaration();
+ CoreDocumentTypeDeclaration node =
+ builderHandler.nodeFactory.createDocumentTypeDeclaration();
node.coreSetRootName(rootName);
node.coreSetPublicId(publicId);
node.coreSetSystemId(systemId);
@@ -174,16 +176,17 @@ final class BuildableContext extends Context implements InputContext {
addChild(node);
}
}
-
+
@Override
- Context startElement(String namespaceURI, String localName, String prefix) throws StreamException {
+ Context startElement(String namespaceURI, String localName, String prefix)
+ throws StreamException {
if (passThroughHandler != null) {
passThroughDepth++;
passThroughHandler.startElement(namespaceURI, localName, prefix);
return this;
} else {
- CoreNSAwareElement element = builderHandler.model.createElement(
- target, depth+1, namespaceURI, localName);
+ CoreNSAwareElement element =
+ builderHandler.model.createElement(target, depth + 1, namespaceURI, localName);
if (element == null) {
element = builderHandler.nodeFactory.createNSAwareElement();
}
@@ -193,7 +196,7 @@ final class BuildableContext extends Context implements InputContext {
return newContext(element);
}
}
-
+
@Override
Context endElement() throws StreamException {
if (passThroughHandler != null) {
@@ -205,9 +208,17 @@ final class BuildableContext extends Context implements InputContext {
}
@Override
- void processAttribute(String namespaceURI, String localName, String prefix, String value, String type, boolean specified) throws StreamException {
+ void processAttribute(
+ String namespaceURI,
+ String localName,
+ String prefix,
+ String value,
+ String type,
+ boolean specified)
+ throws StreamException {
if (passThroughHandler != null) {
- passThroughHandler.processAttribute(namespaceURI, localName, prefix, value, type, specified);
+ passThroughHandler.processAttribute(
+ namespaceURI, localName, prefix, value, type, specified);
} else {
CoreNSAwareAttribute attr = builderHandler.nodeFactory.createNSAwareAttribute();
attr.initName(namespaceURI, localName, prefix, builderHandler.namespaceHelper);
@@ -218,12 +229,13 @@ final class BuildableContext extends Context implements InputContext {
}
attr.coreSetType(type);
attr.coreSetSpecified(specified);
- ((CoreElement)target).coreAppendAttribute(attr);
+ ((CoreElement) target).coreAppendAttribute(attr);
}
}
-
+
@Override
- void processAttribute(String name, String value, String type, boolean specified) throws StreamException {
+ void processAttribute(String name, String value, String type, boolean specified)
+ throws StreamException {
if (passThroughHandler != null) {
passThroughHandler.processAttribute(name, value, type, specified);
} else {
@@ -236,10 +248,10 @@ final class BuildableContext extends Context implements InputContext {
}
attr.coreSetType(type);
attr.coreSetSpecified(specified);
- ((CoreElement)target).coreAppendAttribute(attr);
+ ((CoreElement) target).coreAppendAttribute(attr);
}
}
-
+
@Override
void processNamespaceDeclaration(String prefix, String namespaceURI) throws StreamException {
if (passThroughHandler != null) {
@@ -247,10 +259,10 @@ final class BuildableContext extends Context implements InputContext {
} else {
CoreNamespaceDeclaration decl = builderHandler.nodeFactory.createNamespaceDeclaration();
decl.init(prefix, namespaceURI, builderHandler.namespaceHelper);
- ((CoreElement)target).coreAppendAttribute(decl);
+ ((CoreElement) target).coreAppendAttribute(decl);
}
}
-
+
@Override
void attributesCompleted() throws StreamException {
if (passThroughHandler != null) {
@@ -259,12 +271,14 @@ final class BuildableContext extends Context implements InputContext {
target.coreSetState(CoreParentNode.INCOMPLETE);
}
}
-
+
@Override
void processCharacterData(Object data, boolean ignorable) throws StreamException {
if (passThroughHandler != null) {
passThroughHandler.processCharacterData(data, ignorable);
- } else if (!ignorable && pendingCharacterData == null && target.coreGetFirstChildIfAvailable() == null) {
+ } else if (!ignorable
+ && pendingCharacterData == null
+ && target.coreGetFirstChildIfAvailable() == null) {
pendingCharacterData = data;
} else {
CoreCharacterDataNode node = builderHandler.nodeFactory.createCharacterDataNode();
@@ -273,7 +287,7 @@ final class BuildableContext extends Context implements InputContext {
addChild(node);
}
}
-
+
@Override
Context startProcessingInstruction(String piTarget) throws StreamException {
if (passThroughHandler != null) {
@@ -281,7 +295,8 @@ final class BuildableContext extends Context implements InputContext {
passThroughHandler.startProcessingInstruction(piTarget);
return this;
} else {
- CoreProcessingInstruction node = builderHandler.nodeFactory.createProcessingInstruction();
+ CoreProcessingInstruction node =
+ builderHandler.nodeFactory.createProcessingInstruction();
node.coreSetTarget(piTarget);
addChild(node);
return newContext(node);
@@ -310,7 +325,7 @@ final class BuildableContext extends Context implements InputContext {
return newContext(node);
}
}
-
+
@Override
Context endComment() throws StreamException {
if (passThroughHandler != null) {
@@ -320,7 +335,7 @@ final class BuildableContext extends Context implements InputContext {
return endContext();
}
}
-
+
@Override
Context startCDATASection() throws StreamException {
if (passThroughHandler != null) {
@@ -333,7 +348,7 @@ final class BuildableContext extends Context implements InputContext {
return newContext(node);
}
}
-
+
@Override
Context endCDATASection() throws StreamException {
if (passThroughHandler != null) {
@@ -343,7 +358,7 @@ final class BuildableContext extends Context implements InputContext {
return endContext();
}
}
-
+
@Override
void processEntityReference(String name, String replacementText) throws StreamException {
if (passThroughHandler != null) {
@@ -355,7 +370,7 @@ final class BuildableContext extends Context implements InputContext {
addChild(node);
}
}
-
+
@Override
void completed() throws StreamException {
if (passThroughHandler != null) {
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/BuilderHandler.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/BuilderHandler.java
index c52fbbd..81172c9 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/BuilderHandler.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/BuilderHandler.java
@@ -42,23 +42,27 @@ final class BuilderHandler implements XmlHandler {
// returns the state of completion
private boolean done;
private CoreDocument document;
-
+
/**
* Tracks the depth of the node identified by {@link #target}. By definition, the document has
* depth 0. Note that if caching is disabled, then this depth may be different from the actual
* depth reached by the underlying parser.
*/
public int depth;
-
+
private ArrayList<BuilderListener> listeners;
private Queue<DeferredAction> deferredActions;
- BuilderHandler(NodeFactory2 nodeFactory, Model model, CoreNSAwareElement root, Builder builder) {
+ BuilderHandler(
+ NodeFactory2 nodeFactory, Model model, CoreNSAwareElement root, Builder builder) {
this.nodeFactory = nodeFactory;
this.model = model;
this.builder = builder;
namespaceHelper = nodeFactory.createNamespaceHelper();
- rootContext = root == null ? new BuildableContext(this, null, 0) : new UnwrappingContext(this, root);
+ rootContext =
+ root == null
+ ? new BuildableContext(this, null, 0)
+ : new UnwrappingContext(this, root);
context = rootContext;
activeContextCount = 1;
}
@@ -69,13 +73,13 @@ final class BuilderHandler implements XmlHandler {
}
listeners.add(listener);
}
-
+
void nodeAdded(CoreNode node) {
if (node instanceof CoreDocument) {
- document = (CoreDocument)node;
+ document = (CoreDocument) node;
}
if (listeners != null) {
- for (int i=0, size=listeners.size(); i<size; i++) {
+ for (int i = 0, size = listeners.size(); i < size; i++) {
DeferredAction action = listeners.get(i).nodeAdded(node, depth);
if (action != null) {
scheduleDeferredAction(action);
@@ -99,25 +103,26 @@ final class BuilderHandler implements XmlHandler {
}
}
}
-
+
void incrementActiveContextCount() {
activeContextCount++;
}
-
+
void decrementActiveContextCount() {
if (--activeContextCount == 0) {
- scheduleDeferredAction(() -> {
- while (!done) {
- builder.next();
- }
- });
+ scheduleDeferredAction(
+ () -> {
+ while (!done) {
+ builder.next();
+ }
+ });
}
}
-
+
boolean isCompleted() {
return done;
}
-
+
CoreDocument getDocument() {
if (rootContext instanceof UnwrappingContext) {
throw new UnsupportedOperationException("There is no document linked to this builder");
@@ -125,29 +130,32 @@ final class BuilderHandler implements XmlHandler {
return document;
}
}
-
+
@Override
- public void startDocument(String inputEncoding, String xmlVersion, String xmlEncoding, Boolean standalone) {
+ public void startDocument(
+ String inputEncoding, String xmlVersion, String xmlEncoding, Boolean standalone) {
context.startDocument(inputEncoding, xmlVersion, xmlEncoding, standalone);
}
-
+
@Override
public void startFragment() throws StreamException {
context.startFragment();
}
@Override
- public void processDocumentTypeDeclaration(String rootName, String publicId, String systemId,
- String internalSubset) throws StreamException {
+ public void processDocumentTypeDeclaration(
+ String rootName, String publicId, String systemId, String internalSubset)
+ throws StreamException {
context.processDocumentTypeDeclaration(rootName, publicId, systemId, internalSubset);
}
-
+
@Override
- public void startElement(String namespaceURI, String localName, String prefix) throws StreamException {
+ public void startElement(String namespaceURI, String localName, String prefix)
+ throws StreamException {
depth++;
context = context.startElement(namespaceURI, localName, prefix);
}
-
+
@Override
public void endElement() throws StreamException {
context = context.endElement();
@@ -155,30 +163,39 @@ final class BuilderHandler implements XmlHandler {
}
@Override
- public void processAttribute(String namespaceURI, String localName, String prefix, String value, String type, boolean specified) throws StreamException {
+ public void processAttribute(
+ String namespaceURI,
+ String localName,
+ String prefix,
+ String value,
+ String type,
+ boolean specified)
+ throws StreamException {
context.processAttribute(namespaceURI, localName, prefix, value, type, specified);
}
-
+
@Override
- public void processAttribute(String name, String value, String type, boolean specified) throws StreamException {
+ public void processAttribute(String name, String value, String type, boolean specified)
+ throws StreamException {
context.processAttribute(name, value, type, specified);
}
-
+
@Override
- public void processNamespaceDeclaration(String prefix, String namespaceURI) throws StreamException {
+ public void processNamespaceDeclaration(String prefix, String namespaceURI)
+ throws StreamException {
context.processNamespaceDeclaration(prefix, namespaceURI);
}
-
+
@Override
public void attributesCompleted() throws StreamException {
context.attributesCompleted();
}
-
+
@Override
public void processCharacterData(Object data, boolean ignorable) throws StreamException {
context.processCharacterData(data, ignorable);
}
-
+
@Override
public void startProcessingInstruction(String target) throws StreamException {
context = context.startProcessingInstruction(target);
@@ -198,7 +215,7 @@ final class BuilderHandler implements XmlHandler {
public void endComment() throws StreamException {
context = context.endComment();
}
-
+
@Override
public void startCDATASection() throws StreamException {
context = context.startCDATASection();
@@ -208,12 +225,12 @@ final class BuilderHandler implements XmlHandler {
public void endCDATASection() throws StreamException {
context = context.endCDATASection();
}
-
+
@Override
public void processEntityReference(String name, String replacementText) throws StreamException {
context.processEntityReference(name, replacementText);
}
-
+
@Override
public void completed() throws StreamException {
if (depth != 0) {
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/BuilderImpl.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/BuilderImpl.java
index 97ebcd8..008dce0 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/BuilderImpl.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/BuilderImpl.java
@@ -32,8 +32,8 @@ public final class BuilderImpl implements Builder {
private final BuilderHandler builderHandler;
private Object facade;
- public BuilderImpl(XmlInput input, NodeFactory2 nodeFactory, Model model,
- CoreNSAwareElement root) {
+ public BuilderImpl(
+ XmlInput input, NodeFactory2 nodeFactory, Model model, CoreNSAwareElement root) {
builderHandler = new BuilderHandler(nodeFactory, model, root, this);
reader = input.createReader(builderHandler);
}
@@ -41,7 +41,7 @@ public final class BuilderImpl implements Builder {
public void addListener(BuilderListener listener) {
builderHandler.addListener(listener);
}
-
+
public Object getFacade() {
return facade;
}
@@ -75,7 +75,7 @@ public final class BuilderImpl implements Builder {
}
return document;
}
-
+
@Override
public void close() {
reader.dispose();
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/BuilderListener.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/BuilderListener.java
index 4a44413..8c91a36 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/BuilderListener.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/BuilderListener.java
@@ -28,17 +28,16 @@ public interface BuilderListener {
* invoked for {@link CoreCharacterDataNode}s (because they are created lazily). On the other
* hand, it will be invoked for the {@link CoreDocument}. Since the builder is not reentrant,
* implementations must not perform any operations on the node that would require building
- * additional nodes. If such operations need to be executed, the listener should return a
- * {@link Runnable} encapsulating these operations. The builder will then execute that runnable
- * as soon as it is safe to do so.
- *
- * @param node
- * the node that has been added
- * @param depth
- * the depth of the node, with 0 corresponding to the document
+ * additional nodes. If such operations need to be executed, the listener should return a {@link
+ * Runnable} encapsulating these operations. The builder will then execute that runnable as soon
+ * as it is safe to do so.
+ *
+ * @param node the node that has been added
+ * @param depth the depth of the node, with 0 corresponding to the document
* @return an action to be executed when the object model can safely be accessed again
*/
// TODO: specify if what happens for attributes (including depth)
- // TODO: an ancestor of the node may have been detached or moved; specify what this means for the depth
+ // TODO: an ancestor of the node may have been detached or moved; specify what this means for
+ // the depth
DeferredAction nodeAdded(CoreNode node, int depth);
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/Context.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/Context.java
index 738f896..064836c 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/Context.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/Context.java
@@ -33,48 +33,61 @@ abstract class Context {
protected final BuildableContext newContext(CoreParentNode target) {
if (nestedContext == null) {
- nestedContext = new BuildableContext(builderHandler, this, depth+1);
+ nestedContext = new BuildableContext(builderHandler, this, depth + 1);
}
nestedContext.init(target);
target.coreSetInputContext(nestedContext);
builderHandler.incrementActiveContextCount();
return nestedContext;
}
-
- abstract void startDocument(String inputEncoding, String xmlVersion, String xmlEncoding, Boolean standalone);
-
+
+ abstract void startDocument(
+ String inputEncoding, String xmlVersion, String xmlEncoding, Boolean standalone);
+
abstract void startFragment();
-
- abstract void processDocumentTypeDeclaration(String rootName, String publicId, String systemId,
- String internalSubset) throws StreamException;
-
- abstract Context startElement(String namespaceURI, String localName, String prefix) throws StreamException;
-
+
+ abstract void processDocumentTypeDeclaration(
+ String rootName, String publicId, String systemId, String internalSubset)
+ throws StreamException;
+
+ abstract Context startElement(String namespaceURI, String localName, String prefix)
+ throws StreamException;
+
abstract Context endElement() throws StreamException;
-
- abstract void processAttribute(String namespaceURI, String localName, String prefix, String value, String type, boolean specified) throws StreamException;
-
- abstract void processAttribute(String name, String value, String type, boolean specified) throws StreamException;
-
- abstract void processNamespaceDeclaration(String prefix, String namespaceURI) throws StreamException;
-
+
+ abstract void processAttribute(
+ String namespaceURI,
+ String localName,
+ String prefix,
+ String value,
+ String type,
+ boolean specified)
+ throws StreamException;
+
+ abstract void processAttribute(String name, String value, String type, boolean specified)
+ throws StreamException;
+
+ abstract void processNamespaceDeclaration(String prefix, String namespaceURI)
+ throws StreamException;
+
abstract void attributesCompleted() throws StreamException;
-
+
abstract void processCharacterData(Object data, boolean ignorable) throws StreamException;
-
+
abstract Context startProcessingInstruction(String piTarget) throws StreamException;
-
+
abstract Context endProcessingInstruction() throws StreamException;
-
+
abstract Context startComment() throws StreamException;
-
+
abstract Context endComment() throws StreamException;
-
+
abstract Context startCDATASection() throws StreamException;
-
+
abstract Context endCDATASection() throws StreamException;
-
- abstract void processEntityReference(String name, String replacementText) throws StreamException;
-
+
+ abstract void processEntityReference(String name, String replacementText)
+ throws StreamException;
+
abstract void completed() throws StreamException;
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/Model.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/Model.java
index 27385ef..bc8b733 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/Model.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/Model.java
@@ -25,21 +25,20 @@ import org.apache.axiom.core.CoreParentNode;
public interface Model {
/**
* Create the document node suitable for this model.
- *
+ *
* @return the document node, or {@code null} if a plain {@link CoreDocument} should be used
*/
CoreDocument createDocument();
-
+
/**
* Create a model specific element node. The implementation must only create the element, but
* not set any of its properties.
- *
- * @param parent
- * the parent for the element
- * @param elementName
- * the local name for the element
- * @return the element node, or {@code null} if a plain {@link CoreNSAwareElement} should be used
+ *
+ * @param parent the parent for the element
+ * @param elementName the local name for the element
+ * @return the element node, or {@code null} if a plain {@link CoreNSAwareElement} should be
+ * used
*/
- CoreNSAwareElement createElement(CoreParentNode parent, int elementLevel,
- String namespaceURI, String localName);
+ CoreNSAwareElement createElement(
+ CoreParentNode parent, int elementLevel, String namespaceURI, String localName);
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/PlainXMLModel.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/PlainXMLModel.java
index 2cb0d65..dd45414 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/PlainXMLModel.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/PlainXMLModel.java
@@ -33,8 +33,8 @@ public final class PlainXMLModel implements Model {
}
@Override
- public CoreNSAwareElement createElement(CoreParentNode parent, int elementLevel,
- String namespaceURI, String localName) {
+ public CoreNSAwareElement createElement(
+ CoreParentNode parent, int elementLevel, String namespaceURI, String localName) {
return null;
}
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/UnwrappingContext.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/UnwrappingContext.java
index b537f09..7e2445d 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/UnwrappingContext.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/builder/UnwrappingContext.java
@@ -24,26 +24,25 @@ import org.apache.axiom.core.stream.StreamException;
final class UnwrappingContext extends Context {
private final CoreNSAwareElement root;
-
+
UnwrappingContext(BuilderHandler builderHandler, CoreNSAwareElement root) {
super(builderHandler, 0);
this.root = root;
}
@Override
- void startDocument(String inputEncoding, String xmlVersion, String xmlEncoding,
- Boolean standalone) {
- }
+ void startDocument(
+ String inputEncoding, String xmlVersion, String xmlEncoding, Boolean standalone) {}
@Override
- void startFragment() {
- }
+ void startFragment() {}
@Override
- void processDocumentTypeDeclaration(String rootName, String publicId, String systemId,
- String internalSubset) throws StreamException {
+ void processDocumentTypeDeclaration(
+ String rootName, String publicId, String systemId, String internalSubset)
+ throws StreamException {
// TODO Auto-generated method stub
-
+
}
@Override
@@ -65,35 +64,41 @@ final class UnwrappingContext extends Context {
}
@Override
- void processAttribute(String namespaceURI, String localName, String prefix, String value,
- String type, boolean specified) throws StreamException {
+ void processAttribute(
+ String namespaceURI,
+ String localName,
+ String prefix,
+ String value,
+ String type,
+ boolean specified)
+ throws StreamException {
// TODO Auto-generated method stub
-
+
}
@Override
void processAttribute(String name, String value, String type, boolean specified)
throws StreamException {
// TODO Auto-generated method stub
-
+
}
@Override
void processNamespaceDeclaration(String prefix, String namespaceURI) throws StreamException {
// TODO Auto-generated method stub
-
+
}
@Override
void attributesCompleted() throws StreamException {
// TODO Auto-generated method stub
-
+
}
@Override
void processCharacterData(Object data, boolean ignorable) throws StreamException {
// TODO Auto-generated method stub
-
+
}
@Override
@@ -135,12 +140,12 @@ final class UnwrappingContext extends Context {
@Override
void processEntityReference(String name, String replacementText) throws StreamException {
// TODO Auto-generated method stub
-
+
}
@Override
void completed() throws StreamException {
// TODO Auto-generated method stub
-
+
}
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreAttributeMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreAttributeMixin.java
index fa2b777..9406501 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreAttributeMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreAttributeMixin.java
@@ -30,16 +30,16 @@ import org.apache.axiom.weaver.annotation.Mixin;
@Mixin
public abstract class CoreAttributeMixin implements CoreAttribute {
/**
- * The owner of the attribute. This is either a {@link CoreDocument} if the attribute is not linked
- * to an element, or a {@link CoreElement} if the attribute has been added to an element.
+ * The owner of the attribute. This is either a {@link CoreDocument} if the attribute is not
+ * linked to an element, or a {@link CoreElement} if the attribute has been added to an element.
*/
private CoreParentNode owner;
-
+
private CoreAttribute nextAttribute;
@Override
public final CoreElement coreGetOwnerElement() {
- return owner instanceof CoreElement ? (CoreElement)owner : null;
+ return owner instanceof CoreElement ? (CoreElement) owner : null;
}
@Override
@@ -54,12 +54,12 @@ public abstract class CoreAttributeMixin implements CoreAttribute {
}
owner = element;
}
-
+
@Override
public final void internalUnsetOwnerElement(CoreDocument newOwnerDocument) {
owner = newOwnerDocument;
}
-
+
@Override
public final CoreNode getRootOrOwnerDocument() {
if (owner == null) {
@@ -73,7 +73,7 @@ public abstract class CoreAttributeMixin implements CoreAttribute {
public final void coreSetOwnerDocument(CoreDocument document) {
if (owner instanceof CoreElement) {
// TODO
-// throw new IllegalStateException();
+ // throw new IllegalStateException();
}
owner = document;
}
@@ -87,11 +87,11 @@ public abstract class CoreAttributeMixin implements CoreAttribute {
public final void internalSetNextAttribute(CoreAttribute nextAttribute) {
this.nextAttribute = nextAttribute;
}
-
+
@Override
public final CoreAttribute coreGetPreviousAttribute() {
if (owner instanceof CoreElement) {
- CoreElement ownerElement = (CoreElement)owner;
+ CoreElement ownerElement = (CoreElement) owner;
CoreAttribute previousAttr = ownerElement.coreGetFirstAttribute();
while (previousAttr != null) {
CoreAttribute nextAttr = previousAttr.coreGetNextAttribute();
@@ -120,13 +120,16 @@ public abstract class CoreAttributeMixin implements CoreAttribute {
public final boolean coreRemove(Semantics semantics) {
return internalRemove(semantics, null);
}
-
+
@Override
public final boolean internalRemove(Semantics semantics, CoreElement newOwner) {
if (owner instanceof CoreElement) {
- CoreElement ownerElement = (CoreElement)owner;
+ CoreElement ownerElement = (CoreElement) owner;
CoreAttribute previousAttr = coreGetPreviousAttribute();
- owner = newOwner != null ? newOwner : semantics.getDetachPolicy().getNewOwnerDocument(ownerElement);
+ owner =
+ newOwner != null
+ ? newOwner
+ : semantics.getDetachPolicy().getNewOwnerDocument(ownerElement);
if (previousAttr == null) {
ownerElement.internalSetFirstAttribute(nextAttribute);
} else {
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreCDATASectionMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreCDATASectionMixin.java
index 01c3637..fb4408c 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreCDATASectionMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreCDATASectionMixin.java
@@ -33,16 +33,16 @@ public abstract class CoreCDATASectionMixin implements CoreCDATASection {
public final NodeType coreGetNodeType() {
return NodeType.CDATA_SECTION;
}
-
+
@Override
- public final <T> void init(ClonePolicy<T> policy, T options, CoreNode other) {
- }
+ public final <T> void init(ClonePolicy<T> policy, T options, CoreNode other) {}
@Override
- public final void serializeStartEvent(XmlHandler handler) throws CoreModelException, StreamException {
+ public final void serializeStartEvent(XmlHandler handler)
+ throws CoreModelException, StreamException {
handler.startCDATASection();
}
-
+
@Override
public final void serializeEndEvent(XmlHandler handler) throws StreamException {
handler.endCDATASection();
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreCharacterDataContainingParentNodeMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreCharacterDataContainingParentNodeMixin.java
index 717f2b4..2ca1acb 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreCharacterDataContainingParentNodeMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreCharacterDataContainingParentNodeMixin.java
@@ -24,7 +24,8 @@ import org.apache.axiom.core.ElementAction;
import org.apache.axiom.weaver.annotation.Mixin;
@Mixin
-public abstract class CoreCharacterDataContainingParentNodeMixin implements CoreCharacterDataContainingParentNode {
+public abstract class CoreCharacterDataContainingParentNodeMixin
+ implements CoreCharacterDataContainingParentNode {
@Override
public final Object coreGetCharacterData() throws CoreModelException {
Object characterData = internalGetCharacterData(ElementAction.RETURN_NULL);
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreCharacterDataNodeMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreCharacterDataNodeMixin.java
index 61f47a5..0ecea21 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreCharacterDataNodeMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreCharacterDataNodeMixin.java
@@ -32,46 +32,47 @@ import org.apache.axiom.weaver.annotation.Mixin;
@Mixin
public abstract class CoreCharacterDataNodeMixin implements CoreCharacterDataNode {
- /**
- * Either a {@link String} or a {@link CharacterData} object.
- */
+ /** Either a {@link String} or a {@link CharacterData} object. */
private Object data;
-
+
@Override
public final NodeType coreGetNodeType() {
return NodeType.CHARACTER_DATA;
}
-
+
@Override
public final boolean coreIsIgnorable() {
return internalGetFlag(Flags.IGNORABLE);
}
-
+
@Override
public final void coreSetIgnorable(boolean ignorable) {
internalSetFlag(Flags.IGNORABLE, ignorable);
}
-
+
@Override
public final Object coreGetCharacterData() {
return data == null ? "" : data;
}
-
+
@Override
public final void coreSetCharacterData(Object data) {
this.data = data;
}
-
+
@Override
public final void coreSetCharacterData(Object data, Semantics semantics) {
this.data = data;
}
-
+
@Override
public final <T> void init(ClonePolicy<T> policy, T options, CoreNode other) {
- CoreCharacterDataNode o = (CoreCharacterDataNode)other;
+ CoreCharacterDataNode o = (CoreCharacterDataNode) other;
Object otherData = o.coreGetCharacterData();
- data = otherData instanceof CloneableCharacterData ? ((CloneableCharacterData)otherData).clone(policy, options) : otherData;
+ data =
+ otherData instanceof CloneableCharacterData
+ ? ((CloneableCharacterData) otherData).clone(policy, options)
+ : otherData;
coreSetIgnorable(o.coreIsIgnorable());
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreChildNodeMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreChildNodeMixin.java
index 11f5350..af76e7e 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreChildNodeMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreChildNodeMixin.java
@@ -41,22 +41,22 @@ public abstract class CoreChildNodeMixin implements CoreChildNode {
private CoreParentNode owner;
CoreChildNode nextSibling;
CoreChildNode previousSibling;
-
+
@Override
public final boolean coreHasParent() {
return internalGetFlag(Flags.HAS_PARENT);
}
-
+
@Override
public final CoreParentNode coreGetParent() {
return internalGetFlag(Flags.HAS_PARENT) ? owner : null;
}
-
+
@Override
public final CoreElement coreGetParentElement() {
- return owner instanceof CoreElement ? (CoreElement)owner : null;
+ return owner instanceof CoreElement ? (CoreElement) owner : null;
}
-
+
@Override
public void internalSetParent(CoreParentNode parent) {
if (parent == null) {
@@ -65,13 +65,13 @@ public abstract class CoreChildNodeMixin implements CoreChildNode {
owner = parent;
internalSetFlag(Flags.HAS_PARENT, true);
}
-
+
@Override
public final void internalUnsetParent(CoreDocument newOwnerDocument) {
owner = newOwnerDocument;
internalSetFlag(Flags.HAS_PARENT, false);
}
-
+
@Override
public final CoreNode getRootOrOwnerDocument() {
if (owner == null) {
@@ -80,7 +80,7 @@ public abstract class CoreChildNodeMixin implements CoreChildNode {
return owner.getRootOrOwnerDocument();
}
}
-
+
@Override
public final void coreSetOwnerDocument(CoreDocument document) {
if (internalGetFlag(Flags.HAS_PARENT)) {
@@ -88,7 +88,7 @@ public abstract class CoreChildNodeMixin implements CoreChildNode {
}
owner = document;
}
-
+
@Override
public final CoreChildNode coreGetNextSiblingIfAvailable() {
return nextSibling;
@@ -98,12 +98,12 @@ public abstract class CoreChildNodeMixin implements CoreChildNode {
public final void internalSetNextSibling(CoreChildNode nextSibling) {
this.nextSibling = nextSibling;
}
-
+
@Override
public final CoreChildNode coreGetPreviousSibling() {
return previousSibling;
}
-
+
@Override
public final CoreChildNode coreGetPreviousSibling(NodeFilter filter) {
CoreChildNode sibling = coreGetPreviousSibling();
@@ -112,12 +112,12 @@ public abstract class CoreChildNodeMixin implements CoreChildNode {
}
return sibling;
}
-
+
@Override
public final void internalSetPreviousSibling(CoreChildNode previousSibling) {
this.previousSibling = previousSibling;
}
-
+
@Override
public final CoreChildNode coreGetNextSibling() throws CoreModelException {
CoreChildNode nextSibling = coreGetNextSiblingIfAvailable();
@@ -149,7 +149,7 @@ public abstract class CoreChildNodeMixin implements CoreChildNode {
}
return sibling;
}
-
+
@Override
public final void coreInsertSiblingAfter(CoreChildNode sibling) throws CoreModelException {
CoreParentNode parent = coreGetParent();
@@ -170,7 +170,7 @@ public abstract class CoreChildNodeMixin implements CoreChildNode {
sibling.internalSetNextSibling(nextSibling);
this.nextSibling = sibling;
}
-
+
@Override
public final void coreInsertSiblingBefore(CoreChildNode sibling) throws CoreModelException {
CoreParentNode parent = coreGetParent();
@@ -190,7 +190,7 @@ public abstract class CoreChildNodeMixin implements CoreChildNode {
sibling.internalSetPreviousSibling(previousSibling);
previousSibling = sibling;
}
-
+
@Override
public final void coreInsertSiblingsBefore(CoreDocumentFragment fragment) {
Content fragmentContent = fragment.internalGetContent(false);
@@ -216,18 +216,18 @@ public abstract class CoreChildNodeMixin implements CoreChildNode {
fragmentContent.firstChild = null;
fragmentContent.lastChild = null;
}
-
+
@Override
public final void coreDetach(Semantics semantics) {
internalDetach(semantics.getDetachPolicy(), null);
}
-
+
@Override
public final void coreDetach(CoreDocument newOwnerDocument) {
internalDetach(DetachPolicy.NEW_DOCUMENT, null);
owner = newOwnerDocument;
}
-
+
@Override
public final void internalDetach(DetachPolicy detachPolicy, CoreParentNode newParent) {
CoreParentNode parent = coreGetParent();
@@ -254,7 +254,8 @@ public abstract class CoreChildNodeMixin implements CoreChildNode {
}
@Override
- public final void coreReplaceWith(CoreChildNode newNode, Semantics semantics) throws CoreModelException {
+ public final void coreReplaceWith(CoreChildNode newNode, Semantics semantics)
+ throws CoreModelException {
if (newNode == this) {
return;
}
@@ -281,7 +282,9 @@ public abstract class CoreChildNodeMixin implements CoreChildNode {
}
@Override
- public final <T> CoreNode coreClone(ClonePolicy<T> policy, T options, CoreParentNode targetParent) throws CoreModelException {
+ public final <T> CoreNode coreClone(
+ ClonePolicy<T> policy, T options, CoreParentNode targetParent)
+ throws CoreModelException {
return internalClone(policy, options, targetParent);
}
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreCommentMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreCommentMixin.java
index 135729f..3a95e18 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreCommentMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreCommentMixin.java
@@ -33,13 +33,13 @@ public abstract class CoreCommentMixin implements CoreComment {
public final NodeType coreGetNodeType() {
return NodeType.COMMENT;
}
-
+
@Override
- public final <T> void init(ClonePolicy<T> policy, T options, CoreNode other) {
- }
-
+ public final <T> void init(ClonePolicy<T> policy, T options, CoreNode other) {}
+
@Override
- public final void serializeStartEvent(XmlHandler handler) throws CoreModelException, StreamException {
+ public final void serializeStartEvent(XmlHandler handler)
+ throws CoreModelException, StreamException {
handler.startComment();
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreDocumentFragmentMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreDocumentFragmentMixin.java
index 3e7b418..f370c73 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreDocumentFragmentMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreDocumentFragmentMixin.java
@@ -31,12 +31,12 @@ import org.apache.axiom.weaver.annotation.Mixin;
@Mixin
public abstract class CoreDocumentFragmentMixin implements CoreDocumentFragment {
private CoreDocument ownerDocument;
-
+
@Override
public final NodeType coreGetNodeType() {
return NodeType.DOCUMENT_FRAGMENT;
}
-
+
@Override
public final CoreNode getRootOrOwnerDocument() {
if (ownerDocument == null) {
@@ -45,18 +45,18 @@ public abstract class CoreDocumentFragmentMixin implements CoreDocumentFragment
return ownerDocument;
}
}
-
+
@Override
public final void coreSetOwnerDocument(CoreDocument document) {
ownerDocument = document;
}
-
+
@Override
- public final <T> void init(ClonePolicy<T> policy, T options, CoreNode other) {
- }
+ public final <T> void init(ClonePolicy<T> policy, T options, CoreNode other) {}
@Override
- public final void internalSerialize(XmlHandler handler, boolean cache) throws CoreModelException, StreamException {
+ public final void internalSerialize(XmlHandler handler, boolean cache)
+ throws CoreModelException, StreamException {
// TODO
throw new UnsupportedOperationException();
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreDocumentMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreDocumentMixin.java
index 333a8f6..4f5d0dc 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreDocumentMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreDocumentMixin.java
@@ -36,79 +36,79 @@ public abstract class CoreDocumentMixin implements CoreDocument {
private String xmlVersion = "1.0";
private String xmlEncoding;
private Boolean standalone;
-
+
@Override
public final NodeType coreGetNodeType() {
return NodeType.DOCUMENT;
}
-
+
@Override
public final CoreNode getRootOrOwnerDocument() {
return this;
}
-
+
@Override
public final void coreSetOwnerDocument(CoreDocument document) {
if (document != this) {
throw new IllegalArgumentException();
}
}
-
+
@Override
public final CoreElement coreGetDocumentElement() throws CoreModelException {
CoreChildNode child = coreGetFirstChild();
while (child != null) {
if (child instanceof CoreElement) {
- return (CoreElement)child;
+ return (CoreElement) child;
}
child = child.coreGetNextSibling();
}
return null;
}
-
+
@Override
public final String coreGetInputEncoding() {
return inputEncoding;
}
-
+
@Override
public final void coreSetInputEncoding(String inputEncoding) {
this.inputEncoding = inputEncoding;
}
-
+
@Override
public final String coreGetXmlVersion() {
return xmlVersion;
}
-
+
@Override
public final void coreSetXmlVersion(String xmlVersion) {
this.xmlVersion = xmlVersion;
}
-
+
@Override
public final String coreGetXmlEncoding() {
return xmlEncoding;
}
-
+
@Override
public final void coreSetXmlEncoding(String xmlEncoding) {
this.xmlEncoding = xmlEncoding;
}
-
+
@Override
public final Boolean coreGetStandalone() {
return standalone;
}
-
+
@Override
public final void coreSetStandalone(Boolean standalone) {
this.standalone = standalone;
}
-
+
@Override
public final <T> void init(ClonePolicy<T> policy, T options, CoreNode other) {
- CoreDocument o = (CoreDocument)other;
+ CoreDocument o = (CoreDocument) other;
coreSetXmlVersion(o.coreGetXmlVersion());
coreSetXmlEncoding(o.coreGetXmlEncoding());
coreSetStandalone(o.coreGetStandalone());
@@ -116,17 +116,25 @@ public abstract class CoreDocumentMixin implements CoreDocument {
}
@Override
- public final void serializeStartEvent(XmlHandler handler) throws CoreModelException, StreamException {
- handler.startDocument(coreGetInputEncoding(), coreGetXmlVersion(), coreGetXmlEncoding(), coreGetStandalone());
+ public final void serializeStartEvent(XmlHandler handler)
+ throws CoreModelException, StreamException {
+ handler.startDocument(
+ coreGetInputEncoding(),
+ coreGetXmlVersion(),
+ coreGetXmlEncoding(),
+ coreGetStandalone());
}
-
+
@Override
public final void serializeEndEvent(XmlHandler handler) throws StreamException {
handler.completed();
}
- final void internalCheckNewChild0(CoreChildNode newChild, CoreChildNode replacedChild) throws CoreModelException {
- if (newChild instanceof CoreElement && !(replacedChild instanceof CoreElement) && coreGetDocumentElement() != null) {
+ final void internalCheckNewChild0(CoreChildNode newChild, CoreChildNode replacedChild)
+ throws CoreModelException {
+ if (newChild instanceof CoreElement
+ && !(replacedChild instanceof CoreElement)
+ && coreGetDocumentElement() != null) {
throw new ChildNotAllowedException();
}
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreDocumentTypeDeclarationMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreDocumentTypeDeclarationMixin.java
index 9c44e9d..ba2244b 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreDocumentTypeDeclarationMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreDocumentTypeDeclarationMixin.java
@@ -33,55 +33,55 @@ public abstract class CoreDocumentTypeDeclarationMixin implements CoreDocumentTy
private String publicId;
private String systemId;
private String internalSubset;
-
+
@Override
public final NodeType coreGetNodeType() {
return NodeType.DOCUMENT_TYPE_DECLARATION;
}
-
+
@Override
public final String coreGetRootName() {
return rootName;
}
-
+
@Override
public final void coreSetRootName(String rootName) {
this.rootName = rootName;
}
-
+
@Override
public final String coreGetPublicId() {
return publicId;
}
-
+
@Override
public final void coreSetPublicId(String publicId) {
this.publicId = publicId;
}
-
+
@Override
public final String coreGetSystemId() {
return systemId;
}
-
+
@Override
public final void coreSetSystemId(String systemId) {
this.systemId = systemId;
}
-
+
@Override
public final String coreGetInternalSubset() {
return internalSubset;
}
-
+
@Override
public final void coreSetInternalSubset(String internalSubset) {
this.internalSubset = internalSubset;
}
-
+
@Override
public final <T> void init(ClonePolicy<T> policy, T options, CoreNode other) {
- CoreDocumentTypeDeclaration o = (CoreDocumentTypeDeclaration)other;
+ CoreDocumentTypeDeclaration o = (CoreDocumentTypeDeclaration) other;
coreSetRootName(o.coreGetRootName());
coreSetPublicId(o.coreGetPublicId());
coreSetSystemId(o.coreGetSystemId());
@@ -89,7 +89,9 @@ public abstract class CoreDocumentTypeDeclarationMixin implements CoreDocumentTy
}
@Override
- public final void internalSerialize(XmlHandler handler, boolean cache) throws CoreModelException, StreamException {
- handler.processDocumentTypeDeclaration(coreGetRootName(), coreGetPublicId(), coreGetSystemId(), coreGetInternalSubset());
+ public final void internalSerialize(XmlHandler handler, boolean cache)
+ throws CoreModelException, StreamException {
+ handler.processDocumentTypeDeclaration(
+ coreGetRootName(), coreGetPublicId(), coreGetSystemId(), coreGetInternalSubset());
}
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreElementMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreElementMixin.java
index be7cd20..3814f0f 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreElementMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreElementMixin.java
@@ -59,7 +59,8 @@ public abstract class CoreElementMixin implements CoreElement {
}
@Override
- public final CoreAttribute coreGetAttribute(AttributeMatcher matcher, String namespaceURI, String name) {
+ public final CoreAttribute coreGetAttribute(
+ AttributeMatcher matcher, String namespaceURI, String name) {
CoreAttribute attr = coreGetFirstAttribute();
while (attr != null && !matcher.matches(attr, namespaceURI, name)) {
attr = attr.coreGetNextAttribute();
@@ -80,7 +81,9 @@ public abstract class CoreElementMixin implements CoreElement {
}
@Override
- public final void coreSetAttribute(AttributeMatcher matcher, String namespaceURI, String name, String prefix, String value) throws CoreModelException {
+ public final void coreSetAttribute(
+ AttributeMatcher matcher, String namespaceURI, String name, String prefix, String value)
+ throws CoreModelException {
CoreAttribute attr = firstAttribute;
CoreAttribute previousAttr = null;
while (attr != null && !matcher.matches(attr, namespaceURI, name)) {
@@ -88,7 +91,9 @@ public abstract class CoreElementMixin implements CoreElement {
attr = attr.coreGetNextAttribute();
}
if (attr == null) {
- CoreAttribute newAttr = matcher.createAttribute(coreGetNodeFactory().getFactory2(), namespaceURI, name, prefix, value);
+ CoreAttribute newAttr =
+ matcher.createAttribute(
+ coreGetNodeFactory().getFactory2(), namespaceURI, name, prefix, value);
if (previousAttr == null) {
coreAppendAttribute(newAttr);
} else {
@@ -98,16 +103,17 @@ public abstract class CoreElementMixin implements CoreElement {
matcher.update(attr, prefix, value);
}
}
-
+
@Override
- public final CoreAttribute coreSetAttribute(AttributeMatcher matcher, CoreAttribute attr, Semantics semantics) {
+ public final CoreAttribute coreSetAttribute(
+ AttributeMatcher matcher, CoreAttribute attr, Semantics semantics) {
if (attr.coreGetOwnerElement() == this) {
// TODO: document this and add assertion
return attr;
}
attr.internalRemove(null, this);
String namespaceURI = matcher.getNamespaceURI(attr);
- String name = matcher.getName(attr);
+ String name = matcher.getName(attr);
CoreAttribute existingAttr = coreGetFirstAttribute();
CoreAttribute previousAttr = null;
while (existingAttr != null && !matcher.matches(existingAttr, namespaceURI, name)) {
@@ -126,7 +132,8 @@ public abstract class CoreElementMixin implements CoreElement {
} else {
previousAttr.internalSetNextAttribute(attr);
}
- existingAttr.internalUnsetOwnerElement(semantics.getDetachPolicy().getNewOwnerDocument(this));
+ existingAttr.internalUnsetOwnerElement(
+ semantics.getDetachPolicy().getNewOwnerDocument(this));
attr.internalSetNextAttribute(existingAttr.coreGetNextAttribute());
existingAttr.internalSetNextAttribute(null);
}
@@ -134,7 +141,8 @@ public abstract class CoreElementMixin implements CoreElement {
}
@Override
- public final boolean coreRemoveAttribute(AttributeMatcher matcher, String namespaceURI, String name, Semantics semantics) {
+ public final boolean coreRemoveAttribute(
+ AttributeMatcher matcher, String namespaceURI, String name, Semantics semantics) {
CoreAttribute att = coreGetAttribute(matcher, namespaceURI, name);
if (att != null) {
att.coreRemove(semantics);
@@ -145,23 +153,27 @@ public abstract class CoreElementMixin implements CoreElement {
}
@Override
- public final <T extends CoreAttribute,S> Iterator<S> coreGetAttributesByType(Class<T> type, Mapper<S,? super T> mapper, Semantics semantics) {
+ public final <T extends CoreAttribute, S> Iterator<S> coreGetAttributesByType(
+ Class<T> type, Mapper<S, ? super T> mapper, Semantics semantics) {
return AttributeIterator.create(this, type, mapper, semantics);
}
public abstract String getImplicitNamespaceURI(String prefix);
-
+
@Override
- public final String coreLookupNamespaceURI(String prefix, Semantics semantics) throws CoreModelException {
+ public final String coreLookupNamespaceURI(String prefix, Semantics semantics)
+ throws CoreModelException {
if (!semantics.isUseStrictNamespaceLookup()) {
String namespaceURI = getImplicitNamespaceURI(prefix);
if (namespaceURI != null) {
return namespaceURI;
}
}
- for (CoreAttribute attr = coreGetFirstAttribute(); attr != null; attr = attr.coreGetNextAttribute()) {
+ for (CoreAttribute attr = coreGetFirstAttribute();
+ attr != null;
+ attr = attr.coreGetNextAttribute()) {
if (attr instanceof CoreNamespaceDeclaration) {
- CoreNamespaceDeclaration decl = (CoreNamespaceDeclaration)attr;
+ CoreNamespaceDeclaration decl = (CoreNamespaceDeclaration) attr;
if (prefix.equals(decl.coreGetDeclaredPrefix())) {
return decl.coreGetCharacterData().toString();
}
@@ -178,9 +190,10 @@ public abstract class CoreElementMixin implements CoreElement {
}
public abstract String getImplicitPrefix(String namespaceURI);
-
+
@Override
- public final String coreLookupPrefix(String namespaceURI, Semantics semantics) throws CoreModelException {
+ public final String coreLookupPrefix(String namespaceURI, Semantics semantics)
+ throws CoreModelException {
if (namespaceURI == null) {
throw new IllegalArgumentException("namespaceURI must not be null");
}
@@ -190,9 +203,11 @@ public abstract class CoreElementMixin implements CoreElement {
return prefix;
}
}
- for (CoreAttribute attr = coreGetFirstAttribute(); attr != null; attr = attr.coreGetNextAttribute()) {
+ for (CoreAttribute attr = coreGetFirstAttribute();
+ attr != null;
+ attr = attr.coreGetNextAttribute()) {
if (attr instanceof CoreNamespaceDeclaration) {
- CoreNamespaceDeclaration decl = (CoreNamespaceDeclaration)attr;
+ CoreNamespaceDeclaration decl = (CoreNamespaceDeclaration) attr;
if (decl.coreGetCharacterData().toString().equals(namespaceURI)) {
return decl.coreGetDeclaredPrefix();
}
@@ -203,12 +218,15 @@ public abstract class CoreElementMixin implements CoreElement {
String prefix = parentElement.coreLookupPrefix(namespaceURI, semantics);
// The prefix declared on one of the ancestors may be masked by another
// namespace declaration on this element (or one of its descendants).
- if (!semantics.isUseStrictNamespaceLookup() && getImplicitNamespaceURI(prefix) != null) {
+ if (!semantics.isUseStrictNamespaceLookup()
+ && getImplicitNamespaceURI(prefix) != null) {
return null;
}
- for (CoreAttribute attr = coreGetFirstAttribute(); attr != null; attr = attr.coreGetNextAttribute()) {
+ for (CoreAttribute attr = coreGetFirstAttribute();
+ attr != null;
+ attr = attr.coreGetNextAttribute()) {
if (attr instanceof CoreNamespaceDeclaration) {
- CoreNamespaceDeclaration decl = (CoreNamespaceDeclaration)attr;
+ CoreNamespaceDeclaration decl = (CoreNamespaceDeclaration) attr;
if (decl.coreGetDeclaredPrefix().equals(prefix)) {
return null;
}
@@ -221,27 +239,28 @@ public abstract class CoreElementMixin implements CoreElement {
}
@Override
- public final <T> void init(ClonePolicy<T> policy, T options, CoreNode other) throws CoreModelException {
- CoreElement o = (CoreElement)other;
+ public final <T> void init(ClonePolicy<T> policy, T options, CoreNode other)
+ throws CoreModelException {
+ CoreElement o = (CoreElement) other;
initSource(policy, options, o);
initName(o);
if (isExpanded()) {
CoreAttribute attr = o.coreGetFirstAttribute();
while (attr != null) {
- coreAppendAttribute((CoreAttribute)attr.coreClone(policy, options));
+ coreAppendAttribute((CoreAttribute) attr.coreClone(policy, options));
// TODO: needed?
-// clonedAttr.coreSetSpecified(attr.coreGetSpecified());
+ // clonedAttr.coreSetSpecified(attr.coreGetSpecified());
attr = attr.coreGetNextAttribute();
}
}
}
// This is basically a hook for OMSourcedElement
- public <T> void initSource(ClonePolicy<T> policy, T options, CoreElement other) {
- }
-
+ public <T> void initSource(ClonePolicy<T> policy, T options, CoreElement other) {}
+
@Override
- public final void corePromote(CoreElement newElement, Semantics semantics) throws CoreModelException {
+ public final void corePromote(CoreElement newElement, Semantics semantics)
+ throws CoreModelException {
newElement.initName(this);
newElement.internalSetFirstAttribute(firstAttribute);
CoreAttribute attr = firstAttribute;
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreEntityReferenceMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreEntityReferenceMixin.java
index afe2424..e45daaf 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreEntityReferenceMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreEntityReferenceMixin.java
@@ -30,35 +30,35 @@ import org.apache.axiom.weaver.annotation.Mixin;
public abstract class CoreEntityReferenceMixin implements CoreEntityReference {
private String name;
private String replacementText;
-
+
@Override
public final NodeType coreGetNodeType() {
return NodeType.ENTITY_REFERENCE;
}
-
+
@Override
public final String coreGetName() {
return name;
}
-
+
@Override
public final void coreSetName(String name) {
this.name = name;
}
-
+
@Override
public final String coreGetReplacementText() {
return replacementText;
}
-
+
@Override
public final void coreSetReplacementText(String replacementText) {
this.replacementText = replacementText;
}
-
+
@Override
public final <T> void init(ClonePolicy<T> policy, T options, CoreNode other) {
- CoreEntityReference o = (CoreEntityReference)other;
+ CoreEntityReference o = (CoreEntityReference) other;
coreSetName(o.coreGetName());
coreSetReplacementText(o.coreGetReplacementText());
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreLeafNodeMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreLeafNodeMixin.java
index 44ad5d5..d8fc89f 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreLeafNodeMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreLeafNodeMixin.java
@@ -26,6 +26,6 @@ import org.apache.axiom.weaver.annotation.Mixin;
@Mixin
public abstract class CoreLeafNodeMixin implements CoreLeafNode {
@Override
- public final <T> void cloneChildrenIfNecessary(ClonePolicy<T> policy, T options, CoreNode clone) {
- }
+ public final <T> void cloneChildrenIfNecessary(
+ ClonePolicy<T> policy, T options, CoreNode clone) {}
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreMixedContentContainerMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreMixedContentContainerMixin.java
index 6077327..41e6224 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreMixedContentContainerMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreMixedContentContainerMixin.java
@@ -26,7 +26,8 @@ import org.apache.axiom.weaver.annotation.Mixin;
@Mixin
public abstract class CoreMixedContentContainerMixin implements CoreMixedContentContainer {
@Override
- public final Object coreGetCharacterData(ElementAction elementAction) throws CoreModelException {
+ public final Object coreGetCharacterData(ElementAction elementAction)
+ throws CoreModelException {
return internalGetCharacterData(elementAction);
}
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSAwareAttributeMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSAwareAttributeMixin.java
index bcb0a67..a1c725f 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSAwareAttributeMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSAwareAttributeMixin.java
@@ -33,7 +33,14 @@ public abstract class CoreNSAwareAttributeMixin implements CoreNSAwareAttribute
}
@Override
- public final void internalSerialize(XmlHandler handler, boolean cache) throws CoreModelException, StreamException {
- handler.processAttribute(coreGetNamespaceURI(), coreGetLocalName(), coreGetPrefix(), coreGetCharacterData().toString(), coreGetType(), coreGetSpecified());
+ public final void internalSerialize(XmlHandler handler, boolean cache)
+ throws CoreModelException, StreamException {
+ handler.processAttribute(
+ coreGetNamespaceURI(),
+ coreGetLocalName(),
+ coreGetPrefix(),
+ coreGetCharacterData().toString(),
+ coreGetType(),
+ coreGetSpecified());
}
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSAwareElementMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSAwareElementMixin.java
index bb639f4..bf99399 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSAwareElementMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSAwareElementMixin.java
@@ -32,7 +32,7 @@ public abstract class CoreNSAwareElementMixin implements CoreNSAwareElement {
public final NodeType coreGetNodeType() {
return NodeType.NS_AWARE_ELEMENT;
}
-
+
public final String getImplicitNamespaceURI(String prefix) {
return prefix.equals(coreGetPrefix()) ? coreGetNamespaceURI() : null;
}
@@ -40,14 +40,15 @@ public abstract class CoreNSAwareElementMixin implements CoreNSAwareElement {
public final String getImplicitPrefix(String namespaceURI) {
return namespaceURI.equals(coreGetNamespaceURI()) ? coreGetPrefix() : null;
}
-
+
@Override
public XmlInput getXmlInput(boolean cache, boolean incremental) throws StreamException {
return null;
}
-
+
@Override
- public final void serializeStartEvent(XmlHandler handler) throws CoreModelException, StreamException {
+ public final void serializeStartEvent(XmlHandler handler)
+ throws CoreModelException, StreamException {
handler.startElement(coreGetNamespaceURI(), coreGetLocalName(), coreGetPrefix());
}
@@ -57,6 +58,5 @@ public abstract class CoreNSAwareElementMixin implements CoreNSAwareElement {
}
@Override
- public void validateName(String staxPrefix, String staxLocalName, String staxNamespaceURI) {
- }
+ public void validateName(String staxPrefix, String staxLocalName, String staxNamespaceURI) {}
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSUnawareAttributeMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSUnawareAttributeMixin.java
index 088645b..46321e5 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSUnawareAttributeMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSUnawareAttributeMixin.java
@@ -33,7 +33,8 @@ public abstract class CoreNSUnawareAttributeMixin implements CoreNSUnawareAttrib
}
@Override
- public final void internalSerialize(XmlHandler handler, boolean cache) throws CoreModelException, StreamException {
+ public final void internalSerialize(XmlHandler handler, boolean cache)
+ throws CoreModelException, StreamException {
// TODO
throw new UnsupportedOperationException();
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSUnawareElementMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSUnawareElementMixin.java
index c118fd6..144aa59 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSUnawareElementMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSUnawareElementMixin.java
@@ -32,7 +32,7 @@ public abstract class CoreNSUnawareElementMixin implements CoreNSUnawareElement
public final NodeType coreGetNodeType() {
return NodeType.NS_UNAWARE_ELEMENT;
}
-
+
public final String getImplicitNamespaceURI(String prefix) {
return null;
}
@@ -40,13 +40,14 @@ public abstract class CoreNSUnawareElementMixin implements CoreNSUnawareElement
public final String getImplicitPrefix(String namespaceURI) {
return null;
}
-
+
final void copyName(CoreElement clone) {
- ((CoreNSUnawareElement)clone).coreSetName(coreGetName());
+ ((CoreNSUnawareElement) clone).coreSetName(coreGetName());
}
@Override
- public final void internalSerialize(XmlHandler handler, boolean cache) throws CoreModelException, StreamException {
+ public final void internalSerialize(XmlHandler handler, boolean cache)
+ throws CoreModelException, StreamException {
// TODO
throw new UnsupportedOperationException();
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSUnawareNamedNodeMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSUnawareNamedNodeMixin.java
index 52b3065..f19d95c 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSUnawareNamedNodeMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNSUnawareNamedNodeMixin.java
@@ -30,14 +30,14 @@ public abstract class CoreNSUnawareNamedNodeMixin implements CoreNSUnawareNamedN
public final String coreGetName() {
return name;
}
-
+
@Override
public final void coreSetName(String name) {
this.name = name;
}
-
+
@Override
public final void initName(CoreNamedNode other) {
- coreSetName(((CoreNSUnawareNamedNode)other).coreGetName());
+ coreSetName(((CoreNSUnawareNamedNode) other).coreGetName());
}
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNamespaceDeclarationMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNamespaceDeclarationMixin.java
index d52301d..dd2a19a 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNamespaceDeclarationMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNamespaceDeclarationMixin.java
@@ -33,15 +33,17 @@ public abstract class CoreNamespaceDeclarationMixin implements CoreNamespaceDecl
public final NodeType coreGetNodeType() {
return NodeType.NAMESPACE_DECLARATION;
}
-
+
@Override
public final <T> void init(ClonePolicy<T> policy, T options, CoreNode other) {
// TODO: this is correct but bad for performance with the Axiom API
- coreSetDeclaredNamespace(((CoreNamespaceDeclaration)other).coreGetDeclaredPrefix(), "");
+ coreSetDeclaredNamespace(((CoreNamespaceDeclaration) other).coreGetDeclaredPrefix(), "");
}
-
+
@Override
- public final void internalSerialize(XmlHandler handler, boolean cache) throws CoreModelException, StreamException {
- handler.processNamespaceDeclaration(coreGetDeclaredPrefix(), coreGetCharacterData().toString());
+ public final void internalSerialize(XmlHandler handler, boolean cache)
+ throws CoreModelException, StreamException {
+ handler.processNamespaceDeclaration(
+ coreGetDeclaredPrefix(), coreGetCharacterData().toString());
}
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNodeMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNodeMixin.java
index f8a7d5b..4bc6caa 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNodeMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreNodeMixin.java
@@ -35,12 +35,12 @@ public abstract class CoreNodeMixin implements CoreNode {
public Class<? extends CoreNode> coreGetNodeClass() {
return coreGetNodeType().getInterface();
}
-
+
@Override
public final CoreDocument coreGetOwnerDocument(boolean create) {
CoreNode root = getRootOrOwnerDocument();
if (root instanceof CoreDocument) {
- return (CoreDocument)root;
+ return (CoreDocument) root;
} else if (create) {
CoreDocument ownerDocument = root.coreGetNodeFactory().getFactory2().createDocument();
root.coreSetOwnerDocument(ownerDocument);
@@ -49,7 +49,7 @@ public abstract class CoreNodeMixin implements CoreNode {
return null;
}
}
-
+
@Override
public final boolean coreHasSameOwnerDocument(CoreNode other) {
return other.getRootOrOwnerDocument() == getRootOrOwnerDocument();
@@ -68,7 +68,7 @@ public abstract class CoreNodeMixin implements CoreNode {
flags &= ~flag;
}
}
-
+
@Override
public final int internalGetFlags(int mask) {
return flags & mask;
@@ -78,9 +78,10 @@ public abstract class CoreNodeMixin implements CoreNode {
public final void internalSetFlags(int mask, int value) {
flags = (flags & ~mask) | value;
}
-
+
// TODO: merge this into internalClone once it is no longer referenced elsewhere
- public final <T> CoreNode shallowClone(ClonePolicy<T> policy, T options) throws CoreModelException {
+ public final <T> CoreNode shallowClone(ClonePolicy<T> policy, T options)
+ throws CoreModelException {
CoreNode clone = coreGetNodeFactory().createNode(policy.getTargetNodeClass(options, this));
clone.init(policy, options, this);
clone.initAncillaryData(policy, options, this);
@@ -88,22 +89,24 @@ public abstract class CoreNodeMixin implements CoreNode {
}
@Override
- public final <T> CoreNode internalClone(ClonePolicy<T> policy, T options, CoreParentNode targetParent) throws CoreModelException {
+ public final <T> CoreNode internalClone(
+ ClonePolicy<T> policy, T options, CoreParentNode targetParent)
+ throws CoreModelException {
CoreNode clone = shallowClone(policy, options);
if (targetParent != null) {
- targetParent.coreAppendChild((CoreChildNode)clone);
+ targetParent.coreAppendChild((CoreChildNode) clone);
}
policy.postProcess(options, clone);
cloneChildrenIfNecessary(policy, options, clone);
return clone;
}
-
+
@Override
- public final <T> CoreNode coreClone(ClonePolicy<T> policy, T options) throws CoreModelException {
+ public final <T> CoreNode coreClone(ClonePolicy<T> policy, T options)
+ throws CoreModelException {
return internalClone(policy, options, null);
}
-
+
@Override
- public <T> void initAncillaryData(ClonePolicy<T> policy, T options, CoreNode other) {
- }
+ public <T> void initAncillaryData(ClonePolicy<T> policy, T options, CoreNode other) {}
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreParentNodeMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreParentNodeMixin.java
index 1be6a1d..70b4f9c 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreParentNodeMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreParentNodeMixin.java
@@ -58,13 +58,13 @@ import org.apache.axiom.weaver.annotation.Mixin;
public abstract class CoreParentNodeMixin implements CoreParentNode {
private InputContext context;
private Object content;
-
+
// TODO: rename
@Override
public final int getState() {
return internalGetFlags(Flags.STATE_MASK);
}
-
+
@Override
public final void coreSetState(int state) {
internalSetFlags(Flags.STATE_MASK, state);
@@ -72,14 +72,14 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
completed();
}
}
-
+
public void completed() {}
-
+
@Override
public boolean isExpanded() {
return true;
}
-
+
@Override
public void forceExpand() {}
@@ -99,8 +99,12 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
this.context = context;
if (context == null) {
switch (getState()) {
- case INCOMPLETE: coreSetState(COMPLETE); break;
- case DISCARDING: coreSetState(DISCARDED); break;
+ case INCOMPLETE:
+ coreSetState(COMPLETE);
+ break;
+ case DISCARDING:
+ coreSetState(DISCARDED);
+ break;
}
} else {
coreSetState(INCOMPLETE);
@@ -121,7 +125,8 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
public final Content internalGetContent(boolean create) {
if (getState() == COMPACT) {
Content content = new Content();
- CoreCharacterDataNode cdata = coreGetNodeFactory().getFactory2().createCharacterDataNode();
+ CoreCharacterDataNode cdata =
+ coreGetNodeFactory().getFactory2().createCharacterDataNode();
cdata.internalSetParent(this);
cdata.coreSetCharacterData(this.content);
content.firstChild = cdata;
@@ -130,7 +135,7 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
coreSetState(COMPLETE);
return content;
} else {
- Content content = (Content)this.content;
+ Content content = (Content) this.content;
if (content == null && create) {
content = new Content();
this.content = content;
@@ -138,7 +143,7 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
return content;
}
}
-
+
@Override
public final CoreChildNode coreGetFirstChildIfAvailable() {
forceExpand();
@@ -162,9 +167,9 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
// If the builder is suddenly complete, but the completion status of the node
// doesn't change, then this means that we built the wrong nodes
throw new IllegalStateException("Builder is already complete");
- }
+ }
}
-
+
@Override
public CoreChildNode coreGetFirstChild() throws CoreModelException {
CoreChildNode firstChild = coreGetFirstChildIfAvailable();
@@ -191,7 +196,7 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
}
return child;
}
-
+
@Override
public final CoreChildNode coreGetLastChild() throws CoreModelException {
coreBuild();
@@ -206,9 +211,10 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
}
return child;
}
-
+
@Override
- public final void internalCheckNewChild(CoreChildNode newChild, CoreChildNode replacedChild) throws CoreModelException {
+ public final void internalCheckNewChild(CoreChildNode newChild, CoreChildNode replacedChild)
+ throws CoreModelException {
// Check that the new node is not an ancestor of this node
CoreParentNode current = this;
do {
@@ -216,7 +222,7 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
throw new CyclicRelationshipException();
}
if (current instanceof CoreChildNode) {
- current = ((CoreChildNode)current).coreGetParent();
+ current = ((CoreChildNode) current).coreGetParent();
} else {
break;
}
@@ -226,10 +232,10 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
}
internalCheckNewChild0(newChild, replacedChild);
}
-
- void internalCheckNewChild0(CoreChildNode newChild, CoreChildNode replacedChild) throws CoreModelException {
- }
-
+
+ void internalCheckNewChild0(CoreChildNode newChild, CoreChildNode replacedChild)
+ throws CoreModelException {}
+
@Override
public final void coreAppendChild(CoreChildNode child) throws CoreModelException {
internalCheckNewChild(child, null);
@@ -237,13 +243,13 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
coreBuild();
internalAppendChildWithoutBuild(child);
}
-
+
@Override
public final void internalAppendChildWithoutBuild(CoreChildNode child) {
CoreParentNode parent = child.coreGetParent();
Content content = internalGetContent(true);
if (parent == this && child == content.lastChild) {
- // The child is already the last node.
+ // The child is already the last node.
// We don't need to detach and re-add it.
return;
}
@@ -291,7 +297,7 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
CoreChildNode child = coreGetFirstChildIfAvailable();
while (child != null) {
if (child instanceof CoreParentNode) {
- ((CoreParentNode)child).coreDiscard(consumeInput);
+ ((CoreParentNode) child).coreDiscard(consumeInput);
}
child = child.coreGetNextSiblingIfAvailable();
}
@@ -312,13 +318,14 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
coreSetState(COMPLETE);
content = null;
} else {
- // We need to call this first because if may modify the state (applies to OMSourcedElements)
+ // We need to call this first because if may modify the state (applies to
+ // OMSourcedElements)
CoreChildNode child = coreGetFirstChildIfAvailable();
boolean updateState;
if (getState() == INCOMPLETE) {
CoreChildNode lastChild = coreGetLastKnownChild();
if (lastChild instanceof CoreParentNode) {
- ((CoreParentNode)lastChild).coreBuild();
+ ((CoreParentNode) lastChild).coreBuild();
}
context.discard();
updateState = true;
@@ -326,7 +333,8 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
updateState = false;
}
if (child != null) {
- CoreDocument newOwnerDocument = semantics.getDetachPolicy().getNewOwnerDocument(this);
+ CoreDocument newOwnerDocument =
+ semantics.getDetachPolicy().getNewOwnerDocument(this);
do {
CoreChildNode nextSibling = child.coreGetNextSiblingIfAvailable();
child.internalSetPreviousSibling(null);
@@ -341,9 +349,10 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
}
}
}
-
+
@Override
- public final Object internalGetCharacterData(ElementAction elementAction) throws CoreModelException {
+ public final Object internalGetCharacterData(ElementAction elementAction)
+ throws CoreModelException {
if (getState() == COMPACT) {
return content;
} else {
@@ -360,7 +369,7 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
case RETURN_NULL:
return null;
case RECURSE:
- CoreChildNode firstChild = ((CoreElement)child).coreGetFirstChild();
+ CoreChildNode firstChild = ((CoreElement) child).coreGetFirstChild();
if (firstChild != null) {
child = firstChild;
depth++;
@@ -371,14 +380,18 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
// Just continue
}
} else {
- if (child instanceof CoreCharacterDataNode || child instanceof CoreCDATASection) {
- Object textValue = ((CoreCharacterDataContainer)child).coreGetCharacterData();
- if (textValue instanceof CharacterData || ((String)textValue).length() != 0) {
+ if (child instanceof CoreCharacterDataNode
+ || child instanceof CoreCDATASection) {
+ Object textValue =
+ ((CoreCharacterDataContainer) child).coreGetCharacterData();
+ if (textValue instanceof CharacterData
+ || ((String) textValue).length() != 0) {
if (textContent == null) {
// This is the first non empty text node. Just save the string.
textContent = textValue;
} else {
- // We've already seen a non empty text node before. Concatenate using
+ // We've already seen a non empty text node before. Concatenate
+ // using
// a StringBuilder.
if (buffer == null) {
// This is the first text node we need to append. Initialize the
@@ -393,7 +406,7 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
CoreChildNode nextSibling = child.coreGetNextSibling();
if (depth > 0 && nextSibling == null) {
depth--;
- child = (CoreChildNode)child.coreGetParent();
+ child = (CoreChildNode) child.coreGetParent();
visited = true;
} else {
child = nextSibling;
@@ -409,34 +422,45 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
}
}
}
-
+
@Override
- public final void coreSetCharacterData(Object data, Semantics semantics) throws CoreModelException {
+ public final void coreSetCharacterData(Object data, Semantics semantics)
+ throws CoreModelException {
coreRemoveChildren(semantics);
- if (data != null && (data instanceof CharacterData || ((String)data).length() > 0)) {
+ if (data != null && (data instanceof CharacterData || ((String) data).length() > 0)) {
coreSetState(COMPACT);
content = data;
}
}
-
+
@Override
- public final <T extends CoreNode,S> NodeIterator<S> coreGetNodes(Axis axis, Class<T> type, Mapper<S,? super T> mapper, Semantics semantics) {
- return new NodesIterator<T,S>(this, axis, type, mapper, semantics);
+ public final <T extends CoreNode, S> NodeIterator<S> coreGetNodes(
+ Axis axis, Class<T> type, Mapper<S, ? super T> mapper, Semantics semantics) {
+ return new NodesIterator<T, S>(this, axis, type, mapper, semantics);
}
-
+
@Override
- public final <T extends CoreElement,S> NodeIterator<S> coreGetElements(Axis axis, Class<T> type, ElementMatcher<? super T> matcher, String namespaceURI, String name, Mapper<S,? super T> mapper, Semantics semantics) {
- return new ElementsIterator<T,S>(this, axis, type, matcher, namespaceURI, name, mapper, semantics);
+ public final <T extends CoreElement, S> NodeIterator<S> coreGetElements(
+ Axis axis,
+ Class<T> type,
+ ElementMatcher<? super T> matcher,
+ String namespaceURI,
+ String name,
+ Mapper<S, ? super T> mapper,
+ Semantics semantics) {
+ return new ElementsIterator<T, S>(
+ this, axis, type, matcher, namespaceURI, name, mapper, semantics);
}
@Override
- public final <T> void cloneChildrenIfNecessary(ClonePolicy<T> policy, T options, CoreNode clone) throws CoreModelException {
- CoreParentNode targetParent = (CoreParentNode)clone;
+ public final <T> void cloneChildrenIfNecessary(ClonePolicy<T> policy, T options, CoreNode clone)
+ throws CoreModelException {
+ CoreParentNode targetParent = (CoreParentNode) clone;
if (policy.cloneChildren(options, coreGetNodeType()) && targetParent.isExpanded()) {
if (getState() == COMPACT) {
Object content = this.content;
if (content instanceof CloneableCharacterData) {
- content = ((CloneableCharacterData)content).clone(policy, options);
+ content = ((CloneableCharacterData) content).clone(policy, options);
}
targetParent.coreSetCharacterData(content, null);
} else {
@@ -463,9 +487,10 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
public final XmlReader coreGetReader(XmlHandler handler, boolean cache, boolean incremental) {
return new TreeWalkerImpl(handler, this, cache, incremental);
}
-
+
@Override
- public void internalSerialize(XmlHandler handler, boolean cache) throws CoreModelException, StreamException {
+ public void internalSerialize(XmlHandler handler, boolean cache)
+ throws CoreModelException, StreamException {
try {
XmlReader reader = coreGetReader(handler, cache, false);
while (!reader.proceed()) {
@@ -475,7 +500,7 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
throw ex.getCoreModelException();
}
}
-
+
@Override
public final void coreBuild() throws CoreModelException {
switch (getState()) {
@@ -491,9 +516,10 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
}
}
}
-
+
@Override
- public final void coreMoveChildrenFrom(CoreParentNode other, Semantics semantics) throws CoreModelException {
+ public final void coreMoveChildrenFrom(CoreParentNode other, Semantics semantics)
+ throws CoreModelException {
coreRemoveChildren(semantics);
context = other.coreGetInputContext();
content = other.internalGetContent();
@@ -505,7 +531,7 @@ public abstract class CoreParentNodeMixin implements CoreParentNode {
child.internalSetParent(this);
child = child.coreGetNextSiblingIfAvailable();
}
- if (context != null ) {
+ if (context != null) {
context.setTarget(this);
}
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreProcessingInstructionMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreProcessingInstructionMixin.java
index 0a591de..b4825a4 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreProcessingInstructionMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreProcessingInstructionMixin.java
@@ -35,24 +35,25 @@ public abstract class CoreProcessingInstructionMixin implements CoreProcessingIn
public final NodeType coreGetNodeType() {
return NodeType.PROCESSING_INSTRUCTION;
}
-
+
@Override
public final String coreGetTarget() {
return target;
}
-
+
@Override
public final void coreSetTarget(String target) {
this.target = target;
}
-
+
@Override
public final <T> void init(ClonePolicy<T> policy, T options, CoreNode other) {
- target = ((CoreProcessingInstruction)other).coreGetTarget();
+ target = ((CoreProcessingInstruction) other).coreGetTarget();
}
-
+
@Override
- public final void serializeStartEvent(XmlHandler handler) throws CoreModelException, StreamException {
+ public final void serializeStartEvent(XmlHandler handler)
+ throws CoreModelException, StreamException {
handler.startProcessingInstruction(coreGetTarget());
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreTypedAttributeMixin.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreTypedAttributeMixin.java
index 35c5a49..0266fc4 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreTypedAttributeMixin.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/CoreTypedAttributeMixin.java
@@ -26,20 +26,20 @@ import org.apache.axiom.weaver.annotation.Mixin;
@Mixin
public abstract class CoreTypedAttributeMixin implements CoreTypedAttribute {
private String type;
-
+
@Override
public final String coreGetType() {
return type;
}
-
+
@Override
public final void coreSetType(String type) {
this.type = type;
}
-
+
@Override
public final <T> void init(ClonePolicy<T> policy, T options, CoreNode other) {
- CoreTypedAttribute o = (CoreTypedAttribute)other;
+ CoreTypedAttribute o = (CoreTypedAttribute) other;
initName(o);
coreSetType(o.coreGetType());
}
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/package-info.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/package-info.java
index 98cc8fa..39607cf 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/package-info.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/impl/mixin/package-info.java
@@ -16,29 +16,30 @@
* specific language governing permissions and limitations
* under the License.
*/
-@org.apache.axiom.weaver.annotation.WeavablePackage(mixins={
- CoreAttributeMixin.class,
- CoreCDATASectionMixin.class,
- CoreCharacterDataContainingParentNodeMixin.class,
- CoreCharacterDataNodeMixin.class,
- CoreChildNodeMixin.class,
- CoreCommentMixin.class,
- CoreDocumentFragmentMixin.class,
- CoreDocumentMixin.class,
- CoreDocumentTypeDeclarationMixin.class,
- CoreElementMixin.class,
- CoreEntityReferenceMixin.class,
- CoreLeafNodeMixin.class,
- CoreMixedContentContainerMixin.class,
- CoreNSAwareAttributeMixin.class,
- CoreNSAwareElementMixin.class,
- CoreNSUnawareAttributeMixin.class,
- CoreNSUnawareElementMixin.class,
- CoreNSUnawareNamedNodeMixin.class,
- CoreNamespaceDeclarationMixin.class,
- CoreNodeMixin.class,
- CoreParentNodeMixin.class,
- CoreProcessingInstructionMixin.class,
- CoreTypedAttributeMixin.class,
-})
+@org.apache.axiom.weaver.annotation.WeavablePackage(
+ mixins = {
+ CoreAttributeMixin.class,
+ CoreCDATASectionMixin.class,
+ CoreCharacterDataContainingParentNodeMixin.class,
+ CoreCharacterDataNodeMixin.class,
+ CoreChildNodeMixin.class,
+ CoreCommentMixin.class,
+ CoreDocumentFragmentMixin.class,
+ CoreDocumentMixin.class,
+ CoreDocumentTypeDeclarationMixin.class,
+ CoreElementMixin.class,
+ CoreEntityReferenceMixin.class,
+ CoreLeafNodeMixin.class,
+ CoreMixedContentContainerMixin.class,
+ CoreNSAwareAttributeMixin.class,
+ CoreNSAwareElementMixin.class,
+ CoreNSUnawareAttributeMixin.class,
+ CoreNSUnawareElementMixin.class,
+ CoreNSUnawareNamedNodeMixin.class,
+ CoreNamespaceDeclarationMixin.class,
+ CoreNodeMixin.class,
+ CoreParentNodeMixin.class,
+ CoreProcessingInstructionMixin.class,
+ CoreTypedAttributeMixin.class,
+ })
package org.apache.axiom.core.impl.mixin;
diff --git a/mixins/core-mixins/src/main/java/org/apache/axiom/core/util/TopologicalSort.java b/mixins/core-mixins/src/main/java/org/apache/axiom/core/util/TopologicalSort.java
index f9d984d..b497c5c 100644
--- a/mixins/core-mixins/src/main/java/org/apache/axiom/core/util/TopologicalSort.java
+++ b/mixins/core-mixins/src/main/java/org/apache/axiom/core/util/TopologicalSort.java
@@ -24,13 +24,16 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
-/**
- * Implements topological sorting.
- */
+/** Implements topological sorting. */
public final class TopologicalSort {
private TopologicalSort() {}
-
- private static <T> void visit(Collection<T> vertices, EdgeRelation<? super T> edgeRelation, List<T> result, Set<T> visited, T vertex) {
+
+ private static <T> void visit(
+ Collection<T> vertices,
+ EdgeRelation<? super T> edgeRelation,
+ List<T> result,
+ Set<T> visited,
+ T vertex) {
if (visited.add(vertex)) {
for (T vertex2 : vertices) {
if (vertex2 != vertex && edgeRelation.isEdge(vertex, vertex2)) {
@@ -40,18 +43,15 @@ public final class TopologicalSort {
result.add(vertex);
}
}
-
+
/**
* Apply topological ordering to a given collection.
- *
- * @param <T>
- * the vertex type
- * @param vertices
- * the vertices of the directed acyclic graph
- * @param edgeRelation
- * the relation defining the edges of the graph
+ *
+ * @param <T> the vertex type
+ * @param vertices the vertices of the directed acyclic graph
+ * @param edgeRelation the relation defining the edges of the graph
* @return the topologically sorted list of vertices, where the vertices with no incoming edges
- * come first
+ * come first
*/
public static <T> List<T> sort(Collection<T> vertices, EdgeRelation<? super T> edgeRelation) {
List<T> result = new ArrayList<T>(vertices.size());