Commit dfae5199 authored by Luc Maisonobe's avatar Luc Maisonobe

Moved around some XML tag constants.

parent 6ef49f6e
......@@ -42,6 +42,15 @@ public class OcmFile extends NdmFile<Header, Segment<OcmMetadata, OcmData>>
/** Key for format version. */
public static final String FORMAT_VERSION_KEY = "CCSDS_OCM_VERS";
/** Orbit line element for XML messages. */
public static final String ORB_LINE = "orbLine";
/** Covariance line element for XML messages. */
public static final String COV_LINE = "covLine";
/** Maneuver line element for XML messages. */
public static final String MAN_LINE = "manLine";
/** Gravitational coefficient to use for building Cartesian/Keplerian orbits. */
private final double mu;
......
......@@ -63,12 +63,6 @@ import org.orekit.utils.units.Unit;
*/
public class OcmParser extends CommonParser<OcmFile, OcmParser> implements EphemerisFileParser<OcmFile> {
/** Orbit line element for XML messages. */
private static final String ORB_LINE = "orbLine";
/** User-defined element. */
private static final String USER_DEFINED = "USER_DEFINED";
/** Pattern for splitting strings at blanks. */
private static final Pattern SPLIT_AT_BLANKS = Pattern.compile("\\s+");
......@@ -147,7 +141,7 @@ public class OcmParser extends CommonParser<OcmFile, OcmParser> implements Ephem
final Map<String, XmlTokenBuilder> builders = super.getSpecialXmlElementsBuilders();
// special handling of user-defined parameters
builders.put(USER_DEFINED, new UserDefinedXmlTokenBuilder());
builders.put(UserDefined.USER_DEFINED_XML_TAG, new UserDefinedXmlTokenBuilder());
return builders;
......@@ -463,7 +457,7 @@ public class OcmParser extends CommonParser<OcmFile, OcmParser> implements Ephem
* @return true if token was processed, false otherwise
*/
private boolean processOrbitStateToken(final ParseToken token) {
if (token.getName() != null && !token.getName().equals(ORB_LINE)) {
if (token.getName() != null && !token.getName().equals(OcmFile.ORB_LINE)) {
// we are in the section metadata part
try {
return OrbitStateHistoryMetadataKey.valueOf(token.getName()).
......@@ -523,7 +517,7 @@ public class OcmParser extends CommonParser<OcmFile, OcmParser> implements Ephem
* @return true if token was processed, false otherwise
*/
private boolean processCovarianceToken(final ParseToken token) {
if (token.getName() != null) {
if (token.getName() != null && !token.getName().equals(OcmFile.COV_LINE)) {
// we are in the section metadata part
try {
return CovarianceHistoryMetadataKey.valueOf(token.getName()).
......@@ -562,7 +556,7 @@ public class OcmParser extends CommonParser<OcmFile, OcmParser> implements Ephem
* @return true if token was processed, false otherwise
*/
private boolean processManeuverToken(final ParseToken token) {
if (token.getName() != null) {
if (token.getName() != null && !token.getName().equals(OcmFile.MAN_LINE)) {
// we are in the section metadata part
try {
return ManeuverHistoryMetadataKey.valueOf(token.getName()).
......
......@@ -66,9 +66,6 @@ import org.orekit.utils.IERSConventions;
*/
public class OmmParser extends CommonParser<OmmFile, OmmParser> {
/** User-defined element. */
private static final String USER_DEFINED = "USER_DEFINED";
/** Default mass to use if there are no spacecraft parameters block logical block in the file. */
private final double defaultMass;
......@@ -129,7 +126,7 @@ public class OmmParser extends CommonParser<OmmFile, OmmParser> {
final Map<String, XmlTokenBuilder> builders = super.getSpecialXmlElementsBuilders();
// special handling of user-defined parameters
builders.put(USER_DEFINED, new UserDefinedXmlTokenBuilder());
builders.put(UserDefined.USER_DEFINED_XML_TAG, new UserDefinedXmlTokenBuilder());
return builders;
......
......@@ -67,9 +67,6 @@ import org.orekit.utils.IERSConventions;
*/
public class OpmParser extends CommonParser<OpmFile, OpmParser> {
/** User-defined element. */
private static final String USER_DEFINED = "USER_DEFINED";
/** Default mass to use if there are no spacecraft parameters block logical block in the file. */
private final double defaultMass;
......@@ -137,7 +134,7 @@ public class OpmParser extends CommonParser<OpmFile, OpmParser> {
final Map<String, XmlTokenBuilder> builders = super.getSpecialXmlElementsBuilders();
// special handling of user-defined parameters
builders.put(USER_DEFINED, new UserDefinedXmlTokenBuilder());
builders.put(UserDefined.USER_DEFINED_XML_TAG, new UserDefinedXmlTokenBuilder());
return builders;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment