protected void setOriginalReference(String reference) { checkReference(reference); this.originalReference = reference; }
/** * @param reference a globally unique reference to an entity, * consists of the entity prefix and optional id * @param number this is the separator to get, * 0 would return the first one found, 1 would return the second * @return the location of the separator between the entity and the id or -1 if none found */ protected static int getSeparatorPos(String reference, int number) { checkReference(reference); int position = 0; for (int i = 0; i < number; i++) { position = reference.indexOf(SEPARATOR, position+1); if (position < 0) { break; } } return position; }
/** * 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; }