|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectredora.generator.XMLUtil
public class XMLUtil
XML utilities in specific use for handling the model files.
| Constructor Summary | |
|---|---|
XMLUtil()
|
|
| Method Summary | |
|---|---|
static void |
addChildElement(Document doc,
String tag,
String value)
Adds an child element to the document's root element. |
static Node |
addFinder(Document doc,
Node parent,
String jsonValue,
boolean forceCreate)
|
static Node |
addFinder(Document doc,
Node parent,
String name,
String jsonValue)
|
static String |
asString(Document doc)
Dumps Document to String. |
static void |
attribute(Node node,
String name,
String value)
Insert attribute in given node. |
static NodeList |
attributes(Document doc,
String filter)
Return a nodelist with all the /object/attributes, or filtered as you xpath wished. |
static Set<String> |
definedLanguages(Document doc)
Retrieves the distinct values of all 'language' attributes in given document. |
static Map<String,Document> |
enumerations(Document allModels,
String basePackage)
Retrieves all enum from model doc. |
static Node |
finder(Node parent,
String name)
|
static boolean |
isSortable(Document doc)
Looks if this model document has the sorted = true tag. |
static Document |
newDocument(String basePackage,
String root)
Create the model XML document and adds the root element and optional a package element. |
static NodeList |
queries(Document doc)
|
static void |
xsltTransform(Node xml,
InputStream xslt,
Writer out,
Map<String,String> param)
Transform xml Node with xslt template file to stream |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMLUtil()
| Method Detail |
|---|
public static void xsltTransform(@NotNull
Node xml,
@NotNull
InputStream xslt,
@NotNull
Writer out,
@NotNull
Map<String,String> param)
throws TransformerException
TransformerException
@NotNull
public static Set<String> definedLanguages(@NotNull
Document doc)
throws ModelGenerationException
doc - (Mandatory) The AllModels document
ModelGenerationException - Wrapper on XPath exceptions
public static boolean isSortable(@NotNull
Document doc)
throws XPathExpressionException
doc - (Mandatory) A model document
XPathExpressionException - Just passing on
@NotNull
public static NodeList attributes(@NotNull
Document doc,
@Nullable
String filter)
throws XPathExpressionException
doc - (Mandatory) A model documentfilter - (Optional) XPathish filter. Default it is '*' (all).
XPathExpressionException - Just passing on
public static NodeList queries(@NotNull
Document doc)
throws XPathExpressionException
XPathExpressionException
public static void attribute(@NotNull
Node node,
@NotNull
String name,
@NotNull
String value)
node - (Mandatory) Node in need of attributename - (Mandatory) Attribute namevalue - (Mandatory) It's value
@Nullable
public static Node finder(@NotNull
Node parent,
@Nullable
String name)
@NotNull
public static Node addFinder(@NotNull
Document doc,
@NotNull
Node parent,
String jsonValue,
boolean forceCreate)
@NotNull
public static Node addFinder(@NotNull
Document doc,
@NotNull
Node parent,
String name,
String jsonValue)
public static void addChildElement(@NotNull
Document doc,
@NotNull
String tag,
@Nullable
String value)
doc - (Mandatory) The XML documenttag - (Mandatory) The element's namevalue - (Optional) It's value, when null, the tag will be empty
@NotNull
public static Map<String,Document> enumerations(@NotNull
Document allModels,
@NotNull
String basePackage)
throws ModelGenerationException
allModels - (Mandatory) The allModels documentbasePackage - (Mandatory)
ModelGenerationException - Wrapper on XPath exceptions
@NotNull
public static Document newDocument(@Nullable
String basePackage,
@NotNull
String root)
throws ModelGenerationException
basePackage - (Optional) Adds a 'package' element, it will the the root's
first childroot - (Mandatory) root element name
ModelGenerationException - Wrapper on ParserConfigurationException: should not happen
@NotNull
public static String asString(@NotNull
Document doc)
doc - (Mandatory)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||