/** * Represents an element in the P-Mode XML document with type <code>KeyReferenceMethods</code>. Converts the strings * used in the XML document to equivalent value of {@link X509ReferenceType} enumeration. * * @author Sander Fieten (sander at holodeck-b2b.org) */ class KeyReferenceMethod { private static final String ISSUER_SERIAL = "IssuerSerial"; private static final String BST_REFERENCE = "BSTReference"; private static final String SKI = "KeyIdentifier"; @Text String referenceMethod = null; X509ReferenceType getRefMethod() { if (BST_REFERENCE.equals(referenceMethod)) return X509ReferenceType.BSTReference; else if (SKI.equals(referenceMethod)) return X509ReferenceType.KeyIdentifier; else return X509ReferenceType.IssuerAndSerial; } }
/** * Constructor for the <code>TextLabel</code> object. This is * used to create a label that can convert a XML node into a * primitive value from an XML element text value. * * @param contact this is the contact this label represents * @param label this is the annotation for the contact * @param format this is the format used for this label */ public TextLabel(Contact contact, Text label, Format format) { this.detail = new Introspector(contact, this, format); this.required = label.required(); this.type = contact.getType(); this.empty = label.empty(); this.data = label.data(); this.contact = contact; this.label = label; }
/** * Constructor for the <code>TextListLabel</code> object. This is * used to create a label used for reading free text declared * between the elements of an element list union. Such a label * enables serialization and deserialization of unstructured XML. * * @param label this is the label that is declared with this * @param text this is the text annotation delcaration */ public TextListLabel(Label label, Text text) { this.empty = text.empty(); this.label = label; this.text = text; }
/** * Constructor for the <code>TextListLabel</code> object. This is * used to create a label used for reading free text declared * between the elements of an element list union. Such a label * enables serialization and deserialization of unstructured XML. * * @param label this is the label that is declared with this * @param text this is the text annotation delcaration */ public TextListLabel(Label label, Text text) { this.empty = text.empty(); this.label = label; this.text = text; }
/** * Represents the password element with type attribute */ static class Password { @Text(required = true) private String value; @Attribute(required = false) private String type = "Digest"; }
/** * Constructor for the <code>TextLabel</code> object. This is * used to create a label that can convert a XML node into a * primitive value from an XML element text value. * * @param contact this is the contact this label represents * @param label this is the annotation for the contact * @param format this is the format used for this label */ public TextLabel(Contact contact, Text label, Format format) { this.detail = new Introspector(contact, this, format); this.required = label.required(); this.type = contact.getType(); this.empty = label.empty(); this.data = label.data(); this.contact = contact; this.label = label; }
/** * Constructor for the <code>TextListLabel</code> object. This is * used to create a label used for reading free text declared * between the elements of an element list union. Such a label * enables serialization and deserialization of unstructured XML. * * @param label this is the label that is declared with this * @param text this is the text annotation delcaration */ public TextListLabel(Label label, Text text) { this.empty = text.empty(); this.label = label; this.text = text; }
/** * Represents a <code>KeystoreAlias</code> element in the P-Mode XML document that contains a reference to a certificate * in one of the keystores. The reference consists of at least the alias that is used to identify the certificate in the * keystore and optionally a password to access the private key from the certificate. * * @author Sander Fieten (sander at holodeck-b2b.org) */ class KeystoreAlias { @Text String name = null; @Attribute(required = false) String password = null; }
/** * Constructor for the <code>TextLabel</code> object. This is * used to create a label that can convert a XML node into a * primitive value from an XML element text value. * * @param contact this is the contact this label represents * @param label this is the annotation for the contact * @param format this is the format used for this label */ public TextLabel(Contact contact, Text label, Format format) { this.detail = new Introspector(contact, this, format); this.required = label.required(); this.type = contact.getType(); this.empty = label.empty(); this.data = label.data(); this.contact = contact; this.label = label; }
/** * Represents the configuration for the <b>PMode.id</b> parameter. * * @author Sander Fieten (sander at holodeck-b2b.org) * @author Bram Bakx (bram at holodeck-b2b.org) */ class PModeId { /** * Identifies the PMode uniquely */ @Text String id; /** * Specifies if the PMode ID should be included in the actual message */ @Attribute(required = false) Boolean include = false; }
public class FailureModel { @Attribute public String message; @Attribute public String type; @Text public String text; }
@Root private static class Header { @Attribute private String name; @Text private String value; private String getName(){ return name; } public void append(StringBuilder builder){ builder.append(name).append(": ").append(value).append("\r\n"); } }
public class FailureModel { @Attribute public String message; @Attribute public String type; @Text public String text; }
@Text private String name;
@Root private static class Expect{ @Attribute private String name; @Text private String value; public void check(Map<String, String> response) { String text = response.get(name); if(value == null) { throw new IllegalStateException("Response does not contain header '"+name+"'"); } if(!value.equals(text)) { throw new IllegalStateException("Response header value '"+text+"' does not match expectation '"+value+"'"); } } } }
@Text private String id;
public static class Namespace { @Attribute private int key ; @Attribute(name="case") private String caseRule ; @Text(required=false) private String name ; public int getKey() { return key; } public String getCaseRule() { return caseRule; } public String getName() { if (name == null) return "" ; else return name; } }
@Text(required = false) private String title;//The title of the item. Venice Film Festival Tries to Quit Sinking @Path("link") @Text(required = false) private String link;//The URL of the item. http://www.nytimes.com/2002/09/07/movies/07FEST.html @Path("description") @Text(required = false) private String description;//The item synopsis. Some of the most heated chatter at the Venice Film Festival this week was about the way that the arrival of the stars at the Palazzo del Cinema was being staged. @Path("author") @Text(required = false) private String author;//Email address of the author of the item. More. oprah@oxygen.net @Path("category") @Text(required = false) private String category;//Includes the item in one or more categories. More. Simpsons Characters @Path("comments") @Text(required = false) private String comments;//URL of a page for comments relating to the item. More. http://www.myblog.org/cgi-local/mt/mt-comments.cgi?entry_id=290 @Path("enclosure") @Text(required = false) private String enclosure;// Describes a media object that is attached to the item. More. <enclosure url="http://live.curry.com/mp3/celebritySCms.mp3" length="1069871" type="audio/mpeg"/> @Path("guid") @Text(required = false) private String guid;//A string that uniquely identifies the item. More. <guid isPermaLink="true">http://inessential.com/2002/09/01.php#a2</guid> @Path("pubDate") @Text(required = false) private String pubDate;// Indicates when the item was published. More. Sun, 19 May 2002 15:21:36 GMT @Path("source") @Text(required = false) private String source;// The RSS channel that the item came from. More.
@Text private String value;
@Text private String text;