Skip to content

Commit

Permalink
more to dev guide
Browse files Browse the repository at this point in the history
  • Loading branch information
walterxie committed Oct 23, 2024
1 parent a56792d commit 15b3db1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions DEV_NOTE2.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,10 @@ so that it can be used in an LPhy script.
In LPhy core, the registration is normally in the class [lphy.base.spi.LPhyBaseImpl](https://github.com/LinguaPhylo/linguaPhylo/blob/214bb91e8546fc136d51fb50ab6555522a8385a6/lphy-base/src/main/java/lphy/base/spi/LPhyBaseImpl.java#L46-L120).
Add your class into the corresponding list.

To add and register new `SequenceType` in LPhy extension, you need to:

1. create your own class and inherit (extends) `SequenceTypeBaseImpl` ;
2. initialize Map using the same code in the constructor;
3. copy the method `register()`;
4. overwrite `declareSequenceTypes()` and register your `SequenceType` there;
5. overwrite `getExtensionName()`.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ public class SequenceTypeBaseImpl implements SequenceTypeExtension {
return dataTypeMap;
}

/**TODO private or protected?
* LPhy sequence types {@link SequenceType}
/**
* To add and register new SequenceType in LPhy extension, you need to:
* 1. create your own class and inherit (extends) SequenceTypeBaseImpl ;
* 2. copy the constructor to init Map;
* 3. copy the method {@link #register()};
* 4. overwrite {@link #declareSequenceTypes()} and register your SequenceType there;
* 5. overwrite {@link #getExtensionName()}.
*/
protected static Map<String, SequenceType> dataTypeMap;

Expand Down

0 comments on commit 15b3db1

Please sign in to comment.