Package com.verisign.epp.codec.mark
Class EPPProtection
- java.lang.Object
-
- com.verisign.epp.codec.mark.EPPProtection
-
- All Implemented Interfaces:
EPPCodecComponent
,java.io.Serializable
,java.lang.Cloneable
public class EPPProtection extends java.lang.Object implements EPPCodecComponent
Class that contains the countries and region of the country where the mark is protected and the OPTIONAL ruling, in case of statute protected marks, to identify the country where the statute was enacted. A list ofEPPProtection
instances is contained in aEPPTreatyOrStatute
.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ELM_LOCALNAME
Constant for the local namestatic java.lang.String
ELM_NAME
Constant for the tag name
-
Constructor Summary
Constructors Constructor Description EPPProtection()
Default constructor forEPPProtection
.EPPProtection(java.lang.String aCC, java.lang.String aRegion)
Constructor that takes all of theEPPProtection
required attributes.EPPProtection(java.lang.String aCC, java.lang.String aRegion, java.lang.String aRuling)
Constructor that takes all of theEPPProtection
attributes with a single ruling country.EPPProtection(java.lang.String aCC, java.lang.String aRegion, java.util.List<java.lang.String> aRulings)
Constructor that takes all of theEPPProtection
attributes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRuling(java.lang.String aRuling)
Adds a country for to the list of countries for the ruling.java.lang.Object
clone()
CloneEPPProtection
.void
decode(org.w3c.dom.Element aElement)
Decode theEPPMark
componentorg.w3c.dom.Element
encode(org.w3c.dom.Document aDocument)
Sets all this instance's data in the given XML documentboolean
equals(java.lang.Object aObject)
implements a deepEPPProtection
compare.java.lang.String
getCc()
Gets two-character code of the country in which the mark is protected from [ISO3166-2].java.lang.String
getNamespace()
Returns the XML namespace associated with theEPPCodecComponent
.java.lang.String
getRegion()
Gets the name of the city, state, province or other geographic region in which the mark is protected.java.util.List<java.lang.String>
getRulings()
Gets the list of two-character country codes of the countries of the ruling.void
setCc(java.lang.String aCc)
Sets two-character code of the country in which the mark is protected.void
setRegion(java.lang.String aRegion)
Sets the name of the city, state, province or other geographic region in which the mark is protected.void
setRulings(java.util.List<java.lang.String> aRulings)
Sets the list of two-character country codes of the countries of the ruling.java.lang.String
toString()
Implementation ofObject.toString
, which will result in an indented XMLString
representation of the concreteEPPCodecComponent
.
-
-
-
Field Detail
-
ELM_LOCALNAME
public static final java.lang.String ELM_LOCALNAME
Constant for the local name- See Also:
- Constant Field Values
-
ELM_NAME
public static final java.lang.String ELM_NAME
Constant for the tag name- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EPPProtection
public EPPProtection()
Default constructor forEPPProtection
.
-
EPPProtection
public EPPProtection(java.lang.String aCC, java.lang.String aRegion)
Constructor that takes all of theEPPProtection
required attributes.- Parameters:
aCC
- Two-character code of the country in which the mark is protected.aRegion
- Name of the city, state, province or other geographic region in which the mark is protected.
-
EPPProtection
public EPPProtection(java.lang.String aCC, java.lang.String aRegion, java.lang.String aRuling)
Constructor that takes all of theEPPProtection
attributes with a single ruling country.- Parameters:
aCC
- Two-character code of the country in which the mark is protected.aRegion
- Name of the city, state, province or other geographic region in which the mark is protected.aRuling
- Identify the country where the statute was enacted
-
EPPProtection
public EPPProtection(java.lang.String aCC, java.lang.String aRegion, java.util.List<java.lang.String> aRulings)
Constructor that takes all of theEPPProtection
attributes.- Parameters:
aCC
- Two-character code of the country in which the mark is protected.aRegion
- Name of the city, state, province or other geographic region in which the mark is protected.aRulings
- List of two-character code of countries of the ruling.
-
-
Method Detail
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
CloneEPPProtection
.- Specified by:
clone
in interfaceEPPCodecComponent
- Overrides:
clone
in classjava.lang.Object
- Returns:
- clone of
EPPProtection
- Throws:
java.lang.CloneNotSupportedException
- standard Object.clone exception
-
encode
public org.w3c.dom.Element encode(org.w3c.dom.Document aDocument) throws EPPEncodeException
Sets all this instance's data in the given XML document- Specified by:
encode
in interfaceEPPCodecComponent
- Parameters:
aDocument
- a DOM Document to attach data to.- Returns:
- The root element of this component.
- Throws:
EPPEncodeException
- Thrown if any errors prevent encoding.
-
decode
public void decode(org.w3c.dom.Element aElement) throws EPPDecodeException
Decode theEPPMark
component- Specified by:
decode
in interfaceEPPCodecComponent
- Parameters:
aElement
- Root element of theEPPMark
- Throws:
EPPDecodeException
- Error decoding theEPPMark
-
equals
public boolean equals(java.lang.Object aObject)
implements a deepEPPProtection
compare.- Overrides:
equals
in classjava.lang.Object
- Parameters:
aObject
-EPPProtection
instance to compare with- Returns:
- true if equal false otherwise
-
getCc
public java.lang.String getCc()
Gets two-character code of the country in which the mark is protected from [ISO3166-2].- Returns:
- Two-character code of the country in which the mark is protected
if set;
null
otherwise.
-
setCc
public void setCc(java.lang.String aCc)
Sets two-character code of the country in which the mark is protected. This is a two-character code from [ISO3166-2].- Parameters:
aCc
- Two-character code of the country in which the mark is protected from [ISO3166-2].
-
getRegion
public java.lang.String getRegion()
Gets the name of the city, state, province or other geographic region in which the mark is protected.- Returns:
- the name of the city, state, province or other geographic region
in which the mark is protected if set;
null
otherwise.
-
setRegion
public void setRegion(java.lang.String aRegion)
Sets the name of the city, state, province or other geographic region in which the mark is protected.- Parameters:
aRegion
- Name of the city, state, province or other geographic region in which the mark is protected.
-
getRulings
public java.util.List<java.lang.String> getRulings()
Gets the list of two-character country codes of the countries of the ruling.- Returns:
- The countries of the rulings if set; Empty
List
otherwise.
-
setRulings
public void setRulings(java.util.List<java.lang.String> aRulings)
Sets the list of two-character country codes of the countries of the ruling.- Parameters:
aRulings
- The countries of the ruling
-
addRuling
public void addRuling(java.lang.String aRuling)
Adds a country for to the list of countries for the ruling.- Parameters:
aRuling
- Two-character code of the countries of the ruling. This is a two-character code from [ISO3166-2].
-
toString
public java.lang.String toString()
Implementation ofObject.toString
, which will result in an indented XMLString
representation of the concreteEPPCodecComponent
.- Overrides:
toString
in classjava.lang.Object
- Returns:
- Indented XML
String
if successful;ERROR
otherwise.
-
getNamespace
public java.lang.String getNamespace()
Returns the XML namespace associated with theEPPCodecComponent
.- Specified by:
getNamespace
in interfaceEPPCodecComponent
- Returns:
- XML namespace for the
EPPCodecComponent
.
-
-