-/*\r
- * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)\r
- * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
- * \r
- * This program is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU General Public License\r
- * as published by the Free Software Foundation; either version 2\r
- * of the License, or (at your option) any later version.\r
- * \r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * GNU General Public License for more details.\r
- * \r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA\r
- */\r
-package jalview.io.vamsas;\r
-\r
-import java.util.Enumeration;\r
-import java.util.Vector;\r
-\r
-import uk.ac.vamsas.objects.core.DataSet;\r
-import uk.ac.vamsas.objects.core.DataSetAnnotations;\r
-import uk.ac.vamsas.objects.core.Link;\r
-import uk.ac.vamsas.objects.core.Property;\r
-import uk.ac.vamsas.objects.core.Provenance;\r
-import uk.ac.vamsas.objects.core.RangeAnnotation;\r
-import uk.ac.vamsas.objects.core.Score;\r
-import uk.ac.vamsas.objects.core.Seg;\r
-import uk.ac.vamsas.objects.core.Sequence;\r
-import uk.ac.vamsas.objects.utils.Properties;\r
-import jalview.bin.Cache;\r
-import jalview.datamodel.SequenceFeature;\r
-import jalview.datamodel.SequenceI;\r
-import jalview.io.VamsasAppDatastore;\r
-import jalview.util.UrlLink;\r
-\r
-/**\r
- * @author JimP\r
- * \r
- */\r
-public class Sequencefeature extends Rangetype\r
-{\r
-\r
- uk.ac.vamsas.objects.core.DataSet dataset;\r
-\r
- uk.ac.vamsas.objects.core.Sequence sequence;\r
-\r
- private SequenceI dsSeq;\r
-\r
- public Sequencefeature(VamsasAppDatastore vamsasAppDatastore,\r
- SequenceFeature sequenceFeature,\r
- uk.ac.vamsas.objects.core.DataSet dataset,\r
- uk.ac.vamsas.objects.core.Sequence sequence)\r
- {\r
- super(vamsasAppDatastore, sequenceFeature, DataSetAnnotations.class);\r
- this.dataset = dataset;\r
- this.sequence = sequence;\r
- doSync();\r
- }\r
-\r
- public Sequencefeature(VamsasAppDatastore vamsasAppDatastore,\r
- DataSetAnnotations dseta, SequenceI dsSeq)\r
- {\r
- super(vamsasAppDatastore, dseta, jalview.datamodel.SequenceFeature.class);\r
- this.dsSeq = dsSeq;\r
- doJvUpdate();\r
- }\r
-\r
- public void addToDocument()\r
- {\r
- DataSetAnnotations dsa = (DataSetAnnotations) vobj;\r
- jalview.datamodel.SequenceFeature feature = (jalview.datamodel.SequenceFeature) jvobj;\r
- dsa = (DataSetAnnotations) getDSAnnotationFromJalview(\r
- new DataSetAnnotations(), feature);\r
- if (dsa.getProvenance() == null)\r
- {\r
- dsa.setProvenance(new Provenance());\r
- }\r
- addProvenance(dsa.getProvenance(), "created"); // JBPNote - need\r
- // to update\r
- dsa.addSeqRef(sequence); // we have just created this annotation\r
- // - so safe to use this\r
- bindjvvobj(feature, dsa);\r
- dataset.addDataSetAnnotations(dsa);\r
- }\r
-\r
- public void addFromDocument()\r
- {\r
- DataSetAnnotations dsa = (DataSetAnnotations) vobj;\r
- if (dsa.getSeqRefCount()!=1)\r
- {\r
- Cache.log.warn("Not binding "+dsa.getVorbaId()+" to Sequence Feature - has multiple dataset sequence references.");\r
- return;\r
- }\r
- jalview.datamodel.SequenceFeature sf = (jalview.datamodel.SequenceFeature) jvobj;\r
- dsSeq.addSequenceFeature(sf = getJalviewSeqFeature(dsa));\r
- jvobj = sf;\r
- bindjvvobj(sf, dsa);\r
- }\r
-\r
- public void conflict()\r
- {\r
- log.warn("Untested sequencefeature conflict code");\r
- DataSetAnnotations dsa = (DataSetAnnotations) vobj;\r
- jalview.datamodel.SequenceFeature feature = (jalview.datamodel.SequenceFeature) jvobj;\r
- jalview.datamodel.SequenceFeature sf = getJalviewSeqFeature(dsa);\r
- replaceJvObjMapping(feature, sf); // switch binding of dsa from old feature to newly created feature\r
- dsSeq.addSequenceFeature(sf); // add new imported feature\r
- addToDocument(); // and create a new feature in the document \r
- }\r
-\r
- public void updateToDoc()\r
- {\r
- DataSetAnnotations dsa = (DataSetAnnotations) vobj;\r
- jalview.datamodel.SequenceFeature feature = (jalview.datamodel.SequenceFeature) jvobj;\r
- if (dsa.getSeqRefCount() != 1)\r
- {\r
- replaceJvObjMapping(feature, null);\r
- Cache.log\r
- .warn("Binding of annotation to jalview feature has changed. Removing binding and recreating.");\r
- doSync(); // re-verify bindings.\r
- }\r
- else\r
- {\r
- // Sync the features from Jalview\r
- long oldref = dsa.get__last_hash();\r
- getDSAnnotationFromJalview(dsa, feature);\r
- if (oldref != dsa.hashCode())\r
- {\r
- Cache.log\r
- .debug("Updated dataset sequence annotation from feature.");\r
- addProvenance(dsa.getProvenance(), "modified");\r
- }\r
- }\r
-\r
- }\r
- public void updateFromDoc()\r
- {\r
- DataSetAnnotations dsa = (DataSetAnnotations) vobj;\r
- jalview.datamodel.SequenceFeature feature = (jalview.datamodel.SequenceFeature) jvobj;\r
- if (dsa.getSeqRefCount() != 1)\r
- {\r
- // conflicting update from document - we cannot map this feature anymore.\r
- replaceJvObjMapping(feature, null);\r
- Cache.log\r
- .warn("annotation ("+dsa.getVorbaId()+" bound to jalview feature cannot be mapped. Removing binding, deleting feature, and deleting feature.");\r
- // - consider deleting the feature ?\r
- dsSeq.deleteFeature(feature);\r
- // doSync();\r
- }\r
- else\r
- {\r
- // Sync the features to Jalview - easiest to delete and add the feature again\r
- jalview.datamodel.SequenceFeature newsf = getJalviewSeqFeature(dsa);\r
- dsSeq.deleteFeature(feature);\r
- replaceJvObjMapping(feature, newsf);\r
- dsSeq.addSequenceFeature(newsf);\r
- if (feature.otherDetails!=null) {\r
- // TODO later: leave this to finalise method ? \r
- feature.otherDetails.clear();\r
- }\r
- }\r
- }\r
-\r
- /**\r
- * correctly create/update a RangeAnnotation from a jalview sequence feature\r
- * TODO: refactor to a method in jalview.io.vamsas.RangeAnnotation class\r
- * \r
- * @param dsa\r
- * (typically DataSetAnnotations or\r
- * AlignmentSequenceAnnotation)\r
- * @param feature\r
- * (the feature to be mapped from)\r
- * @return\r
- */\r
- private RangeAnnotation getDSAnnotationFromJalview(RangeAnnotation dsa,\r
- jalview.datamodel.SequenceFeature feature)\r
- {\r
- dsa.setType(feature.getType());\r
- Seg vSeg = new Seg();\r
- vSeg.setStart(feature.getBegin());\r
- vSeg.setEnd(feature.getEnd());\r
- vSeg.setInclusive(true);\r
- if (dsa.getSegCount() > 1)\r
- {\r
- Cache.log\r
- .debug("About to destroy complex annotation in vamsas document mapped to sequence feature ("\r
- + dsa.getVorbaId() + ")");\r
- }\r
- dsa.setSeg(new Seg[]\r
- { vSeg });\r
- dsa.setDescription(feature.getDescription());\r
- dsa.setStatus(feature.getStatus());\r
- if (feature.links != null && feature.links.size() > 0)\r
- {\r
- for (int i = 0, iSize = feature.links.size(); i < iSize; i++)\r
- {\r
- String link = (String) feature.links.elementAt(i);\r
- UrlLink ulink = new UrlLink(link);\r
- if (ulink.isValid())\r
- {\r
- // We only add static links to the document.\r
- Link vLink = new Link();\r
- vLink.setContent(ulink.getLabel());\r
- vLink.setHref(ulink.getTarget());\r
- dsa.addLink(vLink);\r
- }\r
- }\r
- }\r
- dsa.setGroup(feature.getFeatureGroup());\r
- if (feature.getScore() != Float.NaN)\r
- {\r
- Score fscore = new Score();\r
- dsa.setScore(new Score[]\r
- { fscore });\r
- fscore.setContent(feature.getScore());\r
- fscore.setName(feature.getType());\r
- }\r
- if (feature.otherDetails != null)\r
- {\r
- Enumeration iter = feature.otherDetails.keys();\r
- Vector props = dsa.getPropertyAsReference();\r
- while (iter.hasMoreElements())\r
- {\r
- String key = (String) iter.nextElement();\r
- if (!key.equalsIgnoreCase("score")\r
- && !key.equalsIgnoreCase("status"))\r
- {\r
- Property nprop = new Property();\r
- nprop.setName(key);\r
- Object vlu = feature.getValue(key);\r
- nprop.setContent(feature.getValue(key).toString());\r
- boolean valid = false;\r
- if (vlu instanceof String)\r
- {\r
- nprop.setType(uk.ac.vamsas.objects.utils.Properties.STRINGTYPE);\r
- valid = true;\r
- }\r
- else if (vlu instanceof Integer)\r
- {\r
- valid = true;\r
- nprop\r
- .setType(uk.ac.vamsas.objects.utils.Properties.INTEGERTYPE);\r
- }\r
- else if (vlu instanceof Float)\r
- {\r
- nprop.setType(uk.ac.vamsas.objects.utils.Properties.FLOATTYPE);\r
- valid = true;\r
- }\r
- if (valid)\r
- {\r
- if (props != null)\r
- {\r
- uk.ac.vamsas.objects.utils.Properties.addOrReplace(props,\r
- nprop);\r
- }\r
- else\r
- {\r
- dsa.addProperty(nprop);\r
- }\r
- }\r
- }\r
- }\r
- }\r
- return dsa;\r
- }\r
- private SequenceFeature getJalviewSeqFeature(RangeAnnotation dseta)\r
- {\r
- int[] se = getBounds(dseta);\r
- SequenceFeature sf = new jalview.datamodel.SequenceFeature(dseta\r
- .getType(), dseta.getDescription(), dseta.getStatus(), se[0],\r
- se[1], dseta.getGroup());\r
- if (dseta.getLinkCount() > 0)\r
- {\r
- Link[] links = dseta.getLink();\r
- for (int i = 0; i < links.length; i++)\r
- { \r
- // TODO: use URLLink parsing/validation here.\r
- sf.addLink(links[i].getContent() + "|" + links[i].getHref());\r
- }\r
- }\r
- if (dseta.getScoreCount()>0)\r
- {\r
- Enumeration scr = dseta.enumerateScore();\r
- while (scr.hasMoreElements())\r
- {\r
- Score score = (Score) scr.nextElement();\r
- if (score.getName().equals(sf.getType()))\r
- {\r
- sf.setScore(score.getContent());\r
- } else {\r
- sf.setValue(score.getName(), ""+score.getContent());\r
- }\r
- }\r
- }\r
- // other details\r
- Enumeration props = dseta.enumerateProperty();\r
- while (props.hasMoreElements())\r
- {\r
- Property p = (Property) props.nextElement();\r
- Object val = null;\r
- if (Properties.isValid(p)) \r
- {\r
- if (Properties.isString(p))\r
- {\r
- val = p.getContent();\r
- }\r
- if (Properties.isBoolean(p))\r
- {\r
- try {\r
- val = new Boolean(p.getContent());\r
- } catch (Exception e) {}\r
- }\r
- if (Properties.isFloat(p))\r
- {\r
- try {\r
- val = new Float(p.getContent());\r
- \r
- } catch (Exception e)\r
- {\r
- }\r
- }\r
- if(Properties.isInteger(p))\r
- {\r
- try {\r
- val = new Integer(p.getContent());\r
- } catch (Exception e)\r
- {\r
- } \r
- }\r
- if (val!=null)\r
- {\r
- sf.setValue(p.getName(), val);\r
- }\r
- }\r
- }\r
-\r
- return sf;\r
- }\r
-\r
-}\r
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
+ * Copyright (C) 2014 The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+package jalview.io.vamsas;
+
+import java.util.Enumeration;
+import java.util.Vector;
+
+import uk.ac.vamsas.objects.core.DataSetAnnotations;
+import uk.ac.vamsas.objects.core.Link;
+import uk.ac.vamsas.objects.core.Property;
+import uk.ac.vamsas.objects.core.Provenance;
+import uk.ac.vamsas.objects.core.RangeAnnotation;
+import uk.ac.vamsas.objects.core.Score;
+import uk.ac.vamsas.objects.core.Seg;
+import uk.ac.vamsas.objects.utils.Properties;
+import jalview.bin.Cache;
+import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceI;
+import jalview.io.VamsasAppDatastore;
+import jalview.util.UrlLink;
+
+/**
+ * @author JimP
+ *
+ */
+public class Sequencefeature extends Rangetype
+{
+
+ uk.ac.vamsas.objects.core.DataSet dataset;
+
+ uk.ac.vamsas.objects.core.Sequence sequence;
+
+ private SequenceI dsSeq;
+
+ public Sequencefeature(VamsasAppDatastore vamsasAppDatastore,
+ SequenceFeature sequenceFeature,
+ uk.ac.vamsas.objects.core.DataSet dataset,
+ uk.ac.vamsas.objects.core.Sequence sequence)
+ {
+ super(vamsasAppDatastore, sequenceFeature, DataSetAnnotations.class);
+ this.dataset = dataset;
+ this.sequence = sequence;
+ doSync();
+ }
+
+ public Sequencefeature(VamsasAppDatastore vamsasAppDatastore,
+ DataSetAnnotations dseta, SequenceI dsSeq)
+ {
+ super(vamsasAppDatastore, dseta,
+ jalview.datamodel.SequenceFeature.class);
+ this.dsSeq = dsSeq;
+ doJvUpdate();
+ }
+
+ public void addToDocument()
+ {
+ DataSetAnnotations dsa = (DataSetAnnotations) vobj;
+ jalview.datamodel.SequenceFeature feature = (jalview.datamodel.SequenceFeature) jvobj;
+ dsa = (DataSetAnnotations) getDSAnnotationFromJalview(
+ new DataSetAnnotations(), feature);
+ if (dsa.getProvenance() == null)
+ {
+ dsa.setProvenance(new Provenance());
+ }
+ addProvenance(dsa.getProvenance(), "created"); // JBPNote - need
+ // to update
+ dsa.addSeqRef(sequence); // we have just created this annotation
+ // - so safe to use this
+ bindjvvobj(feature, dsa);
+ dataset.addDataSetAnnotations(dsa);
+ }
+
+ public void addFromDocument()
+ {
+ DataSetAnnotations dsa = (DataSetAnnotations) vobj;
+ if (dsa.getSeqRefCount() != 1)
+ {
+ Cache.log
+ .warn("Not binding "
+ + dsa.getVorbaId()
+ + " to Sequence Feature - has multiple dataset sequence references.");
+ return;
+ }
+ jalview.datamodel.SequenceFeature sf = (jalview.datamodel.SequenceFeature) jvobj;
+ dsSeq.addSequenceFeature(sf = getJalviewSeqFeature(dsa));
+ jvobj = sf;
+ bindjvvobj(sf, dsa);
+ }
+
+ public void conflict()
+ {
+ log.warn("Untested sequencefeature conflict code");
+ DataSetAnnotations dsa = (DataSetAnnotations) vobj;
+ jalview.datamodel.SequenceFeature feature = (jalview.datamodel.SequenceFeature) jvobj;
+ jalview.datamodel.SequenceFeature sf = getJalviewSeqFeature(dsa);
+ replaceJvObjMapping(feature, sf); // switch binding of dsa from old feature
+ // to newly created feature
+ dsSeq.addSequenceFeature(sf); // add new imported feature
+ addToDocument(); // and create a new feature in the document
+ }
+
+ public void updateToDoc()
+ {
+ DataSetAnnotations dsa = (DataSetAnnotations) vobj;
+ jalview.datamodel.SequenceFeature feature = (jalview.datamodel.SequenceFeature) jvobj;
+ if (dsa.getSeqRefCount() != 1)
+ {
+ replaceJvObjMapping(feature, null);
+ Cache.log
+ .warn("Binding of annotation to jalview feature has changed. Removing binding and recreating.");
+ doSync(); // re-verify bindings.
+ }
+ else
+ {
+ // Sync the features from Jalview
+ long oldref = dsa.get__last_hash();
+ getDSAnnotationFromJalview(dsa, feature);
+ if (oldref != dsa.hashCode())
+ {
+ Cache.log
+ .debug("Updated dataset sequence annotation from feature.");
+ addProvenance(dsa.getProvenance(), "modified");
+ }
+ }
+
+ }
+
+ public void updateFromDoc()
+ {
+ DataSetAnnotations dsa = (DataSetAnnotations) vobj;
+ jalview.datamodel.SequenceFeature feature = (jalview.datamodel.SequenceFeature) jvobj;
+ if (dsa.getSeqRefCount() != 1)
+ {
+ // conflicting update from document - we cannot map this feature anymore.
+ replaceJvObjMapping(feature, null);
+ Cache.log
+ .warn("annotation ("
+ + dsa.getVorbaId()
+ + " bound to jalview feature cannot be mapped. Removing binding, deleting feature, and deleting feature.");
+ // - consider deleting the feature ?
+ dsSeq.deleteFeature(feature);
+ // doSync();
+ }
+ else
+ {
+ // Sync the features to Jalview - easiest to delete and add the feature
+ // again
+ jalview.datamodel.SequenceFeature newsf = getJalviewSeqFeature(dsa);
+ dsSeq.deleteFeature(feature);
+ replaceJvObjMapping(feature, newsf);
+ dsSeq.addSequenceFeature(newsf);
+ if (feature.otherDetails != null)
+ {
+ // TODO later: leave this to finalise method ?
+ feature.otherDetails.clear();
+ }
+ }
+ }
+
+ /**
+ * correctly create/update a RangeAnnotation from a jalview sequence feature
+ * TODO: refactor to a method in jalview.io.vamsas.RangeAnnotation class
+ *
+ * @param dsa
+ * (typically DataSetAnnotations or AlignmentSequenceAnnotation)
+ * @param feature
+ * (the feature to be mapped from)
+ * @return
+ */
+ private RangeAnnotation getDSAnnotationFromJalview(RangeAnnotation dsa,
+ jalview.datamodel.SequenceFeature feature)
+ {
+ dsa.setType(feature.getType());
+ Seg vSeg = new Seg();
+ vSeg.setStart(feature.getBegin());
+ vSeg.setEnd(feature.getEnd());
+ vSeg.setInclusive(true);
+ if (dsa.getSegCount() > 1)
+ {
+ Cache.log
+ .debug("About to destroy complex annotation in vamsas document mapped to sequence feature ("
+ + dsa.getVorbaId() + ")");
+ }
+ dsa.setSeg(new Seg[]
+ { vSeg });
+ dsa.setDescription(feature.getDescription());
+ dsa.setStatus(feature.getStatus());
+ if (feature.links != null && feature.links.size() > 0)
+ {
+ for (int i = 0, iSize = feature.links.size(); i < iSize; i++)
+ {
+ String link = (String) feature.links.elementAt(i);
+ UrlLink ulink = new UrlLink(link);
+ if (ulink.isValid())
+ {
+ // We only add static links to the document.
+ Link vLink = new Link();
+ vLink.setContent(ulink.getLabel());
+ vLink.setHref(ulink.getTarget());
+ dsa.addLink(vLink);
+ }
+ }
+ }
+ dsa.setGroup(feature.getFeatureGroup());
+ if (feature.getScore() != Float.NaN)
+ {
+ Score fscore = new Score();
+ dsa.setScore(new Score[]
+ { fscore });
+ fscore.setContent(feature.getScore());
+ fscore.setName(feature.getType());
+ }
+ if (feature.otherDetails != null)
+ {
+ Enumeration iter = feature.otherDetails.keys();
+ Vector props = dsa.getPropertyAsReference();
+ while (iter.hasMoreElements())
+ {
+ String key = (String) iter.nextElement();
+ if (!key.equalsIgnoreCase("score")
+ && !key.equalsIgnoreCase("status"))
+ {
+ Property nprop = new Property();
+ nprop.setName(key);
+ Object vlu = feature.getValue(key);
+ nprop.setContent(feature.getValue(key).toString());
+ boolean valid = false;
+ if (vlu instanceof String)
+ {
+ nprop.setType(uk.ac.vamsas.objects.utils.Properties.STRINGTYPE);
+ valid = true;
+ }
+ else if (vlu instanceof Integer)
+ {
+ valid = true;
+ nprop.setType(uk.ac.vamsas.objects.utils.Properties.INTEGERTYPE);
+ }
+ else if (vlu instanceof Float)
+ {
+ nprop.setType(uk.ac.vamsas.objects.utils.Properties.FLOATTYPE);
+ valid = true;
+ }
+ if (valid)
+ {
+ if (props != null)
+ {
+ uk.ac.vamsas.objects.utils.Properties.addOrReplace(props,
+ nprop);
+ }
+ else
+ {
+ dsa.addProperty(nprop);
+ }
+ }
+ }
+ }
+ }
+ return dsa;
+ }
+
+ private SequenceFeature getJalviewSeqFeature(RangeAnnotation dseta)
+ {
+ int[] se = getBounds(dseta);
+ SequenceFeature sf = new jalview.datamodel.SequenceFeature(
+ dseta.getType(), dseta.getDescription(), dseta.getStatus(),
+ se[0], se[1], dseta.getGroup());
+ if (dseta.getLinkCount() > 0)
+ {
+ Link[] links = dseta.getLink();
+ for (int i = 0; i < links.length; i++)
+ {
+ // TODO: use URLLink parsing/validation here.
+ sf.addLink(links[i].getContent() + "|" + links[i].getHref());
+ }
+ }
+ if (dseta.getScoreCount() > 0)
+ {
+ Enumeration scr = dseta.enumerateScore();
+ while (scr.hasMoreElements())
+ {
+ Score score = (Score) scr.nextElement();
+ if (score.getName().equals(sf.getType()))
+ {
+ sf.setScore(score.getContent());
+ }
+ else
+ {
+ sf.setValue(score.getName(), "" + score.getContent());
+ }
+ }
+ }
+ // other details
+ Enumeration props = dseta.enumerateProperty();
+ while (props.hasMoreElements())
+ {
+ Property p = (Property) props.nextElement();
+ Object val = null;
+ if (Properties.isValid(p))
+ {
+ if (Properties.isString(p))
+ {
+ val = p.getContent();
+ }
+ if (Properties.isBoolean(p))
+ {
+ try
+ {
+ val = new Boolean(p.getContent());
+ } catch (Exception e)
+ {
+ }
+ }
+ if (Properties.isFloat(p))
+ {
+ try
+ {
+ val = new Float(p.getContent());
+
+ } catch (Exception e)
+ {
+ }
+ }
+ if (Properties.isInteger(p))
+ {
+ try
+ {
+ val = new Integer(p.getContent());
+ } catch (Exception e)
+ {
+ }
+ }
+ if (val != null)
+ {
+ sf.setValue(p.getName(), val);
+ }
+ }
+ }
+
+ return sf;
+ }
+
+}