mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-08 08:23:11 +00:00
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* This file is part of l2jserver <l2jserver.com>.
|
||||
*
|
||||
* l2jserver is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* l2jserver 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.exception;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class L2ChatServiceException extends L2ServiceException {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public L2ChatServiceException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public L2ChatServiceException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public L2ChatServiceException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public L2ChatServiceException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* This file is part of l2jserver <l2jserver.com>.
|
||||
*
|
||||
* l2jserver is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* l2jserver 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.exception;
|
||||
|
||||
/**
|
||||
* Base exception for Lineage 2
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class L2ServiceException extends Exception {
|
||||
/**
|
||||
* Default Serial Version UID
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* @see Exception#Exception()
|
||||
*/
|
||||
public L2ServiceException() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see Exception#Exception(String, Throwable)
|
||||
*/
|
||||
public L2ServiceException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see Exception#Exception(String)
|
||||
*/
|
||||
public L2ServiceException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see Exception#Exception(Throwable)
|
||||
*/
|
||||
public L2ServiceException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
}
|
||||
38
src/main/java/com/l2jserver/util/html/L2BodyTag.java
Normal file
38
src/main/java/com/l2jserver/util/html/L2BodyTag.java
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* This file is part of l2jserver <l2jserver.com>.
|
||||
*
|
||||
* l2jserver is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* l2jserver 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.html;
|
||||
|
||||
import org.htmlparser.Tag;
|
||||
import org.htmlparser.nodes.TagNode;
|
||||
import org.htmlparser.tags.BodyTag;
|
||||
import org.htmlparser.util.NodeList;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*
|
||||
*/
|
||||
public class L2BodyTag extends BodyTag {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public L2BodyTag() {
|
||||
super.setTagName("body");
|
||||
Tag end = new TagNode();
|
||||
end.setTagName("/body");
|
||||
super.setEndTag(end);
|
||||
super.setChildren(new NodeList());
|
||||
}
|
||||
}
|
||||
37
src/main/java/com/l2jserver/util/html/L2BrTag.java
Normal file
37
src/main/java/com/l2jserver/util/html/L2BrTag.java
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* This file is part of l2jserver <l2jserver.com>.
|
||||
*
|
||||
* l2jserver is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* l2jserver 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.html;
|
||||
|
||||
import org.htmlparser.Tag;
|
||||
import org.htmlparser.nodes.TagNode;
|
||||
import org.htmlparser.tags.Span;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*
|
||||
*/
|
||||
public class L2BrTag extends Span {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public L2BrTag() {
|
||||
super.setTagName("br");
|
||||
Tag end = new TagNode();
|
||||
end.setTagName("/br");
|
||||
super.setEndTag(end);
|
||||
super.setEmptyXmlTag(true);
|
||||
}
|
||||
}
|
||||
36
src/main/java/com/l2jserver/util/html/L2CenterTag.java
Normal file
36
src/main/java/com/l2jserver/util/html/L2CenterTag.java
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* This file is part of l2jserver <l2jserver.com>.
|
||||
*
|
||||
* l2jserver is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* l2jserver 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.html;
|
||||
|
||||
import org.htmlparser.Tag;
|
||||
import org.htmlparser.nodes.TagNode;
|
||||
import org.htmlparser.tags.Span;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*
|
||||
*/
|
||||
public class L2CenterTag extends Span {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public L2CenterTag() {
|
||||
super.setTagName("center");
|
||||
Tag end = new TagNode();
|
||||
end.setTagName("/center");
|
||||
super.setEndTag(end);
|
||||
}
|
||||
}
|
||||
38
src/main/java/com/l2jserver/util/html/L2DivTag.java
Normal file
38
src/main/java/com/l2jserver/util/html/L2DivTag.java
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* This file is part of l2jserver <l2jserver.com>.
|
||||
*
|
||||
* l2jserver is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* l2jserver 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.html;
|
||||
|
||||
import org.htmlparser.Tag;
|
||||
import org.htmlparser.nodes.TagNode;
|
||||
import org.htmlparser.tags.Div;
|
||||
import org.htmlparser.util.NodeList;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*
|
||||
*/
|
||||
public class L2DivTag extends Div {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public L2DivTag() {
|
||||
super.setTagName("div");
|
||||
Tag end = new TagNode();
|
||||
end.setTagName("/div");
|
||||
super.setEndTag(end);
|
||||
super.setChildren(new NodeList());
|
||||
}
|
||||
}
|
||||
38
src/main/java/com/l2jserver/util/html/L2FontTag.java
Normal file
38
src/main/java/com/l2jserver/util/html/L2FontTag.java
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* This file is part of l2jserver <l2jserver.com>.
|
||||
*
|
||||
* l2jserver is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* l2jserver 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.html;
|
||||
|
||||
import org.htmlparser.Tag;
|
||||
import org.htmlparser.nodes.TagNode;
|
||||
import org.htmlparser.tags.Span;
|
||||
import org.htmlparser.util.NodeList;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*
|
||||
*/
|
||||
public class L2FontTag extends Span {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public L2FontTag() {
|
||||
super.setTagName("font");
|
||||
Tag end = new TagNode();
|
||||
end.setTagName("/font");
|
||||
super.setEndTag(end);
|
||||
super.setChildren(new NodeList());
|
||||
}
|
||||
}
|
||||
37
src/main/java/com/l2jserver/util/html/L2HeadTag.java
Normal file
37
src/main/java/com/l2jserver/util/html/L2HeadTag.java
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* This file is part of l2jserver <l2jserver.com>.
|
||||
*
|
||||
* l2jserver is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* l2jserver 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.html;
|
||||
|
||||
import org.htmlparser.Tag;
|
||||
import org.htmlparser.nodes.TagNode;
|
||||
import org.htmlparser.tags.HeadTag;
|
||||
import org.htmlparser.util.NodeList;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class L2HeadTag extends HeadTag {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public L2HeadTag() {
|
||||
super.setTagName("head");
|
||||
Tag end = new TagNode();
|
||||
end.setTagName("/head");
|
||||
super.setEndTag(end);
|
||||
super.setChildren(new NodeList());
|
||||
}
|
||||
}
|
||||
38
src/main/java/com/l2jserver/util/html/L2HtmlTag.java
Normal file
38
src/main/java/com/l2jserver/util/html/L2HtmlTag.java
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* This file is part of l2jserver <l2jserver.com>.
|
||||
*
|
||||
* l2jserver is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* l2jserver 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.html;
|
||||
|
||||
import org.htmlparser.Tag;
|
||||
import org.htmlparser.nodes.TagNode;
|
||||
import org.htmlparser.tags.Html;
|
||||
import org.htmlparser.util.NodeList;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*
|
||||
*/
|
||||
public class L2HtmlTag extends Html {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public L2HtmlTag() {
|
||||
super.setTagName("html");
|
||||
Tag end = new TagNode();
|
||||
end.setTagName("/html");
|
||||
super.setEndTag(end);
|
||||
super.setChildren(new NodeList());
|
||||
}
|
||||
}
|
||||
36
src/main/java/com/l2jserver/util/html/L2ImageTag.java
Normal file
36
src/main/java/com/l2jserver/util/html/L2ImageTag.java
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* This file is part of l2jserver <l2jserver.com>.
|
||||
*
|
||||
* l2jserver is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* l2jserver 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.html;
|
||||
|
||||
import org.htmlparser.Tag;
|
||||
import org.htmlparser.nodes.TagNode;
|
||||
import org.htmlparser.tags.ImageTag;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class L2ImageTag extends ImageTag {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public L2ImageTag() {
|
||||
super.setTagName("img");
|
||||
Tag end = new TagNode();
|
||||
end.setTagName("/img");
|
||||
super.setEndTag(end);
|
||||
super.setEmptyXmlTag(true);
|
||||
}
|
||||
}
|
||||
38
src/main/java/com/l2jserver/util/html/L2LinkTag.java
Normal file
38
src/main/java/com/l2jserver/util/html/L2LinkTag.java
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* This file is part of l2jserver <l2jserver.com>.
|
||||
*
|
||||
* l2jserver is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* l2jserver 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.html;
|
||||
|
||||
import org.htmlparser.Tag;
|
||||
import org.htmlparser.nodes.TagNode;
|
||||
import org.htmlparser.tags.LinkTag;
|
||||
import org.htmlparser.util.NodeList;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class L2LinkTag extends LinkTag {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public L2LinkTag() {
|
||||
super.setTagName("a");
|
||||
Tag end = new TagNode();
|
||||
end.setTagName("/a");
|
||||
super.setEndTag(end);
|
||||
super.setChildren(new NodeList());
|
||||
super.setEmptyXmlTag(true);
|
||||
}
|
||||
}
|
||||
37
src/main/java/com/l2jserver/util/html/L2NewLineTag.java
Normal file
37
src/main/java/com/l2jserver/util/html/L2NewLineTag.java
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* This file is part of l2jserver <l2jserver.com>.
|
||||
*
|
||||
* l2jserver is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* l2jserver 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.html;
|
||||
|
||||
import org.htmlparser.Tag;
|
||||
import org.htmlparser.nodes.TagNode;
|
||||
import org.htmlparser.tags.Span;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*
|
||||
*/
|
||||
public class L2NewLineTag extends Span {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public L2NewLineTag() {
|
||||
super.setTagName("p");
|
||||
Tag end = new TagNode();
|
||||
end.setTagName("/pp");
|
||||
super.setEndTag(end);
|
||||
super.setEmptyXmlTag(true);
|
||||
}
|
||||
}
|
||||
37
src/main/java/com/l2jserver/util/html/L2TitleTag.java
Normal file
37
src/main/java/com/l2jserver/util/html/L2TitleTag.java
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* This file is part of l2jserver <l2jserver.com>.
|
||||
*
|
||||
* l2jserver is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* l2jserver 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.html;
|
||||
|
||||
import org.htmlparser.Tag;
|
||||
import org.htmlparser.nodes.TagNode;
|
||||
import org.htmlparser.tags.TitleTag;
|
||||
import org.htmlparser.util.NodeList;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class L2TitleTag extends TitleTag {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public L2TitleTag() {
|
||||
super.setTagName("title");
|
||||
Tag end = new TagNode();
|
||||
end.setTagName("/title");
|
||||
super.setEndTag(end);
|
||||
super.setChildren(new NodeList());
|
||||
}
|
||||
}
|
||||
57
src/main/java/com/l2jserver/util/html/markup/Markup.java
Normal file
57
src/main/java/com/l2jserver/util/html/markup/Markup.java
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* This file is part of l2jserver <l2jserver.com>.
|
||||
*
|
||||
* l2jserver is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* l2jserver 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.html.markup;
|
||||
|
||||
import org.htmlparser.nodes.TextNode;
|
||||
import org.htmlparser.tags.HeadTag;
|
||||
import org.htmlparser.tags.Html;
|
||||
import org.htmlparser.tags.TitleTag;
|
||||
|
||||
import com.l2jserver.util.html.L2HeadTag;
|
||||
import com.l2jserver.util.html.L2HtmlTag;
|
||||
import com.l2jserver.util.html.L2TitleTag;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*
|
||||
*/
|
||||
public class Markup {
|
||||
private final Builder builder;
|
||||
private final String title;
|
||||
|
||||
public Markup(String title, Builder builder) {
|
||||
this.builder = builder;
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public Html build() {
|
||||
final Html html = new L2HtmlTag();
|
||||
final HeadTag head = new L2HeadTag();
|
||||
final TitleTag title = new L2TitleTag();
|
||||
|
||||
head.getChildren().add(head);
|
||||
head.getChildren().add(title);
|
||||
title.getChildren().add(new TextNode(this.title));
|
||||
|
||||
this.builder.build(new MarkupTag(html));
|
||||
return html;
|
||||
}
|
||||
|
||||
public interface Builder {
|
||||
void build(MarkupTag body);
|
||||
}
|
||||
}
|
||||
123
src/main/java/com/l2jserver/util/html/markup/MarkupTag.java
Normal file
123
src/main/java/com/l2jserver/util/html/markup/MarkupTag.java
Normal file
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
* This file is part of l2jserver <l2jserver.com>.
|
||||
*
|
||||
* l2jserver is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* l2jserver 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.util.html.markup;
|
||||
|
||||
import org.htmlparser.Tag;
|
||||
import org.htmlparser.nodes.TextNode;
|
||||
|
||||
import com.l2jserver.util.html.L2BrTag;
|
||||
import com.l2jserver.util.html.L2CenterTag;
|
||||
import com.l2jserver.util.html.L2DivTag;
|
||||
import com.l2jserver.util.html.L2FontTag;
|
||||
import com.l2jserver.util.html.L2ImageTag;
|
||||
import com.l2jserver.util.html.L2LinkTag;
|
||||
import com.l2jserver.util.html.L2NewLineTag;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*
|
||||
*/
|
||||
public class MarkupTag {
|
||||
private final Tag tag;
|
||||
private final MarkupTag parent;
|
||||
|
||||
public MarkupTag(Tag tag, MarkupTag parent) {
|
||||
this.tag = tag;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public MarkupTag(Tag tag) {
|
||||
this(tag, null);
|
||||
}
|
||||
|
||||
public MarkupTag attr(String name, String value) {
|
||||
tag.setAttribute(name, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public MarkupTag text(String text) {
|
||||
tag.getChildren().add(new TextNode(text));
|
||||
return this;
|
||||
}
|
||||
|
||||
public MarkupTag text(String text, String color) {
|
||||
final Tag font = new L2FontTag();
|
||||
font.setAttribute("color", color);
|
||||
font.getChildren().add(new TextNode(text));
|
||||
this.tag.getChildren().add(font);
|
||||
return this;
|
||||
}
|
||||
|
||||
public MarkupTag div() {
|
||||
final Tag tag = new L2DivTag();
|
||||
this.tag.getChildren().add(tag);
|
||||
return new MarkupTag(tag, this);
|
||||
}
|
||||
|
||||
public MarkupTag br() {
|
||||
final Tag tag = new L2BrTag();
|
||||
this.tag.getChildren().add(tag);
|
||||
return this;
|
||||
}
|
||||
|
||||
public MarkupTag p() {
|
||||
final Tag tag = new L2NewLineTag();
|
||||
this.tag.getChildren().add(tag);
|
||||
return this;
|
||||
}
|
||||
|
||||
public MarkupTag center() {
|
||||
final Tag tag = new L2CenterTag();
|
||||
this.tag.getChildren().add(tag);
|
||||
return new MarkupTag(this.tag, this);
|
||||
}
|
||||
|
||||
public MarkupTag addImage(String src, int height, int width) {
|
||||
final Tag tag = new L2ImageTag();
|
||||
this.tag.getChildren().add(tag);
|
||||
tag.setAttribute("height", Integer.toString(height));
|
||||
tag.setAttribute("width", Integer.toString(width));
|
||||
tag.setAttribute("src", src);
|
||||
return this;
|
||||
}
|
||||
|
||||
public MarkupTag addLink(String text, String action) {
|
||||
final Tag tag = new L2LinkTag();
|
||||
this.tag.getChildren().add(tag);
|
||||
tag.setAttribute("action", "bypass -h " + action);
|
||||
tag.getChildren().add(new TextNode(text));
|
||||
return this;
|
||||
}
|
||||
|
||||
public MarkupTag close() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the tag
|
||||
*/
|
||||
public Tag getTag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the parent
|
||||
*/
|
||||
public MarkupTag getParent() {
|
||||
return parent;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user