2019-01-24 11:47:03 +01:00
|
|
|
package org.gcube.socialnetworking.socialtoken;
|
2019-01-22 18:22:17 +01:00
|
|
|
|
2019-01-23 14:58:59 +01:00
|
|
|
import org.gcube.portal.databook.client.GCubeSocialNetworking;
|
2019-01-24 11:50:00 +01:00
|
|
|
import org.gcube.socialnetworking.tokenization.Token;
|
2019-01-23 14:58:59 +01:00
|
|
|
|
2019-01-22 18:22:17 +01:00
|
|
|
public class TagToken extends ReplaceableToken {
|
|
|
|
|
2019-01-23 18:01:42 +01:00
|
|
|
public TagToken(String token, String delimiter, int start, int end) {
|
|
|
|
super(token, delimiter, start, end);
|
|
|
|
}
|
|
|
|
|
2019-01-22 18:22:17 +01:00
|
|
|
public TagToken(Token token) {
|
2019-01-23 14:58:59 +01:00
|
|
|
super(token);
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getTokenReplacement() {
|
|
|
|
if(!replaced) {
|
2019-01-24 11:50:00 +01:00
|
|
|
String linkTarget = ReplaceableToken.createHref("", GCubeSocialNetworking.HASHTAG_OID, super.token);
|
2019-01-23 15:51:28 +01:00
|
|
|
tokenReplacement = ReplaceableToken.createLink(linkTarget, token, null);
|
2019-01-23 14:58:59 +01:00
|
|
|
replaced = true;
|
|
|
|
}
|
2019-01-23 17:05:15 +01:00
|
|
|
return tokenReplacement;
|
2019-01-22 18:22:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|