Skip to content

Commit

Permalink
v3 migration guide for 'ast' removed methods
Browse files Browse the repository at this point in the history
  • Loading branch information
abelsromero committed Jun 2, 2023
1 parent 7183bb8 commit 0971155
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Improvement::
* BREAKING: Remove deprecated methods from Asciidoctor interface (#1201) (@abelsromero)
* BREAKING: Remove deprecated methods from Document interface (#1202) (@abelsromero)
* BREAKING: Remove deprecated methods and constants from extension package (#1203) (@abelsromero)
* BREAKING: Remove deprecated methods from ast package (#1204) (@abelsromero)

Bug Fixes::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ include::partial$removal-of-deprecated-methods-in-document.adoc[]
include::partial$removal-of-deprecated-constants-in-BlockProcessor.adoc[]

include::partial$removal-of-deprecated-methods-in-extension-package.adoc[]

include::partial$removal-of-deprecated-methods-in-ast-package.adoc[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
== Removal of deprecated methods in `org.asciidoctor.ast` package

Several methods under `org.asciidoctor.ast` that were marked as `@Deprecated` have been removed.
The new methods align better with Java naming patterns and are easily identifiable.

Here follows the list of affected interfaces, describing for each one the removed methods and the substitutions.

=== Block

[,java]
.Removed deprecated methods
----
List<String> lines()
String source()
----

[,java]
.Final methods
----
List<String> getLines()
String getSource()
----

=== DescriptionList, PhraseNode and List

[,java]
.Removed deprecated method
----
String render()
----

[,java]
.Final method
----
String convert()
----

=== ContentNode

[,java]
.Removed deprecated methods
----
String id()
ContentNode parent()
String context()
Document document()
String role()
Object getAttr(Object name, Object defaultValue, boolean inherit)
Object getAttr(Object name, Object defaultValue)
Object getAttr(Object name)
boolean hasAttr(Object name)
boolean hasAttr(Object name, boolean inherited)
boolean isAttr(Object name, Object expected)
boolean isAttr(Object name, Object expected, boolean inherit)
boolean setAttr(Object name, Object value, boolean overwrite)
----

[,java]
.Final methods
----
String getId()
ContentNode getParent()
String getContext()
Document getDocument()
String getRole()
Object getAttribute(Object name, Object defaultValue, boolean inherit)
Object getAttribute(Object name, Object defaultValue)
Object getAttribute(Object name)
boolean hasAttribute(Object name)
boolean hasAttribute(Object name, boolean inherited)
boolean isAttribute(Object name, Object expected)
boolean isAttribute(Object name, Object expected, boolean inherit)
boolean setAttribute(Object name, Object value, boolean overwrite)
----

=== Section

On top of the methods replaced by Java getters, both `number` and `getNumber` are replaced by `getNumeral`.
This is done to support non-number numerals.

[,java]
.Removed deprecated methods
----
int index()
int number()
int getNumber()
String sectname()
boolean special()
boolean numbered()
----

[,java]
.Final methods
----
int getIndex()
String getNumeral()
String getSectionName()
boolean isSpecial()
boolean isNumbered()
----

=== StructuralNode

[,java]
.Removed deprecated methods
----
Object content()
String style()
String title()
List<StructuralNode> blocks()
----

.Final methods
----
Object getContent()
String getStyle()
String getTitle()
List<StructuralNode> getBlocks()
----
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
== Removal of deprecated methods in `org.asciidoctor.extension` package

Several methods under `org.asciidoctor.extension that were marked as `@Deprecated` have been removed.
Several methods under `org.asciidoctor.extension` that were marked as `@Deprecated` have been removed.
The new methods align better with Java naming patterns and are easily identifiable.

[,java]
Expand Down

0 comments on commit 0971155

Please sign in to comment.