SchemaParser parser,
String target, String data) {
SchemaObject object = parser.getCurrentObject();
ProcessingInstruction pi = new ProcessingInstruction(target, data);
String value;
if (object instanceof AttributeInfo) {
AttributeInfo info = (AttributeInfo) object;
// Process the options.
if ((value = pi.getValue("name")) != null) {
info.setAPIName(value);
parser.println("Attribute " + info.getName() +
" is known as "
+ info.getAPIName() + " in java code");
}
if ((value = pi.getValue("protocolName")) != null) {
info.setProtocolName(value);
parser.println("Attribute " + info.getName() +
" is known as "
+ info.getProtocolName() + " in protocol");
}
} else if (object instanceof ElementInfo) {
ElementInfo info = (ElementInfo) object;
AttributesStructureInfo attributesStructureInfo
= info.getAttributesStructureInfo();
info.setAPIElementClass(pi.getValue("elementClass"));
value = pi.getValue("attributesClass");
info.setAPIAttributesClass(value);
value = pi.getValue("naturalName");
info.setNaturalName(value);
value = pi.getValue("assetClass");
attributesStructureInfo.setApiAssetClassName(value);
value = pi.getValue("componentClassBase");
attributesStructureInfo.setApiComponentClassBase(value);
} else if (object instanceof AttributeGroupInfo) {
AttributeGroupInfo info = (AttributeGroupInfo) object;
AttributesStructureInfo attributesStructureInfo
= info.getAttributesStructureInfo();
info.setAPIElementClass(pi.getValue("elementClass"));
value = pi.getValue("attributeGroupClass");
//System.out.println ("attributeGroupClass=" + value);
attributesStructureInfo.setAPIAttributesClass(value);
value = pi.getValue("attributeGroupInterface");
attributesStructureInfo.setAPIAttributesInterface(value);
value = pi.getValue("baseAttributeGroup");
// System.out.println("baseAttributeGroup = " + value);
attributesStructureInfo.setAPIBaseAttributeGroup(value);
value = pi.getValue("naturalName");
attributesStructureInfo.setNaturalName(value);
// Add any extra attributes.
if ((value = pi.getValue("attribute")) != null) {
String name = value;
Scope scope = parser.getScope();
AttributeDefinition definition = scope.addAttributeDefinition(
name);
definition.setType(pi.getValue("type"));
definition.setUse(pi.getValue("use"));
List attributes = attributesStructureInfo.getAttributes();
attributes.add(definition);
}