static XDIArc fromComponents(String string, Character cs, boolean variable, boolean definition, boolean collection, boolean attribute, boolean immutable, boolean relative, String literal, XDIXRef xref) {
if (string == null) {
StringBuffer buffer = new StringBuffer();
if (variable) buffer.append(XDIConstants.XS_VARIABLE.charAt(0));
if (definition) buffer.append(XDIConstants.XS_DEFINITION.charAt(0));
if (collection) buffer.append(XDIConstants.XS_COLLECTION.charAt(0));
if (attribute) buffer.append(XDIConstants.XS_ATTRIBUTE.charAt(0));
if (cs != null) buffer.append(cs);
if (immutable) buffer.append(XDIConstants.S_IMMUTABLE);
if (relative) buffer.append(XDIConstants.S_RELATIVE);
if (literal != null) buffer.append(literal);
if (xref != null) buffer.append(xref.toString());
if (attribute) buffer.append(XDIConstants.XS_ATTRIBUTE.charAt(1));
if (collection) buffer.append(XDIConstants.XS_COLLECTION.charAt(1));
if (definition) buffer.append(XDIConstants.XS_DEFINITION.charAt(1));
if (variable) buffer.append(XDIConstants.XS_VARIABLE.charAt(1));
string = buffer.toString();
}
if (cs == null && literal != null) throw new ParserException("If there is a literal, must have a context symbol: " + string);
if (literal != null && xref != null) throw new ParserException("Cannot have both literal and xref: " + string);
return new XDIArc(string, cs, variable, definition, collection, attribute, immutable, relative, literal, xref);
}