@NotNull public static CompositeElement composite(@NotNull final IElementType type) { if (type instanceof ICompositeElementType) { return (CompositeElement)((ICompositeElementType)type).createCompositeNode(); } final CompositeElement customComposite = factory(type).createComposite(type); return customComposite != null ? customComposite : DefaultFactoryHolder.DEFAULT.createComposite(type); }
@Nonnull @Override public CompositeElement createComposite(IElementType type) { if (type instanceof IFileElementType) { return new FileElement(type, null); } if (type instanceof ICompositeElementType) { return (CompositeElement)((ICompositeElementType)type).createCompositeNode(); } return new CompositeElement(type); }