Class IdEncoder
- java.lang.Object
 - 
- jetbrains.mps.smodel.persistence.def.v9.IdEncoder
 
 
- 
- All Implemented Interfaces:
 IdInfoRegistry.IndexEncoder
public final class IdEncoder extends Object implements IdInfoRegistry.IndexEncoder
Intention is to keep all serialize/de-serialize code in a single place. FIXME this class is public merely for the sake of GoToNodeById action. Once this encoder is part of persistence API, action shall use API, not this class This class is not thread-safe, uses internal buffers to save memory on (de-)serialize, do not share it between thread (although unlikely to happen as persistence demands single thread access). 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIdEncoder.EncodingException 
- 
Constructor Summary
Constructors Constructor Description IdEncoder() 
- 
Method Summary
 
 - 
 
- 
- 
Method Detail
- 
toText
public String toText(SLanguageId langId)
 
- 
parseLanguageId
public SLanguageId parseLanguageId(String text)
 
- 
toText
public String toText(SConceptId conceptId)
 
- 
parseConceptId
public SConceptId parseConceptId(SLanguageId lang, String text)
 
- 
toText
public String toText(SPropertyId propertyId)
 
- 
parsePropertyId
public SPropertyId parsePropertyId(SConceptId concept, String text)
 
- 
toText
public String toText(SReferenceLinkId linkId)
 
- 
parseAssociation
public SReferenceLinkId parseAssociation(SConceptId concept, String text)
 
- 
toText
public String toText(SContainmentLinkId linkId)
 
- 
parseAggregation
public SContainmentLinkId parseAggregation(SConceptId concept, String text)
 
- 
parseNodeId
public SNodeId parseNodeId(String text) throws IdEncoder.EncodingException
- Throws:
 IdEncoder.EncodingException
 
- 
toText
public String toText(SModelReference mr)
 
- 
parseModelReference
public SModelReference parseModelReference(String text)
 
- 
toText
public String toText(SModuleReference ref)
 
- 
parseModuleReference
public SModuleReference parseModuleReference(String text)
 
- 
toTextLocal
public String toTextLocal(SReference ref)
 
- 
toTextExternal
public String toTextExternal(@NotNull jetbrains.mps.smodel.persistence.def.v9.ImportsHelper imports, @NotNull SReference ref)
Local references are saved in a form of serialized node id, or '^' for dynamic references. External references are prefixed with import index and ':'. NOTE, the way import index and nodeId value are serialized is expected to never include ':' separator char 
- 
parseExternalNodeReference
public Pair<SModelReference,SNodeId> parseExternalNodeReference(jetbrains.mps.smodel.persistence.def.v9.ImportsHelper imports, String referenceTarget)
 
- 
index
public String index(int key)
- Specified by:
 indexin interfaceIdInfoRegistry.IndexEncoder
 
 - 
 
 -