Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation /
 
 package org.eclipse.jdt.internal.core.jdom;
 
DOMPackage provides an implementation of IDOMPackage.

Deprecated:
The JDOM was made obsolete by the addition in 2.0 of the more powerful, fine-grained DOM/AST API found in the org.eclipse.jdt.core.dom package.
See also:
org.eclipse.jdt.core.jdom.IDOMPackage
DOMNode
 
 class DOMPackage extends DOMNode implements IDOMPackage {

Creates an empty PACKAGE node.
 
 }
Creates a new simple PACKAGE document fragment on the given range of the document.

Parameters:
document - the document containing this node's original contents
sourceRange - a two element array of integers describing the entire inclusive source range of this node within its document. Contents start on and include the character at the first position. Contents end on and include the character at the last position. An array of -1's indicates this node's contents do not exist in the document.
name - the identifier portion of the name of this node, or null if this node does not have a name
 
 DOMPackage(char[] documentint[] sourceRangeString name) {
 	super(documentsourceRangenamenew int[] {-1, -1});
 }
Creates a new detailed PACKAGE document fragment on the given range of the document.

Parameters:
document - the document containing this node's original contents
sourceRange - a two element array of integers describing the entire inclusive source range of this node within its document. Contents start on and include the character at the first position. Contents end on and include the character at the last position. An array of -1's indicates this node's contents do not exist in the document.
name - the identifier portion of the name of this node, or null if this node does not have a name
nameRange - a two element array of integers describing the entire inclusive source range of this node's name within its document, including any array qualifiers that might immediately follow the name or -1's if this node does not have a name.
 
 DOMPackage(char[] documentint[] sourceRangeString nameint[] nameRange) {
 	super(documentsourceRangenamenameRange);
 }
 
 protected void appendFragmentedContents(CharArrayBuffer buffer) {
 	if (this.[0] < 0) {
 		String lineSeparator = Util.getLineSeparator(buffer.toString(), null);
 		buffer
 			.append("package "//$NON-NLS-1$
 			.append(this.)
 			.append(';')
 			.append(lineSeparator)
 			.append(lineSeparator);
 	} else {
 		buffer
 			.append(this.this.[0], this.[0] - this.[0])
 			.append(this.)
 			.append(this.this.[1] + 1, this.[1] - this.[1]);
 	}
 }
 
 public String getContents() {
 	if (this. == null) {
 		return null;
else {
		return super.getContents();
	}
protected DOMNode getDetailedNode() {
else {
	}
public int getNodeType() {

See also:
DOMNode
protected DOMNode newDOMNode() {
	return new DOMPackage();
public void setName(String name) {
	super.setName(name);
public String toString() {
	return "PACKAGE: " + getName(); //$NON-NLS-1$
New to GrepCode? Check out our FAQ X