/** * Get the entity prefix based on an entity reference string, * <b>WARNING:</b> this is meant for internal use, * use {@link EntityReference#EntityReference(String)} and * the methods in {@link EntityBroker} to parse references * * @param reference an entity reference or entity URL * @return the entity prefix */ public static String getPrefix(String reference) { return findPrefix(reference); }
/** * Constructor which takes an entity reference, * this is the most common way to construct an entity reference object * * @param reference a globally unique reference to an entity, * consists of the entity prefix and optional path segments */ public EntityReference(String reference) { // OVERRIDE THIS when creating your own EntityReference this(); checkReference(reference); this.originalReference = reference; this.prefix = findPrefix(reference); this.entityId = findId(reference); empty = false; }