Skip to content

Commit

Permalink
Merge pull request #1214 from abelsromero/issue-1204-remove-deprecate…
Browse files Browse the repository at this point in the history
…d-from-ast-package

Remove deprecated from ast package
  • Loading branch information
robertpanzer authored Jun 4, 2023
2 parents 1bdabed + 0971155 commit d41caec
Show file tree
Hide file tree
Showing 22 changed files with 172 additions and 384 deletions.
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
17 changes: 3 additions & 14 deletions asciidoctorj-api/src/main/java/org/asciidoctor/ast/Block.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
import java.util.List;

public interface Block extends StructuralNode {
/**
* @deprecated Please use {@link #getLines}
* @return The original content of this block
*/
@Deprecated
List<String> lines();

/**
* @return The original content of this block
Expand All @@ -17,24 +11,19 @@ public interface Block extends StructuralNode {

/**
* Sets the source lines of the Block.
*
* @param lines The source of this Block, substitutions will still be applied.
*/
void setLines(List<String> lines);

/**
* @deprecated Please use {@link #getSource}
* @return the String containing the lines joined together or null if there are no lines
*/
@Deprecated
String source();

/**
* @return the String containing the lines joined together or null if there are no lines
* @return The String containing the lines joined together or null if there are no lines
*/
String getSource();

/**
* Sets the source of the Block.
*
* @param source The source of this Block, substitutions will still be applied.
*/
void setSource(String source);
Expand Down
121 changes: 17 additions & 104 deletions asciidoctorj-api/src/main/java/org/asciidoctor/ast/ContentNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@

public interface ContentNode {

/**
* @deprecated Please use {@link #getId()}
* @return A unique ID for this node
*/
@Deprecated
String id();

/**
* @return A unique ID for this node
*/
Expand All @@ -20,126 +13,46 @@ public interface ContentNode {
void setId(String id);

String getNodeName();
/**
* @deprecated Use {@linkplain #getParent()} instead.
*/
@Deprecated
ContentNode parent();

ContentNode getParent();
/**
* @deprecated Use {@linkplain #getContext()} instead.
*/
@Deprecated
String context();

String getContext();
/**
* @deprecated Use {@linkplain #getDocument()} instead.
*/
@Deprecated
Document document();

Document getDocument();
boolean isInline();
boolean isBlock();
Map<String, Object> getAttributes();

/**
*
* @param name
* @param defaultValue
* @param inherit
* @return
* @deprecated Use {@link #getAttribute(Object, Object, boolean)} instead
*/
@Deprecated
Object getAttr(Object name, Object defaultValue, boolean inherit);
boolean isInline();

/**
*
* @param name
* @param defaultValue
* @return
* @deprecated Use {@link #getAttribute(Object, Object)} instead
*/
@Deprecated
Object getAttr(Object name, Object defaultValue);
boolean isBlock();

/**
* @param name
* @return
* @deprecated Use {@link #getAttribute(Object)} instead
*/
@Deprecated
Object getAttr(Object name);
Map<String, Object> getAttributes();

Object getAttribute(Object name, Object defaultValue, boolean inherit);

Object getAttribute(Object name, Object defaultValue);

Object getAttribute(Object name);

/**
* @param name
* @return {@code true} if this node or the document has an attribute with the given name
* @deprecated Use {@link #hasAttribute(Object)} instead
*/
@Deprecated
boolean hasAttr(Object name);

/**
*
* @param name
* @param inherited
* @return {@code true} if the current node or depending on the inherited parameter the document has an attribute with the given name.
* @deprecated Use {@link #hasAttribute(Object, boolean)} instead
*/
@Deprecated
boolean hasAttr(Object name, boolean inherited);

/**
* @param name
* @return {@code true} if this node or the document has an attribute with the given name
*/
boolean hasAttribute(Object name);

/**
*
* @param name
* @param inherited
* @return {@code true} if the current node or depending on the inherited parameter the document has an attribute with the given name.
*/
boolean hasAttribute(Object name, boolean inherited);

/**
*
* @param name
* @param expected
* @return
* @deprecated Use {@link #isAttribute(Object, Object)} instead.
*/
@Deprecated
boolean isAttr(Object name, Object expected);

/**
*
* @param name
* @param expected
* @param inherit
* @return
* @deprecated Use {@link #isAttribute(Object, Object, boolean)} instead.
*/
@Deprecated
boolean isAttr(Object name, Object expected, boolean inherit);

/**
*
* @param name
* @param expected
* @return
*/
boolean isAttribute(Object name, Object expected);

/**
*
* @param name
* @param expected
* @param inherit
Expand All @@ -148,43 +61,43 @@ public interface ContentNode {
boolean isAttribute(Object name, Object expected, boolean inherit);

/**
*
* @param name
* @param value
* @param overwrite
* @return
* @deprecated Use {@link #setAttribute(Object, Object, boolean)} instead.
*/
@Deprecated
boolean setAttr(Object name, Object value, boolean overwrite);

boolean setAttribute(Object name, Object value, boolean overwrite);



boolean isOption(Object name);

//boolean isRole(String expect); cannot be implemented because it tries to use the non argument isRole.
boolean isRole();

boolean hasRole(String role);

String getRole();
/**
* @deprecated Use {@linkplain #getRole()} instead.
*/
@Deprecated
String role();

List<String> getRoles();

void addRole(String role);

void removeRole(String role);

boolean isReftext();

String getReftext();

String iconUri(String name);

String mediaUri(String target);

String imageUri(String targetImage);

String imageUri(String targetImage, String assetDirKey);

String readAsset(String path, Map<Object, Object> opts);

String normalizeWebPath(String path, String start, boolean preserveUriTarget);

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ public interface DescriptionList extends StructuralNode {

boolean hasItems();

/**
* @deprecated Please use {@link #convert()}
* @return
*/
@Deprecated
String render();

String convert();

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public interface DescriptionListEntry {
* return doc;
* }
* }</pre></code>
*
* @param description The new description for this description list entry,
*/
void setDescription(final ListItem description);
Expand Down
9 changes: 0 additions & 9 deletions asciidoctorj-api/src/main/java/org/asciidoctor/ast/List.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,4 @@ public interface List extends StructuralNode {

boolean hasItems();

/**
* @deprecated Please use {@link #convert()}
* @return
*/
@Deprecated
String render();

String convert();

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

public interface PhraseNode extends ContentNode {

/**
* @deprecated Please use {@link #convert()}
*/
@Deprecated
String render();

String convert();

String getType();
Expand Down
44 changes: 1 addition & 43 deletions asciidoctorj-api/src/main/java/org/asciidoctor/ast/Section.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,73 +2,31 @@

public interface Section extends StructuralNode {

/**
* @deprecated Please use {@link #getIndex()}
* @return the 0-based index order of this section within the parent block
*/
@Deprecated
int index();

/**
* @return the 0-based index order of this section within the parent block
*/
int getIndex();

/**
* @deprecated Please use {@link #getNumber()}
* @return the number of this section within the parent block
*/
@Deprecated
int number();

/**
* @deprecated Please use {@link #getNumeral()}
* @return the number of this section within the parent block
*/
@Deprecated
int getNumber();

/**
* Section numeral.
*
* <p>
* This is a roman numeral for book parts, arabic numeral for regular sections,
* and a letter for special sections.
*
* @return the section numeral
*/
String getNumeral();

/**
* @deprecated Please use {@link #getSectionName()}
* @return the section name of this section
*/
@Deprecated
String sectname();

/**
* @return the section name of this section
*/
String getSectionName();

/**
* @deprecated Please use {@link #isSpecial()}
* @return Get the flag to indicate whether this is a special section or a child of one
*/
@Deprecated
boolean special();

/**
* @return Get the flag to indicate whether this is a special section or a child of one
*/
boolean isSpecial();

/**
* @deprecated Please use {@link #isNumbered()}
* @return the state of the numbered attribute at this section (need to preserve for creating TOC)
*/
@Deprecated
boolean numbered();

/**
* @return the state of the numbered attribute at this section (need to preserve for creating TOC)
*/
Expand Down
Loading

0 comments on commit d41caec

Please sign in to comment.