/** Generate an AET Name that corresponds to the tag passed in */ private Name getNameForTag(MXMLTagData tag) { if (tag == rootTag) { return new Name(parent.getEffectiveID()); } else { String uri = tag.getURI(); if (uri != null) { return new Name(new Namespace(ABCConstants.CONSTANT_Namespace, uri), tag.getShortName()); } else { return new Name(tag.getShortName()); } } }
@Override protected void processChildTag( MXMLTreeBuilder builder, MXMLTagData tag, MXMLTagData childTag, MXMLNodeInfo info) { if (info.hasSpecifierWithName(childTag.getShortName(), childTag.getStateName())) { ICompilerProblem problem = new MXMLDuplicateChildTagProblem(childTag); builder.addProblem(problem); return; } FlexProject project = builder.getProject(); // Handle child tags that are property/style/event specifiers. MXMLSpecifierNodeBase childNode = createSpecifierNode(builder, childTag.getShortName()); if (childNode != null) { // This tag is not part of the default property value. processNonDefaultPropertyContentUnit(builder, info); childNode.setSuffix(builder, childTag.getStateName()); childNode.initializeFromTag(builder, childTag); info.addChildNode(childNode); } else if (builder.getFileScope().isScriptTag(childTag) && (builder.getMXMLDialect().isEqualToOrBefore(MXMLDialect.MXML_2009))) { // In MXML 2006 and 2009, allow a <Script> tag // inside any class reference tag if (!processingDefaultProperty) { // Not processing the default property, just make a script // node and put it in the tree. MXMLScriptNode scriptNode = new MXMLScriptNode(this); scriptNode.initializeFromTag(builder, childTag); info.addChildNode(scriptNode); } else { // We are processing a default property. Script nodes need // to be a child of that default specifier nodes so that // finding a node by offset works properly. // See: http://bugs.adobe.com/jira/browse/CMP-955 processDefaultPropertyContentUnit(builder, childTag, info); } } else if (builder.getFileScope().isReparentTag(childTag)) { MXMLReparentNode reparentNode = new MXMLReparentNode(this); reparentNode.initializeFromTag(builder, childTag); info.addChildNode(reparentNode); } else { IDefinition definition = builder.getFileScope().resolveTagToDefinition(childTag); if (definition instanceof ClassDefinition) { // Handle child tags that are instance tags. IVariableDefinition defaultPropertyDefinition = getDefaultPropertyDefinition(builder); if (defaultPropertyDefinition != null && !processedDefaultProperty) { // Since there is a default property and we haven't already processed it, // assume this child instance tag is part of its value. processDefaultPropertyContentUnit(builder, childTag, info); } else { // This tag is not part of the default property value. processNonDefaultPropertyContentUnit(builder, info); MXMLInstanceNode instanceNode = MXMLInstanceNode.createInstanceNode(builder, definition.getQualifiedName(), this); instanceNode.setClassReference( project, (IClassDefinition) definition); // TODO Move this logic to initializeFromTag(). instanceNode.initializeFromTag(builder, childTag); info.addChildNode(instanceNode); } } else { // Handle child tags that are something other than property/style/event tags // or instance tags. // This tag is not part of the default property value. processNonDefaultPropertyContentUnit(builder, info); super.processChildTag(builder, tag, childTag, info); } } }