Java 类com.intellij.psi.tree.ICompositeElementType 实例源码

项目:intellij-ce-playground    文件:ASTFactory.java   
@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);
}
项目:consulo    文件:DefaultASTCompositeFactory.java   
@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);
}