Change Component setFromEscapedString and setSegment to static makeFromEscapedString and makeSegment, and make the class read-only.