public class CommentsContainer extends Object implements Section
CCSDS files accept comments only at the beginning of sections. Once header/metadata/data content has started, comments in the corresponding section are refused.
Constructor and Description |
---|
CommentsContainer()
Create a new meta-data.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptComments()
Check if container is still accepting comments.
|
boolean |
addComment(String comment)
Add comment.
|
void |
checkAllowed(double version,
Object field,
Enum<?> key,
double minVersion,
double maxVersion)
Complain if a key is not allowed.
|
void |
checkNotNaN(double field,
Enum<?> key)
Complain if a field is NaN.
|
void |
checkNotNegative(int field,
Enum<?> key)
Complain if a field is negative.
|
void |
checkNotNull(Object field,
Enum<?> key)
Complain if a field is null.
|
List<String> |
getComments()
Get the comments.
|
void |
refuseFurtherComments()
Set flag to refuse further comments.
|
void |
validate(double version)
Check is all mandatory entries have been initialized.
|
public void checkNotNegative(int field, Enum<?> key)
field
- field to checkkey
- key associated with the fieldpublic void checkNotNaN(double field, Enum<?> key)
field
- field to checkkey
- key associated with the fieldpublic void checkNotNull(Object field, Enum<?> key)
field
- field to checkkey
- key associated with the fieldpublic void checkAllowed(double version, Object field, Enum<?> key, double minVersion, double maxVersion)
version
- format versionfield
- field to checkkey
- key associated with the fieldminVersion
- version at which key started to be allowedmaxVersion
- version at which key started to be forbiddenpublic void validate(double version)
This method should throw an exception if some mandatory entries are missing or not compatible with version number.
public boolean acceptComments()
A container that still accept comments does not contain any other data.
public void refuseFurtherComments()
public boolean addComment(String comment)
Comments are accepted only at start. Once other content is stored in the same section, comments are refused.
comment
- comment lineCopyright © 2002-2023 CS GROUP. All rights reserved.