-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move "org.asciidoctor.ast" package to "asciidoctorj-api" project
* convert classes to interfaces in api project ** Author ** ContentPart ** DocumentHeader ** RevisionInfo ** StructuredDocument * Create implementation in core project
- Loading branch information
1 parent
5c0e5d3
commit fe43931
Showing
41 changed files
with
331 additions
and
174 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apply plugin: 'osgi' | ||
|
||
dependencies { | ||
} | ||
|
||
|
||
jar { | ||
manifest { | ||
symbolicName = 'org.asciidoctor' | ||
instruction 'Export-Package', | ||
"org.asciidoctor.ast;version=\"${version}\"" | ||
} | ||
} | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
properName=AsciidoctorJ API | ||
description=API for AsciidoctorJ |
16 changes: 16 additions & 0 deletions
16
asciidoctorj-api/src/main/java/org/asciidoctor/ast/Author.java
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.asciidoctor.ast; | ||
|
||
public interface Author { | ||
|
||
String getFullName(); | ||
|
||
String getLastName(); | ||
|
||
String getFirstName(); | ||
|
||
String getMiddleName(); | ||
|
||
String getEmail(); | ||
|
||
String getInitials(); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 25 additions & 0 deletions
25
asciidoctorj-api/src/main/java/org/asciidoctor/ast/ContentPart.java
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.asciidoctor.ast; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public interface ContentPart { | ||
|
||
String getId(); | ||
|
||
int getLevel(); | ||
|
||
String getContext(); | ||
|
||
String getStyle(); | ||
|
||
String getRole(); | ||
|
||
String getTitle(); | ||
|
||
Map<String, Object> getAttributes(); | ||
|
||
String getContent(); | ||
|
||
List<? extends ContentPart> getParts(); | ||
} |
File renamed without changes.
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
File renamed without changes.
141 changes: 61 additions & 80 deletions
141
...in/java/org/asciidoctor/ast/Document.java → ...in/java/org/asciidoctor/ast/Document.java
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,80 +1,61 @@ | ||
package org.asciidoctor.ast; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public interface Document extends StructuralNode { | ||
|
||
/** | ||
* @return The Title structure for this document. | ||
* @see Title | ||
*/ | ||
Title getStructuredDoctitle(); | ||
|
||
/** | ||
* @return The title as a String. | ||
* @see Title | ||
*/ | ||
String getDoctitle(); | ||
|
||
/** | ||
* @deprecated Please use {@link #getDoctitle()} | ||
* @return The title as a String. | ||
* @see Title | ||
*/ | ||
String doctitle(); | ||
|
||
/** | ||
* | ||
* @return page title | ||
*/ | ||
String title(); | ||
|
||
/** | ||
* | ||
* @return attributes defined in document | ||
*/ | ||
Map<String, Object> getAttributes(); | ||
|
||
/** | ||
* @return basebackend attribute value | ||
*/ | ||
boolean isBasebackend(String backend); | ||
|
||
/** | ||
* @deprecated Please use {@link #isBasebackend(String)} | ||
* @return basebackend attribute value | ||
*/ | ||
boolean basebackend(String backend); | ||
|
||
/** | ||
* | ||
* @return blocks contained within current Document. | ||
*/ | ||
List<StructuralNode> blocks(); | ||
|
||
/** | ||
* | ||
* @return options defined in document. | ||
*/ | ||
Map<Object, Object> getOptions(); | ||
|
||
/** | ||
* Gets the current counter with the given name and increases its value. | ||
* At the first invocation the counter will return 1. | ||
* After the call the value of the counter is set to the returned value plus 1. | ||
* @param name | ||
* @return | ||
*/ | ||
int getAndIncrementCounter(String name); | ||
|
||
/** | ||
* Gets the current counter with the given name and increases its value. | ||
* At the first invocation the counter will return the given initial value. | ||
* After the call the value of the counter is set to the returned value plus 1. | ||
* @param name | ||
* @param initialValue | ||
* @return | ||
*/ | ||
int getAndIncrementCounter(String name, int initialValue); | ||
} | ||
package org.asciidoctor.ast; | ||
|
||
import java.util.Map; | ||
|
||
public interface Document extends StructuralNode { | ||
|
||
/** | ||
* @return The Title structure for this document. | ||
* @see Title | ||
*/ | ||
Title getStructuredDoctitle(); | ||
|
||
/** | ||
* @return The title as a String. | ||
* @see Title | ||
*/ | ||
String getDoctitle(); | ||
|
||
/** | ||
* @deprecated Please use {@link #getDoctitle()} | ||
* @return The title as a String. | ||
* @see Title | ||
*/ | ||
String doctitle(); | ||
|
||
/** | ||
* @return basebackend attribute value | ||
*/ | ||
boolean isBasebackend(String backend); | ||
|
||
/** | ||
* @deprecated Please use {@link #isBasebackend(String)} | ||
* @return basebackend attribute value | ||
*/ | ||
boolean basebackend(String backend); | ||
|
||
/** | ||
* | ||
* @return options defined in document. | ||
*/ | ||
Map<Object, Object> getOptions(); | ||
|
||
/** | ||
* Gets the current counter with the given name and increases its value. | ||
* At the first invocation the counter will return 1. | ||
* After the call the value of the counter is set to the returned value plus 1. | ||
* @param name | ||
* @return | ||
*/ | ||
int getAndIncrementCounter(String name); | ||
|
||
/** | ||
* Gets the current counter with the given name and increases its value. | ||
* At the first invocation the counter will return the given initial value. | ||
* After the call the value of the counter is set to the returned value plus 1. | ||
* @param name | ||
* @param initialValue | ||
* @return | ||
*/ | ||
int getAndIncrementCounter(String name, int initialValue); | ||
} |
19 changes: 19 additions & 0 deletions
19
asciidoctorj-api/src/main/java/org/asciidoctor/ast/DocumentHeader.java
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.asciidoctor.ast; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public interface DocumentHeader { | ||
|
||
List<? extends Author> getAuthors(); | ||
|
||
Title getDocumentTitle(); | ||
|
||
String getPageTitle(); | ||
|
||
Author getAuthor(); | ||
|
||
RevisionInfo getRevisionInfo(); | ||
|
||
Map<String, Object> getAttributes(); | ||
} |
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
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
15 changes: 15 additions & 0 deletions
15
asciidoctorj-api/src/main/java/org/asciidoctor/ast/PhraseNode.java
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.asciidoctor.ast; | ||
|
||
public interface PhraseNode extends ContentNode { | ||
|
||
@Deprecated | ||
String render(); | ||
|
||
String convert(); | ||
|
||
String getType(); | ||
|
||
String getText(); | ||
|
||
String getTarget(); | ||
} |
10 changes: 10 additions & 0 deletions
10
asciidoctorj-api/src/main/java/org/asciidoctor/ast/RevisionInfo.java
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.asciidoctor.ast; | ||
|
||
public interface RevisionInfo { | ||
|
||
String getDate(); | ||
|
||
String getNumber(); | ||
|
||
String getRemark(); | ||
} |
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 |
---|---|---|
|
@@ -4,6 +4,6 @@ | |
|
||
public interface Row { | ||
|
||
public List<Cell> getCells(); | ||
List<Cell> getCells(); | ||
|
||
} |
File renamed without changes.
File renamed without changes.
70 changes: 70 additions & 0 deletions
70
asciidoctorj-api/src/main/java/org/asciidoctor/ast/StructuredDocument.java
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 |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package org.asciidoctor.ast; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Structure document containing header and content chunks | ||
* | ||
* @author marek | ||
* | ||
*/ | ||
public interface StructuredDocument { | ||
|
||
List<? extends ContentPart> getParts(); | ||
|
||
DocumentHeader getHeader(); | ||
|
||
/** | ||
* Return first matched part by id | ||
* | ||
* @param id The id to match | ||
* @return The ContentPart if the id is not null and the document | ||
* contains a block-level element with this id or null otherwise. | ||
*/ | ||
ContentPart getPartById(String id); | ||
|
||
/** | ||
* Return first matched part by style | ||
* | ||
* @param style The style to match | ||
* @return The first ContentPart if the style is not null and the document | ||
* contains a block-level element with this style name or null otherwise. | ||
*/ | ||
ContentPart getPartByStyle(String style); | ||
|
||
/** | ||
* Return first matched part by role | ||
* | ||
* @param role The role to match | ||
* @return The first ContentPart if the role is not null and the document | ||
* contains a block-level element with this role name or null otherwise. | ||
*/ | ||
ContentPart getPartByRole(String role); | ||
|
||
/** | ||
* Return all parts that match specified context | ||
* | ||
* @param context The context to match | ||
* @return A list of ContentPart items that match the context if the | ||
* context is not null or an empty collection. | ||
*/ | ||
List<? extends ContentPart> getPartsByContext(String context); | ||
|
||
/** | ||
* Return all parts that match specified style | ||
* | ||
* @param style The style to match | ||
* @return A list of ContentPart items that match the style if the | ||
* style is not null or an empty collection. | ||
*/ | ||
List<? extends ContentPart> getPartsByStyle(String style); | ||
|
||
/** | ||
* Return all parts that match specified role | ||
* | ||
* @param role The role to match | ||
* @return A list of ContentPart items that match the role if the | ||
* role is not null or an empty collection. | ||
*/ | ||
List<? extends ContentPart> getPartsByRole(String role); | ||
} |
File renamed without changes.
File renamed without changes.
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
Oops, something went wrong.