abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1610231 - /abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/
Date Sun, 13 Jul 2014 15:13:13 GMT
Author: veithen
Date: Sun Jul 13 15:13:13 2014
New Revision: 1610231

URL: http://svn.apache.org/r1610231
Log:
Adapt to recent changes in Axiom and avoid using internal APIs.

Modified:
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMComment.java
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMPerson.java
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMProcessingInstruction.java
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMService.java
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMText.java
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTextValue.java
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWorkspace.java

Modified: abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java?rev=1610231&r1=1610230&r2=1610231&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java
(original)
+++ abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java
Sun Jul 13 15:13:13 2014
@@ -74,7 +74,7 @@ public class FOMCategories extends FOMEx
 
     public Category addCategory(String term) {
         complete();
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Category category = factory.newCategory(this);
         category.setTerm(term);
         return category;
@@ -82,7 +82,7 @@ public class FOMCategories extends FOMEx
 
     public Category addCategory(String scheme, String term, String label) {
         complete();
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Category category = factory.newCategory(this);
         category.setTerm(term);
         category.setScheme(scheme);

Modified: abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java?rev=1610231&r1=1610230&r2=1610231&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java
(original)
+++ abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java
Sun Jul 13 15:13:13 2014
@@ -70,7 +70,7 @@ public class FOMCollection extends FOMEx
 
     private Text setTitle(String title, Text.Type type) {
         complete();
-        FOMFactory fomfactory = (FOMFactory)factory;
+        FOMFactory fomfactory = (FOMFactory)getOMFactory();
         Text text = fomfactory.newText(PREFIXED_TITLE, type);
         text.setValue(title);
         this._setChild(PREFIXED_TITLE, (OMElement)text);
@@ -218,7 +218,7 @@ public class FOMCollection extends FOMEx
 
     public Categories addCategories() {
         complete();
-        return ((FOMFactory)factory).newCategories(this);
+        return ((FOMFactory)getOMFactory()).newCategories(this);
     }
 
     public Collection addCategories(Categories categories) {
@@ -229,7 +229,7 @@ public class FOMCollection extends FOMEx
 
     public Categories addCategories(String href) {
         complete();
-        Categories cats = ((FOMFactory)factory).newCategories();
+        Categories cats = ((FOMFactory)getOMFactory()).newCategories();
         cats.setHref(href);
         addCategories(cats);
         return cats;
@@ -237,7 +237,7 @@ public class FOMCollection extends FOMEx
 
     public Categories addCategories(List<Category> categories, boolean fixed, String
scheme) {
         complete();
-        Categories cats = ((FOMFactory)factory).newCategories();
+        Categories cats = ((FOMFactory)getOMFactory()).newCategories();
         cats.setFixed(fixed);
         if (scheme != null)
             cats.setScheme(scheme);

Modified: abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMComment.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMComment.java?rev=1610231&r1=1610230&r2=1610231&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMComment.java (original)
+++ abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMComment.java Sun
Jul 13 15:13:13 2014
@@ -55,7 +55,7 @@ public class FOMComment extends OMCommen
     }
 
     public Factory getFactory() {
-        return (Factory)this.factory;
+        return (Factory)this.getOMFactory();
     }
 
     public String toString() {

Modified: abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java?rev=1610231&r1=1610230&r2=1610231&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java (original)
+++ abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java Sun
Jul 13 15:13:13 2014
@@ -118,7 +118,8 @@ public class FOMContent extends FOMExten
                 }
             }
             OMElement el = (OMElement)(value instanceof ElementWrapper ? ((ElementWrapper)value).getInternal()
: value);
-            this.setFirstChild(el);
+            removeChildren();
+            addChild(el);
         } else {
             _removeAllChildren();
         }
@@ -198,7 +199,7 @@ public class FOMContent extends FOMExten
             }
         }
         _removeAllChildren();
-        addChild(factory.createOMText(dataHandler, true));
+        addChild(getOMFactory().createOMText(dataHandler, true));
         return this;
     }
 

Modified: abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java?rev=1610231&r1=1610230&r2=1610231&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java
(original)
+++ abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java
Sun Jul 13 15:13:13 2014
@@ -178,14 +178,14 @@ public class FOMDocument<T extends Eleme
     }
 
     public Object clone() {
-        Document<T> doc = ((FOMFactory)factory).newDocument();
+        Document<T> doc = ((FOMFactory)getOMFactory()).newDocument();
         OMDocument omdoc = (OMDocument)doc;
         for (Iterator i = getChildren(); i.hasNext();) {
             OMNode node = (OMNode)i.next();
             switch (node.getType()) {
                 case OMNode.COMMENT_NODE:
                     OMComment comment = (OMComment)node;
-                    factory.createOMComment(omdoc, comment.getValue());
+                    getOMFactory().createOMComment(omdoc, comment.getValue());
                     break;
                 // TODO: Decide what to do with this code; it will no longer work in Axiom
1.2.14 (because of AXIOM-437).
                 //       On the other hand, since we filter out DTDs, this code is never
triggered.
@@ -199,7 +199,7 @@ public class FOMDocument<T extends Eleme
                     break;
                 case OMNode.PI_NODE:
                     OMProcessingInstruction pi = (OMProcessingInstruction)node;
-                    factory.createOMProcessingInstruction(omdoc, pi.getTarget(), pi.getValue());
+                    getOMFactory().createOMProcessingInstruction(omdoc, pi.getTarget(), pi.getValue());
                     break;
             }
         }
@@ -218,7 +218,7 @@ public class FOMDocument<T extends Eleme
     }
 
     public Factory getFactory() {
-        return (Factory)this.factory;
+        return (Factory)this.getOMFactory();
     }
 
     public String[] getProcessingInstruction(String target) {
@@ -235,7 +235,7 @@ public class FOMDocument<T extends Eleme
     }
 
     public Document<T> addProcessingInstruction(String target, String value) {
-        OMProcessingInstruction pi = this.factory.createOMProcessingInstruction(null, target,
value);
+        OMProcessingInstruction pi = this.getOMFactory().createOMProcessingInstruction(null,
target, value);
         if (this.getOMDocumentElement() != null) {
             this.getOMDocumentElement().insertSiblingBefore(pi);
         } else {
@@ -254,7 +254,7 @@ public class FOMDocument<T extends Eleme
     }
 
     public <X extends Base> X addComment(String value) {
-        OMComment comment = this.factory.createOMComment(null, value);
+        OMComment comment = this.getOMFactory().createOMComment(null, value);
         if (this.getOMDocumentElement() != null) {
             this.getOMDocumentElement().insertSiblingBefore(comment);
         } else {

Modified: abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java?rev=1610231&r1=1610230&r2=1610231&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java (original)
+++ abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java Sun
Jul 13 15:13:13 2014
@@ -112,14 +112,14 @@ public class FOMElement extends OMElemen
     }
 
     protected void setParentDocument(Document parent) {
-        super.setParent((OMContainer)parent);
+        ((OMContainer)parent).addChild(this);
     }
 
     public <T extends Element> T setParentElement(Element parent) {
         if (parent instanceof ElementWrapper) {
             parent = ((ElementWrapper)parent).getInternal();
         }
-        super.setParent((FOMElement)parent);
+        ((FOMElement)parent).addChild(this);
         return (T)this;
     }
 
@@ -250,6 +250,7 @@ public class FOMElement extends OMElemen
             if (value != null) {
                 String uri = qname.getNamespaceURI();
                 String prefix = qname.getPrefix();
+                OMFactory factory = getOMFactory();
                 if (uri != null) {
                     OMNamespace ns = findNamespace(uri, prefix);
                     if (ns == null)
@@ -377,7 +378,7 @@ public class FOMElement extends OMElemen
                 node.discard();
             }
         } else if (element == null && value != null) {
-            element = factory.createOMElement(qname, this);
+            element = getOMFactory().createOMElement(qname, this);
             element.setText(value);
             this.addChild(element);
         }
@@ -408,7 +409,7 @@ public class FOMElement extends OMElemen
             setTextElement(qname, null, false);
             return null;
         }
-        FOMFactory fomfactory = (FOMFactory)factory;
+        FOMFactory fomfactory = (FOMFactory)getOMFactory();
         Text text = fomfactory.newText(qname, Text.Type.TEXT);
         text.setValue(value);
         setTextElement(qname, text, false);
@@ -420,7 +421,7 @@ public class FOMElement extends OMElemen
             setTextElement(qname, null, false);
             return null;
         }
-        FOMFactory fomfactory = (FOMFactory)factory;
+        FOMFactory fomfactory = (FOMFactory)getOMFactory();
         Text text = fomfactory.newText(qname, Text.Type.HTML);
         if (baseUri != null)
             text.setBaseUri(baseUri);
@@ -434,7 +435,7 @@ public class FOMElement extends OMElemen
             setTextElement(qname, null, false);
             return null;
         }
-        FOMFactory fomfactory = (FOMFactory)factory;
+        FOMFactory fomfactory = (FOMFactory)getOMFactory();
         Text text = fomfactory.newText(qname, Text.Type.XHTML);
         if (baseUri != null)
             text.setBaseUri(baseUri);
@@ -448,7 +449,7 @@ public class FOMElement extends OMElemen
             setTextElement(qname, null, false);
             return null;
         }
-        FOMFactory fomfactory = (FOMFactory)factory;
+        FOMFactory fomfactory = (FOMFactory)getOMFactory();
         Text text = fomfactory.newText(qname, Text.Type.XHTML);
         if (baseUri != null)
             text.setBaseUri(baseUri);
@@ -518,7 +519,7 @@ public class FOMElement extends OMElemen
     protected Element _parse(String value, IRI baseUri) throws ParseException, UnsupportedEncodingException
{
         if (value == null)
             return null;
-        FOMFactory fomfactory = (FOMFactory)factory;
+        FOMFactory fomfactory = (FOMFactory)getOMFactory();
         Parser parser = fomfactory.newParser();
         ParserOptions options = parser.getDefaultParserOptions();
         options.setFactory(fomfactory);
@@ -570,6 +571,7 @@ public class FOMElement extends OMElemen
     }
 
     protected OMElement _copyElement(OMElement src, OMElement dest) {
+        OMFactory factory = getOMFactory();
         for (Iterator i = src.getAllAttributes(); i.hasNext();) {
             OMAttribute attr = (OMAttribute)i.next();
             dest.addAttribute(attr);
@@ -611,19 +613,19 @@ public class FOMElement extends OMElemen
     protected OMElement _create(OMElement src) {
         OMElement el = null;
 
-        FOMFactory fomfactory = (FOMFactory)factory;
+        FOMFactory fomfactory = (FOMFactory)getOMFactory();
         Object obj = null;
         if (src instanceof Content)
             obj = ((Content)src).getContentType();
         if (src instanceof Text)
             obj = ((Text)src).getTextType();
-        el = fomfactory.createElement(src.getQName(), (OMContainer)fomfactory.newDocument(),
factory, obj);
+        el = fomfactory.createElement(src.getQName(), (OMContainer)fomfactory.newDocument(),
fomfactory, obj);
 
         return el;
     }
 
     public Factory getFactory() {
-        return (Factory)this.factory;
+        return (Factory)this.getOMFactory();
     }
 
     // This appears to no longer be necessary with Axiom 1.2
@@ -645,7 +647,7 @@ public class FOMElement extends OMElemen
     // }
 
     public <T extends Base> T addComment(String value) {
-        factory.createOMComment(this, value);
+        getOMFactory().createOMComment(this, value);
         return (T)this;
     }
 
@@ -729,7 +731,7 @@ public class FOMElement extends OMElemen
     }
 
     public <T extends Element> List<T> getElements() {
-        return new FOMList<T>(new FOMElementIteratorWrapper((FOMFactory)factory, getChildElements()));
+        return new FOMList<T>(new FOMElementIteratorWrapper((FOMFactory)getOMFactory(),
getChildElements()));
     }
 
     public boolean getMustPreserveWhitespace() {
@@ -754,7 +756,7 @@ public class FOMElement extends OMElemen
 
     public <T extends Element> T setText(DataHandler handler) {
         _removeAllChildren();
-        addChild(factory.createOMText(handler, true));
+        addChild(getOMFactory().createOMText(handler, true));
         return (T)this;
     }
 

Modified: abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java?rev=1610231&r1=1610230&r2=1610231&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java (original)
+++ abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java Sun
Jul 13 15:13:13 2014
@@ -97,7 +97,7 @@ public class FOMEntry extends FOMExtensi
 
     public Person addAuthor(String name) {
         complete();
-        FOMFactory fomfactory = (FOMFactory)this.factory;
+        FOMFactory fomfactory = (FOMFactory)this.getOMFactory();
         Person person = fomfactory.newAuthor(this);
         person.setName(name);
         return person;
@@ -105,7 +105,7 @@ public class FOMEntry extends FOMExtensi
 
     public Person addAuthor(String name, String email, String uri) {
         complete();
-        FOMFactory fomfactory = (FOMFactory)this.factory;
+        FOMFactory fomfactory = (FOMFactory)this.getOMFactory();
         Person person = fomfactory.newAuthor(this);
         person.setName(name);
         person.setEmail(email);
@@ -140,7 +140,7 @@ public class FOMEntry extends FOMExtensi
 
     public Category addCategory(String term) {
         complete();
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Category category = factory.newCategory(this);
         category.setTerm(term);
         return category;
@@ -148,7 +148,7 @@ public class FOMEntry extends FOMExtensi
 
     public Category addCategory(String scheme, String term, String label) {
         complete();
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Category category = factory.newCategory(this);
         category.setTerm(term);
         category.setScheme(scheme);
@@ -175,7 +175,7 @@ public class FOMEntry extends FOMExtensi
      */
     public Content setContent(String value) {
         complete();
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Content content = factory.newContent();
         content.setValue(value);
         setContentElement(content);
@@ -194,7 +194,7 @@ public class FOMEntry extends FOMExtensi
      * Sets the content for this entry
      */
     public Content setContent(String value, Content.Type type) {
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Content content = factory.newContent(type);
         content.setValue(value);
         setContentElement(content);
@@ -205,7 +205,7 @@ public class FOMEntry extends FOMExtensi
      * Sets the content for this entry
      */
     public Content setContent(Element value) {
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Content content = factory.newContent();
         content.setValueElement(value);
         setContentElement(content);
@@ -221,7 +221,7 @@ public class FOMEntry extends FOMExtensi
         try {
             if (MimeTypeHelper.isText(mediaType))
                 throw new IllegalArgumentException();
-            FOMFactory factory = (FOMFactory)this.factory;
+            FOMFactory factory = (FOMFactory)this.getOMFactory();
             Content content = factory.newContent(new MimeType(mediaType));
             content.setValueElement(element);
             setContentElement(content);
@@ -253,7 +253,7 @@ public class FOMEntry extends FOMExtensi
                 throw new RuntimeException(e);
             }
         } else {
-            FOMFactory factory = (FOMFactory)this.factory;
+            FOMFactory factory = (FOMFactory)this.getOMFactory();
             Content content = factory.newContent(Content.Type.MEDIA);
             content.setDataHandler(dataHandler);
             if (mediatype != null)
@@ -308,7 +308,7 @@ public class FOMEntry extends FOMExtensi
      */
     public Content setContent(String value, String mediatype) {
         try {
-            FOMFactory factory = (FOMFactory)this.factory;
+            FOMFactory factory = (FOMFactory)this.getOMFactory();
             Content content = factory.newContent(new MimeType(mediatype));
             content.setValue(value);
             content.setMimeType(mediatype);
@@ -327,7 +327,7 @@ public class FOMEntry extends FOMExtensi
      */
     public Content setContent(IRI uri, String mediatype) {
         try {
-            FOMFactory factory = (FOMFactory)this.factory;
+            FOMFactory factory = (FOMFactory)this.getOMFactory();
             Content content = factory.newContent(new MimeType(mediatype));
             content.setSrc(uri.toString());
             setContentElement(content);
@@ -349,7 +349,7 @@ public class FOMEntry extends FOMExtensi
 
     public Person addContributor(String name) {
         complete();
-        FOMFactory fomfactory = (FOMFactory)this.factory;
+        FOMFactory fomfactory = (FOMFactory)this.getOMFactory();
         Person person = fomfactory.newContributor(this);
         person.setName(name);
         return person;
@@ -357,7 +357,7 @@ public class FOMEntry extends FOMExtensi
 
     public Person addContributor(String name, String email, String uri) {
         complete();
-        FOMFactory fomfactory = (FOMFactory)this.factory;
+        FOMFactory fomfactory = (FOMFactory)this.getOMFactory();
         Person person = fomfactory.newContributor(this);
         person.setName(name);
         person.setEmail(email);
@@ -405,7 +405,7 @@ public class FOMEntry extends FOMExtensi
                 id.setValue(value);
             return id;
         } else {
-            FOMFactory fomfactory = (FOMFactory)factory;
+            FOMFactory fomfactory = (FOMFactory)getOMFactory();
             IRIElement iri = fomfactory.newID(this);
             iri.setValue((normalize) ? IRI.normalizeString(value) : value);
             return iri;
@@ -437,7 +437,7 @@ public class FOMEntry extends FOMExtensi
 
     public Link addLink(String href, String rel) {
         complete();
-        FOMFactory fomfactory = (FOMFactory)factory;
+        FOMFactory fomfactory = (FOMFactory)getOMFactory();
         Link link = fomfactory.newLink(this);
         link.setHref(href);
         if (rel != null)
@@ -447,7 +447,7 @@ public class FOMEntry extends FOMExtensi
 
     public Link addLink(String href, String rel, String type, String title, String hreflang,
long length) {
         complete();
-        FOMFactory fomfactory = (FOMFactory)factory;
+        FOMFactory fomfactory = (FOMFactory)getOMFactory();
         Link link = fomfactory.newLink(this);
         link.setHref(href);
         link.setRel(rel);
@@ -487,7 +487,7 @@ public class FOMEntry extends FOMExtensi
             dte.setValue(value);
             return dte;
         } else {
-            FOMFactory fomfactory = (FOMFactory)factory;
+            FOMFactory fomfactory = (FOMFactory)getOMFactory();
             DateTime dt = fomfactory.newPublished(this);
             dt.setValue(value);
             return dt;
@@ -514,7 +514,7 @@ public class FOMEntry extends FOMExtensi
 
     public Text setRights(String value) {
         complete();
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Text text = factory.newRights();
         text.setValue(value);
         setRightsElement(text);
@@ -530,7 +530,7 @@ public class FOMEntry extends FOMExtensi
     }
 
     public Text setRights(String value, Text.Type type) {
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Text text = factory.newRights(type);
         text.setValue(value);
         setRightsElement(text);
@@ -538,7 +538,7 @@ public class FOMEntry extends FOMExtensi
     }
 
     public Text setRights(Div value) {
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Text text = factory.newRights(Text.Type.XHTML);
         text.setValueElement(value);
         setRightsElement(text);
@@ -577,7 +577,7 @@ public class FOMEntry extends FOMExtensi
 
     public Text setSummary(String value) {
         complete();
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Text text = factory.newSummary();
         text.setValue(value);
         setSummaryElement(text);
@@ -593,7 +593,7 @@ public class FOMEntry extends FOMExtensi
     }
 
     public Text setSummary(String value, Text.Type type) {
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Text text = factory.newSummary(type);
         text.setValue(value);
         setSummaryElement(text);
@@ -601,7 +601,7 @@ public class FOMEntry extends FOMExtensi
     }
 
     public Text setSummary(Div value) {
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Text text = factory.newSummary(Text.Type.XHTML);
         text.setValueElement(value);
         setSummaryElement(text);
@@ -624,7 +624,7 @@ public class FOMEntry extends FOMExtensi
 
     public Text setTitle(String value) {
         complete();
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Text text = factory.newTitle();
         text.setValue(value);
         setTitleElement(text);
@@ -640,7 +640,7 @@ public class FOMEntry extends FOMExtensi
     }
 
     public Text setTitle(String value, Text.Type type) {
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Text text = factory.newTitle(type);
         text.setValue(value);
         setTitleElement(text);
@@ -648,7 +648,7 @@ public class FOMEntry extends FOMExtensi
     }
 
     public Text setTitle(Div value) {
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Text text = factory.newTitle(Text.Type.XHTML);
         text.setValueElement(value);
         setTitleElement(text);
@@ -688,7 +688,7 @@ public class FOMEntry extends FOMExtensi
             dte.setValue(value);
             return dte;
         } else {
-            FOMFactory fomfactory = (FOMFactory)factory;
+            FOMFactory fomfactory = (FOMFactory)getOMFactory();
             DateTime dt = fomfactory.newUpdated(this);
             dt.setValue(value);
             return dt;
@@ -738,7 +738,7 @@ public class FOMEntry extends FOMExtensi
             dte.setValue(value);
             return dte;
         } else {
-            FOMFactory fomfactory = (FOMFactory)factory;
+            FOMFactory fomfactory = (FOMFactory)getOMFactory();
             DateTime dt = fomfactory.newEdited(this);
             dt.setValue(value);
             return dt;
@@ -900,7 +900,7 @@ public class FOMEntry extends FOMExtensi
         complete();
         Control control = getControl();
         if (control == null && draft) {
-            control = ((FOMFactory)factory).newControl(this);
+            control = ((FOMFactory)getOMFactory()).newControl(this);
         }
         if (control != null)
             control.setDraft(draft);
@@ -919,7 +919,7 @@ public class FOMEntry extends FOMExtensi
         complete();
         Control control = getControl();
         if (control == null) {
-            control = ((FOMFactory)factory).newControl(this);
+            control = ((FOMFactory)getOMFactory()).newControl(this);
         }
         return control;
     }

Modified: abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java?rev=1610231&r1=1610230&r2=1610231&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java
(original)
+++ abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java
Sun Jul 13 15:13:13 2014
@@ -87,7 +87,7 @@ public class FOMExtensibleElement extend
 
     public <T extends Element> T addExtension(QName qname) {
         complete();
-        FOMFactory fomfactory = (FOMFactory)factory;
+        FOMFactory fomfactory = (FOMFactory)getOMFactory();
         String prefix = qname.getPrefix();
         declareIfNecessary(qname.getNamespaceURI(), prefix);
         return (T)fomfactory.newExtensionElement(qname, this);
@@ -102,7 +102,7 @@ public class FOMExtensibleElement extend
 
     public Element addSimpleExtension(QName qname, String value) {
         complete();
-        FOMFactory fomfactory = (FOMFactory)factory;
+        FOMFactory fomfactory = (FOMFactory)getOMFactory();
         Element el = fomfactory.newElement(qname, this);
         el.setText(value);
         String prefix = qname.getPrefix();

Modified: abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java?rev=1610231&r1=1610230&r2=1610231&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java (original)
+++ abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java Sun
Jul 13 15:13:13 2014
@@ -74,7 +74,7 @@ public class FOMFeed extends FOMSource i
 
     public Entry addEntry() {
         complete();
-        FOMFactory fomfactory = (FOMFactory)factory;
+        FOMFactory fomfactory = (FOMFactory)getOMFactory();
         return fomfactory.newEntry(this);
     }
 
@@ -91,14 +91,14 @@ public class FOMFeed extends FOMSource i
 
     public Entry insertEntry() {
         complete();
-        FOMFactory fomfactory = (FOMFactory)factory;
+        FOMFactory fomfactory = (FOMFactory)getOMFactory();
         Entry entry = fomfactory.newEntry((Feed)null);
         insertEntry(entry);
         return entry;
     }
 
     public Source getAsSource() {
-        FOMSource source = (FOMSource)((FOMFactory)factory).newSource(null);
+        FOMSource source = (FOMSource)((FOMFactory)getOMFactory()).newSource(null);
         for (Iterator<?> i = this.getChildElements(); i.hasNext();) {
             FOMElement child = (FOMElement)i.next();
             if (!child.getQName().equals(ENTRY)) {

Modified: abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMPerson.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMPerson.java?rev=1610231&r1=1610230&r2=1610231&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMPerson.java (original)
+++ abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMPerson.java Sun
Jul 13 15:13:13 2014
@@ -63,7 +63,7 @@ public class FOMPerson extends FOMExtens
     public Element setName(String name) {
         complete();
         if (name != null) {
-            FOMFactory fomfactory = (FOMFactory)factory;
+            FOMFactory fomfactory = (FOMFactory)getOMFactory();
             Element el = fomfactory.newName(null);
             el.setText(name);
             _setChild(NAME, (OMElement)el);
@@ -95,7 +95,7 @@ public class FOMPerson extends FOMExtens
     public Element setEmail(String email) {
         complete();
         if (email != null) {
-            FOMFactory fomfactory = (FOMFactory)factory;
+            FOMFactory fomfactory = (FOMFactory)getOMFactory();
             Element el = fomfactory.newEmail(null);
             el.setText(email);
             _setChild(EMAIL, (OMElement)el);
@@ -127,7 +127,7 @@ public class FOMPerson extends FOMExtens
     public IRIElement setUri(String uri) {
         complete();
         if (uri != null) {
-            FOMFactory fomfactory = (FOMFactory)factory;
+            FOMFactory fomfactory = (FOMFactory)getOMFactory();
             IRIElement el = fomfactory.newUri(null);
             el.setValue(uri);
             _setChild(URI, (OMElement)el);

Modified: abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMProcessingInstruction.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMProcessingInstruction.java?rev=1610231&r1=1610230&r2=1610231&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMProcessingInstruction.java
(original)
+++ abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMProcessingInstruction.java
Sun Jul 13 15:13:13 2014
@@ -46,7 +46,7 @@ public class FOMProcessingInstruction ex
     }
 
     public Factory getFactory() {
-        return (Factory)this.factory;
+        return (Factory)this.getOMFactory();
     }
 
     public String getText() {

Modified: abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMService.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMService.java?rev=1610231&r1=1610230&r2=1610231&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMService.java (original)
+++ abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMService.java Sun
Jul 13 15:13:13 2014
@@ -95,7 +95,7 @@ public class FOMService extends FOMExten
 
     public Workspace addWorkspace(String title) {
         complete();
-        FOMFactory fomfactory = (FOMFactory)factory;
+        FOMFactory fomfactory = (FOMFactory)getOMFactory();
         Workspace workspace = fomfactory.newWorkspace(this);
         workspace.setTitle(title);
         return workspace;

Modified: abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java?rev=1610231&r1=1610230&r2=1610231&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java (original)
+++ abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java Sun
Jul 13 15:13:13 2014
@@ -86,7 +86,7 @@ public class FOMSource extends FOMExtens
 
     public Person addAuthor(String name) {
         complete();
-        FOMFactory fomfactory = (FOMFactory)this.factory;
+        FOMFactory fomfactory = (FOMFactory)this.getOMFactory();
         Person person = fomfactory.newAuthor(this);
         person.setName(name);
         return person;
@@ -94,7 +94,7 @@ public class FOMSource extends FOMExtens
 
     public Person addAuthor(String name, String email, String uri) {
         complete();
-        FOMFactory fomfactory = (FOMFactory)this.factory;
+        FOMFactory fomfactory = (FOMFactory)this.getOMFactory();
         Person person = fomfactory.newAuthor(this);
         person.setName(name);
         person.setEmail(email);
@@ -129,7 +129,7 @@ public class FOMSource extends FOMExtens
 
     public Category addCategory(String term) {
         complete();
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Category category = factory.newCategory(this);
         category.setTerm(term);
         return category;
@@ -137,7 +137,7 @@ public class FOMSource extends FOMExtens
 
     public Category addCategory(String scheme, String term, String label) {
         complete();
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Category category = factory.newCategory(this);
         category.setTerm(term);
         category.setScheme(scheme);
@@ -157,7 +157,7 @@ public class FOMSource extends FOMExtens
 
     public Person addContributor(String name) {
         complete();
-        FOMFactory fomfactory = (FOMFactory)this.factory;
+        FOMFactory fomfactory = (FOMFactory)this.getOMFactory();
         Person person = fomfactory.newContributor(this);
         person.setName(name);
         return person;
@@ -165,7 +165,7 @@ public class FOMSource extends FOMExtens
 
     public Person addContributor(String name, String email, String uri) {
         complete();
-        FOMFactory fomfactory = (FOMFactory)this.factory;
+        FOMFactory fomfactory = (FOMFactory)this.getOMFactory();
         Person person = fomfactory.newContributor(this);
         person.setName(name);
         person.setEmail(email);
@@ -214,7 +214,7 @@ public class FOMSource extends FOMExtens
                 id.setValue(value);
             return id;
         } else {
-            FOMFactory fomfactory = (FOMFactory)factory;
+            FOMFactory fomfactory = (FOMFactory)getOMFactory();
             IRIElement iri = fomfactory.newID(this);
             iri.setValue((normalize) ? IRI.normalizeString(value) : value);
             return iri;
@@ -245,7 +245,7 @@ public class FOMSource extends FOMExtens
 
     public Link addLink(String href, String rel) {
         complete();
-        FOMFactory fomfactory = (FOMFactory)factory;
+        FOMFactory fomfactory = (FOMFactory)getOMFactory();
         Link link = fomfactory.newLink(this);
         link.setHref(href);
         if (rel != null)
@@ -255,7 +255,7 @@ public class FOMSource extends FOMExtens
 
     public Link addLink(String href, String rel, String type, String title, String hreflang,
long length) {
         complete();
-        FOMFactory fomfactory = (FOMFactory)factory;
+        FOMFactory fomfactory = (FOMFactory)getOMFactory();
         Link link = fomfactory.newLink(this);
         link.setHref(href);
         link.setRel(rel);
@@ -278,7 +278,7 @@ public class FOMSource extends FOMExtens
 
     public Text setRights(String value) {
         complete();
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Text text = factory.newRights();
         text.setValue(value);
         setRightsElement(text);
@@ -294,7 +294,7 @@ public class FOMSource extends FOMExtens
     }
 
     public Text setRights(String value, Text.Type type) {
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Text text = factory.newRights(type);
         text.setValue(value);
         setRightsElement(text);
@@ -302,7 +302,7 @@ public class FOMSource extends FOMExtens
     }
 
     public Text setRights(Div value) {
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Text text = factory.newRights(Text.Type.XHTML);
         text.setValueElement(value);
         setRightsElement(text);
@@ -325,7 +325,7 @@ public class FOMSource extends FOMExtens
 
     public Text setSubtitle(String value) {
         complete();
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Text text = factory.newSubtitle();
         text.setValue(value);
         setSubtitleElement(text);
@@ -341,7 +341,7 @@ public class FOMSource extends FOMExtens
     }
 
     public Text setSubtitle(String value, Text.Type type) {
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Text text = factory.newSubtitle(type);
         text.setValue(value);
         setSubtitleElement(text);
@@ -349,7 +349,7 @@ public class FOMSource extends FOMExtens
     }
 
     public Text setSubtitle(Div value) {
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Text text = factory.newSubtitle(Text.Type.XHTML);
         text.setValueElement(value);
         setSubtitleElement(text);
@@ -372,7 +372,7 @@ public class FOMSource extends FOMExtens
 
     public Text setTitle(String value) {
         complete();
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Text text = factory.newTitle();
         text.setValue(value);
         setTitleElement(text);
@@ -388,7 +388,7 @@ public class FOMSource extends FOMExtens
     }
 
     public Text setTitle(String value, Text.Type type) {
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Text text = factory.newTitle(type);
         text.setValue(value);
         setTitleElement(text);
@@ -396,7 +396,7 @@ public class FOMSource extends FOMExtens
     }
 
     public Text setTitle(Div value) {
-        FOMFactory factory = (FOMFactory)this.factory;
+        FOMFactory factory = (FOMFactory)this.getOMFactory();
         Text text = factory.newTitle(Text.Type.XHTML);
         text.setValueElement(value);
         setTitleElement(text);
@@ -441,7 +441,7 @@ public class FOMSource extends FOMExtens
             dte.setValue(value);
             return dte;
         } else {
-            FOMFactory fomfactory = (FOMFactory)factory;
+            FOMFactory fomfactory = (FOMFactory)getOMFactory();
             DateTime dt = fomfactory.newUpdated(this);
             dt.setValue(value);
             return dt;
@@ -471,7 +471,7 @@ public class FOMSource extends FOMExtens
 
     public Generator setGenerator(String uri, String version, String value) {
         complete();
-        FOMFactory fomfactory = (FOMFactory)factory;
+        FOMFactory fomfactory = (FOMFactory)getOMFactory();
         Generator generator = fomfactory.newGenerator(this);
         if (uri != null)
             generator.setUri(uri);
@@ -501,7 +501,7 @@ public class FOMSource extends FOMExtens
             _removeChildren(ICON, false);
             return null;
         }
-        FOMFactory fomfactory = (FOMFactory)factory;
+        FOMFactory fomfactory = (FOMFactory)getOMFactory();
         IRIElement iri = fomfactory.newIcon(this);
         iri.setValue(value);
         return iri;
@@ -532,7 +532,7 @@ public class FOMSource extends FOMExtens
             _removeChildren(LOGO, false);
             return null;
         }
-        FOMFactory fomfactory = (FOMFactory)factory;
+        FOMFactory fomfactory = (FOMFactory)getOMFactory();
         IRIElement iri = fomfactory.newLogo(this);
         iri.setValue(value);
         return iri;
@@ -618,7 +618,7 @@ public class FOMSource extends FOMExtens
     }
 
     public Feed getAsFeed() {
-        FOMFeed feed = (FOMFeed)((FOMFactory)factory).newFeed();
+        FOMFeed feed = (FOMFeed)((FOMFactory)getOMFactory()).newFeed();
         for (Iterator i = this.getChildElements(); i.hasNext();) {
             FOMElement child = (FOMElement)i.next();
             if (!child.getQName().equals(ENTRY)) {

Modified: abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMText.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMText.java?rev=1610231&r1=1610230&r2=1610231&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMText.java (original)
+++ abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMText.java Sun
Jul 13 15:13:13 2014
@@ -87,7 +87,8 @@ public class FOMText extends FOMElement 
             if (this.getFirstChildWithName(Constants.DIV) != null)
                 this.getFirstChildWithName(Constants.DIV).discard();
             init(Text.Type.XHTML);
-            this.setFirstChild((OMElement)value);
+            removeChildren();
+            addChild((OMElement)value);
         } else
             _removeAllChildren();
         return this;

Modified: abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTextValue.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTextValue.java?rev=1610231&r1=1610230&r2=1610231&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTextValue.java
(original)
+++ abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMTextValue.java
Sun Jul 13 15:13:13 2014
@@ -105,7 +105,7 @@ public class FOMTextValue extends OMText
     }
 
     public Factory getFactory() {
-        return (Factory)this.factory;
+        return (Factory)this.getOMFactory();
     }
 
     @Override

Modified: abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWorkspace.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWorkspace.java?rev=1610231&r1=1610230&r2=1610231&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWorkspace.java
(original)
+++ abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWorkspace.java
Sun Jul 13 15:13:13 2014
@@ -63,7 +63,7 @@ public class FOMWorkspace extends FOMExt
 
     private Text setTitle(String title, Text.Type type) {
         complete();
-        FOMFactory fomfactory = (FOMFactory)factory;
+        FOMFactory fomfactory = (FOMFactory)getOMFactory();
         Text text = fomfactory.newText(PREFIXED_TITLE, type);
         text.setValue(title);
         this._setChild(PREFIXED_TITLE, (OMElement)text);
@@ -113,7 +113,7 @@ public class FOMWorkspace extends FOMExt
 
     public Collection addCollection(String title, String href) {
         complete();
-        FOMFactory fomfactory = (FOMFactory)factory;
+        FOMFactory fomfactory = (FOMFactory)getOMFactory();
         Collection collection = fomfactory.newCollection(this);
         collection.setTitle(title);
         collection.setHref(href);
@@ -122,7 +122,7 @@ public class FOMWorkspace extends FOMExt
 
     public Collection addMultipartCollection(String title, String href) {
         complete();
-        FOMFactory fomfactory = (FOMFactory)factory;
+        FOMFactory fomfactory = (FOMFactory)getOMFactory();
         Collection collection = fomfactory.newMultipartCollection(this);
         collection.setTitle(title);
         collection.setHref(href);



Mime
View raw message