forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r743648 - in /forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl: AbstractXmlStructurer.java CocoonResolver.java XMLStructurer.java XMLStructurerAxiom.java
Date Thu, 12 Feb 2009 08:11:59 GMT
Author: thorsten
Date: Thu Feb 12 08:11:58 2009
New Revision: 743648

URL: http://svn.apache.org/viewvc?rev=743648&view=rev
Log:
Enhancing code by using final where possible. Adding more java docs. General slim down

Modified:
    forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/AbstractXmlStructurer.java
    forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/CocoonResolver.java
    forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/XMLStructurer.java
    forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/XMLStructurerAxiom.java

Modified: forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/AbstractXmlStructurer.java
URL: http://svn.apache.org/viewvc/forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/AbstractXmlStructurer.java?rev=743648&r1=743647&r2=743648&view=diff
==============================================================================
--- forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/AbstractXmlStructurer.java
(original)
+++ forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/AbstractXmlStructurer.java
Thu Feb 12 08:11:58 2009
@@ -16,12 +16,14 @@
  */
 package org.apache.forrest.dispatcher.impl;
 
+import java.io.InputStream;
 import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.forrest.dispatcher.api.Resolver;
 import org.apache.forrest.dispatcher.api.Structurer;
 import org.apache.forrest.dispatcher.config.DispatcherBean;
+import org.apache.forrest.dispatcher.exception.DispatcherException;
 import org.apache.forrest.dispatcher.factories.ContractFactory;
 import org.apache.forrest.dispatcher.impl.helper.Loggable;
 import org.apache.forrest.dispatcher.impl.helper.StAX;
@@ -29,13 +31,13 @@
 public abstract class AbstractXmlStructurer extends Loggable  implements Structurer {
 
   protected final Resolver resolver;
-  protected StAX stax;
+  protected final StAX stax;
   protected final boolean allowXmlProperties;
   protected final ContractFactory contractRep;
-  protected boolean shrink;
-  protected Map<String, Object> param;
+  protected final boolean shrink;
+  protected final Map<String, Object> param;
 
-  public AbstractXmlStructurer(DispatcherBean config, Map<String, Object> defaultProperties)
{
+  protected AbstractXmlStructurer(final DispatcherBean config, final Map<String, Object>
defaultProperties) {
     this.contractRep = new ContractFactory(config);
     this.stax = config.getStaxHelper();
     this.resolver = config.getResolver();
@@ -48,4 +50,7 @@
     }
   }
 
+public abstract InputStream execute(InputStream structurerStream, String format)
+        throws DispatcherException;
+
 }
\ No newline at end of file

Modified: forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/CocoonResolver.java
URL: http://svn.apache.org/viewvc/forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/CocoonResolver.java?rev=743648&r1=743647&r2=743648&view=diff
==============================================================================
--- forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/CocoonResolver.java
(original)
+++ forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/CocoonResolver.java
Thu Feb 12 08:11:58 2009
@@ -21,8 +21,8 @@
 
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
-import org.apache.forrest.dispatcher.exception.DispatcherException;
 import org.apache.forrest.dispatcher.api.Resolver;
+import org.apache.forrest.dispatcher.exception.DispatcherException;
 
 public class CocoonResolver implements Resolver {
 

Modified: forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/XMLStructurer.java
URL: http://svn.apache.org/viewvc/forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/XMLStructurer.java?rev=743648&r1=743647&r2=743648&view=diff
==============================================================================
--- forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/XMLStructurer.java
(original)
+++ forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/XMLStructurer.java
Thu Feb 12 08:11:58 2009
@@ -25,11 +25,16 @@
 import org.apache.forrest.dispatcher.exception.DispatcherException;
 import org.apache.forrest.dispatcher.impl.helper.Captions;
 import org.apache.forrest.dispatcher.impl.helper.CommonString;
+import org.apache.forrest.dispatcher.impl.helper.StAX;
 import org.apache.forrest.dispatcher.impl.helper.StreamHelper;
 
+/**
+ * @author thorsten
+ * @version 1.0
+ */
 public class XMLStructurer extends AbstractXmlStructurer {
 
-  private LinkedHashMap<String, LinkedHashSet<XMLEvent>> resultTree = new LinkedHashMap<String,
LinkedHashSet<XMLEvent>>();
+  private final LinkedHashMap<String, LinkedHashSet<XMLEvent>> resultTree = new
LinkedHashMap<String, LinkedHashSet<XMLEvent>>();
 
   private String currentPath = "";
   
@@ -44,7 +49,7 @@
    * @param config
    * @param defaultProperties
    */
-  public XMLStructurer(DispatcherBean config, Map<String, Object> defaultProperties)
{
+  public XMLStructurer(final DispatcherBean config, final Map<String, Object> defaultProperties)
{
     super(config, defaultProperties);
   }
 
@@ -53,26 +58,26 @@
    * org.apache.forrest.dispatcher.impl.Structurer#execute(java.io.InputStream,
    * java.lang.String)
    */
-  public InputStream execute(InputStream structurerStream, String format)
+  public InputStream execute(final InputStream structurerStream, final String format)
       throws DispatcherException {
     BufferedInputStream stream = null;
     try {
-      XMLStreamReader reader = stax.getReader(structurerStream);
+      final XMLStreamReader reader = stax.getReader(structurerStream);
       boolean process = true;
       while (process) {
-        int event = reader.next();
+        final int event = reader.next();
         switch (event) {
         case XMLStreamConstants.END_DOCUMENT:
           process = false;
           break;
 
         case XMLStreamConstants.START_ELEMENT:
-          String elementName = reader.getLocalName();
+          final String elementName = reader.getLocalName();
           if (elementName.equals(Captions.STRUCTURE_ELEMENT)) {
             String m_type = "", path = "";
             // Get attribute names
             for (int i = 0; i < reader.getAttributeCount(); i++) {
-              String localName = reader.getAttributeLocalName(i);
+              final String localName = reader.getAttributeLocalName(i);
               if (localName.equals(Captions.TYPE_ATT)) {
                 // Return value
                 m_type = reader.getAttributeValue(i);
@@ -98,32 +103,36 @@
           break;
         }
       }
-    } catch (XMLStreamException e) {
-      throw new DispatcherException(e);
-    } catch (IOException e) {
+    } catch (final XMLStreamException e) {
       throw new DispatcherException(e);
     } finally {
       try {
         StreamHelper.closeStream(structurerStream);
-      } catch (IOException e) {
+      } catch (final IOException e) {
         throw new DispatcherException(e);
       }
     }
     return stream;
   }
 
-  private BufferedInputStream processStructure(XMLStreamReader reader)
-      throws XMLStreamException, DispatcherException, IOException {
+  /**
+ * @param reader
+ * @return
+ * @throws XMLStreamException
+ * @throws DispatcherException
+ */
+private BufferedInputStream processStructure(final XMLStreamReader reader)
+      throws XMLStreamException, DispatcherException{
     boolean process = true;
     String elementName = null;
-    ByteArrayOutputStream out = new ByteArrayOutputStream();
+    final ByteArrayOutputStream out = new ByteArrayOutputStream();
     while (process) {
-      int event = reader.next();
+      final int event = reader.next();
       switch (event) {
       case XMLStreamConstants.END_ELEMENT:
         elementName = reader.getLocalName();
         if (elementName.equals(Captions.STRUCTURE_ELEMENT)) {
-          XMLEventWriter writer = stax.getWriter(out);
+          final XMLEventWriter writer = stax.getWriter(out);
           createResultStax(writer);
           resultTree.clear();
           process = false;
@@ -149,7 +158,7 @@
       }
     }
     log.debug(out.toString());
-    return (out != null) ? StreamHelper.switchStream(out) : null;
+    return StreamHelper.switchStream(out);
   }
 
   /**
@@ -157,24 +166,25 @@
    * injectionPoints that can be defined in the different contracts.
    * 
    * This injectionPoints can be within or extending other.
-   */
-
-  private void createResultStax(XMLEventWriter writer)
+ * @param writer
+ * @throws XMLStreamException
+ */
+private void createResultStax(final XMLEventWriter writer)
       throws XMLStreamException {
     // We start with creating a new result document
     writer.add(stax.getEventFactory().createStartDocument("UTF-8", "1.0"));
     // get a iterator about the injectionPoints we use
-    Iterator<String> iterator = resultTree.keySet().iterator();
+    final Iterator<String> iterator = resultTree.keySet().iterator();
     // create an path array
-    String[] paths = resultTree.keySet().toArray(new String[1]);
+    final String[] paths = resultTree.keySet().toArray(new String[1]);
     // determine the common root path for all paths
-    String rootPath = CommonString.common(paths);
+    final String rootPath = CommonString.common(paths);
     // Prepare the creation of the root path
-    String[] tokenizer = rootPath.split("/");
+    final String[] tokenizer = rootPath.split("/");
     // create the events related to the root path
     openPaths(writer, tokenizer);
     while (iterator.hasNext()) {
-      String element = iterator.next();
+      final String element = iterator.next();
       final String replaceFirst = element.replaceFirst(rootPath, "");
       final String[] split = replaceFirst.split("/");
       if (split.length > 1) {
@@ -182,23 +192,23 @@
         injectResult(writer, element);
         closingPaths(writer, split);
       } else {
-        if (replaceFirst != null && !replaceFirst.equals("")) {
-          StartElement start = stax.getEventFactory().createStartElement("", "",
+        if (null != replaceFirst && !replaceFirst.equals("")) {
+          final StartElement start = stax.getEventFactory().createStartElement("", "",
               replaceFirst);
           writer.add((XMLEvent) start);
         }else if(element.equals("/")){
-          StartElement start = stax.getEventFactory().createStartElement("", "",
+          final StartElement start = stax.getEventFactory().createStartElement("", "",
               "result");
           writer.add((XMLEvent) start);
         }
 
         injectResult(writer, element);
         if (replaceFirst != null && !replaceFirst.equals("")) {
-          EndElement end = stax.getEventFactory().createEndElement("", "",
+          final EndElement end = stax.getEventFactory().createEndElement("", "",
               replaceFirst);
           writer.add((XMLEvent) end);
         }else if(element.equals("/")){
-          EndElement end = stax.getEventFactory().createEndElement("", "",
+          final EndElement end = stax.getEventFactory().createEndElement("", "",
               "result");
           writer.add((XMLEvent) end);
     }
@@ -210,14 +220,19 @@
     writer.add(stax.getEventFactory().createEndDocument());
   }
 
-  private void processContract(XMLStreamReader reader)
+  /**
+ * @param reader
+ * @throws DispatcherException
+ * @throws XMLStreamException
+ */
+private void processContract(final XMLStreamReader reader)
       throws DispatcherException, XMLStreamException{
     boolean process = true;
     String elementName = null;
     String name = "", data = null;
     // Get attribute names
     for (int i = 0; i < reader.getAttributeCount(); i++) {
-      String localName = reader.getAttributeLocalName(i);
+      final String localName = reader.getAttributeLocalName(i);
       if (localName.equals(Captions.NAME_ATT)) {
         // Return value
         name = reader.getAttributeValue(i);
@@ -230,20 +245,20 @@
     if (null != data && !data.equals("")) {
       dataStream = resolver.resolve(data);
     }
-    Contract contract = contractRep.resolve(name);
-    Map<String, Object> localParams = new HashMap<String, Object>(param);
+    final Contract contract = contractRep.resolve(name);
+    final Map<String, Object> localParams = new HashMap<String, Object>(param);
     while (process) {
-      int event = reader.next();
+      final int event = reader.next();
       switch (event) {
       case XMLStreamConstants.END_ELEMENT:
         elementName = reader.getLocalName();
         if (elementName.equals(Captions.CONTRACT_ELEMENT)) {
           try {
-            InputStream resultStream = contract.execute(dataStream, localParams);
+            final InputStream resultStream = contract.execute(dataStream, localParams);
             StreamHelper.closeStream(dataStream);
             processContractResult(resultStream);
             StreamHelper.closeStream(resultStream);
-          } catch (Exception e) {
+          } catch (final Exception e) {
             /*
              *  FOR-1127
              *  Here we can inject custom handler for allowing that contracts can
@@ -274,20 +289,24 @@
     }
   }
 
-  private void processContractResult(InputStream resultStream)
+  /**
+ * @param resultStream
+ * @throws XMLStreamException
+ */
+private void processContractResult(final InputStream resultStream)
       throws XMLStreamException {
-    XMLStreamReader contractResultReader = stax.getReader(resultStream);
+    final XMLStreamReader contractResultReader = stax.getReader(resultStream);
     String xpath = "", injectionPoint = "";
     LinkedHashSet<XMLEvent> pathElement = null;
     boolean process = true;
     while (process) {
-      int resultEvent = contractResultReader.next();
+      final int resultEvent = contractResultReader.next();
       switch (resultEvent) {
       case XMLStreamConstants.START_ELEMENT:
         if (contractResultReader.getLocalName().equals(Captions.PART_ELEMENT)) {
           // Get attribute names
           for (int i = 0; i < contractResultReader.getAttributeCount(); i++) {
-            String localName = contractResultReader.getAttributeLocalName(i);
+            final String localName = contractResultReader.getAttributeLocalName(i);
             if (localName.equals(Captions.CONTRACT_RESULT_XPATH)) {
               // Return value
               xpath = contractResultReader.getAttributeValue(i);
@@ -321,6 +340,7 @@
         break;
       case XMLStreamConstants.END_DOCUMENT:
         process = false;
+        break;
 
       default:
         break;
@@ -329,33 +349,44 @@
     }
   }
 
-  private void processHook(XMLStreamReader reader, boolean start)
+  /**
+ * @param reader
+ * @param start
+ * @throws XMLStreamException
+ */
+private void processHook(final XMLStreamReader reader, final boolean start)
       throws XMLStreamException {
 
-    LinkedHashSet<XMLEvent> pathElement;
+    LinkedHashSet<XMLEvent> pathElement = null;
     if (resultTree.containsKey(currentPath)) {
       pathElement = resultTree.get(currentPath);
     } else {
       pathElement = new LinkedHashSet<XMLEvent>();
     }
-    XMLEventAllocator allocator = stax.getEventAllocator();
+    final XMLEventAllocator allocator = stax.getEventAllocator();
     XMLEvent currentEvent = allocator.allocate(reader);
     if (start){
-      currentEvent = stax.createStartElementNS(reader, currentEvent);
+      currentEvent = StAX.createStartElementNS(reader, currentEvent);
     }
     pathElement.add(currentEvent);
     resultTree.put(currentPath, pathElement);
   }
 
-  private void inject(LinkedHashSet<XMLEvent> pathElement,
-      XMLStreamReader parser, String injectionPoint) throws XMLStreamException {
+  /**
+ * @param pathElement
+ * @param parser
+ * @param injectionPoint
+ * @throws XMLStreamException
+ */
+private void inject(final LinkedHashSet<XMLEvent> pathElement,
+      final XMLStreamReader parser, final String injectionPoint) throws XMLStreamException
{
     log.debug("injectionPoint " + injectionPoint);
-    XMLEventAllocator allocator = stax.getEventAllocator();
+    final XMLEventAllocator allocator = stax.getEventAllocator();
     boolean process = true;
     while (process) {
-      int event = parser.next();
+      final int event = parser.next();
 
-      XMLEvent currentEvent = allocator.allocate(parser);
+      final XMLEvent currentEvent = allocator.allocate(parser);
       switch (event) {
       case XMLStreamConstants.END_ELEMENT:
         if (parser.getLocalName().equals("part")) {
@@ -374,12 +405,17 @@
     }
   }
 
-  private void processProperty(XMLStreamReader reader, Map<String, Object> localParam)
+  /**
+ * @param reader
+ * @param localParam
+ * @throws XMLStreamException
+ */
+private void processProperty(final XMLStreamReader reader, final Map<String, Object>
localParam)
       throws XMLStreamException {
     String propertyName = null, propertyValue = null;
     // Get attribute names
     for (int i = 0; i < reader.getAttributeCount(); i++) {
-      String localName = reader.getAttributeLocalName(i);
+      final String localName = reader.getAttributeLocalName(i);
       if (localName.equals(Captions.NAME_ATT)) {
         // Return value
         propertyName = reader.getAttributeValue(i);
@@ -390,33 +426,48 @@
     stax.addProperties(reader, localParam, propertyName, propertyValue,allowXmlProperties,
shrink);
   }
 
-  private void openPaths(XMLEventWriter writer, String[] tokenizer)
+  /**
+ * @param writer
+ * @param tokenizer
+ * @throws XMLStreamException
+ */
+private void openPaths(final XMLEventWriter writer, final String[] tokenizer)
       throws XMLStreamException {
-    for (String string : tokenizer) {
+    for (final String string : tokenizer) {
       if (!string.equals("")) {
-        StartElement value = stax.getEventFactory().createStartElement("", "",
+        final StartElement value = stax.getEventFactory().createStartElement("", "",
             string);
         writer.add((XMLEvent) value);
       }
     }
   }
 
-  private void closingPaths(XMLEventWriter writer, String[] tokenizer)
+  /**
+ * @param writer
+ * @param tokenizer
+ * @throws XMLStreamException
+ */
+private void closingPaths(final XMLEventWriter writer, final String[] tokenizer)
       throws XMLStreamException {
     // closing the initial paths again
     for (int j = tokenizer.length - 1; j >= 0; j--) {
       if (!tokenizer[j].equals("")) {
-        EndElement value = stax.getEventFactory().createEndElement("", "",
+        final EndElement value = stax.getEventFactory().createEndElement("", "",
             tokenizer[j]);
         writer.add((XMLEvent) value);
       }
     }
   }
 
-  private void injectResult(XMLEventWriter writer, String element)
+  /**
+ * @param writer
+ * @param element
+ * @throws XMLStreamException
+ */
+private void injectResult(final XMLEventWriter writer, final String element)
       throws XMLStreamException {
-    LinkedHashSet<XMLEvent> part = resultTree.get(element);
-    Object[] partResult = part.toArray();
+    final LinkedHashSet<XMLEvent> part = resultTree.get(element);
+    final Object[] partResult = part.toArray();
     for (int i = 0; i < partResult.length; i++) {
       writer.add((XMLEvent) partResult[i]);
     }

Modified: forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/XMLStructurerAxiom.java
URL: http://svn.apache.org/viewvc/forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/XMLStructurerAxiom.java?rev=743648&r1=743647&r2=743648&view=diff
==============================================================================
--- forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/XMLStructurerAxiom.java
(original)
+++ forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/XMLStructurerAxiom.java
Thu Feb 12 08:11:58 2009
@@ -140,7 +140,6 @@
         } catch (IOException e) {
           throw new DispatcherException(e);
         }
-        ;
       }
     }
     stream = StreamHelper.switchStream(out);
@@ -152,7 +151,7 @@
    * @param node
    * @return
    */
-  private boolean isElement(OMNode node) {
+  public static boolean isElement(final OMNode node) {
     return node.getType() == OMNode.ELEMENT_NODE;
   }
 
@@ -170,7 +169,7 @@
       JaxenException {
     Iterator<OMNode> strucutrerElements = structure.getChildren();
     while (strucutrerElements.hasNext()) {
-      OMNode node = (OMNode) strucutrerElements.next();
+      OMNode node = strucutrerElements.next();
       if (isElement(node)) {
         computeNodes((OMElement) node, pathNode);
       }
@@ -181,7 +180,7 @@
   /**
    * This is the main iterating process here we process all contracts and hooks.
    * 
-   * @param node
+   * @param component
    *          current node
    * @param pathNode
    *          the model representing the current path
@@ -228,12 +227,13 @@
     nextChildren(component, element);
   }
 
-  private void nextChildren(OMElement component, OMElement element)
+  @SuppressWarnings("unchecked")
+private void nextChildren(OMElement component, OMElement element)
       throws DispatcherException, XMLStreamException, IOException,
       JaxenException {
     Iterator<OMNode> childs = component.getChildren();
     while (childs.hasNext()) {
-      OMNode node = (OMNode) childs.next();
+      OMNode node = childs.next();
       if (isElement(node)) {
         computeNodes((OMElement) node, element);
       }
@@ -242,15 +242,13 @@
 
   /**
    * @param component
+   * @param pathNode
    * @throws DispatcherException
    * @throws XMLStreamException
-   * @throws IOException
-   * @throws JaxenException
    */
   @SuppressWarnings("unchecked")
   private void processContract(OMElement component, OMElement pathNode)
-      throws DispatcherException, XMLStreamException, IOException,
-      JaxenException {
+      throws DispatcherException, XMLStreamException {
     String name = "", data = null;
     name = component.getAttributeValue(qIt(Captions.NAME_ATT));
     data = component.getAttributeValue(qIt(Captions.DATA_ATT));
@@ -263,7 +261,7 @@
     Iterator <OMNode> properties = component.getChildrenWithName(qIt(Captions.NS,Captions.PROPERTY_ELEMENT));
     Map<String, Object> localParams = new HashMap<String, Object>(param);
     while (properties.hasNext()) {
-      OMNode node = (OMNode) properties.next();
+      OMNode node = properties.next();
       if (isElement(node)){
         processProperty((OMElement) node, localParams);
       }
@@ -318,7 +316,7 @@
       Iterator<OMNode> children = part.getChildren();
       if (xpath == null) {
         while (children.hasNext()) {
-          OMNode child = (OMNode) children.next();
+          OMNode child = children.next();
           pathNode.addChild(child);
         }
       } else {
@@ -333,7 +331,7 @@
         OMElement injectionPoint = (OMElement) xpathSelector.selectSingleNode(
             root, true);
         while (children.hasNext()) {
-          OMNode child = (OMNode) children.next();
+          OMNode child = children.next();
           injectionPoint.addChild(child);
         }
 
@@ -345,7 +343,7 @@
    * @param name
    * @return
    */
-  private QName qIt(String name) {
+  public static QName qIt(String name) {
     return new QName(name);
   }
 
@@ -354,20 +352,20 @@
    * @param uri
    * @return
    */
-  private QName qIt(String uri,String name) {
+  public static  QName qIt(String uri,String name) {
     return new QName(uri,name);
   }
   /**
    * @param properties
-   * @param param
+   * @param currentParam
    * @throws XMLStreamException
    */
-  private void processProperty(OMElement properties, Map<String, Object> param)
+  private void processProperty(OMElement properties, Map<String, Object> currentParam)
       throws XMLStreamException {
     String propertyName = null, propertyValue = null;
     propertyName = properties.getAttributeValue(qIt(Captions.NAME_ATT));
     propertyValue = properties.getAttributeValue(qIt(Captions.VALUE_ATT));
-    stax.addProperties(properties.getXMLStreamReader(), param, propertyName, propertyValue,
allowXmlProperties, shrink);
+    stax.addProperties(properties.getXMLStreamReader(), currentParam, propertyName, propertyValue,
allowXmlProperties, shrink);
   }
 
   



Mime
View raw message