Example usage for org.eclipse.jdt.core.jdom IDOMType getComment

List of usage examples for org.eclipse.jdt.core.jdom IDOMType getComment

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.jdom IDOMType getComment.

Prototype

public String getComment();

Source Link

Document

Returns the comment associated with this member (including comment delimiters).

Usage

From source file:org.eclipse.emf.codegen.jmerge.JMerger.java

License:Open Source License

protected void pullTargetCompilationUnit() {
    if (targetCompilationUnit == null) {
        setTargetCompilationUnit((IDOMCompilationUnit) insertClone(sourceCompilationUnit));
    } else {// w  w w.j  av a2  s.  c o  m
        map(sourceCompilationUnit, targetCompilationUnit);
        applyPullRules(sourceCompilationUnit, targetCompilationUnit);

        /*
            // PULL Header 
            //
            String sourceHeader = sourceCompilationUnit.getHeader();
            if (sourceHeader != null)
            {
              targetCompilationUnit.setHeader(sourceHeader);
            }
                
        */
        for (IDOMNode child = targetCompilationUnit.getFirstChild(); child != null; child = child
                .getNextNode()) {
            switch (child.getNodeType()) {
            case IDOMNode.PACKAGE: {
                pullTargetPackage((IDOMPackage) child);
                break;
            }
            case IDOMNode.IMPORT: {
                pullTargetImport((IDOMImport) child);
                break;
            }
            case IDOMNode.TYPE: {
                IDOMType type = (IDOMType) child;
                isBlocked = jControlModel.getBlockPattern() != null && type.getComment() != null
                        && jControlModel.getBlockPattern().matcher(type.getComment()).find();
                if (!isBlocked) {
                    pullTargetType(type);
                }
                break;
            }
            }
        }
    }
}