本文整理汇总了Java中org.simpleframework.xml.Order类的典型用法代码示例。如果您正苦于以下问题:Java Order类的具体用法?Java Order怎么用?Java Order使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Order类属于org.simpleframework.xml包,在下文中一共展示了Order类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: extract
import org.simpleframework.xml.Order; //导入依赖的package包/类
/**
* This method is used to extract the annotations associated with
* the type. Annotations extracted include the <code>Root</code>
* annotation and the <code>Namespace</code> annotation as well as
* other annotations that are used to describe the type.
*
* @param type this is the type to extract the annotations from
*/
private void extract(Class type) {
for(Annotation label : labels) {
if(label instanceof Namespace) {
namespace(label);
}
if(label instanceof NamespaceList) {
scope(label);
}
if(label instanceof Root) {
root(label);
}
if(label instanceof Order) {
order(label);
}
if(label instanceof Default) {
access(label);
}
}
}
开发者ID:ngallagher,项目名称:simplexml,代码行数:28,代码来源:DetailScanner.java
示例2: assembleAttributes
import org.simpleframework.xml.Order; //导入依赖的package包/类
/**
* This is used to assemble the model by perform registrations
* based on the <code>Order</code> annotation. The initial
* registrations performed by this establish the element and
* attribute order for serialization of the schema class.
*
* @param model the model to perform registrations on
* @param order this is the order specified by the class
*/
private void assembleAttributes(Model model, Order order) throws Exception {
for(String value : order.attributes()) {
Expression path = builder.build(value);
if(!path.isAttribute() && path.isPath()) {
throw new PathException("Ordered attribute '%s' references an element in %s", path, detail);
}
if(!path.isPath()) {
Style style = format.getStyle();
String name = style.getAttribute(value);
model.registerAttribute(name);
} else {
registerAttributes(model, path);
}
}
}
开发者ID:ngallagher,项目名称:simplexml,代码行数:27,代码来源:ModelAssembler.java
示例3: assembleElements
import org.simpleframework.xml.Order; //导入依赖的package包/类
/**
* This is used to assemble the model by perform registrations
* based on the <code>Order</code> annotation. The initial
* registrations performed by this establish the element and
* attribute order for serialization of the schema class.
*
* @param model the model to perform registrations on
* @param order this is the order specified by the class
*/
private void assembleElements(Model model, Order order) throws Exception {
for(String value : order.elements()) {
Expression path = builder.build(value);
if(path.isAttribute()) {
throw new PathException("Ordered element '%s' references an attribute in %s", path, detail);
}
registerElements(model, path);
}
}
开发者ID:ngallagher,项目名称:simplexml,代码行数:20,代码来源:ModelAssembler.java
示例4: validate
import org.simpleframework.xml.Order; //导入依赖的package包/类
/**
* This is used to validate the configuration of the scanned class.
* If a <code>Text</code> annotation has been used with elements
* then validation will fail and an exception will be thrown.
*
* @param type this is the object type that is being scanned
*/
public void validate(Class type) throws Exception {
Order order = scanner.getOrder();
validateUnions(type);
validateElements(type, order);
validateAttributes(type, order);
validateModel(type);
validateText(type);
validateTextList(type);
}
开发者ID:ngallagher,项目名称:simplexml,代码行数:18,代码来源:StructureBuilder.java
示例5: validateElements
import org.simpleframework.xml.Order; //导入依赖的package包/类
/**
* This is used to validate the configuration of the scanned class.
* If an ordered element is specified but does not refer to an
* existing element then this will throw an exception.
*
* @param type this is the object type that is being scanned
* @param order this is the order that is to be validated
*/
private void validateElements(Class type, Order order) throws Exception {
if(order != null) {
for(String name : order.elements()) {
if(!isElement(name)) {
throw new ElementException("Ordered element '%s' missing for %s", name, type);
}
}
}
}
开发者ID:ngallagher,项目名称:simplexml,代码行数:18,代码来源:StructureBuilder.java
示例6: validateAttributes
import org.simpleframework.xml.Order; //导入依赖的package包/类
/**
* This is used to validate the configuration of the scanned class.
* If an ordered attribute is specified but does not refer to an
* existing attribute then this will throw an exception.
*
* @param type this is the object type that is being scanned
* @param order this is the order that is to be validated
*/
private void validateAttributes(Class type, Order order) throws Exception {
if(order != null) {
for(String name : order.attributes()) {
if(!isAttribute(name)) {
throw new AttributeException("Ordered attribute '%s' missing in %s", name, type);
}
}
}
}
开发者ID:ngallagher,项目名称:simplexml,代码行数:18,代码来源:StructureBuilder.java
示例7: assemble
import org.simpleframework.xml.Order; //导入依赖的package包/类
/**
* This is used to acquire the optional order annotation to provide
* order to the elements and attributes for the generated XML. This
* acts as an override to the order provided by the declaration of
* the types within the object.
*
* @param type this is the type to be scanned for the order
*/
public void assemble(Class type) throws Exception {
Order order = scanner.getOrder();
if(order != null) {
assembler.assemble(root, order);
}
}
开发者ID:ngallagher,项目名称:simplexml,代码行数:16,代码来源:StructureBuilder.java
示例8: getOrder
import org.simpleframework.xml.Order; //导入依赖的package包/类
/**
* This returns the order annotation used to determine the order
* of serialization of attributes and elements. The order is a
* class level annotation that can be used only once per class
* XML schema. If none exists then this will return null.
* of the class processed by this scanner.
*
* @return this returns the name of the object being scanned
*/
public Order getOrder() {
return detail.getOrder();
}
开发者ID:ngallagher,项目名称:simplexml,代码行数:13,代码来源:DefaultDetail.java
示例9: getOrder
import org.simpleframework.xml.Order; //导入依赖的package包/类
/**
* This returns the order annotation used to determine the order
* of serialization of attributes and elements. The order is a
* class level annotation that can be used only once per class
* XML schema. If none exists then this will return null.
* of the class processed by this scanner.
*
* @return this returns the name of the object being scanned
*/
public Order getOrder() {
return order;
}
开发者ID:ngallagher,项目名称:simplexml,代码行数:13,代码来源:DetailScanner.java
示例10: getOrder
import org.simpleframework.xml.Order; //导入依赖的package包/类
/**
* This is used to acquire the <code>Order</code> annotation for
* the class schema. The order annotation defines the order that
* the elements and attributes should appear within the document.
* Providing order in this manner makes the resulting XML more
* predictable. If no order is provided, appearance is random.
*
* @return this returns the order, if any, defined for the class
*/
public Order getOrder() {
return scanner.getOrder();
}
开发者ID:ngallagher,项目名称:simplexml,代码行数:13,代码来源:ObjectScanner.java
示例11: getOrder
import org.simpleframework.xml.Order; //导入依赖的package包/类
/**
* This returns the order annotation used to determine the order
* of serialization of attributes and elements. The order is a
* class level annotation that can be used only once per class
* XML schema. If none exists then this will return null.
* of the class processed by this scanner.
*
* @return this returns the name of the object being scanned
*/
Order getOrder();
开发者ID:ngallagher,项目名称:simplexml,代码行数:11,代码来源:Detail.java
示例12: getOrder
import org.simpleframework.xml.Order; //导入依赖的package包/类
/**
* This is used to acquire the <code>Order</code> annotation for
* the class schema. The order annotation defines the order that
* the elements and attributes should appear within the document.
* Providing order in this manner makes the resulting XML more
* predictable. If no order is provided, appearance is random.
*
* @return this returns the order, if any, defined for the class
*/
public Order getOrder() {
return null;
}
开发者ID:ngallagher,项目名称:simplexml,代码行数:13,代码来源:PrimitiveScanner.java
示例13: assemble
import org.simpleframework.xml.Order; //导入依赖的package包/类
/**
* This is used to assemble the model by perform registrations
* based on the <code>Order</code> annotation. The initial
* registrations performed by this establish the element and
* attribute order for serialization of the schema class.
*
* @param model the model to perform registrations on
* @param order this is the order specified by the class
*/
public void assemble(Model model, Order order) throws Exception {
assembleElements(model, order);
assembleAttributes(model, order);
}
开发者ID:ngallagher,项目名称:simplexml,代码行数:14,代码来源:ModelAssembler.java
示例14: getOrder
import org.simpleframework.xml.Order; //导入依赖的package包/类
/**
* This is used to acquire the <code>Order</code> annotation for
* the class schema. The order annotation defines the order that
* the elements and attributes should appear within the document.
* Providing order in this manner makes the resulting XML more
* predictable. If no order is provided, appearance is random.
*
* @return this returns the order, if any, defined for the class
*/
Order getOrder();
开发者ID:ngallagher,项目名称:simplexml,代码行数:11,代码来源:Scanner.java
注:本文中的org.simpleframework.xml.Order类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论