protected AbstractWriter(Writer w,Document doc,int pos,int len){
  this.doc=doc;
  it=new ElementIterator(doc.getDefaultRootElement());
  out=w;
  startOffset=pos;
  endOffset=pos + len;
  Object docNewline=doc.getProperty(DefaultEditorKit.EndOfLineStringProperty);
  if (docNewline instanceof String) {
    setLineSeparator((String)docNewline);
  }
 else {
    String newline=null;
    try {
      newline=System.getProperty("line.separator");
    }
 catch (    SecurityException se) {
    }
    if (newline == null) {
      newline="\n";
    }
    setLineSeparator(newline);
  }
  canWrapLines=true;
}

protected AbstractWriter ( Writer w , Document doc , int pos , int len ) { this . doc = doc ; it = new ElementIterator ( doc . getDefaultRootElement ( ) ) ; out = w ; startOffset = pos ; endOffset = pos + len ; Object docNewline = doc . getProperty ( DefaultEditorKit . EndOfLineStringProperty ) ; if ( docNewline instanceof String ) { setLineSeparator ( ( String ) docNewline ) ; } else { String newline = null ; try { newline = System . getProperty ( "line.separator" ) ; } catch ( SecurityException se ) { } if ( newline == null ) { newline = "\n" ; } setLineSeparator ( newline ) ; } canWrapLines = true ; }
creates a new abstractwriter . initializes the elementiterator with the element passed in .
