-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
2,116 additions
and
2,081 deletions.
There are no files selected for viewing
487 changes: 266 additions & 221 deletions
487
src/main/java/org/jboss/staxmapper/FixedXMLStreamReader.java
Large diffs are not rendered by default.
Oops, something went wrong.
1,028 changes: 500 additions & 528 deletions
1,028
src/main/java/org/jboss/staxmapper/FormattingXMLStreamWriter.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,47 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* Copyright 2010, Red Hat, Inc., and individual contributors | ||
* as indicated by the @author tags. See the copyright.txt file in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
|
||
package org.jboss.staxmapper; | ||
|
||
import java.util.Iterator; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">David M. Lloyd</a> | ||
*/ | ||
final class Spliterable implements Iterable<String> { | ||
private final String subject; | ||
private final char delimiter; | ||
|
||
Spliterable(final String subject, final char delimiter) { | ||
this.subject = subject; | ||
this.delimiter = delimiter; | ||
} | ||
|
||
static Spliterable over(String subject, char delimiter) { | ||
return new Spliterable(subject, delimiter); | ||
} | ||
|
||
public Iterator<String> iterator() { | ||
return new Spliterator(subject, delimiter); | ||
} | ||
} | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* Copyright 2010, Red Hat, Inc., and individual contributors | ||
* as indicated by the @author tags. See the copyright.txt file in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
|
||
package org.jboss.staxmapper; | ||
|
||
import java.util.Iterator; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">David M. Lloyd</a> | ||
*/ | ||
final class Spliterable implements Iterable<String> { | ||
private final String subject; | ||
private final char delimiter; | ||
|
||
Spliterable(final String subject, final char delimiter) { | ||
this.subject = subject; | ||
this.delimiter = delimiter; | ||
} | ||
|
||
static Spliterable over(String subject, char delimiter) { | ||
return new Spliterable(subject, delimiter); | ||
} | ||
|
||
@Override | ||
public Iterator<String> iterator() { | ||
return new Spliterator(subject, delimiter); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,69 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* Copyright 2010, Red Hat, Inc., and individual contributors | ||
* as indicated by the @author tags. See the copyright.txt file in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
|
||
package org.jboss.staxmapper; | ||
|
||
import java.util.Iterator; | ||
import java.util.NoSuchElementException; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">David M. Lloyd</a> | ||
*/ | ||
final class Spliterator implements Iterator<String> { | ||
private final String subject; | ||
private final char delimiter; | ||
private int i; | ||
|
||
Spliterator(final String subject, final char delimiter) { | ||
this.subject = subject; | ||
this.delimiter = delimiter; | ||
i = 0; | ||
} | ||
|
||
static Spliterator over(String subject, char delimiter) { | ||
return new Spliterator(subject, delimiter); | ||
} | ||
|
||
public boolean hasNext() { | ||
return i != -1; | ||
} | ||
|
||
public String next() { | ||
final int i = this.i; | ||
if (i == -1) { | ||
throw new NoSuchElementException(); | ||
} | ||
int n = subject.indexOf(delimiter, i); | ||
try { | ||
return n == -1 ? subject.substring(i) : subject.substring(i, n); | ||
} finally { | ||
this.i = n == -1 ? -1 : n + 1; | ||
} | ||
} | ||
|
||
public void remove() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
} | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* Copyright 2010, Red Hat, Inc., and individual contributors | ||
* as indicated by the @author tags. See the copyright.txt file in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
|
||
package org.jboss.staxmapper; | ||
|
||
import java.util.Iterator; | ||
import java.util.NoSuchElementException; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">David M. Lloyd</a> | ||
*/ | ||
final class Spliterator implements Iterator<String> { | ||
private final String subject; | ||
private final char delimiter; | ||
private int i; | ||
|
||
Spliterator(final String subject, final char delimiter) { | ||
this.subject = subject; | ||
this.delimiter = delimiter; | ||
i = 0; | ||
} | ||
|
||
static Spliterator over(String subject, char delimiter) { | ||
return new Spliterator(subject, delimiter); | ||
} | ||
|
||
@Override | ||
public boolean hasNext() { | ||
return i != -1; | ||
} | ||
|
||
@Override | ||
public String next() { | ||
final int i = this.i; | ||
if (i == -1) { | ||
throw new NoSuchElementException(); | ||
} | ||
int n = subject.indexOf(delimiter, i); | ||
try { | ||
return n == -1 ? subject.substring(i) : subject.substring(i, n); | ||
} finally { | ||
this.i = n == -1 ? -1 : n + 1; | ||
} | ||
} | ||
|
||
@Override | ||
public void remove() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
} |
Oops, something went wrong.