log.debugf("Removed structure deployer %1s", deployer);
}
public boolean determineStructure(VirtualFile file, StructureContext parentContext) throws DeploymentException
{
StructureMetaData structure = StructureMetaDataFactory.createStructureMetaData();
StructureContext context = new StructureContext(file, structure, parentContext);
boolean result = doDetermineStructure(context);
if (result)
{
String relativePath = AbstractStructureDeployer.getRelativePath(context.getParent(), file);
// Something said it recognised it
ContextInfo recognised = structure.getContext("");
if (recognised == null)
throw new IllegalStateException("Something recognised the deployment, but there is no context? " + file);
// Create the context in the parent structure
ContextInfo parentContextInfo;
List<MetaDataEntry> metaDataPath = recognised.getMetaDataPath();
if (metaDataPath == null || metaDataPath.isEmpty())
parentContextInfo = StructureMetaDataFactory.createContextInfo(relativePath, recognised.getClassPath());
else
parentContextInfo = StructureMetaDataFactory.createContextInfo(recognised.getClassPath(), metaDataPath, relativePath);
// copy the modification type information
parentContextInfo.setModificationType(recognised.getModificationType());
StructureMetaData structureMetaData = parentContext.getMetaData();
structureMetaData.addContext(parentContextInfo);
MutableAttachments attachments = (MutableAttachments) parentContextInfo.getPredeterminedManagedObjects();
attachments.addAttachment(StructureMetaData.class, structure);
}
return result;
}