Class MarkupLineAdapter
- java.lang.Object
-
- gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeAdapter<TYPE,ITEM_TYPE>
-
- gov.nist.secauto.metaschema.core.datatype.AbstractCustomJavaDataTypeAdapter<TYPE,IMarkupItem>
-
- gov.nist.secauto.metaschema.core.datatype.markup.AbstractMarkupAdapter<MarkupLine>
-
- gov.nist.secauto.metaschema.core.datatype.markup.MarkupLineAdapter
-
- All Implemented Interfaces:
IDataTypeAdapter<MarkupLine>
public class MarkupLineAdapter extends AbstractMarkupAdapter<MarkupLine>
-
-
Field Summary
-
Fields inherited from class gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeAdapter
DEFAULT_JSON_FIELD_NAME
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDefaultJsonValueKey()
Gets the default value to use as the JSON/YAML field name for a Metaschema field value if no JSON value key flag or name is configured.Class<IMarkupItem>
getItemClass()
Get the java type of the associated item.List<String>
getNames()
Get the metaschema type names associated with this adapter.IMarkupItem
newItem(Object value)
Construct a new item of this type using the provided value.MarkupLine
parse(com.fasterxml.jackson.core.JsonParser parser)
This default implementation will parse the value as a string and delegate to the string-based parsing method.MarkupLine
parse(String value)
Parse a line of Markdown.MarkupLine
parse(org.codehaus.stax2.XMLEventReader2 eventReader)
This method is expected to parse content starting at the next event.-
Methods inherited from class gov.nist.secauto.metaschema.core.datatype.markup.AbstractMarkupAdapter
getJsonRawType, isXmlMixed, writeJsonValue, writeXmlValue, writeXmlValue
-
Methods inherited from class gov.nist.secauto.metaschema.core.datatype.AbstractCustomJavaDataTypeAdapter
copy
-
Methods inherited from class gov.nist.secauto.metaschema.core.datatype.AbstractDataTypeAdapter
asString, canHandleQName, cast, castInternal, getJavaClass, isParsingStartElement, isUnrappedValueAllowedInXml, toValue
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface gov.nist.secauto.metaschema.core.datatype.IDataTypeAdapter
getPreferredName, isAtomic, parseAndSupply, parseAndSupply, parseAndSupply
-
-
-
-
Method Detail
-
getNames
public List<String> getNames()
Description copied from interface:IDataTypeAdapter
Get the metaschema type names associated with this adapter. This name must be unique with respect to all other metaschema types.At least one name must be provided, with the first name being the most preferred name.
- Returns:
- the name
-
parse
public MarkupLine parse(String value)
Parse a line of Markdown.- Parameters:
value
- the string value to parse- Returns:
- the parsed data as the adapter's type
-
parse
public MarkupLine parse(org.codehaus.stax2.XMLEventReader2 eventReader) throws IOException
Description copied from interface:IDataTypeAdapter
This method is expected to parse content starting at the next event. Parsing will continue until the next event represents content that is not handled by this adapter. This means the event stream should be positioned after anyXMLStreamConstants.END_ELEMENT
that corresponds to anXMLStreamConstants.START_ELEMENT
parsed by this adapter.If
IDataTypeAdapter.isParsingStartElement()
returnstrue
, then the first event to parse will be theXMLStreamConstants.START_ELEMENT
for the element that contains the value data, then the value data. If this is the case, this method must also parse the correspondingXMLStreamConstants.END_ELEMENT
. Otherwise, the first event to parse will be the value data.The value data is expected to be parsed completely, leaving the event stream on a peeked event corresponding to content that is not handled by this method.
- Specified by:
parse
in interfaceIDataTypeAdapter<MarkupLine>
- Overrides:
parse
in classAbstractDataTypeAdapter<MarkupLine,IMarkupItem>
- Parameters:
eventReader
- the XML parser used to read the parsed value- Returns:
- the parsed value
- Throws:
IOException
- if a parsing error occurs
-
parse
public MarkupLine parse(com.fasterxml.jackson.core.JsonParser parser) throws IOException
Description copied from class:AbstractDataTypeAdapter
This default implementation will parse the value as a string and delegate to the string-based parsing method.- Specified by:
parse
in interfaceIDataTypeAdapter<MarkupLine>
- Overrides:
parse
in classAbstractDataTypeAdapter<MarkupLine,IMarkupItem>
- Parameters:
parser
- the JSON parser used to read the parsed value- Returns:
- the parsed value
- Throws:
IOException
- if a parsing error occurs
-
getDefaultJsonValueKey
public String getDefaultJsonValueKey()
Description copied from interface:IDataTypeAdapter
Gets the default value to use as the JSON/YAML field name for a Metaschema field value if no JSON value key flag or name is configured.- Specified by:
getDefaultJsonValueKey
in interfaceIDataTypeAdapter<MarkupLine>
- Overrides:
getDefaultJsonValueKey
in classAbstractDataTypeAdapter<MarkupLine,IMarkupItem>
- Returns:
- the default field name to use
-
getItemClass
public Class<IMarkupItem> getItemClass()
Description copied from interface:IDataTypeAdapter
Get the java type of the associated item.- Specified by:
getItemClass
in interfaceIDataTypeAdapter<MarkupLine>
- Specified by:
getItemClass
in classAbstractDataTypeAdapter<MarkupLine,IMarkupItem>
- Returns:
- the java associated item type
-
newItem
public IMarkupItem newItem(Object value)
Description copied from interface:IDataTypeAdapter
Construct a new item of this type using the provided value.- Specified by:
newItem
in interfaceIDataTypeAdapter<MarkupLine>
- Specified by:
newItem
in classAbstractDataTypeAdapter<MarkupLine,IMarkupItem>
- Parameters:
value
- the item's value- Returns:
- a new item
-
-